/* ==========================================================================
   ROOM-MODAL — popin "Découvrir la chambre" (voir
   template-parts/results/room-modal.php), reprend la maquette page-chambres
   sans créer de page séparée (voir CLAUDE.md — pas d'URL individuelle par
   chambre). Centrage géré par le navigateur (<dialog> + showModal()), pas de
   position/transform custom ici.
   ========================================================================== */
/* Un <dialog> fermé est display:none par défaut (règle navigateur), mais
   notre display:flex ci-dessous a la même spécificité et charge après —
   il l'emporte et garde la popin visible même fermée (même bug que
   .foo[hidden], voir les autres composants). On ne doit du flex qu'à la
   popin réellement ouverte (attribut [open] posé par showModal()). */
.room-modal {
    display: none;
}

.room-modal[open] {
    display: flex;
    flex-direction: column;
    align-items: center;
    /* width: min(900px, 92vw); */
    /* width: 90%; */
    width: 100%;
    max-width: 1400px;
    /* max-height: 85vh; */
    height: 100%;
    max-height: 100vh;
    /* Le navigateur centre un <dialog> ouvert en showModal() via
       margin:auto dans sa propre feuille de style — mais le reset global
       (*, *::before, *::after { margin:0 }, voir critical.css) l'écrase.
       À redéclarer explicitement, sinon la popin colle en haut. */
    margin: auto;
    /* padding: 0; */
    /* padding: 3rem; */
    padding: 0;
    border: 0;
    background-color: var(--color-surface);
    overflow-y: auto;
}

@media (min-width: 520px) {
    .room-modal[open] {
        padding: 1rem;
    }
}

/* Même couleur de fond que .calendar::backdrop (calendar.css) — cohérence
   entre les deux seuls <dialog> du site. */
.room-modal::backdrop {
    background: rgba(28, 33, 46, 0.5);
}

.room-modal__close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    background-color: var(--color-surface);
    border: 0;
    border-radius: 50%;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--color-text);
    cursor: pointer;
}

.room-modal__swiper {
    width: 100%;
    aspect-ratio: 21/9;
    aspect-ratio: 4/3;
    /* Enfant flex (voir .room-modal[open], flex-direction:column) : sans
       ça, le flex-shrink par défaut (1) peut ramener la hauteur à 0, car
       overflow:hidden (imposé par Swiper) fait tomber sa "taille minimale
       automatique" à 0 — plus aucun contenu n'est pris en compte pour ce
       calcul. flex-shrink:0 force le respect de aspect-ratio à la place. */
    flex-shrink: 0;
}

.room-modal__swiper .swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.room-modal__swiper .swiper-pagination-bullet-active {
    background-color: var(--color-secondary);
}

.room-modal__body {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    /* padding: 2rem 1.5rem; */
    padding: 2rem 0;
}

.room-modal__wrap {
    width: 90%;
    max-width: 1050px;
}

.room-modal__intro {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

@media (min-width: 768px) {
    .room-modal__body {
        flex-direction: row;
        /* padding: 2.5rem; */
    }

    .room-modal__intro {
        flex: 2;
    }

    .room-modal__sidebar {
        flex: 1;
        aspect-ratio: 1/1.2;
    }
}

.room-modal__intro-title {
    font-family: var(--font-primary);
    font-weight: 400;
    font-size: var(--font-size-h2);
    color: var(--color-text);
}

.room-modal__text {
    margin-top: 1rem;
    color: var(--color-text-muted);
}

/* Le HTML de Thaïs contient ses propres <p> — même raison que sur
   options.css (.options__rate-description), pas de marge en trop. */
.room-modal__text > :first-child {
    margin-top: 0;
}

.room-modal__text > :last-child {
    margin-bottom: 0;
}

.room-modal__specs {
    display: flex;
    flex-wrap: wrap;
    /* gap: 1rem 1.5rem; */
    gap: 2rem 1.5rem;
    /* margin-top: 1.5rem; */
    margin: 2rem 0 1rem;
    list-style: none;
}

.room-modal__specs li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    /* width: calc(50% - 0.75rem); */
    /* width: 30%; */
    width: 45%;
    color: var(--color-text);
    font-size: var(--font-size-sm);
    font-size: .7rem;
}

@media (min-width: 600px) {
    .room-modal__specs li {
        width: 30%;
    }
}

.room-modal__sidebar {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 1.5rem;
    background-color: var(--color-primary);
    color: var(--color-text-light);
}

.room-modal__room-name {
    font-family: var(--font-primary);
    font-size: var(--font-size-h3);
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--color-secondary);
}

/* Base commune .price-label (voir critical.css) — ici juste la marge
   propre à la sidebar de la popin. */
.room-modal__price-label {
    margin-top: 1.5rem;
    color: var(--color-surface);
}

.room-modal__price {
    /* margin-top: 0.5rem; */
    margin-bottom: 2.5rem;
    font-family: var(--font-primary);
    /* font-size: var(--font-size-h2); */
    font-size: min(max(2.2rem, 3vw), 3rem);
    /* color: var(--color-secondary); */
    color: var(--color-surface);
    line-height: 1;
}

.room-modal__price span {
    font-family: var(--font-secondary);
    font-size: var(--font-size-sm);
}

.room-modal__best-price {
    margin-top: 0.5rem;
    font-size: var(--font-size-sm);
    color: var(--color-secondary);
}

.room-modal__cta {
    width: 100%;
    margin-top: 1.5rem;
}

.room-modal__gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 0 1.5rem 2rem;
    padding: 0 0 2rem;
}

.room-modal__gallery img {
    flex: 1;
    /* min-width: 8rem;
    height: 8rem; */
    width: 30%;
    aspect-ratio: 1/1;
    object-fit: cover;
}

/* @media (min-width: 768px) {
    .room-modal__gallery {
        padding: 0 2.5rem 2.5rem;
    }
} */
