/* ============================================
   ADVANCED HEADER - AGENCY PREMIUM REDESIGN
   Fully Responsive & Theme Compatible
   ============================================ */

:root {
    --header-height: 80px;
    --header-height-scrolled: 64px;
    --header-bg: rgba(11, 15, 25, 0.95);
    --header-bg-solid: #0b0f19;
    --header-accent: #28CCCD;
    --header-accent-glow: rgba(40, 204, 205, 0.3);
    --header-text: #ffffff;
    --header-text-dim: rgba(255, 255, 255, 0.7);
    --header-border: rgba(255, 255, 255, 0.08);
    --header-blur: 20px;
    --header-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
    --header-shadow-scrolled: 0 10px 40px rgba(0, 0, 0, 0.5);
    --transition-smooth: cubic-bezier(0.4, 0, 0.2, 1);
    --radius-submenu: 16px;
    --radius-cta: 100px;
}

/* ─── BASE HEADER STYLES ─────────────────────────────────────────── */
.custom-classic-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background: var(--header-bg);
    backdrop-filter: blur(var(--header-blur));
    -webkit-backdrop-filter: blur(var(--header-blur));
    border-bottom: 1px solid var(--header-border);
    box-shadow: var(--header-shadow);
    z-index: 10000;
    transition: all 0.4s var(--transition-smooth);
}

/* Scrolled State - Shrink & Solidify */
.custom-classic-header.is-scrolled {
    height: var(--header-height-scrolled);
    background: var(--header-bg-solid);
    box-shadow: var(--header-shadow-scrolled);
    border-bottom-color: rgba(40, 204, 205, 0.2);
}

/* ─── HEADER CONTAINER ───────────────────────────────────────────── */
.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    gap: 2rem;
}

/* ─── LOGO AREA ──────────────────────────────────────────────────── */
.site-logo {
    flex-shrink: 0;
    transition: all 0.3s var(--transition-smooth);
    z-index: 10001;
}

.custom-classic-header.is-scrolled .site-logo {
    transform: scale(0.92);
}

.site-logo a {
    display: flex;
    align-items: center;
    text-decoration: none !important;
}

.site-logo img {
    height: 42px;
    width: auto;
    transition: height 0.3s var(--transition-smooth);
}

.custom-classic-header.is-scrolled .site-logo img {
    height: 34px;
}

.logo-text {
    font-family: "Mona Sans", sans-serif;
    font-weight: 800;
    font-size: 1.6rem;
    color: #fff;
    letter-spacing: -0.03em;
    text-transform: lowercase;
    text-decoration: none !important;
}

.logo-text .highlight {
    color: var(--header-accent);
}

/* ─── NAVIGATION ─────────────────────────────────────────────────── */
.main-navigation {
    flex: 1;
    display: flex;
    justify-content: center;
}

.menu-container {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    list-style: none !important;
    margin: 0;
    padding: 0;
}

/* Reset any inherited list styles */
.custom-classic-header ul,
.custom-classic-header li {
    list-style: none !important;
    margin: 0;
    padding: 0;
}

.custom-classic-header li::before,
.custom-classic-header li::after {
    content: none !important;
}

/* ─── MENU ITEMS ─────────────────────────────────────────────────── */
.menu-item {
    position: relative;
}

.menu-item > a {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1rem;
    color: var(--header-text-dim) !important;
    text-decoration: none !important;
    font-family: "Plus Jakarta Sans", sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    border-radius: 8px;
    transition: all 0.25s ease;
}

.menu-item > a:hover,
.menu-item.active > a {
    color: var(--header-text) !important;
    background: rgba(255, 255, 255, 0.05);
}

/* Underline Animation on Hover */
.menu-item > a::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: calc(100% - 2rem);
    height: 2px;
    background: var(--header-accent);
    transition: transform 0.3s var(--transition-smooth);
    box-shadow: 0 0 8px var(--header-accent-glow);
}

.menu-item:hover > a::after,
.menu-item.active > a::after {
    transform: translateX(-50%) scaleX(1);
}

