/* ============================================================
   HEADER / NAV — corrected
   FIX: removed the duplicate .dropdown-menu block that was
   appended after the media queries. It re-applied desktop rules
   (opacity:0; visibility:hidden; position:absolute) on mobile,
   making opened dropdowns occupy space but stay invisible.
   Also hardened .dropdown.active .dropdown-menu on mobile.
   ============================================================ */

/* --- Root variables used by the nav --- */
:root {
    --pri: #1B17FF !important;
    --pri2: #131B2E !important;
    --pri3: #1A2540 !important;
    --acc: #000 !important;
    --acc2: #fff !important;
    --accg: rgba(59, 130, 246, .12);
    --sn: #F8FAFC;
    --bd: #E2E8F0;
    --tx: #64748B;
    --dk: #1E293B;
    --wh: #FFFFFF;
    --se: 'DM Serif Display', Georgia, serif;
    --sa: 'Outfit', system-ui, sans-serif;
    --mo: 'JetBrains Mono', monospace
}

/* ===== NAV ===== */
nav {
    background: #fff;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 1.25rem 0;
    transition: all .4s cubic-bezier(.16, 1, .3, 1)
}

nav.scrolled {
    background: rgba(248, 247, 244, .92);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--bd);
    padding: .75rem 0
}

nav .container {
    display: flex;
    align-items: center;
    justify-content: space-between
}

.nav-logo {
    font-family: 'DM Serif Display', serif;
    font-size: 1.15rem;
    text-decoration: none;
    letter-spacing: -.02em
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center
}

.nav-links a {
    font-size: .8rem;
    font-weight: 500;
    color: var(--dk);
    text-decoration: none;
    transition: color .2s;
    letter-spacing: .01em
}

.nav-links a:hover {
    color: var(--pri)
}

/* ===== DROPDOWN ===== */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 150%;
    left: 0;
    background: #fff;
    padding: 1rem;
    border-radius: 14px;
    width: 600px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 99;
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 10px;
    text-decoration: none;
    color: #000;
    border: 1px solid transparent;
    transition: 0.3s;
}

.dropdown-menu a i {
    font-size: 14px;
}

.dropdown-menu a:hover {
    border: 1px solid #1B17FF;
    background: #f8f9ff;
}

/* ===== HAMBURGER TOGGLE ===== */
.menu-toggle {
    display: none;
    font-size: 22px;
    cursor: pointer;
}

/* ===== CUSTOM LINK ARROW ===== */
.custom-link {
    position: relative;
    transition: all 0.3s ease;
    padding-right: 25px;
}

.custom-link::after {
    content: "\f061";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    right: 10px;
    opacity: 0;
    transform: translateX(-5px);
    transition: all 0.3s ease;
}

.custom-link:hover::after {
    opacity: 1;
    transform: translateX(0);
}

/* ===== NAV CTA ===== */
.nav-cta {
    background: #1B17FF;
    color: #fff !important;
    padding: .55rem 1.25rem;
    border-radius: 100px;
    font-size: .75rem !important;
    font-weight: 600 !important;
    transition: all .3s !important;
}

.nav-cta:hover {
    background: #131B2E;
    transform: translateY(-1px);
}

/* ===== TABLET / MOBILE NAV ===== */
@media (max-width: 991px) {

    .menu-toggle {
        display: block;
    }

    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: #fff;
        flex-direction: column;
        gap: 18px;
        max-height: 0;
        overflow: hidden;
        transition: 0.3s;
        padding: 0 20px;
    }

    .nav-links.active {
        max-height: calc(100vh - 80px);
        overflow-y: auto;
        overflow-x: hidden;
        padding: 20px;
    }

    /* Closed state: fully removed from layout */
    .dropdown .dropdown-menu {
        position: static;
        display: none;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        padding-left: 10px;
        width: auto;
        max-height: 60vh;
        overflow-y: auto;
    }

    /* Open state: visible AND explicit, so later rules can't hide it */
    .dropdown.active .dropdown-menu {
        display: flex;
        flex-direction: column;
        position: static;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
    }

    /* Only one dropdown's items scroll; keep rows intact */
    .dropdown-menu a {
        flex-shrink: 0;
    }

    /* Disable desktop hover-open on touch layouts */
    .dropdown:hover .dropdown-menu {
        opacity: 1;
        visibility: visible;
    }
}

@media (max-width: 768px) {
    .nav-logo {
        width: 90px;
    }

    nav {
        padding: .6rem 1.2rem;
    }
}

/* ===== MOBILE DROPDOWN COLUMN FIX ===== */
@media (max-width: 767px) {

    #nav .dropdown-menu .row > div {
        width: 100% !important;
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }

    #nav .dropdown-menu .dropdown-item {
        display: block;
        width: 100%;
    }

    #nav .dropdown-menu {
        width: auto !important;
    }
}

/* ===== ALIGNMENT FIX ===== */
.nav-links > a,
.nav-links .dropdown {
    display: inline-flex;
    align-items: center;
}



