:root {
    --divana-teal: #2D8B94;
    --divana-gold: #C5A059;
    --divana-dark: #1e293b;
    --bg-soft: #f8fafc;
    --shadow-premium: 0 20px 50px rgba(0,0,0,0.05);
}

/* 1. Structure & Hero */
.detail-page-wrapper { background-color: white; color: var(--divana-dark); }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

.detail-top-nav { padding: 25px 0; background: var(--bg-soft); border-bottom: 1px solid #edf2f7; }
.breadcrumb-divana { font-weight: 700; color: var(--divana-gold); font-size: 0.9rem; text-transform: uppercase; letter-spacing: 1px; }

/* 2. Visuals - Montage Photo */
.main-stage { display: grid; grid-template-columns: 1fr 200px; gap: 20px; margin-top: 40px; height: 500px; }
.primary-image { position: relative; border-radius: 20px; overflow: hidden; }
.primary-image img { width: 100%; height: 100%; object-fit: cover; }
.offre-badge { position: absolute; top: 20px; left: 20px; background: var(--divana-teal); color: white; padding: 8px 20px; border-radius: 50px; font-weight: 800; font-size: 0.8rem; }

.galerie-scroll { display: flex; flex-direction: column; gap: 15px; overflow-y: auto; padding-right: 5px; }
.galerie-thumb { height: 110px; border-radius: 12px; overflow: hidden; cursor: pointer; transition: 0.3s; opacity: 0.7; }
.galerie-thumb:hover { opacity: 1; transform: scale(1.05); }
.galerie-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* 3. Grid Layout */
.details-grid { display: grid; grid-template-columns: 1fr 380px; gap: 60px; padding: 60px 0; }

/* 4. Main Content Area */
.intro-block h1 { font-size: 2.8rem; font-weight: 900; margin: 10px 0; line-height: 1.1; }
.cat-label { color: var(--divana-gold); font-weight: 800; text-transform: uppercase; font-size: 0.8rem; }
.location-pin { color: #64748b; font-size: 1.1rem; margin-top: 10px; }

.features-pill-bar { display: flex; gap: 15px; margin: 40px 0; }
.pill { background: var(--bg-soft); padding: 15px 25px; border-radius: 15px; border: 1px solid #e2e8f0; font-size: 0.9rem; }
.pill strong { color: var(--divana-teal); font-size: 1.1rem; }

.description-area { margin-top: 50px; }
.divana-line { width: 60px; height: 4px; background: var(--divana-gold); margin: 15px 0 30px; }
.text-content { line-height: 1.8; color: #475569; font-size: 1.1rem; }

.amenities-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-top: 30px; }
.am-item { padding: 15px; border-radius: 12px; border: 1px solid #f1f5f9; display: flex; align-items: center; gap: 12px; color: #94a3b8; transition: 0.3s; }
.am-item.active { border-color: var(--divana-teal); color: var(--divana-dark); font-weight: 600; box-shadow: 0 5px 15px rgba(45,139,148,0.05); }
.am-item i { color: var(--divana-teal); font-size: 1.2rem; }

/* 5. Sidebar - La carte de contact qui claque */
.contact-box-sticky { position: sticky; top: 100px; background: white; border-radius: 30px; padding: 40px; box-shadow: var(--shadow-premium); border: 1px solid #f1f5f9; }

.price-tag { font-size: 2.2rem; font-weight: 900; color: var(--divana-teal); margin-bottom: 30px; border-bottom: 2px solid var(--bg-soft); padding-bottom: 20px; }

.contact-methods h4 { font-size: 1.3rem; margin-bottom: 10px; }
.official-contacts { list-style: none; padding: 0; margin: 25px 0; }
.official-contacts li { display: flex; align-items: center; gap: 15px; margin-bottom: 20px; font-size: 0.95rem; color: #475569; }
.official-contacts li i { color: var(--divana-gold); font-size: 1.1rem; background: #fffcf5; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border-radius: 50%; }
.official-contacts a { text-decoration: none; color: inherit; font-weight: 700; transition: 0.3s; }
.official-contacts a:hover { color: var(--divana-teal); }

.cta-buttons { display: flex; flex-direction: column; gap: 15px; margin-top: 30px; }
.btn-cta { padding: 18px; border-radius: 15px; text-decoration: none; font-weight: 800; display: flex; align-items: center; justify-content: center; gap: 10px; transition: 0.4s; text-transform: uppercase; font-size: 0.85rem; letter-spacing: 1px; }

.btn-cta.whatsapp { background: #25D366; color: white; box-shadow: 0 10px 20px rgba(37, 211, 102, 0.2); }
.btn-cta.phone { background: var(--divana-dark); color: white; box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1); }
.btn-cta:hover { transform: translateY(-5px); box-shadow: 0 15px 30px rgba(0,0,0,0.15); }

/* Responsive */
@media (max-width: 992px) {
    .main-stage { grid-template-columns: 1fr; height: auto; }
    .galerie-scroll { flex-direction: row; height: 100px; overflow-x: auto; }
    .galerie-thumb { width: 120px; flex-shrink: 0; }
    .details-grid { grid-template-columns: 1fr; gap: 40px; }
    .intro-block h1 { font-size: 2rem; }
}

/* Sécurité pour les images */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Force la structure côte à côte pour la galerie */
.main-stage {
    display: flex; 
    flex-wrap: nowrap; /* Empêche le retour à la ligne sur PC */
    gap: 20px;
    align-items: flex-start;
}

.primary-image {
    flex: 3; /* 75% de l'espace */
}

.galerie-scroll {
    flex: 1; /* 25% de l'espace */
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Empêche les images de déborder et de casser la page */
img {
    max-width: 100%;
    height: auto;
    object-fit: cover;
}

/* Structure de la galerie (Côte à côte sur PC) */
.main-stage {
    display: flex;
    gap: 15px;
    height: 500px; /* Hauteur fixe pour éviter l'effet "image géante" */
    margin-bottom: 30px;
}

.primary-image {
    flex: 3;
    border-radius: 15px;
    overflow: hidden;
}

.primary-image img {
    width: 100%;
    height: 100%;
}

.galerie-scroll {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto; /* Permet de défiler si bcp d'images */
}

.galerie-thumb {
    height: 120px;
    cursor: pointer;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid transparent;
    transition: 0.3s;
}

.galerie-thumb:hover {
    border-color: var(--divana-gold);
}

/* Mobile : On empile */
@media (max-width: 768px) {
    .main-stage {
        flex-direction: column;
        height: auto;
    }
    .primary-image {
        height: 300px;
    }
    .galerie-scroll {
        flex-direction: row;
        height: 80px;
    }
}

/* Empêche les images de prendre toute la place */
.main-stage {
    display: flex;
    gap: 20px;
    height: 550px; /* Hauteur fixe pour stabiliser la vue */
    margin-bottom: 40px;
}

.primary-image {
    flex: 3;
    border-radius: 20px;
    overflow: hidden;
    background: #eee;
}

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

.galerie-scroll {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
    overflow-y: auto;
    padding-right: 10px;
}

.galerie-thumb {
    height: 130px;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    border: 3px solid transparent; /* Prêt pour le clic */
    transition: 0.3s;
}

.galerie-thumb:hover {
    border-color: #C5A059;
}

.galerie-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.suggestions-section {
    padding: 60px 0;
    border-top: 1px solid #eee;
}

.suggestions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.sug-card {
    text-decoration: none; /* Enlève le souligné bleu moche */
    color: inherit;
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
    transition: 0.3s;
}

.sug-card:hover {
    transform: translateY(-10px);
}

.sug-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.sug-info {
    padding: 20px;
}

.sug-info h4 {
    margin: 0;
    color: #1e293b;
    font-size: 1.1rem;
}

.sug-info p {
    color: #2D8B94; /* Ton bleu Divana */
    font-weight: 700;
    margin-top: 10px;
}

/* 1. On s'assure que le header et la nav restent les maîtres absolus */
header, 
.nav-container, 
nav {
    position: relative;
    z-index: 99999 !important; /* Priorité maximale */
}





/* 4. On calme le jeu sur la page recherche */
/* Le "Glassmorphism" crée souvent des bugs de superposition */
.recherche-page, 
.filter-section, 
.glass-filter {
    position: relative;
    z-index: 1 !important; /* On les force à rester au niveau du sol */
}

.modern-card {
    z-index: 1; /* On évite que les cartes ne volent au-dessus du menu */
}


.detail-top-nav { 
    padding: 15px 0; 
    background: var(--bg-soft); 
    border-bottom: 1px solid #edf2f7; 
    position: relative;
    z-index: 10; /* Assez bas pour passer sous le menu mobile */
}

.breadcrumb-divana { 
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.back-link {
    text-decoration: none;
    color: var(--divana-teal);
    font-weight: 700;
    font-size: 0.9rem;
    transition: 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.back-link:hover {
    color: var(--divana-gold);
    transform: translateX(-5px);
}

.ref-badge {
    background: white;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.75rem;
    color: #94a3b8;
    border: 1px solid #e2e8f0;
}

/* --- MOBILE : On cache le texte "Retour au catalogue" si c'est trop serré --- */
@media (max-width: 480px) {
    .back-link {
        font-size: 1.1rem; /* On grossit juste la flèche */
    }
    /* On peut cacher le texte pour ne garder que la flèche sur mini écrans */
    .back-link span { 
        display: none; 
    }
}
/* 1. Sécurisation de la colonne latérale */
.sidebar-column {
    position: relative;
    /* On s'assure que la colonne ne dépasse jamais un z-index de 10 */
    z-index: 5 !important; 
}

/* 2. La boîte collante (Sticky) */
.contact-box-sticky {
    position: sticky;
    top: 100px;
    background: white;
    border-radius: 30px;
    padding: 40px;
    box-shadow: var(--shadow-premium);
    border: 1px solid #f1f5f9;
    /* TRÈS IMPORTANT : Un z-index modéré */
    z-index: 10 !important; 
}

/* 3. Correction spécifique pour le Mobile */
@media (max-width: 992px) {
    .sidebar-column {
        z-index: 1 !important; /* On baisse la priorité au minimum sur mobile */
        position: static; /* Désactive le contexte d'empilement complexe */
    }

    .contact-box-sticky {
        position: relative; /* On enlève le sticky sur mobile pour éviter les bugs */
        top: 0;
        margin-top: 30px;
        z-index: 1 !important;
        padding: 25px; /* On réduit un peu le padding pour gagner de la place */
    }
}

/* Style de la légende sur l'image */
.image-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 10px 20px;
    font-size: 0.9rem;
    font-weight: 500;
    backdrop-filter: blur(5px);
}

/* Lien Google Maps */
.btn-map-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
    color: var(--divana-teal);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
    transition: 0.3s;
}

.btn-map-link:hover {
    color: var(--divana-gold);
    text-decoration: underline;
}



 
/* --- Structure Unifiée de la Galerie --- */
.main-stage {
    display: flex;
    gap: 20px;
    height: 550px; /* Hauteur fixe pour stabiliser l'affichage sur PC */
    margin-top: 40px;
    margin-bottom: 40px;
}

.primary-image {
    flex: 3; /* Prend 75% de la largeur */
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    background: #eee;
}

.primary-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.galerie-scroll {
    flex: 1; /* Prend 25% de la largeur */
    display: flex;
    flex-direction: column;
    gap: 15px;
    overflow-y: auto; /* Active le défilement vertical si beaucoup d'images */
    padding-right: 10px;
}

/* Style des miniatures */
.galerie-thumb {
    height: 130px;
    flex-shrink: 0; /* Empêche les images de s'écraser */
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    border: 3px solid transparent;
    transition: 0.3s;
    opacity: 0.8;
}

.galerie-thumb:hover {
    opacity: 1;
    border-color: var(--divana-gold);
    transform: scale(1.02);
}

.galerie-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* --- Responsive Mobile --- */
@media (max-width: 992px) {
    .main-stage {
        flex-direction: column; /* On empile l'image et la galerie */
        height: auto;
    }

    .primary-image {
        height: 350px; /* Hauteur fixe sur mobile pour l'image principale */
    }

    .galerie-scroll {
        flex-direction: row; /* Défilement horizontal sur mobile */
        height: 100px;
        overflow-x: auto;
        overflow-y: hidden;
        padding-bottom: 10px;
    }

    .galerie-thumb {
        width: 120px;
        height: 80px;
    }
}

.galerie-thumb {
    width: 120px; /* Largeur fixe pour toutes */
    height: 80px;  /* Hauteur fixe pour toutes */
    flex-shrink: 0; /* Empêche l'image de rétrécir */
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: 0.3s;
}

.galerie-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* IMPORTANT : force l'image à remplir tout le rectangle de 120x80 */
    object-position: center; /* Centre l'image si elle est rognée */
}
/* --- Structure Stable de la Galerie --- */
.main-stage {
    display: flex;
    gap: 20px;
    height: 600px; /* On fixe la hauteur totale du bloc photo */
    margin: 40px 0;
}

.primary-image {
    flex: 3;
    height: 100%; /* L'image principale prend toute la hauteur du bloc */
    border-radius: 20px;
    overflow: hidden;
}

.galerie-scroll {
    flex: 1;
    display: flex;
    flex-direction: column; /* Alignement vertical sur PC */
    gap: 12px;
    height: 100%; /* Important : la galerie fait la même taille que l'image principale */
    overflow-y: auto; /* Active le scroll vertical SEULEMENT si ça dépasse 600px */
    padding-right: 8px;
}

/* Customisation du scrollbar pour que ce soit joli */
.galerie-scroll::-webkit-scrollbar {
    width: 5px;
}
.galerie-scroll::-webkit-scrollbar-thumb {
    background: var(--divana-gold);
    border-radius: 10px;
}
@media (max-width: 992px) {
    .main-stage {
        flex-direction: column;
        height: auto; /* On libère la hauteur fixe sur mobile */
    }

    .primary-image {
        width: 100%;
        height: 350px; /* L'image principale devient un peu plus petite sur mobile */
    }

    .galerie-scroll {
        flex-direction: row; /* On bascule les 12 images sur une ligne */
        width: 100%;
        height: 100px; /* Hauteur de la barre de miniatures */
        overflow-x: auto; /* Scroll horizontal actif */
        overflow-y: hidden; /* Désactive le scroll vertical */
        padding: 5px 0;
    }

    .galerie-thumb {
        width: 120px; /* Largeur fixe pour que le scroll horizontal fonctionne */
        height: 100%;
        flex-shrink: 0;
    }
}


.features-pill-bar {
    display: flex;
    flex-wrap: wrap; /* Permet de passer à la ligne si ça ne rentre pas */
    gap: 10px;       /* Réduit l'espace entre les éléments sur mobile */
    margin: 20px 0;
}

.pill {
    flex: 1 1 calc(50% - 10px); /* Prend 50% de la largeur sur mobile (2 par ligne) */
    min-width: 140px;           /* Empêche d'être trop petit */
    padding: 12px 15px;         /* Réduit un peu le rembourrage */
    text-align: center;
    background: var(--bg-soft);
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    font-size: 0.85rem;
}

@media (max-width: 480px) {
    .pill {
        flex: 1 1 100%; /* Sur très petit écran, 1 seul élément par ligne */
    }
}
.amenities-grid {
    display: grid;
    /* Crée autant de colonnes que possible de minimum 160px */
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); 
    gap: 12px;
    margin-top: 20px;
}

.am-item {
    padding: 12px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 10px;
    background: #fff;
    border: 1px solid #f1f5f9;
    white-space: nowrap; /* Évite que le texte ne revienne à la ligne à l'intérieur du bloc */
    overflow: hidden;    /* Sécurité */
    text-overflow: ellipsis; /* Ajoute "..." si le nom est vraiment trop long */
}

/* On force l'affichage sur une colonne si l'écran est minuscule */
@media (max-width: 400px) {
    .amenities-grid {
        grid-template-columns: 1fr;
    }
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px; /* Padding de sécurité pour que le contenu ne touche pas les bords */
    box-sizing: border-box; /* Très important pour le calcul des largeurs */
}

* {
    box-sizing: border-box; /* Applique à tout le projet pour éviter les débordements */
}