/* Toggle Icon */
.toggle-icon {
    font-size: 0.65rem;
    opacity: 0.5;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.menu-item:hover .toggle-icon {
    transform: rotate(180deg);
    opacity: 1;
    color: var(--header-accent);
}

/* ─── MEGA SUBMENU / DROPDOWN ────────────────────────────────────── */
.submenu {
    position: absolute;
    top: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    min-width: 260px;
    background: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-submenu);
    padding: 0.75rem;
    list-style: none !important;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s var(--transition-smooth);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05);
    z-index: 10001;
    pointer-events: none;
}

.submenu::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid rgba(255, 255, 255, 0.1);
}

.menu-item:hover .submenu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

.submenu li {
    margin: 0;
    padding: 2px 0;
}

.submenu a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 1rem;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--header-text-dim) !important;
    text-decoration: none !important;
    transition: all 0.2s ease;
}

.submenu a:hover {
    background: rgba(40, 204, 205, 0.12);
    color: var(--header-accent) !important;
    transform: translateX(4px);
}

.submenu a::after {
    display: none !important;
}

/* ─── CTA BUTTON ──────────────────────────────────────────────────── */
.menu-item.cta-item {
    margin-left: 0.5rem;
}

.nav-cta {
    background: var(--header-accent) !important;
    color: #0b0f19 !important;
    padding: 0.7rem 1.5rem !important;
    border-radius: var(--radius-cta) !important;
    font-weight: 700 !important;
    font-size: 0.88rem !important;
    border: none !important;
    transition: all 0.3s var(--transition-smooth) !important;
    box-shadow: 0 4px 15px rgba(40, 204, 205, 0.25);
}

.nav-cta:hover {
    background: #fff !important;
    color: #0b0f19 !important;
    box-shadow: 0 6px 25px rgba(40, 204, 205, 0.4);
    transform: translateY(-2px);
}

.nav-cta::after {
    display: none !important;
}

/* ─── MOBILE MENU TOGGLE ──────────────────────────────────────────── */
.mobile-menu-toggle {
    display: none;
    position: relative;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    cursor: pointer;
    z-index: 10002;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.mobile-menu-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--header-accent);
}

.hamburger {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 22px;
    height: 16px;
}

.hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    position: absolute;
    left: 0;
    transition: all 0.3s var(--transition-smooth);
}

.hamburger span:nth-child(1) { top: 0; }
.hamburger span:nth-child(2) { top: 7px; opacity: 1; }
.hamburger span:nth-child(3) { top: 14px; }

/* Hamburger Animation when active */
.mobile-menu-toggle.is-active .hamburger span:nth-child(1) {
    top: 7px;
    transform: rotate(45deg);
}

.mobile-menu-toggle.is-active .hamburger span:nth-child(2) {
    opacity: 0;
    transform: translateX(-10px);
}

.mobile-menu-toggle.is-active .hamburger span:nth-child(3) {
    top: 7px;
    transform: rotate(-45deg);
}

/* ─── RESPONSIVE BREAKPOINTS ──────────────────────────────────────── */

/* Large Tablets (1100px and below) */
@media (max-width: 1100px) {
    :root {
        --header-height: 70px;
        --header-height-scrolled: 60px;
    }

    .header-container {
        padding: 0 1.5rem;
        gap: 1rem;
    }

    .menu-container {
        gap: 0.15rem;
    }

    .menu-item > a {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }

    .menu-item.cta-item {
        margin-left: 0.25rem;
    }

    .nav-cta {
        padding: 0.6rem 1.2rem !important;
        font-size: 0.82rem !important;
    }
}

