/* ==========================================================================
   RÉSIDENCE 2M — MODAL.CSS (CORRIGÉ)
   Styles de la modale de détail des hébergements
   ========================================================================== */

/* Appliquer le box-sizing à tout le document pour éviter les débordements */
*, ::before, ::after {
    box-sizing: border-box;
}

/* --------------------------------------------------------------------------
   1. STRUCTURE PRINCIPALE
   -------------------------------------------------------------------------- */

.modal-room {
    display:        flex;
    flex-direction: column;
    min-height:     0;  
}


/* --------------------------------------------------------------------------
   2. GALERIE PRINCIPALE
   -------------------------------------------------------------------------- */

.modal-gallery {
    position:    relative;
    width:       100%;
    background:  #0E0E0E;
    flex-shrink: 0;
}

.modal-gallery-track {
    width:           100%;
    height:          clamp(200px, 42vw, 300px);
    overflow:        hidden;
    display:         flex;
    align-items:     center;
    justify-content: center;
}

.modal-gallery-track img {
    width:      100%;
    height:     100%;
    object-fit: cover;
    display:    block;
    transition: opacity 0.20s ease, transform 0.20s ease;
}

.modal-gallery-counter {
    position:        absolute;
    bottom:          10px;
    right:           14px;
    background:      rgba(0, 0, 0, 0.55);
    color:           #FFFFFF;
    font-size:       0.7rem;
    font-weight:     700;
    padding:         3px 10px;
    border-radius:   20px;
    letter-spacing:  1px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    pointer-events:  none;
    user-select:     none;
}

.modal-gallery-prev,
.modal-gallery-next {
    position:        absolute;
    top:             50%;
    transform:       translateY(-50%);
    width:           40px;
    height:          40px;
    background:      rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border:          none;
    border-radius:   50%;
    color:           #FFFFFF;
    font-size:       0.82rem;
    cursor:          pointer;
    display:         flex;
    align-items:     center;
    justify-content: center;
    transition:      background 0.2s ease, transform 0.2s ease;
    z-index:         5;
}

.modal-gallery-prev { left:  12px; }
.modal-gallery-next { right: 12px; }

.modal-gallery-prev:hover,
.modal-gallery-next:hover {
    background: rgba(182, 16, 16, 0.80);
    transform:  translateY(-50%) scale(1.08);
}


/* --------------------------------------------------------------------------
   3. BARRE DE MINIATURES
   -------------------------------------------------------------------------- */

.modal-thumbs {
    display:             flex;
    gap:                 6px;
    padding:             10px 16px;
    background:          #111111;
    overflow-x:          auto;
    scrollbar-width:     none;
    -ms-overflow-style:  none;
    flex-shrink:         0;
}

.modal-thumbs::-webkit-scrollbar { display: none; }

.modal-thumb {
    flex-shrink:   0;
    width:         58px;
    height:        42px;
    border-radius: 5px;
    overflow:      hidden;
    border:        2px solid transparent;
    cursor:        pointer;
    transition:    border-color 0.2s, opacity 0.2s;
    opacity:       0.50;
    padding:       0;
    background:    none;
    display:       block;
}

.modal-thumb img {
    width:      100%;
    height:     100%;
    object-fit: cover;
    display:    block;
}

.modal-thumb.active {
    border-color: #C9A84C;
    opacity:      1;
}


/* --------------------------------------------------------------------------
   4. CORPS TEXTE
   -------------------------------------------------------------------------- */

.modal-room-body {
    padding:         clamp(20px, 4vw, 30px);
    display:         flex;
    flex-direction:  column;
    /* Espace pour le footer sticky mobile */
    padding-bottom:  100px; 
}

.modal-room-body .room-name {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size:   clamp(1.5rem, 3vw, 1.85rem);
    font-weight: 600;
    line-height: 1.15;
    margin-bottom: 10px;
    color:       #0E0E0E;
}

.modal-room-description {
    font-size:     clamp(0.84rem, 1.4vw, 0.92rem);
    color:         #6E6E6E;
    line-height:   1.8;
    margin-bottom: 22px;
}

.modal-amenities {
    list-style:            none;
    display:               grid;
    grid-template-columns: 1fr 1fr;
    gap:                   10px 16px;
    margin-bottom:         24px;
}

.modal-amenities li {
    display:     flex;
    align-items: center;
    gap:         8px;
    font-size:   clamp(0.78rem, 1.3vw, 0.84rem);
    color:       #0E0E0E;
    line-height: 1.3;
}

.modal-amenities li i {
    color:       #C9A84C;
    font-size:   0.65rem;
    flex-shrink: 0;
}


/* --------------------------------------------------------------------------
   5. FOOTER STICKY (CORRIGÉ POUR MOBILE)
   -------------------------------------------------------------------------- */

.modal-sticky-footer {
    position:        fixed;
    bottom:          0;
    left:            0;
    width:           100%;
    box-sizing:      border-box; /* IMPORTANT : empêche le débordement dû au padding */
    background:      #FFFFFF;
    border-top:      2px solid #b61010;
    padding:         12px 20px;
    display:         flex;
    align-items:     center;
    justify-content: space-between;
    gap:             12px;
    z-index:         30;
    box-shadow:      0 -4px 20px rgba(0, 0, 0, 0.10);
}

.modal-sticky-footer .room-price {
    display:     flex;
    align-items: baseline;
    gap:         4px;
    flex-shrink: 0; /* Empêche le prix de s'écraser */
}

.modal-sticky-footer .price-amount {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size:   clamp(1.2rem, 3vw, 1.6rem);
    font-weight: 700;
    color:       #C9A84C;
    line-height: 1;
}

.modal-sticky-footer .price-currency {
    font-size:   0.72rem;
    font-weight: 600;
    color:       #6E6E6E;
}

/* Optimisation du bouton Réserver */
.modal-sticky-footer .btn-main {
    flex:        1;          /* Le bouton occupe l'espace restant */
    max-width:   180px;      /* Largeur max pour ne pas être trop grand */
    min-width:   110px;      /* Sécurité pour le texte */
    text-align:  center;
    white-space: nowrap;     /* Évite le texte sur 2 lignes */
}


/* --------------------------------------------------------------------------
   6. DESKTOP — footer statique
   -------------------------------------------------------------------------- */

@media (min-width: 640px) {
    .modal-room-body {
        padding-bottom: clamp(20px, 4vw, 30px);
    }

    .modal-sticky-footer {
        position:   static;
        box-shadow: none;
        border-top: 1px solid rgba(0, 0, 0, 0.07);
        padding:    20px 0 0;
        background: transparent;
        width:      100%; /* Reste à 100% mais contenu dans le flux du parent */
    }
}


/* --------------------------------------------------------------------------
   7. RESPONSIVE — très petits mobiles
   -------------------------------------------------------------------------- */

@media (max-width: 440px) {
    .modal-amenities {
        grid-template-columns: 1fr;
    }
    
    .modal-sticky-footer {
        padding: 10px 15px; /* On réduit un peu le padding sur mini écrans */
    }
}
