/* ========================================
   CORRECTIONS MENU MOBILE
   Version: 1.1
   À ajouter dans style.css ou à enqueue séparément
   ======================================== */

/* ========================================
   FORCER LES COULEURS CLAIRES (Anti Dark Mode)
   Bloque le mode sombre automatique des navigateurs
   ======================================== */

/* Désactiver le mode sombre automatique */
:root {
    color-scheme: light only !important;
}

html, body {
    color-scheme: light only !important;
    -webkit-color-scheme: light only !important;
}

/* Forcer le fond blanc sur le body et éléments principaux */
body {
    background-color: #ffffff !important;
    color: #333333 !important;
}

/* Header - forcer fond blanc */
.site-header {
    background-color: #ffffff !important;
    color: #333333 !important;
}

.header-content {
    background-color: #ffffff !important;
}

/* Logo */
.site-branding {
    background-color: transparent !important;
}

/* Bouton hamburger - forcer couleur */
.menu-toggle {
    background-color: transparent !important;
}

.menu-toggle span {
    background-color: #333333 !important;
}

/* Navigation mobile - forcer fond blanc */
.main-navigation {
    background-color: #ffffff !important;
    color: #333333 !important;
}

.nav-menu li a {
    color: #333333 !important;
    background-color: transparent !important;
}

.nav-menu li a:hover,
.nav-menu li.current-menu-item a {
    background-color: #f0f9ff !important;
    color: #0077b6 !important;
}

/* Formulaire de recherche - forcer fond blanc */
.thalasso-search-form,
.search-row,
.search-field {
    background-color: rgba(255, 255, 255, 0.95) !important;
}

.search-field input,
.search-field select {
    background-color: #ffffff !important;
    color: #333333 !important;
    border-color: #dddddd !important;
}

.search-field label {
    color: #333333 !important;
}

/* Section carte des centres - forcer couleurs */
.centres-map-section {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%) !important;
}

.carte-header h2 {
    color: #0077b6 !important;
}

.thalasso-carte-container {
    background-color: transparent !important;
}

/* Boutons de filtre */
.filter-btn {
    background-color: #ffffff !important;
    color: #0077b6 !important;
    border-color: #0077b6 !important;
}

.filter-btn.active {
    background-color: #0077b6 !important;
    color: #ffffff !important;
}

/* Liste des centres */
.centres-liste-compacte {
    background-color: transparent !important;
}

.centre-item {
    background-color: #f8f9fa !important;
    color: #333333 !important;
}

.centre-item strong {
    color: #0077b6 !important;
}

/* Cards appartements */
.appartement-card-home,
.blog-card {
    background-color: #ffffff !important;
}

.appartement-card-home h3 a,
.blog-card h3 a {
    color: #333333 !important;
}

/* Footer - garder sombre */
.site-footer {
    background-color: #1a1a2e !important;
    color: #cccccc !important;
}

/* Boutons - forcer couleurs charte graphique */
.btn-primary,
button[type="submit"] {
    background-color: #0077b6 !important;
    color: #ffffff !important;
}

.btn-contact {
    background-color: #333333 !important;
    color: #ffffff !important;
}

.btn-login {
    background-color: transparent !important;
    color: #0077b6 !important;
    border-color: #0077b6 !important;
}

.btn-register {
    background-color: #28a745 !important;
    color: #ffffff !important;
}

/* Actions mobiles */
.mobile-actions {
    background-color: #ffffff !important;
}

.mobile-action-btn {
    background-color: #f8f9fa !important;
    color: #333333 !important;
}

.mobile-action-register {
    background-color: #28a745 !important;
    color: #ffffff !important;
}

/* Sections avec fond clair */
.benefits-section {
    background-color: #f9f9f9 !important;
}

.benefits-section > div > div {
    background-color: #ffffff !important;
}

/* Hero section - garder le style original */
.hero-section {
    color: #ffffff !important;
}

.hero-content {
    color: #ffffff !important;
}

/* ======================================== */

