/* =========================================
   PROJECTIVE HEADER - PROJECTIVE CONSEIL
   Adaptation du widget Elementor de référence
   ========================================= */

/* === CSS VARIABLES (defaults) === */
.projective-main-header {
    --header-bg: rgba(255, 255, 255, 0.05);
    --header-scrolled-bg: #006D77;
    --header-blur: 10px;
    --logo-height: 50px;
    --logo-height-scrolled: 35px;
    --nav-bar-bg: rgba(0, 0, 0, 0.15);
    --nav-bar-height: 50px;
    --mobile-menu-bg: #006D77;
    --mobile-link-color: #EDF6F5;
    --mobile-link-hover-bg: #0A9396;
}

/* === HEADER TWO LEVEL === */
.projective-main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 9999;
    background: var(--header-bg);
    backdrop-filter: blur(var(--header-blur));
    -webkit-backdrop-filter: blur(var(--header-blur));
    color: #FFFFFF;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.4s ease;
    font-family: 'Work Sans', sans-serif;
}

/* Top row: Logo centré */
.projective-header-top {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.4s ease;
    position: relative;
}

.projective-header-top .projective-logo img {
    height: var(--logo-height);
    width: auto;
    transition: all 0.4s ease;
}

/* Bottom row: Navigation */
.projective-header-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    width: 100%;
    padding: 0 20px;
    height: var(--nav-bar-height);
    background: var(--nav-bar-bg);
    transition: all 0.4s ease;
}

/* Support for wp_nav_menu output (li elements) */
.projective-header-nav ul,
.projective-header-nav .menu {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.projective-header-nav li {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Nav Links */
.projective-header-nav a {
    font-size: 0.72rem;
    font-weight: 600;
    color: #EDF6F5;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    transition: all 0.3s ease;
    white-space: nowrap;
    position: relative;
    padding: 12px 0;
    display: inline-block;
}

.projective-header-nav a::after {
    content: '';
    position: absolute;
    bottom: 5px;
    left: 0;
    width: 0;
    height: 2px;
    background: #E9C46A;
    transition: width 0.3s ease;
}

.projective-header-nav a:hover {
    color: #E9C46A;
}

.projective-header-nav a:hover::after {
    width: 100%;
}

/* Current menu item */
.projective-header-nav .current-menu-item>a,
.projective-header-nav a.current-menu-item {
    color: #E9C46A;
}

.projective-header-nav .current-menu-item>a::after,
.projective-header-nav a.current-menu-item::after {
    width: 100%;
}

/* === SCROLLED STATE === */
.projective-main-header.scrolled {
    background: var(--header-scrolled-bg);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    border-bottom: none;
}

.projective-main-header.scrolled .projective-header-top {
    padding: 8px 20px;
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

.projective-main-header.scrolled .projective-header-top .projective-logo img {
    height: var(--logo-height-scrolled);
}

.projective-main-header.scrolled .projective-header-nav {
    height: 45px;
    background: rgba(0, 0, 0, 0.1);
}

.projective-main-header.scrolled .projective-header-nav a {
    font-size: 0.8rem;
}

/* === MOBILE TOGGLE - Reset Elementor/WordPress Styles === */
.projective-main-header .projective-mobile-toggle,
.projective-main-header button.projective-mobile-toggle {
    display: none;
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    color: inherit;
    cursor: pointer;
    width: 24px !important;
    height: 18px !important;
    min-width: 24px !important;
    min-height: 18px !important;
    max-width: 24px !important;
    max-height: 18px !important;
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    padding: 0 !important;
    margin: 0 !important;
}

.projective-main-header .projective-mobile-toggle:hover,
.projective-main-header .projective-mobile-toggle:focus,
.projective-main-header .projective-mobile-toggle:active {
    background: transparent !important;
    background-color: transparent !important;
    box-shadow: none !important;
    outline: none !important;
}

.projective-main-header .projective-hamburger-line {
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px !important;
    background: #EDF6F5 !important;
    background-color: #EDF6F5 !important;
    border-radius: 1px;
    transition: all 0.3s ease;
    display: block !important;
}

.projective-main-header .projective-hamburger-line:nth-child(1) {
    top: 0;
}

.projective-main-header .projective-hamburger-line:nth-child(2) {
    top: 50%;
    transform: translateY(-50%);
}

.projective-main-header .projective-hamburger-line:nth-child(3) {
    bottom: 0;
}

/* Hamburger animation - croix */
.projective-main-header .projective-mobile-toggle.active .projective-hamburger-line:nth-child(1) {
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
}

.projective-main-header .projective-mobile-toggle.active .projective-hamburger-line:nth-child(2) {
    opacity: 0;
}

.projective-main-header .projective-mobile-toggle.active .projective-hamburger-line:nth-child(3) {
    bottom: auto;
    top: 50%;
    transform: translateY(-50%) rotate(-45deg);
}

/* === MOBILE RESPONSIVE === */
@media (max-width: 991px) {

    /* Header reste fixe */
    .projective-main-header {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
    }

    .projective-main-header .projective-mobile-toggle,
    .projective-main-header button.projective-mobile-toggle {
        display: block !important;
    }

    /* Logo à gauche sur mobile */
    .projective-main-header .projective-header-top {
        justify-content: flex-start;
        padding: 12px 20px;
        position: relative;
        z-index: 999999;
        background: transparent;
        transition: background 0.3s ease;
    }

    /* Header opaque quand scrolled OU menu ouvert */
    .projective-main-header.scrolled .projective-header-top,
    .projective-main-header.menu-open .projective-header-top {
        background: var(--header-scrolled-bg);
    }

    /* Nav slide depuis la gauche - Full screen */
    .projective-main-header .projective-header-nav,
    .projective-main-header.scrolled .projective-header-nav {
        display: flex;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        min-height: 100vh;
        height: 100vh;
        background: var(--mobile-menu-bg) !important;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        padding: 56px 0 20px 0;
        gap: 0;
        overflow-y: auto;
        z-index: 99999;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .projective-main-header .projective-header-nav.active,
    .projective-main-header.scrolled .projective-header-nav.active {
        transform: translateX(0);
    }

    /* Support for wp_nav_menu output on mobile */
    .projective-main-header .projective-header-nav ul,
    .projective-main-header .projective-header-nav .menu {
        flex-direction: column;
        gap: 0;
        align-items: stretch;
    }

    .projective-header-nav a {
        display: block;
        width: 100%;
        padding: 18px 30px;
        font-size: 1rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        text-align: left;
        color: var(--mobile-link-color);
    }

    .projective-header-nav a::after {
        display: none;
    }

    .projective-header-nav a:hover {
        background: var(--mobile-link-hover-bg);
        color: var(--mobile-link-color);
    }
}

@media (max-width: 768px) {
    .projective-header-top .projective-logo img {
        height: 40px;
    }

    .projective-main-header.scrolled .projective-header-top .projective-logo img {
        height: 30px;
    }
}

/* === BODY PADDING === */
/* Compensate for fixed header */
body.has-projective-header {
    padding-top: 130px;
}

body.has-projective-header.scrolled-header {
    padding-top: 90px;
}

@media (max-width: 991px) {
    body.has-projective-header {
        padding-top: 65px;
    }
}
