/* =============================================== */
/* CSS HEADER COMPLET - REMPLACER TOUT LE CONTENU */
/* Fichier: header-style.css */
/* =============================================== */

/* Variables CSS */
:root {
    --primary-blue: #4285f4;
    --dark-blue: #1c338a;
    --text-dark: #333;
    --border-light: #e2e8f0;
    --white: #ffffff;
    --light-bg: #f8fafc;
}

/* HEADER PRINCIPAL */
body #header .header-inner {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-light);
    transition: all 0.3s ease;
}

/* CONTENEUR PRINCIPAL - CENTRAGE CRITIQUE */
body #header .header-inner .container {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    height: 70px !important;
    padding: 0 2rem !important;
    max-width: 1400px !important;
    margin: 0 auto !important;
}

/* LOGO */
body #header #logo {
    display: flex !important;
    align-items: center !important;
    height: 100% !important;
    flex-shrink: 0;
}

body #header #logo > a img {
    height: 50px !important;
    width: auto !important;
    max-width: 150px !important;
    transition: all 0.3s ease !important;
}

body #header #logo:hover img {
    transform: scale(1.02) !important;
}

/* MENU NAVIGATION */
body #header #mainMenu {
    display: flex !important;
    align-items: center !important;
    height: 100% !important;
    flex-grow: 1;
    justify-content: center;
}

body #header #mainMenu nav > ul {
    display: flex !important;
    align-items: center !important;
    gap: 0.1rem !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* LIENS MENU PRINCIPAL */
body #header #mainMenu nav > ul > li > a {
    display: block;
    padding: 0.6rem 1rem;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-dark);
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

body #header #mainMenu nav > ul > li > a:hover {
    color: var(--primary-blue) !important;
    background-color: rgba(66, 133, 244, 0.10) !important;
    border-radius: 4px !important;
}

body #header #mainMenu nav > ul > li.current > a,
body #header #mainMenu nav > ul > li.active > a {
    color: var(--primary-blue) !important;
    background-color: rgba(66, 133, 244, 0.15) !important;
    border-radius: 4px !important;
}

/* DROPDOWN MENU */
body #header #mainMenu nav > ul > li.dropdown {
    position: relative !important;
}

body #header #mainMenu nav > ul > li .dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--white) !important;
    border: 1px solid rgba(0,0,0,0.08) !important;
    border-radius: 6px !important;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15) !important;
    padding: 10px 0 !important;
    min-width: 220px !important;
    margin-top: 8px !important;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    z-index: 9999;
}

/* Zone invisible pour maintenir le hover */
body #header #mainMenu nav > ul > li.dropdown::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 10px;
    z-index: 9998;
}

body #header #mainMenu nav > ul > li.dropdown:hover .dropdown-menu {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
}

body #header #mainMenu nav > ul > li .dropdown-menu > li > a {
    padding: 10px 20px !important;
    color: var(--text-dark) !important;
    font-size: 14px !important;
    line-height: 1.4 !important;
    transition: all 0.3s ease !important;
    display: block !important;
    text-decoration: none !important;
}

body #header #mainMenu nav > ul > li .dropdown-menu > li:hover > a {
    background: linear-gradient(90deg, #f8f9fa 0%, #e3f2fd 100%) !important;
    color: var(--primary-blue) !important;
    padding-left: 25px !important;
}

/* BOUTON TÉLÉPHONE ROND */
body #header .text-center {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 100% !important;
    flex-shrink: 0;
}

body .btn-phone-enhanced,
body .btn-phone-professional {
    all: unset !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 50px !important;
    height: 50px !important;
    background: var(--dark-blue) !important;
    color: var(--white) !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    box-shadow: 0 4px 15px rgba(28, 51, 138, 0.3) !important;
    transition: all 0.3s ease !important;
    animation: pulse-gentle 3s ease-in-out infinite !important;
}

@keyframes pulse-gentle {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(28, 51, 138, 0.3);
        transform: translateY(0);
    }
    50% {
        box-shadow: 0 6px 20px rgba(28, 51, 138, 0.4);
        transform: translateY(-2px);
    }
}

body .btn-phone-enhanced:hover,
body .btn-phone-professional:hover {
    transform: translateY(-4px) scale(1.05) !important;
    background: #2a4ba8 !important;
    box-shadow: 0 8px 25px rgba(28, 51, 138, 0.5) !important;
    animation-play-state: paused !important;
}

body .btn-phone-enhanced i,
body .btn-phone-professional i {
    font-size: 18px !important;
    color: var(--white) !important;
}

body .btn-phone-enhanced:hover i,
body .btn-phone-professional:hover i {
    transform: rotate(8deg) scale(1.1) !important;
}

body .btn-phone-enhanced span,
body .btn-phone-professional span {
    display: none !important;
}

/* MENU MOBILE TRIGGER */
body #header #mainMenu-trigger {
    display: none;
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    border-radius: 6px;
}

