/* =============================================
   MEGA NAVIGATION - Two-Column Layout
   Left: Logo (25-30%) | Right: Utility + Nav
   ============================================= */

.mega-header {
    background: var(--white);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--gray-100);
    transition: box-shadow 0.3s ease;
}
.mega-header.scrolled {
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
}

/* Two-Column Inner */
.mega-header-inner {
    display: grid;
    grid-template-columns: 250px 1fr;
    align-items: stretch;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Left Column: Logo */
.mega-header-logo {
    display: flex;
    align-items: center;
    padding: 12px 20px 12px 0;
}
.mega-header-logo .logo img {
    height: 80px;
    max-width: 220px;
    object-fit: contain;
    transition: all 0.3s ease;
}
.mega-header.scrolled .mega-header-logo .logo img {
    height: 60px;
}
.mega-header-logo .logo:hover img {
    transform: scale(1.02);
    filter: brightness(1.03);
}

/* Right Column */
.mega-header-right {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-left: 25px;
}

/* Utility Row */
.mega-utility-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 8px 0;
}
.mega-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}
.mega-header .header-cta {
    padding: 9px 20px;
    font-size: 0.82rem;
}
.mega-header .header-partner {
    padding: 9px 18px;
    font-size: 0.82rem;
}

/* Login */
.login-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: transparent;
    border: 2px solid var(--gray-200);
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary);
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font);
}
.login-trigger:hover {
    border-color: var(--primary);
    background: rgba(26,58,92,0.03);
}
.login-trigger:focus-visible {
    outline: 3px solid rgba(26,58,92,0.15);
    outline-offset: 2px;
}
.login-dropdown-wrap { position: relative; }
.login-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 280px;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: 0 12px 45px rgba(0,0,0,0.12);
    border: 1px solid var(--gray-100);
    padding: 8px;
    opacity: 0; visibility: hidden;
    transform: translateY(8px);
    transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
    z-index: 200;
}
.login-dropdown.show { opacity: 1; visibility: visible; transform: translateY(0); }
.login-dropdown a {
    display: flex; align-items: center; gap: 11px;
    padding: 10px 12px; border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}
.login-dropdown a:hover { background: rgba(232,122,46,0.04); }
.login-dropdown a i {
    width: 32px; height: 32px; min-width: 32px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 7px;
    background: linear-gradient(135deg,rgba(26,58,92,0.07),rgba(26,58,92,0.02));
    color: var(--primary); font-size: 0.78rem;
    transition: all 0.2s ease;
}
.login-dropdown a:hover i { background: var(--secondary); color: var(--white); }
.login-dropdown a div { display: flex; flex-direction: column; }
.login-dropdown a strong { font-size: 0.82rem; color: var(--primary); font-weight: 600; }
.login-dropdown a span { font-size: 0.68rem; color: var(--gray-400); }

/* Nav Row */
.mega-nav-row {
    padding: 0;
}
.mega-nav-list {
    display: flex;
    align-items: center;
    gap: 0;
    list-style: none;
    margin: 0; padding: 0;
}
.mega-nav-list > li { position: relative; }
.mega-nav-list > li > a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 14px 14px;
    font-size: 0.86rem;
    font-weight: 500;
    color: var(--gray-700);
    transition: all 0.3s ease;
    white-space: nowrap;
    position: relative;
}
.mega-nav-list > li > a::after {
    content: '';
    position: absolute;
    bottom: 0; left: 50%;
    width: 0; height: 3px;
    background: var(--secondary);
    border-radius: 3px;
    transition: width 0.3s ease, left 0.3s ease;
}
.mega-nav-list > li:hover > a::after,
.mega-nav-list > li > a.active::after {
    width: 22px; left: calc(50% - 11px);
}
.mega-nav-list > li > a i.fa-chevron-down {
    font-size: 0.55rem; opacity: 0.5;
    transition: transform 0.3s;
}
.mega-nav-list > li:hover > a { color: var(--secondary); }
.mega-nav-list > li:hover > a i.fa-chevron-down { transform: rotate(180deg); opacity: 1; }
.mega-nav-list > li > a.active { color: var(--secondary); font-weight: 600; }

/* Active subnav item inside dropdown */
.mega-dropdown a.active {
    background: rgba(232,122,46,0.06);
    color: var(--secondary);
    font-weight: 600;
}
.mega-dropdown a.active i {
    background: var(--secondary);
    color: var(--white);
}

/* Dropdowns */
.mega-dropdown {
    position: absolute;
    top: 100%; left: 0;
    min-width: 220px;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: 0 12px 40px rgba(0,0,0,0.11);
    border: 1px solid var(--gray-100);
    padding: 8px;
    opacity: 0; visibility: hidden;
    transform: translateY(8px);
    transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
    z-index: 100;
}
.mega-dropdown-wide { min-width: 260px; }
.has-dropdown:hover .mega-dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.mega-dropdown a {
    display: flex; align-items: center; gap: 9px;
    padding: 9px 12px; font-size: 0.83rem; font-weight: 500;
    color: var(--gray-700); border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}
