@charset "utf-8";

/* ==========================================================================
   1. VARIABLES & BASE DYNAMIQUE
   ========================================================================== */
:root {
    /* Valeurs par défaut (Thème Home) */
    --theme-main: #999e31; 
    --theme-dark: #7b7f28;
    --theme-light: #cccf98;
    --theme-nav: #3e2723;
    --transition-smooth: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

html { scroll-behavior: smooth; }

/* Utilitaires de texte universels */
.text-theme { color: var(--theme-main) !important; }
.text-theme-dark { color: var(--theme-dark) !important; }
.text-theme-light { color: var(--theme-light) !important; }
.text-olive { color: var(--theme-main) !important; }

/* ==========================================================================
   2. ANIMATIONS & COMPOSANTS (BOUTONS & CARTES)
   ========================================================================== */

.btn-ialpes, .btn-olive {
    color: #ffffff !important;
    background-color: var(--theme-main) !important;
    border: none !important;
    padding: 8px 20px !important;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    border-radius: 50px;
    transition: var(--transition-smooth) !important;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1) !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none !important;
}

.btn-ialpes:hover, .btn-olive:hover {
    transform: scale(1.05) translateY(-2px);
    background-color: var(--theme-nav) !important;
    color: #ffffff !important;
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.25) !important;
}

.hover-shadow {
    transition: var(--transition-smooth);
    will-change: transform, box-shadow;
}

.hover-shadow:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15) !important;
}

/* Style des liens dans les onglets */
.tab-pane .col a {
    display: block;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.2s ease-in-out;
    color: #333;
    text-decoration: none;
}

/* Effet de survol doux */
.tab-pane .col a:hover {
    background-color: #f8f9fa;
    color: var(--theme-main);
    padding-left: 15px;
    border-left: 3px solid var(--theme-main);
}

/* ==========================================================================
   COMPOSANT : NAV-PILLS (Gestion des onglets)
   ========================================================================== */

.nav-pills .nav-link {
    color: #555 !important;
    font-weight: 600;
    margin: 0 8px;
    border-radius: 50px !important;
    transition: all 0.3s ease;
}

.nav-pills .nav-link.active {
    background-color: var(--theme-main) !important;
    color: #ffffff !important;
    border-radius: 50px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transform: scale(1.05);
}

.nav-pills .nav-link:hover:not(.active) {
    background-color: rgba(0, 0, 0, 0.05);
    color: var(--theme-main) !important;
    border-radius: 50px !important;
}

/* ==========================================================================
   3. NAVIGATION & MÉGA-MENU (CORRIGÉ)
   ========================================================================== */
.navbar {
    min-height: 58px;
    z-index: 1050 !important;
    background-color: var(--theme-nav) !important;
}

nav.navbar .navbar-nav .nav-link,
nav.navbar .navbar-brand {
    color: #ffffff !important;
    min-height: 48px; 
    display: inline-flex; 
    align-items: center;
    padding: 5px 15px;
    transition: var(--transition-smooth);
}

nav.navbar .navbar-nav .nav-link:hover {
    color: var(--theme-light) !important;
    background-color: rgba(255,255,255,0.05);
}

