/**
 * ==============================================================================
 * RÉSIDENCE TOUVALEM - STYLES DE LA PAGE DÉTAILS CHAMBRE (room-details.css)
 * ==============================================================================
 * Styles de la fiche détaillée d'un hébergement (/rooms/{id}) :
 * 1. Bannière d'en-tête (Room Hero).
 * 2. Galerie de photos interactive (Vignettes + Photo principale + Modal plein écran).
 * 3. Bloc principal (Titre, badge de standing, note, tarif par nuit, caractéristiques).
 * 4. Présentation textuelle, grille des commodités (Wi-Fi, Climatisation, etc.).
 * 5. Règles de la maison et conditions d'enregistrement.
 * 6. Barre latérale de réservation sticky avec calculateur en temps réel.
 * 7. Carousel des chambres similaires.
 * ==============================================================================
 */

/* ------------------------------------------------------------------------------
 * 1. BANNIÈRE HERO
 * ------------------------------------------------------------------------------
 */
.room-hero {
    position: relative;
    height: 300px;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.room-hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.45);
}

.room-hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    color: #ffffff;
}

.room-hero-title {
    font-family: var(--font-heading, 'Playfair Display', serif);
    font-size: 3.2rem;
    margin-bottom: 12px;
}

.room-breadcrumb {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

.room-breadcrumb a {
    color: #ffffff;
    text-decoration: none;
}

/* ------------------------------------------------------------------------------
 * 2. SECTION PRINCIPALE & GALERIE
 * ------------------------------------------------------------------------------
 */
.room-details-section {
    padding: 60px 0 100px 0;
    background-color: #FAFAFA;
}

.gallery-grid {
    display: grid;
    grid-template-columns: 1fr 3fr;
    gap: 15px;
    margin-bottom: 40px;
}

.gallery-left {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.gallery-img-box {
    position: relative;
    width: 100%;
    height: 100px;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
}

.gallery-img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-img-box:hover img {
    transform: scale(1.05);
}

.gallery-img-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-view-photos {
    background: #244C4A;
    color: #ffffff;
    border: none;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
}

.gallery-main {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 445px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease;
}

/* Modal Popup plein écran pour toutes les photos */
.gallery-modal-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.gallery-modal-close {
    position: absolute;
    top: 20px;
    right: 40px;
    background: none;
    border: none;
    color: #ffffff;
    font-size: 3rem;
    cursor: pointer;
    z-index: 10000;
    transition: color 0.3s;
}

.gallery-modal-close:hover {
    color: #EFA836;
}

.gallery-modal-content {
    width: 90%;
    height: 85%;
    overflow-y: auto;
    padding: 20px;
    border-radius: 12px;
}

.gallery-modal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.gallery-modal-grid img {
    width: 100%;
    height: 350px;
    object-fit: cover;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.gallery-modal-grid img:hover {
    transform: scale(1.02);
}

/* ------------------------------------------------------------------------------
 * 3. DISPOSITION EN 2 COLONNES (CONTENU & SIDEBAR)
 * ------------------------------------------------------------------------------
 */
.details-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
}

.content-box {
    background: #ffffff;
    border: 1px solid #f0f0f0;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.header-title-area {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-title-area h2 {
    font-family: var(--font-heading, 'Playfair Display', serif);
    font-size: 2rem;
    color: #1a1a1a;
    margin: 0;
}

.badge-luxury {
    background: #244C4A;
    color: #ffffff;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.header-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #333333;
}

.header-rating i {
    color: #EFA836;
}

.header-rating span {
    color: #777777;
    font-weight: 400;
}

.header-location {
    color: #777777;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
}

.header-price {
    font-size: 2rem;
    font-weight: 700;
    color: #244C4A;
    font-family: var(--font-heading, 'Playfair Display', serif);
    margin-bottom: 20px;
}

.header-price span {
    font-size: 1rem;
    color: #777777;
    font-weight: 400;
    font-family: var(--font-body, 'Inter', sans-serif);
}

.divider {
    height: 1px;
    background: #eeeeee;
    margin: 20px 0;
}

.header-features {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.features-list {
    display: flex;
    gap: 25px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #333333;
    font-size: 0.9rem;
    font-weight: 500;
}

.feature-item i {
    color: #EFA836;
    font-size: 1.1rem;
}

.section-subtitle {
    font-family: var(--font-heading, 'Playfair Display', serif);
    font-size: 1.8rem;
    color: #1a1a1a;
    margin-bottom: 20px;
}

.section-text {
    color: #666666;
    line-height: 1.8;
    font-size: 0.95rem;
    margin-bottom: 0;
}

/* Grille des équipements */
.amenities-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px 10px;
    margin-top: 25px;
}

.amenity-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
    color: #333333;
    font-weight: 500;
}

.amenity-icon-box {
    width: 40px;
    height: 40px;
    background: #FAFAFA;
    border: 1px solid #eeeeee;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #244C4A;
}

/* Règles de séjour */
.rules-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 25px;
}

.rules-col h4 {
    font-family: var(--font-heading, 'Playfair Display', serif);
    font-size: 1.3rem;
    color: #1a1a1a;
    margin-bottom: 15px;
}

.rules-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.rules-list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
    color: #666666;
    font-size: 0.9rem;
    line-height: 1.5;
}

.rules-list li i {
    color: #EFA836;
    margin-top: 3px;
}

/* ------------------------------------------------------------------------------
 * 4. SIDEBAR DE RÉSERVATION & CALCULATEUR EN DIRECT
 * ------------------------------------------------------------------------------
 */
