/* Global Header Variables & Reset */
:root {
    --header-height: 80px;
    --megamenu-bg: rgba(20, 20, 20, 0.95);
}

.global-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    z-index: 1000;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(10, 10, 10, 0.3);
    overflow: visible;
}

.header-inner {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

.logo-icon {
    width: 24px !important;
    height: 24px !important;
    color: var(--accent);
}

.header-logo h1 {
    font-size: 1.3rem;
    font-weight: 900;
    letter-spacing: -1px;
    color: white;
    margin: 0;
}

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

.header-nav {
    display: flex;
    align-items: center;
    gap: 3rem;
}

.nav-link {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: color 0.3s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.nav-link:hover {
    color: white;
}

.btn-primary-sm {
    padding: 0.6rem 1.5rem;
    background: white;
    color: black;
    font-size: 0.8rem;
    font-weight: 800;
    border-radius: 40px;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-primary-sm:hover {
    background: #eee;
    transform: translateY(-2px);
}

/* Megamenu Logic */
.has-megamenu {
    position: relative;
    height: var(--header-height);
    display: flex;
    align-items: center;
}

.megamenu-wrapper {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: var(--megamenu-bg);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    width: 600px;
    padding: 2rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 40px 100px rgba(0,0,0,0.8);
}

.megamenu-wrapper.dropdown {
    width: 320px;
    padding: 1rem;
}

.megamenu-wrapper.dropdown .megamenu {
    grid-template-columns: 1fr;
    gap: 0;
}


.has-megamenu:hover .megamenu-wrapper {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.megamenu {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3rem;
}

.megamenu-title {
    display: block;
    font-size: 0.75rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--accent);
    margin-bottom: 2rem;
    opacity: 0.6;
}

.megamenu-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.megamenu-item {
    display: flex;
    gap: 1rem;
    text-decoration: none;
    color: var(--text-secondary);
    padding: 1rem;
    border-radius: 12px;
    transition: all 0.2s;
}

.megamenu-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.megamenu-item i {
    color: var(--accent);
    width: 20px;
    height: 20px;
    margin-top: 3px;
}

.megamenu-item strong {
    display: block;
    font-size: 0.95rem;
    margin-bottom: 0.2rem;
}

.megamenu-item span {
    font-size: 0.8rem;
    opacity: 0.6;
}

.megamenu-list li.disabled {
    opacity: 0.4;
    cursor: default;
}

.mobile-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
}

@media (max-width: 900px) {
    .header-nav { 
        display: none; 
        position: fixed;
        top: var(--header-height);
        left: 0;
        width: 100%;
        height: calc(100vh - var(--header-height));
        background: rgba(10, 10, 10, 0.98);
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        flex-direction: column;
        padding: 2.5rem 1.5rem;
        gap: 2rem;
        align-items: center;
        backdrop-filter: blur(40px);
        -webkit-backdrop-filter: blur(40px);
        z-index: 2000;
        overflow-y: auto;
    }

    .header-nav.active {
        display: flex;
        animation: fadeIn 0.3s ease forwards;
    }

    @keyframes fadeIn {
        from { opacity: 0; transform: translateY(-10px); }
        to { opacity: 1; transform: translateY(0); }
    }

    .mobile-toggle { 
        display: flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        background: rgba(255, 255, 255, 0.03);
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: 12px;
        transition: all 0.2s;
    }

    .mobile-toggle:active {
        transform: scale(0.95);
        background: rgba(255, 255, 255, 0.08);
    }

    .has-megamenu {
        width: 100%;
        height: auto;
        text-align: center;
    }

    .megamenu-wrapper {
        position: static;
        width: 100% !important;
        transform: none !important;
        display: block;
        opacity: 1;
        visibility: visible;
        background: rgba(255, 255, 255, 0.02);
        box-shadow: none;
        border: 1px solid rgba(255, 255, 255, 0.05);
        padding: 1.5rem;
        margin-top: 1rem;
        border-radius: 20px;
    }

    .megamenu {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }

    .megamenu-item {
        padding: 1rem;
        background: rgba(255, 255, 255, 0.02);
        border-radius: 12px;
    }

    .btn-primary-sm {
        width: 100%;
        max-width: 320px;
        text-align: center;
        padding: 1.25rem;
        font-size: 1rem;
        margin-top: 1rem;
    }

    .nav-link {
        font-size: 1.1rem;
        padding: 0.5rem 0;
    }
}