/* RESPONSIVE DESIGN */
@media (max-width: 768px) {
    /* CORRECTION CRITIQUE : Écraser la hauteur du header original */
    body #header {
        height: 0px !important;
        line-height: 60px !important;
    }
    
    /* Header mobile fixe */
    body #header .header-inner {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 1000 !important;
        background: rgba(255, 255, 255, 0.98) !important;
    }
    
    body #header .header-inner .container {
        height: 60px !important;
        padding: 0 1rem !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
    }
    
    /* CORRECTION : Supprimer l'espace après le header */
    body {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }
    
    /* Cibler spécifiquement la structure de votre site */
    .body-inner {
        margin-top: 60px !important;
        padding-top: 0 !important;
    }
    
    /* Alternative si body-inner ne fonctionne pas */
    body > div:not(.header):first-child,
    body > .wrapper,
    body > main,
    body > section:first-of-type {
        margin-top: 60px !important;
    }
    
    /* CORRECTION : Logo centré verticalement */
    body #header #logo {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        height: 60px !important;
        order: 1;
    }
    
    /* Logo mobile */
    body #header #logo > a img {
        height: 35px !important;
        vertical-align: middle !important;
    }
    
    /* Bouton mobile trigger */
    body #header #mainMenu-trigger {
        display: block;
        order: 3;
        height: 60px !important;
        display: flex !important;
        align-items: center !important;
    }
    
    /* Bouton téléphone mobile */
    body .btn-phone-enhanced,
    body .btn-phone-professional {
        width: 45px !important;
        height: 45px !important;
        order: 2;
        margin-right: 1rem;
    }
    
    body .btn-phone-enhanced i,
    body .btn-phone-professional i {
        font-size: 16px !important;
    }
    
    /* Menu mobile overlay */
    body #header #mainMenu {
        position: fixed !important;
        top: 60px !important;
        left: 0 !important;
        right: 0 !important;
        background: rgba(255, 255, 255, 0.98) !important;
        backdrop-filter: blur(20px) !important;
        max-height: 0 !important;
        overflow: hidden !important;
        transition: max-height 0.4s ease !important;
        z-index: 999 !important;
        justify-content: flex-start;
        align-items: stretch;
    }
    
    body #header #mainMenu.active {
        max-height: calc(100vh - 60px) !important;
        overflow-y: auto !important;
    }
    
    /* Navigation mobile */
    body #header #mainMenu nav > ul {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0 !important;
        width: 100%;
    }
    
    body #header #mainMenu nav > ul > li > a {
        padding: 15px 20px !important;
        border-bottom: 1px solid rgba(0,0,0,0.1) !important;
        font-size: 16px !important;
        border-radius: 0 !important;
    }
    
    /* Dropdown mobile */
    body #header #mainMenu nav > ul > li.dropdown > a::after {
        content: '+' !important;
        float: right !important;
        font-size: 18px !important;
        transition: transform 0.3s ease !important;
    }
    
    body #header #mainMenu nav > ul > li.dropdown.open > a::after {
        transform: rotate(45deg) !important;
    }
    
    body #header #mainMenu nav > ul > li .dropdown-menu {
        position: static !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
        box-shadow: none !important;
        background: var(--light-bg) !important;
        max-height: 0 !important;
        overflow: hidden !important;
        transition: max-height 0.3s ease !important;
        margin: 0 !important;
        border: none !important;
    }
    
    body #header #mainMenu nav > ul > li.dropdown.open .dropdown-menu {
        max-height: 300px !important;
    }
    
    body #header #mainMenu nav > ul > li .dropdown-menu > li > a {
        padding: 12px 40px !important;
        color: #666 !important;
        font-size: 14px !important;
        border-bottom: 1px solid rgba(0,0,0,0.05) !important;
    }
    
    body #header #mainMenu nav > ul > li .dropdown-menu > li > a:hover {
        background: #e9ecef !important;
        color: var(--primary-blue) !important;
        padding-left: 40px !important;
    }
}

/* RESPONSIVE LAPTOP - Correction débordement */
@media (max-width: 1200px) and (min-width: 769px) {
    body #header .header-inner .container {
        padding: 0 1rem !important;
        max-width: 100% !important;
    }
    
    body #header #mainMenu nav > ul {
        gap: 0.1rem !important;
    }
    
    body #header #mainMenu nav > ul > li > a {
        padding: 0.4rem 0.6rem !important;
        font-size: 11px !important;
        white-space: nowrap;
    }
    
    /* Logo plus petit sur laptop */
    body #header #logo > a img {
        height: 25px !important;
    }
    
    /* Bouton téléphone plus petit */
    body .btn-phone-enhanced,
    body .btn-phone-professional {
        width: 45px !important;
        height: 45px !important;
    }
    
    body .btn-phone-enhanced i,
    body .btn-phone-professional i {
        font-size: 16px !important;
    }
}

/* RESPONSIVE LAPTOP LARGE - Ajustement fin */
@media (max-width: 1400px) and (min-width: 1201px) {
    body #header #mainMenu nav > ul {
        gap: 0.3rem !important;
    }
    
    body #header #mainMenu nav > ul > li > a {
        padding: 0.5rem 0.8rem !important;
        font-size: 13px !important;
    }
}