/* Menu mobile - visibilité du bouton hamburger */
@media (max-width: 768px) {
    
    /* Header sur mobile */
    .header-content {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center;
        padding: 10px 0;
    }
    
    /* Logo plus petit sur mobile */
    .site-branding {
        flex: 0 0 auto;
        max-width: 180px;
    }
    
    .site-branding img {
        max-width: 100%;
        height: auto;
    }
    
    /* Bouton hamburger visible */
    .menu-toggle {
        display: flex !important;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        width: 44px;
        height: 44px;
        background: none;
        border: none;
        cursor: pointer;
        padding: 10px;
        z-index: 1001;
        order: 2;
    }
    
    .menu-toggle span {
        display: block;
        width: 25px;
        height: 3px;
        background: #333;
        margin: 3px 0;
        transition: all 0.3s ease;
        border-radius: 2px;
    }
    
    /* Animation hamburger -> X */
    .menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(6px, 6px);
    }
    
    .menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(6px, -6px);
    }
    
    /* Navigation cachée par défaut sur mobile */
    .main-navigation {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: white;
        z-index: 1000;
        padding-top: 80px;
        overflow-y: auto;
    }
    
    /* Navigation visible quand active */
    .main-navigation.active {
        display: block !important;
    }
    
    /* Menu vertical sur mobile */
    .nav-menu {
        display: flex;
        flex-direction: column;
        padding: 0;
        margin: 0;
        list-style: none;
    }
    
    .nav-menu li {
        width: 100%;
        border-bottom: 1px solid #eee;
    }
    
    .nav-menu li a {
        display: block;
        padding: 18px 25px;
        font-size: 16px;
        font-weight: 500;
        color: #333;
        text-decoration: none;
        transition: all 0.3s;
    }
    
    .nav-menu li a:hover,
    .nav-menu li.current-menu-item a {
        background: #f0f9ff;
        color: #0077b6;
        padding-left: 30px;
    }
    
    /* Cacher les actions header sur petit écran */
    .header-actions {
        display: none;
    }
    
    /* Ajouter les actions dans le menu mobile */
    .main-navigation.active::after {
        content: '';
        display: block;
        padding: 20px;
    }
}

/* Tablette */
@media (max-width: 992px) and (min-width: 769px) {
    
    .header-content {
        flex-wrap: nowrap;
    }
    
    .menu-toggle {
        display: flex !important;
        order: 3;
    }
    
    .main-navigation {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: white;
        box-shadow: 0 4px 15px rgba(0,0,0,0.1);
        z-index: 999;
    }
    
    .main-navigation.active {
        display: block !important;
    }
    
    .nav-menu {
        flex-direction: column;
    }
    
    .nav-menu li {
        border-bottom: 1px solid #eee;
    }
    
    .nav-menu li a {
        display: block;
        padding: 15px 25px;
    }
    
    .header-actions {
        display: flex;
        gap: 10px;
        order: 2;
    }
    
    .header-actions .btn-register,
    .header-actions .btn-logout {
        display: none;
    }
}

/* Fix z-index pour que le menu soit au-dessus */
.site-header {
    position: relative;
    z-index: 1002;
}

/* Header fixe (sticky) en mode responsive */
@media (max-width: 992px) {
    .site-header {
        position: fixed !important;
        top: 0;
        left: 0;
        right: 0;
        width: 100%;
        background: white;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        z-index: 9999;
    }
    
    /* Compenser l'espace du header fixe */
    body {
        padding-top: 70px;
    }
    
    /* Ajuster si admin bar WordPress visible */
    .admin-bar .site-header {
        top: 32px;
    }
    
    @media (max-width: 782px) {
        .admin-bar .site-header {
            top: 46px;
        }
    }
}

/* Assurer que le bouton toggle est visible */
.menu-toggle {
    position: relative;
    z-index: 1003;
}

/* Sélecteur de langue dans le menu mobile */
@media (max-width: 992px) {
    /* Fix pour le sélecteur de langue mobile Polylang */
    .mobile-lang-switcher {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 15px !important;
        padding: 15px !important;
        list-style: none !important;
    }
    
    .mobile-lang-switcher li,
    .mobile-lang-switcher .lang-item {
        display: inline-block !important;
        width: auto !important;
        border: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .mobile-lang-switcher li a,
    .mobile-lang-switcher .lang-item a {
        display: inline-block !important;
        padding: 5px !important;
    }
    
    .mobile-lang-switcher img {
        width: 32px !important;
        height: 22px !important;
        border-radius: 3px;
    }
    
    /* Fallback pour thalasso-lang-switcher */
    .main-navigation .thalasso-lang-switcher.flags,
    .nav-menu .thalasso-lang-switcher.flags,
    .thalasso-lang-switcher.flags {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap;
        gap: 10px;
        justify-content: center;
        padding: 15px;
    }
    
    .main-navigation .thalasso-lang-switcher.flags a,
    .nav-menu .thalasso-lang-switcher.flags a,
    .thalasso-lang-switcher.flags a {
        display: inline-block !important;
    }
}