/* Toggle Mobile */
.navbar-toggler { border: none !important; outline: none !important; }
.navbar-toggler .fa-bars { color: #ffffff !important; }

/* Dropdown / Méga-menu */
.dropdown-menu {
    border: none;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    padding: 20px;
}

@media (min-width: 992px) {
    .navbar .nav-item.dropdown.position-static {
        position: static !important;
    }
    
    .navbar .nav-item.dropdown .dropdown-menu.w-100 {
        width: 100% !important;
        left: 0 !important;
        right: 0 !important;
        margin-top: 0 !important;
    }

    .nav-item.dropdown.position-static .dropdown-menu,
    .dropdown-hover .dropdown-menu {
        display: block !important;
        visibility: hidden; 
        opacity: 0;
        transform: translateY(10px);
        transition: visibility 0s, opacity 0.3s ease, transform 0.3s ease;
        
        /* FIX TUNNEL SOURIS : Pont invisible pour éviter la fermeture au survol */
        border-top: 20px solid transparent !important;
        margin-top: -20px !important;
    }
    
    /* Déclenchement du survol */
    .nav-item.dropdown.position-static:hover > .dropdown-menu,
    .dropdown-hover:hover > .dropdown-menu {
        visibility: visible !important; 
        opacity: 1 !important; 
        transform: translateY(0) !important;
    }
}

/* Centrage dynamique des boutons dans le menu */
.dropdown-menu .card .btn-ialpes,
.dropdown-menu .card .btn-olive {
    width: fit-content !important;
    margin: 15px auto 5px auto !important;
}

/* Titres internes du menu */
.dropdown-menu .text-theme,
.dropdown-menu .text-uppercase.fw-bold {
    color: var(--theme-main) !important;
    border-bottom: 2px solid var(--theme-light) !important;
    display: block;
    margin-bottom: 15px;
    padding-bottom: 5px;
}

/* ==========================================================================
   4. SYSTÈME DE THÈMES TERRITORIAUX
   ========================================================================== */

.theme-home         { --theme-main: #999e31; --theme-nav: #3e2723; --theme-light: #cccf98; }
.theme-ain          { --theme-main: #556b2f; --theme-nav: #3a4b1f; --theme-light: #dcedc8; }
.theme-isere        { --theme-main: #5d7d8e; --theme-nav: #2c3e50; --theme-light: #d1d9e0; }
.theme-jura         { --theme-main: #27ae60; --theme-nav: #1e8449; --theme-light: #abebc6; }
.theme-savoie       { --theme-main: #c0392b; --theme-nav: #922b21; --theme-light: #e6b0aa; }
.theme-haute-savoie { --theme-main: #e74c3c; --theme-nav: #b03a2e; --theme-light: #f5b7b1; }

/* Suisse */
.theme-geneve       { --theme-main: #2980b9; --theme-nav: #1c5980; --theme-light: #aed6f1; }
.theme-valais       { --theme-main: #8e44ad; --theme-nav: #5b2c6f; --theme-light: #d7bde2; }
.theme-vaud         { --theme-main: #16a085; --theme-nav: #0e6655; --theme-light: #a2d9ce; }

/* Italie */
.theme-piemont      { --theme-main: #d35400; --theme-nav: #873600; --theme-light: #edbb99; }
.theme-vallee-aoste { --theme-main: #2c3e50; --theme-nav: #1c2833; --theme-light: #abb2b9; }

/* Application automatique aux boutons selon le thème du body */
body[class^="theme-"] .btn-ialpes, 
body[class*=" theme-"] .btn-ialpes {
    background-color: var(--theme-main) !important;
}

/* ==========================================================================
   5. TYPOGRAPHIE & RESPONSIVE
   ========================================================================== */
.main-title {
    font-size: clamp(1.8rem, 5vw, 3rem) !important;
    line-height: 1.2;
    text-wrap: balance;
    color: var(--theme-main) !important;
}

h2 { color: var(--theme-nav); margin-bottom: 1.5rem; text-wrap: balance; }

/* ==========================================================================
   6. FIXES (MODALS & UTILS)
   ========================================================================== */
.modal { z-index: 99999 !important; }
.modal-backdrop { z-index: 99998 !important; }

#TopUp {
    display: none; 
    position: fixed; 
    bottom: 20px; 
    right: 30px; 
    z-index: 2000;
    background-color: var(--theme-main); 
    color: white; 
    border-radius: 50%;
    width: 50px; 
    height: 50px; 
    border: none; 
    cursor: pointer;
    line-height: 50px;
    text-align: center;
}

#TopUp i {
    width: 16px;
}

/* ==========================================================================
   7. FOOTER (Optimisé pour fond d'image et lisibilité)
   ========================================================================== */
footer {
    padding: 0;
    border-top: 1px solid var(--theme-light);
}

footer h4, footer h5, footer h6, footer .text-uppercase.fw-bold {
    color: #ffffff !important;
    border-bottom: 2px solid var(--theme-main) !important;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

footer .list-unstyled a {
    color: rgba(255, 255, 255, 0.85) !important; 
    transition: var(--transition-smooth);
    display: inline-block;
}

footer .list-unstyled a:hover {
    color: var(--theme-light) !important;
    transform: translateX(5px);
}

footer .border-top a {
    color: #ffffff !important;
    transition: var(--transition-smooth);
}
footer .border-top a:hover {
    color: var(--theme-light) !important;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}

.gtranslate_wrapper {
    position: relative !important;
    z-index: 1000;
}

.gtranslate_wrapper select {
    display: inline-block !important;
    position: relative !important;
    bottom: auto !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    max-width: 150px;
}

div[id^="gt_holder"], .gt_switcher_wrapper {
    position: static !important;
    float: none !important;
}

.breadcrumb-gris {
    background-color: #f8f9fa !important;
}

.breadcrumb-gris .breadcrumb {
    background-color: transparent !important;
}

/* ==========================================================================
   8. AJUSTEMENTS POUR LES CARTES DU MÉGA-MENU
   ========================================================================== */
.dropdown-menu .card {
    border-radius: 4px;
    overflow: hidden;
}

.dropdown-menu .card-img-top {
    width: 100%;
    height: 130px;
    object-fit: cover;
}

.dropdown-menu .btn-link {
    color: var(--theme-main) !important;
    font-weight: 700;
    text-decoration: none !important;
    font-size: 0.9rem;
}

.dropdown-menu .btn-link:hover {
    color: var(--theme-dark) !important;
    text-decoration: underline !important;
}