.mega-dropdown a:hover { background: rgba(232,122,46,0.05); color: var(--secondary); padding-left: 16px; }
.mega-dropdown a i {
    width: 26px; height: 26px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 5px;
    background: rgba(26,58,92,0.05);
    color: var(--primary); font-size: 0.7rem;
    flex-shrink: 0; transition: all 0.2s;
}
.mega-dropdown a:hover i { background: var(--secondary); color: var(--white); }

/* Hamburger */
.mega-header .hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
    align-self: center;
    margin-left: auto;
}

/* Hide mobile-only login on desktop */
.mobile-login-item { display: none; }
.mega-header .hamburger span {
    width: 26px; height: 2.5px;
    background: var(--primary); border-radius: 3px;
    transition: all 0.3s ease;
}
.mega-header .hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.mega-header .hamburger.active span:nth-child(2) { opacity: 0; }
.mega-header .hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* Mobile Overlay */
.nav-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 998;
    opacity: 0; visibility: hidden;
    transition: all 0.3s ease;
}
.nav-overlay.show { opacity: 1; visibility: visible; }
.mobile-drawer-ctas {display: none;}

/* ---- RESPONSIVE ---- */
@media (max-width: 1200px) {
    .mega-header-inner { grid-template-columns: 200px 1fr; }
    .mega-header-logo .logo img { height: 65px; max-width: 180px; }
    .mega-nav-list > li > a { padding: 12px 10px; font-size: 0.82rem; }
}

@media (max-width: 1024px) {
    .mega-header-inner {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 10px 20px;
    }
    .mega-header-logo { border-right: none; padding: 0; }
    .mega-header-logo .logo img { height: 52px; }
    .mega-header-right {
        display: block !important;
        position: static;
        flex: none;
        padding: 0;
    }
    .mega-utility-row { display: none; }
    .mega-nav-row { display: block; }
    .mega-header .hamburger { display: flex; }

    /* Show login item in mobile drawer */
    .mobile-login-item { display: block !important; }

    /* Mobile Drawer */
    .mega-nav {
        position: fixed;
        top: 0; right: -320px;
        width: 300px; height: 100vh;
        background: var(--white);
        box-shadow: -6px 0 30px rgba(0,0,0,0.1);
        padding: 20px;
        padding-top: 70px;
        overflow-y: auto;
        transition: right 0.4s cubic-bezier(0.4,0,0.2,1);
        z-index: 999;
    }
    .mega-nav.active { right: 0; }

    .mega-nav-list { flex-direction: column; gap: 0; width: 100%; }
    .mega-nav-list > li { width: 100%; }
    .mega-nav-list > li > a {
        display: flex; justify-content: space-between;
        padding: 14px 12px; border-bottom: 1px solid var(--gray-100);
        border-radius: 0; width: 100%;
    }
    .mega-nav-list > li > a::after { display: none; }

    .mega-dropdown {
        position: static; opacity: 1; visibility: visible; transform: none;
        box-shadow: none; border: none; border-radius: 0;
        padding: 0; max-height: 0; overflow: hidden;
        transition: max-height 0.4s ease;
        background: var(--gray-50); margin: 0;
    }
    .has-dropdown.open .mega-dropdown { max-height: 500px; padding: 6px 0 6px 10px; }
    .has-dropdown.open > a i.fa-chevron-down { transform: rotate(180deg); }
    .mega-dropdown a { padding: 10px 12px; font-size: 0.82rem; }

    /* Mobile CTAs at bottom of drawer */
    .mega-nav::after {
        content: '';
        display: none;
    }
    .mobile-drawer-ctas {
        display: flex;
        flex-direction: column;
        gap: 10px;
        margin-top: 20px;
        padding-top: 16px;
        border-top: 1px solid var(--gray-100);
    }
    .mobile-drawer-ctas a {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        padding: 13px 20px;
        border-radius: 50px;
        font-weight: 600;
        font-size: 0.85rem;
        text-decoration: none;
        text-align: center;
        transition: all 0.3s ease;
    }
    .mobile-drawer-ctas .mob-partner {
        background: linear-gradient(135deg, var(--primary), var(--primary-light));
        color: #fff;
        box-shadow: 0 4px 12px rgba(26,58,92,0.25);
    }
    .mobile-drawer-ctas .mob-invest {
        background: linear-gradient(135deg, var(--secondary), var(--secondary-light));
        color: #fff;
        box-shadow: 0 4px 12px rgba(232,122,46,0.25);
    }
}

@media (max-width: 768px) {
    .mega-header-inner { padding: 8px 15px; }
    .mega-header-logo .logo img { height: 46px; }
}
