/* ==========================================================================
   Page Magasins (/magasins) — dsstores
   Vignettes horizontales empilees (photo pleine hauteur a gauche, infos a
   droite : titre + filet, zones Adresse/Horaires, boutons), modale visite
   360 et carte Google Maps sous la liste.
   Charge par DsStores::hookActionFrontControllerSetMedia (page stores).
   ========================================================================== */
:root {
    --ms-gold: #ba933e;          /* doré de la marque */
    --ms-dark: #1a1a1a;
    --ms-card-radius: 10px;
}

.ms-stores {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 15px 0;   /* pas de marge basse : la carte colle au footer */
}

/* Empêche le scroll horizontal induit par la carte full-bleed (100vw inclut la
   scrollbar). `clip` (et non `hidden`) ne casse pas le header sticky.
   Ce CSS n'est chargé que sur la page magasins. */
body {
    overflow-x: clip;
}

/* --- Carte Google Maps pleine largeur (full-bleed) --------------------- */
.ms-stores__map {
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    height: 420px;
    margin-bottom: 40px;
    background: #ececec;
}

/* Carte placée SOUS la liste des magasins */
.ms-stores__map--bottom {
    margin-top: 40px;
    margin-bottom: 0;
}

.ms-stores__popup {
    font-size: 13px;
    line-height: 1.4;
    max-width: 220px;
}

.ms-stores__popup strong {
    color: var(--ms-dark);
}

/* --- En-tête ----------------------------------------------------------- */
.ms-stores__head {
    margin-bottom: 28px;
}

.ms-stores__title {
    font-size: 30px;
    font-weight: 700;
    color: var(--ms-dark);
    margin: 0;
}

/* --- Liste : vignettes horizontales empilées --------------------------- */
.ms-stores__grid {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

/* --- Carte magasin (horizontale : photo à gauche, infos à droite) ------ */
.ms-store-card {
    display: flex;
    flex-direction: row;
    align-items: stretch;   /* la photo prend toute la hauteur de la carte */
    background: #fff;
    border: 1px solid #e6e6e6;
    border-radius: var(--ms-card-radius);
    overflow: hidden;
    transition: transform .3s ease, box-shadow .3s ease;
}

.ms-store-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, .12);
}

/* --- Photo à gauche (pleine hauteur de la carte) ----------------------- */
.ms-store-card__media {
    position: relative;
    flex: 0 0 300px;
    width: 300px;
    align-self: stretch;      /* la colonne photo prend toute la hauteur de la carte */
    min-height: 260px;
    overflow: hidden;
    background: #f2f2f2;
}

/* Image en cover plein cadre. Préfixe #content + !important pour battre toute
   règle `img { height:auto / margin:auto }` du thème (spécificité maximale). */
#content .ms-store-card__media picture,
#content .ms-store-card__media .ms-store-card__img {
    position: absolute !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    display: block !important;
    object-fit: cover !important;
}

#content .ms-store-card__media .ms-store-card__img {
    transition: transform .45s ease;
}

.ms-store-card:hover .ms-store-card__img {
    transform: scale(1.05);
}

/* --- Corps : titre, puis 2 zones (adresse | horaires), puis ligne CTA -- */
.ms-store-card__body {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    padding: 26px 30px;
}

/* Titre + filet horizontal prolongeant la ligne (façon maquette) */
.ms-store-card__header {
    display: flex;
    align-items: center;
    gap: 22px;
    margin-bottom: 20px;
}

.ms-store-card__header::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #e6e6e6;
}

.ms-store-card__title {
    font-size: 22px;
    font-weight: 700;
    color: var(--ms-dark);
    margin: 0;
    line-height: 1.25;
    white-space: nowrap;
}

.ms-store-card__desc {
    font-size: 13.5px;
    line-height: 1.55;
    color: #555;
    margin-bottom: 18px;
}

.ms-store-card__desc p {
    margin: 0 0 10px;
}

/* Les 2 zones */
.ms-store-card__cols {
    display: flex;
    gap: 40px;
    align-items: flex-start;
    margin-bottom: 22px;
}

.ms-store-card__zone {
    flex: 1;
    min-width: 0;
}

.ms-store-card__zone-title {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: var(--ms-gold);
    margin-bottom: 10px;
}

.ms-store-card__addr {
    font-size: 13.5px;
    line-height: 1.4;
    font-weight: 700;
    font-style: normal;
    color: var(--ms-dark);
    margin: 0 0 10px;
    text-transform: uppercase;
}

.ms-store-card__contact {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 13px;
    color: #555;
}

.ms-store-card__contact li {
    margin-bottom: 3px;
}

.ms-store-card__contact a {
    color: #555;
}

.ms-store-card__contact a:hover {
    color: var(--ms-gold);
}