.booking-sidebar {
    background: #ffffff;
    border: 1px solid #f0f0f0;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
    position: sticky;
    top: 100px;
}

.booking-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.booking-sidebar-header h3 {
    margin: 0;
    font-size: 1.6rem;
    font-family: var(--font-heading, 'Playfair Display', serif);
    color: #1a1a1a;
}

.direct-whatsapp-badge {
    background: rgba(37, 211, 102, 0.15);
    color: #128C7E;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.booking-redirect-card {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border: 1.5px solid #25D366;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
    text-align: center;
    box-shadow: 0 8px 20px rgba(37, 211, 102, 0.15);
}

.booking-redirect-icon {
    width: 50px;
    height: 50px;
    background: #25D366;
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    margin: 0 auto 12px;
    box-shadow: 0 4px 10px rgba(37, 211, 102, 0.4);
}

.booking-actions-stack {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.btn-whatsapp-confirm {
    background: #25D366;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 18px;
    border-radius: 25px;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.2s ease;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.35);
}

.btn-pdf-download {
    background: #ffffff;
    color: #244C4A;
    border: 1.5px solid #244C4A;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 10px 18px;
    border-radius: 25px;
    font-weight: 600;
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.2s ease;
}

.live-calc-box {
    background: #f8faf9;
    border: 1.5px dashed #244C4A;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
}

.live-calc-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: #666666;
    margin-bottom: 6px;
}

.live-calc-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
}

.live-calc-total-row span.total-label {
    font-weight: 700;
    color: #1a1a1a;
    font-size: 0.95rem;
}

.live-calc-total-row span.total-value {
    font-size: 1.25rem;
    font-weight: 800;
    color: #244C4A;
    font-family: var(--font-heading, serif);
}

.btn-submit-booking {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #244C4A;
    color: #ffffff;
    border: none;
    width: 100%;
    padding: 15px;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

.btn-submit-booking:hover {
    background: #1a3836;
}

/* ------------------------------------------------------------------------------
 * 5. MEDIA QUERIES
 * ------------------------------------------------------------------------------
 */
@media (max-width: 992px) {
    .details-layout {
        grid-template-columns: 1fr;
    }
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    .gallery-left {
        flex-direction: row;
    }
    .gallery-img-box {
        height: 120px;
    }
}

@media (max-width: 768px) {
    .header-top {
        flex-direction: column;
        gap: 15px;
    }
    .header-features {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    .features-list {
        flex-wrap: wrap;
    }
    .amenities-grid {
        grid-template-columns: 1fr 1fr;
    }
    .rules-grid {
        grid-template-columns: 1fr;
    }
    .gallery-left {
        display: none;
    }
}

/* ------------------------------------------------------------------------------
 * 6. FIXES FORM CONTROLS IN BOOKING SIDEBAR
 * Prevents date/text inputs from overflowing the narrow sticky sidebar.
 * ------------------------------------------------------------------------------
 */
.booking-sidebar {
    overflow: hidden; /* guard against child overflow */
}

.booking-sidebar .form-group {
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 16px;
}

.booking-sidebar label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: #2c3e50;
}

.booking-sidebar .form-control {
    width: 100%;
    min-width: 0;           /* allows shrinking inside grid cells */
    box-sizing: border-box;
    padding: 11px 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.88rem;
    background-color: #f8fafc;
    color: #1e293b;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    font-family: var(--font-body, 'Inter', sans-serif);
    appearance: none;
    -webkit-appearance: none;
}

.booking-sidebar .form-control:focus {
    border-color: #244C4A;
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(36, 76, 74, 0.1);
}

.booking-sidebar select.form-control {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23244C4A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 13px;
    padding-right: 36px;
    cursor: pointer;
}

.booking-sidebar textarea.form-control {
    resize: vertical;
    min-height: 80px;
    line-height: 1.55;
}

/* Date row: two equal columns that can shrink */
.booking-sidebar .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 14px;
}

.booking-sidebar .form-row .form-group {
    min-width: 0;
    margin-bottom: 0;
}

/* Promo input + button row */
.booking-sidebar .promo-input-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.booking-sidebar .promo-input-row .form-control {
    flex: 1;
    min-width: 0;
}

.booking-sidebar .promo-input-row .btn {
    white-space: nowrap;
    padding: 0 14px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    border: 1.5px solid #244C4A;
    background: #244C4A;
    color: #fff;
    cursor: pointer;
    transition: background 0.2s ease;
}

.booking-sidebar .promo-input-row .btn:hover {
    background: #183332;
}

/* Step indicator tabs */
.sidebar-step-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.sidebar-step-tab {
    flex: 1;
    text-align: center;
    padding: 7px 6px;
    border-radius: 8px;
    background: #f1f5f9;
    color: #64748b;
    font-weight: 700;
    font-size: 0.78rem;
    transition: background 0.2s ease, color 0.2s ease;
    user-select: none;
}

.sidebar-step-tab.active {
    background: #e0f2f1;
    color: #244C4A;
}

/* Full width button utility */
.btn-block {
    display: block;
    width: 100%;
    text-align: center;
}

/* Navigation pair (back + submit) */
.booking-sidebar .step-nav-pair {
    display: flex;
    gap: 10px;
    margin-top: 14px;
}

.booking-sidebar .step-nav-pair .btn-room-back {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
    border-radius: 25px;
    padding: 12px 16px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.booking-sidebar .step-nav-pair .btn-room-back:hover {
    background: #e2e8f0;
}
