/* HERO MINI (Juste pour le titre) */
.offices-hero-mini {
    position: relative; height: 30vh; min-height: 250px;
    background: url('../images/slide-montage.png') no-repeat center center/cover;
    display: flex; align-items: center; justify-content: center;
    text-align: center;
    background-color: #0a0a0a;
    border-bottom: 1px solid rgba(255, 204, 0, 0.2);
}
.offices-hero-mini::before {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to bottom, rgba(0,0,0,0.7), #0a0a0a);
}
.hero-content { position: relative; z-index: 2; padding: 0 20px; }
.hero-title { font-size: 3rem; color: #fff; font-weight: 900; text-transform: uppercase; margin: 0; letter-spacing: 2px; }

/* LAYOUT SPLIT (GAUCHE / DROITE) */
.offices-split-layout {
    display: flex;
    align-items: flex-start; /* Requis pour position: sticky sur le panneau droit */
    min-height: 600px;
    background: #0a0a0a;
    position: relative;
}

/* PANNEAU GAUCHE (LISTE) */
.offices-panel-left {
    width: 450px;
    flex-shrink: 0;
    background: rgba(20, 20, 20, 0.95);
    border-right: 1px solid rgba(255, 204, 0, 0.1);
    display: flex; flex-direction: column;
    z-index: 10;
    box-shadow: 10px 0 30px rgba(0,0,0,0.5);
    /* Flux naturel : la hauteur = contenu → footer pas chevauchement */
    position: relative;
    height: auto;
    min-height: calc(100vh - 90px); /* Au moins un écran de haut */
}

.panel-header {
    padding: 40px 30px;
    background: linear-gradient(to bottom, rgba(255,255,255,0.02), transparent);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.panel-title { font-size: 1.8rem; color: #fff; text-transform: uppercase; margin: 0 0 15px 0; font-weight: 800; }
.line-gold-left { width: 50px; height: 3px; background: var(--ttb-gold); margin-bottom: 20px; }
.panel-desc { color: #aaa; font-size: 0.95rem; line-height: 1.6; font-weight: 300; }

/* LISTE DÉFILANTE — pas de scroll interne, la page défile */
.offices-list-wrapper {
    flex: 1;
    overflow-y: visible;
    padding: 20px;
}

/* ITEM LISTE (CARTE) */
.office-item {
    display: flex; align-items: center; gap: 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 20px; margin-bottom: 15px;
    border-radius: 12px; cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative; overflow: hidden;
}

.office-item:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateX(5px);
    border-color: rgba(255, 204, 0, 0.3);
}

.office-item.active {
    background: linear-gradient(135deg, rgba(255, 204, 0, 0.1), rgba(255, 204, 0, 0.02));
    border-color: var(--ttb-gold);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}
.office-item.active::before {
    content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--ttb-gold);
}

.item-flag {
    font-size: 2rem; flex-shrink: 0;
    filter: drop-shadow(0 5px 10px rgba(0,0,0,0.5));
}
.item-content { flex: 1; }
.item-country { color: #fff; font-size: 1.1rem; font-weight: 700; margin: 0 0 8px 0; text-transform: uppercase; transition: 0.3s; }
.office-item.active .item-country { color: var(--ttb-gold); }

.item-details p {
    margin: 0 0 5px 0; font-size: 0.85rem; color: #888;
    display: flex; align-items: center; gap: 10px;
}
.item-details i { color: var(--ttb-gold); width: 15px; text-align: center; font-size: 0.8rem; }

.item-action {
    color: #444; font-size: 1rem; transition: 0.3s;
}
.office-item:hover .item-action { color: var(--ttb-gold); transform: translateX(3px); }

/* PANNEAU DROITE (MAP) — sticky seul, borné par la hauteur du container */
.offices-panel-right {
    flex: 1;
    position: sticky;
    top: 90px;
    height: calc(100vh - 90px);
    align-self: flex-start; /* Reste en haut, ne s'étire pas avec le panel gauche */
    background: #111;
}
#world-map { width: 100%; height: 100%; z-index: 1; }

/* Ombre interne sur la map pour l'intégration */
.map-overlay-gradient {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    box-shadow: inset 20px 0 50px rgba(0,0,0,0.8);
    pointer-events: none; z-index: 2;
}

/* Custom Marker Leaflet */
.custom-map-marker {
    color: var(--ttb-gold); font-size: 2.5rem;
    text-shadow: 0 5px 15px rgba(0,0,0,0.8);
    animation: bounce 2s infinite;
}
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

/* POPUP MAP STYLE WHAOU */
.leaflet-popup-content-wrapper {
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid var(--ttb-gold);
    border-radius: 0;
    padding: 0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
}
.leaflet-popup-tip { background: var(--ttb-gold); }
.leaflet-popup-content { margin: 0; width: 250px !important; }

.map-popup { font-family: 'Poppins', sans-serif; }
.popup-header {
    background: var(--ttb-gold); color: #000;
    padding: 10px 15px; font-weight: 800; text-transform: uppercase; font-size: 0.9rem;
    display: flex; align-items: center; gap: 10px;
}
.popup-body {
    padding: 15px; color: #ccc; font-size: 0.85rem; line-height: 1.5;
}

/* SCROLLBAR CUSTOM */
.custom-scrollbar::-webkit-scrollbar { width: 6px; }
.custom-scrollbar::-webkit-scrollbar-track { background: #111; }
.custom-scrollbar::-webkit-scrollbar-thumb { background: #333; border-radius: 3px; }
.custom-scrollbar::-webkit-scrollbar-thumb:hover { background: var(--ttb-gold); }

/* =============================================
   RESPONSIVE TABLETTE / MOBILE (≤ 1024px)
   ============================================= */
@media (max-width: 1024px) {

    /* Container : flux vertical, pas de hauteur min imposée */
    .offices-split-layout {
        flex-direction: column;
        min-height: 0;
        align-items: stretch;
    }

    /* ── 1. CARTE en premier ── */
    .offices-panel-right {
        order: 1;
        width: 100%;
        height: 55vw;       /* Proportionnel à la largeur d'écran */
        min-height: 280px;
        max-height: 420px;
        position: relative;
        top: auto;
    }

    /* Ombre de fusion vers la liste */
    .map-overlay-gradient {
        box-shadow: inset 0 -30px 50px rgba(0,0,0,0.9);
    }

    /* ── 2. LISTE en dessous ── */
    .offices-panel-left {
        order: 2;
        width: 100%;
        height: auto;           /* Flux naturel – la page scroll */
        overflow: visible;      /* Reset du overflow: hidden desktop */
        position: relative;
        top: auto;
        border-right: none;
        border-top: 1px solid rgba(255, 204, 0, 0.15);
        box-shadow: none;
    }

    /* Header compact */
    .panel-header {
        padding: 20px 18px 15px;
    }
    .panel-title { font-size: 1.3rem; margin-bottom: 8px; }
    .line-gold-left { margin-bottom: 10px; }
    .panel-desc { font-size: 0.88rem; }

    /* Liste : pas de scroll interne sur mobile, la page entière scroll */
    .offices-list-wrapper {
        overflow-y: visible;
        padding: 15px;
        min-height: 0;
        flex: none;
    }

    /* Items légèrement plus compacts */
    .office-item {
        padding: 14px;
        gap: 14px;
        margin-bottom: 10px;
    }
    .office-item:hover { transform: none; } /* Pas de translate sur touch */

    .item-flag { font-size: 1.6rem; }
    .item-country { font-size: 0.95rem; }
    .item-details p { font-size: 0.8rem; }

    /* Titre hero */
    .hero-title { font-size: 2.2rem; letter-spacing: 1px; }
}

/* ── Extra small (≤ 480px) ── */
@media (max-width: 480px) {
    .offices-panel-right {
        height: 65vw;
        min-height: 220px;
    }
    .panel-header { padding: 15px 14px 12px; }
    .panel-title { font-size: 1.1rem; }
    .offices-list-wrapper { padding: 10px; }
    .office-item { padding: 12px; }
    .hero-title { font-size: 1.7rem; }
}