/* --- Horaires (tableau affiché) ---------------------------------------- */
.ms-store-card__hours {
    width: 100%;
    font-size: 12.5px;
    border-collapse: collapse;
}

.ms-store-card__hours th {
    text-align: left;
    font-weight: 600;
    color: var(--ms-dark);
    padding: 2px 10px 2px 0;
    width: 40%;
    vertical-align: top;
}

.ms-store-card__hours td {
    text-align: left;
    color: #555;
    padding: 2px 0;
}

.ms-store-card__hours td span {
    display: block;
}

.ms-store-card__closed {
    color: #b0b0b0;
    font-style: italic;
}

/* --- Ligne CTA (3e ligne) : Itinéraire + Découvrir + Visite 360° ------- */
.ms-store-card__cta-row {
    margin-top: auto;
    padding-top: 4px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.ms-store-card__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--ms-gold);
    color: #fff;
    border: 1px solid var(--ms-gold);
    border-radius: 6px;
    padding: 11px 26px;
    font-size: 13.5px;
    font-weight: 600;
    text-transform: none;
    cursor: pointer;
    transition: background .25s ease, color .25s ease, border-color .25s ease;
}

.ms-store-card__cta:hover,
.ms-store-card__cta:focus {
    background: var(--ms-dark);
    border-color: var(--ms-dark);
    color: #fff;
}

/* Variante secondaire (bordure dorée, fond blanc) */
.ms-store-card__cta--ghost {
    background: #fff;
    color: var(--ms-dark);
    border-color: #d8d8d8;
}

.ms-store-card__cta--ghost:hover,
.ms-store-card__cta--ghost:focus {
    background: var(--ms-gold);
    border-color: var(--ms-gold);
    color: #fff;
}

/* --- Modale visite virtuelle 360° -------------------------------------- */
.ms-tour-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.ms-tour-modal.is-open {
    display: flex;
}

.ms-tour-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .72);
}

.ms-tour-modal__dialog {
    position: relative;
    width: 100%;
    max-width: 1000px;
    background: #000;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
}

.ms-tour-modal__close {
    position: absolute;
    top: -14px;
    right: -14px;
    z-index: 5;           /* au-dessus de l'iframe de la visite 360° */
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    background: #fff;
    color: var(--ms-dark);
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .3);
    transition: background .2s ease, color .2s ease;
}

.ms-tour-modal__close:hover {
    background: var(--ms-gold);
    color: #fff;
}

.ms-tour-modal__frame {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 8px;
}

.ms-tour-modal__frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

@media (max-width: 767px) {
    .ms-store-card__cta { flex: 1 1 auto; }
    .ms-tour-modal { padding: 14px; }
    .ms-tour-modal__close { top: -8px; right: -8px; }
}

/* --- Responsive -------------------------------------------------------- */
@media (max-width: 991px) {
    .ms-store-card__cols { gap: 28px; }
    .ms-store-card__title { white-space: normal; }
}

@media (max-width: 767px) {
    /* Mobile : mise en page verticale simplifiée, sans photo. */
    .ms-store-card { flex-direction: column; }
    #content .ms-store-card__media { display: none !important; }
    .ms-store-card__body { padding: 22px 22px 24px; }
    .ms-store-card__header { gap: 16px; margin-bottom: 16px; }
    .ms-store-card__cols { flex-direction: column; gap: 20px; }
    .ms-stores__map { height: 320px; }
}

@media (max-width: 575px) {
    .ms-stores__map { height: 260px; }
}

/* --- Bannière « points de retrait » (parallaxe, full-bleed) ------------- */
.ms-stores__push {
    position: relative;
    width: 100vw;
    left: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    margin-top: 22px;   /* aligné sur le gap de .ms-stores__grid */
    min-height: 320px;
    display: flex;
    align-items: center;
    background-color: var(--ms-dark);
    background-image: url("../img/pickup-banner.jpg"); /* image à fournir */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    overflow: hidden;
}

/* Effet parallaxe desktop (image fixée au viewport). */
.ms-stores__push--parallax {
    background-attachment: fixed;
}

/* Voile sombre : lisibilité du texte par-dessus l'image. */
.ms-stores__push-scrim {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: rgba(0, 0, 0, .45);
}

.ms-stores__push-inner {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1080px;   /* aligné sur .ms-stores */
    margin-inline: auto;
    padding: 48px 30px;
    text-align: center;
    color: #fff;
}

.ms-stores__push-title {
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .01em;
    margin: 0 0 14px;
    color: #fff;
}

.ms-stores__push-text {
    font-size: 1rem;
    line-height: 1.55;
    margin: 0 auto;
    max-width: 640px;
}

/* Mobile : pas de background-attachment: fixed (cassé sur iOS). */
@media (max-width: 767px) {
    .ms-stores__push {
        background-attachment: scroll;
        min-height: 240px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ms-stores__push--parallax { background-attachment: scroll; }
}