/* Tablet (900px and below) */
@media (max-width: 900px) {
    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .main-navigation {
        position: fixed;
        top: 0;
        right: -100%;
        width: min(320px, 85vw);
        height: 100vh;
        height: 100dvh;
        background: linear-gradient(180deg, #0f1729 0%, #0b0f19 100%);
        padding: 6rem 1.5rem 2rem;
        transition: right 0.4s var(--transition-smooth);
        box-shadow: -20px 0 60px rgba(0, 0, 0, 0.5);
        overflow-y: auto;
        z-index: 10001;
        border-left: 1px solid rgba(255, 255, 255, 0.05);
    }

    .main-navigation.active {
        right: 0;
    }

    .menu-container {
        flex-direction: column;
        align-items: stretch;
        gap: 0.25rem;
    }

    .menu-item {
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        padding-bottom: 0.25rem;
    }

    .menu-item:last-child {
        border-bottom: none;
    }

    .menu-item > a {
        padding: 1rem 0.75rem;
        font-size: 1rem;
        justify-content: space-between;
    }

    .menu-item > a::after {
        display: none;
    }

    .menu-item:hover .toggle-icon {
        transform: rotate(0deg);
    }

    .menu-item.open .toggle-icon {
        transform: rotate(180deg) !important;
    }

    /* Mobile Submenu */
    .submenu {
        position: static;
        transform: none !important;
        width: 100%;
        background: rgba(255, 255, 255, 0.03);
        border: none;
        border-radius: 10px;
        padding: 0.5rem;
        margin-top: 0.25rem;
        box-shadow: none;
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto;
        display: none;
    }

    .menu-item.open .submenu {
        display: block;
        animation: slideDown 0.3s ease;
    }

    .submenu a {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }

    .submenu a:hover {
        transform: translateX(0);
        background: rgba(40, 204, 205, 0.08);
    }

    /* CTA in mobile */
    .menu-item.cta-item {
        margin-left: 0;
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

    .nav-cta {
        display: block;
        text-align: center;
        width: 100%;
    }
}

/* Mobile (600px and below) */
@media (max-width: 600px) {
    :root {
        --header-height: 64px;
        --header-height-scrolled: 56px;
    }

    .header-container {
        padding: 0 1rem;
    }

    .logo-text {
        font-size: 1.3rem;
    }

    .site-logo img {
        height: 36px;
    }

    .custom-classic-header.is-scrolled .site-logo img {
        height: 30px;
    }

    .main-navigation {
        width: 100%;
        padding-top: 5rem;
    }
}

/* ─── OVERLAY FOR MOBILE MENU ─────────────────────────────────────── */
.header-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.header-overlay.active {
    display: block;
    opacity: 1;
}

/* ─── ANIMATIONS ─────────────────────────────────────────────────── */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ─── BODY PADDING FOR FIXED HEADER ─────────────────────────────── */
body {
    padding-top: var(--header-height);
    transition: padding-top 0.4s var(--transition-smooth);
}

body.admin-bar {
    padding-top: calc(var(--header-height) + 32px);
}

.custom-classic-header.is-scrolled ~ body,
.custom-classic-header.is-scrolled + * {
    /* Content adjusts automatically via padding */
}

/* ─── BLOG PAGE SPECIFIC - Light Header Variant ───────────────────── */
body.blog .custom-classic-header,
body.archive .custom-classic-header,
body.search .custom-classic-header {
    background: rgba(245, 247, 250, 0.98);
    border-bottom-color: rgba(0, 0, 0, 0.08);
}

body.blog .custom-classic-header.is-scrolled,
body.archive .custom-classic-header.is-scrolled,
body.search .custom-classic-header.is-scrolled {
    background: #ffffff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border-bottom-color: rgba(40, 204, 205, 0.3);
}

body.blog .logo-text,
body.archive .logo-text,
body.search .logo-text {
    color: #0b0f19;
}

body.blog .menu-item > a,
body.archive .menu-item > a,
body.search .menu-item > a {
    color: rgba(11, 15, 25, 0.75) !important;
}

body.blog .menu-item > a:hover,
body.blog .menu-item.active > a,
body.archive .menu-item > a:hover,
body.archive .menu-item.active > a,
body.search .menu-item > a:hover,
body.search .menu-item.active > a {
    color: #0b0f19 !important;
    background: rgba(40, 204, 205, 0.08);
}

body.blog .submenu,
body.archive .submenu,
body.search .submenu {
    background: rgba(255, 255, 255, 0.98);
    border-color: rgba(0, 0, 0, 0.08);
}

body.blog .hamburger span,
body.archive .hamburger span,
body.search .hamburger span {
    background: #0b0f19;
}

body.blog .mobile-menu-toggle,
body.archive .mobile-menu-toggle,
body.search .mobile-menu-toggle {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
}

body.blog .mobile-menu-toggle:hover,
body.archive .mobile-menu-toggle:hover,
body.search .mobile-menu-toggle:hover {
    background: rgba(40, 204, 205, 0.1);
    border-color: var(--header-accent);
}