/* =============================================================================
   HEADER — Navigation & top bar styles
   Loaded globally on every page via functions.php
   ============================================================================= */

.ap-header {
    position: sticky; top: 0; z-index: 999;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid #e2e8f0;
}
.ap-header-inner {
    max-width: 1280px; margin: 0 auto;
    padding: 0 1.5rem; height: 5rem;
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem;
}
.ap-logo {
    display: flex; align-items: center; gap: 0.6rem;
    text-decoration: none; color: #0f172a;
    min-width: 0;
}
.ap-logo-text {
    font-size: 1.35rem; font-weight: 900;
    text-transform: uppercase; letter-spacing: -0.02em;
}
.ap-logo-orange { color: #f98c1f; }
.ap-nav {
    display: flex;
    align-items: center;
    gap: 2.5rem;
    background: transparent;
}
.ap-nav-link {
    font-size: 0.78rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.1em;
    text-decoration: none; color: #0f172a;
    transition: color 0.2s;
}
.ap-nav-link:hover, .ap-nav-link.active { color: #f98c1f; }
.ap-header-right { display: flex; align-items: center; gap: 1rem; flex-shrink: 0; }
.ap-theme-toggle {
    background: none; border: 1px solid #cbd5e1; color: #0f172a;
    width: 36px; height: 36px; border-radius: 0.375rem;
    cursor: pointer; font-size: 0.9rem; transition: all 0.3s;
    display: flex; align-items: center; justify-content: center; padding: 0;
}
.ap-theme-toggle:hover { background: #f1f5f9; }
body.dark-mode .ap-theme-toggle {
    color: #f1f5f9; border-color: #475569;
}
body.dark-mode .ap-theme-toggle:hover { background: #1e293b; }
.ap-btn-commander {
    background: #f98c1f; color: #fff;
    padding: 0.55rem 1.4rem; border-radius: 0.5rem;
    font-size: 0.78rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.05em;
    text-decoration: none; border: none; cursor: pointer;
    transition: background 0.2s; white-space: nowrap;
}
.ap-btn-commander:hover { background: #e07a10; color: #fff; }
.ap-hamburger {
    display: none; flex-direction: column; gap: 5px;
    background: none; border: none; cursor: pointer; padding: 4px;
}
.ap-hamburger span {
    display: block; width: 24px; height: 2px;
    background: #0f172a; border-radius: 2px; transition: 0.3s;
}
body.dark-mode .ap-hamburger span {
    background: #ffffff !important;
}

/* =============================================================================
   TABLET & MOBILE (<= 1024px) : 100% OPAQUE DROPDOWN NAVIGATION
   ============================================================================= */
@media (max-width: 1024px) {
    .ap-header {
        position: sticky;
        top: 0;
        z-index: 99999;
    }

    .ap-header-inner {
        position: relative;
        height: auto;
        min-height: 4.5rem;
        padding: 0.75rem 1.25rem;
    }

    .ap-hamburger {
        display: flex !important;
    }

    /* 100% Opaque Solid Navigation for Mobile & Tablet */
    .ap-nav {
        display: none !important;
        position: absolute !important;
        top: 100% !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        flex-direction: column !important;
        gap: 0 !important;
        padding: 1.25rem 1.75rem 1.75rem !important;
        background: #ffffff !important;
        opacity: 1 !important;
        border-top: 2px solid #f98c1f !important;
        border-bottom: 2px solid #e2e8f0 !important;
        box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25) !important;
        max-height: calc(100vh - 4.5rem);
        overflow-y: auto;
        z-index: 999999 !important;
    }

    .ap-nav.open {
        display: flex !important;
    }

    .ap-nav .ap-nav-link {
        font-size: 0.95rem !important;
        font-weight: 800 !important;
        text-transform: uppercase !important;
        letter-spacing: 0.08em !important;
        text-decoration: none !important;
        color: #0f172a !important;
        padding: 1rem 0 !important;
        border-bottom: 1px solid #f1f5f9 !important;
        width: 100% !important;
        display: block !important;
        transition: color 0.2s, padding-left 0.2s !important;
    }

    .ap-nav .ap-nav-link:hover,
    .ap-nav .ap-nav-link.active {
        color: #f98c1f !important;
        padding-left: 8px !important;
    }

    /* Dark mode solid opaque */
    body.dark-mode .ap-nav {
        background: #0f172a !important;
        border-top: 2px solid #f98c1f !important;
        border-bottom: 2px solid #1e293b !important;
        box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.75) !important;
    }

    body.dark-mode .ap-nav .ap-nav-link {
        color: #ffffff !important;
        border-bottom: 1px solid #1e293b !important;
    }

    body.dark-mode .ap-nav .ap-nav-link:hover,
    body.dark-mode .ap-nav .ap-nav-link.active {
        color: #f98c1f !important;
    }
}

@media (max-width: 480px) {
    .ap-header-inner {
        padding: 0.65rem 0.75rem;
        gap: 0.4rem;
    }

    .ap-logo img {
        height: 46px !important;
    }

    .ap-logo-text {
        font-size: 0.92rem;
    }

    .ap-btn-commander {
        padding: 0.38rem 0.65rem;
        font-size: 0.68rem;
    }

    .ap-theme-toggle {
        width: 30px;
        height: 30px;
        font-size: 0.75rem;
    }

    .ap-hamburger span {
        width: 20px;
    }
}

/* --- Polylang Switcher Container --- */
.ap-language-switcher ul {
    display: flex !important;
    flex-direction: row;
    align-items: center;
    list-style: none !important;
    gap: 12px !important;
    margin: 0 20px 0 0 !important;
    padding: 0 !important;
}

/* --- Liens des langues --- */
.ap-language-switcher li a {
    font-size: 0.85rem;
    font-weight: 800;
    text-decoration: none;
    color: #64748b; 
    text-transform: uppercase;
    transition: color 0.3s ease;
}


.ap-language-switcher li a:hover {
    color: #f98c1f; /* Orange Astro */
}

.ap-language-switcher li.current-lang a {
    color: #f98c1f !important;
    cursor: default;
    pointer-events: none; 
}

@media (max-width: 768px) {
    .ap-language-switcher {
        margin-right: 10px !important;
    }
}