﻿/* =========================================================
   NAVBAR — Purple / Blue theme
   Desktop: hover + click dropdowns
   Mobile (≤800px): slide-in drawer + accordion submenus
   ========================================================= */

/* ---------- Header shell ---------- */
.site-header {
    background: #fff;
    box-shadow: 0 2px 14px rgba(37, 99, 235, .08);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 4px 0;
}

.brand img {
    max-height:69px;
    display: block;
}

.header-cta {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ---------- Hamburger ---------- */
.nav-toggle {
    display: none;
    background: none;
    border: 0;
    cursor: pointer;
    padding: 8px;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    transition: background .2s ease;
}

    .nav-toggle:hover {
        background: #f3f4f9;
    }

    .nav-toggle span {
        display: block;
        width: 24px;
        height: 2.5px;
        background: #33384d;
        border-radius: 2px;
        margin: 5px auto;
        transition: transform .3s ease, opacity .3s ease;
    }

    .nav-toggle[aria-expanded="true"] span:nth-child(1) {
        transform: translateY(7.5px) rotate(45deg);
    }

    .nav-toggle[aria-expanded="true"] span:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle[aria-expanded="true"] span:nth-child(3) {
        transform: translateY(-7.5px) rotate(-45deg);
    }

/* ---------- Main nav (desktop) ---------- */
.main-nav {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0;
    padding: 0;
}

    .main-nav > li {
        position: relative;
    }

        .main-nav > li > a {
            display: block;
            padding: 12px 16px;
            color: #33384d;
            font-size: 15px;
            font-weight: 600;
            text-decoration: none;
            border-radius: 10px;
            position: relative;
            transition: color .25s ease;
        }

            .main-nav > li > a::after {
                content: "";
                position: absolute;
                left: 16px;
                right: 16px;
                bottom: 6px;
                height: 3px;
                border-radius: 3px;
                background: linear-gradient(90deg, #7c3aed, #2563eb);
                transform: scaleX(0);
                transform-origin: left center;
                transition: transform .3s ease;
            }

        .main-nav > li:hover > a,
        .main-nav > li.active > a,
        .main-nav > li:focus-within > a,
        .main-nav > li.submenu-open > a {
            color: #0a5f1e;
        }


/* ---------- Caret ---------- */
.has-submenu > a::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-left: 8px;
    margin-bottom: 2px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform .3s ease;
}

.has-submenu:hover > a::before,
.has-submenu:focus-within > a::before,
.has-submenu.submenu-open > a::before {
    transform: rotate(-135deg) translate(-2px, -2px);
}

/* ---------- Hover bridge (desktop) ---------- */
.has-submenu::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    height: 16px;
    background: transparent;
    pointer-events: auto;
}

/* ---------- Dropdown (desktop) ---------- */
.submenu {
    list-style: none;
    margin: 0;
    padding: 8px;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 240px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 20px 40px rgba(76, 29, 149, .16);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity .25s ease, transform .25s ease, visibility .25s ease;
    z-index: 50;
}

    .submenu::before {
        content: "";
        position: absolute;
        inset: 0 0 auto 0;
        height: 4px;
        border-radius: 14px 14px 0 0;
        background: linear-gradient(90deg, #7c3aed, #2563eb);
    }

    .submenu a {
        display: block;
        padding: 10px 14px;
        border-radius: 8px;
        color: #4b4f63;
        font-size: 14px;
        font-weight: 500;
        text-decoration: none;
        transition: background .2s ease, color .2s ease, padding-left .2s ease;
    }

        .submenu a:hover,
        .submenu a:focus {
            background: linear-gradient(90deg, rgba(124, 58, 237, .12), rgba(37, 99, 235, .12));
            color: #7c3aed;
            padding-left: 22px;
            outline: none;
        }

.has-submenu:hover > .submenu,
.has-submenu:focus-within > .submenu,
.has-submenu.submenu-open > .submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* ---------- Backdrop ---------- */
.nav-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(20, 15, 40, .5);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s ease, visibility .3s ease;
    z-index: 950;
}

body.nav-open .nav-backdrop {
    opacity: 1;
    visibility: visible;
}

/* =========================================================
   MOBILE (≤ 800px)  — uses !important to defeat site.css
   ========================================================= */
@media (max-width: 800px) {

    .header-inner {
        padding: 4px 0;
    }

    .nav-toggle {
        display: block;
    }

    /* ---------- Slide-in drawer ---------- */
    .main-nav-container {
        position: fixed;
        top: 0;
        right: 0;
        width: min(340px, 88vw);
        height: 100vh;
        height: 100dvh;
        padding: 84px 0 24px;
        background: #fff;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        transform: translateX(100%);
        transition: transform .35s cubic-bezier(.4, 0, .2, 1);
        z-index: 960;
    }

    body.nav-open .main-nav-container {
        transform: translateX(0);
    }

    /* ---------- Vertical menu ---------- */
    .main-nav {
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
        padding: 0 12px;
    }

        .main-nav > li {
            width: 100%;
        }

            .main-nav > li > a {
                padding: 14px 16px;
                font-size: 16px;
                border-radius: 10px;
            }

                .main-nav > li > a::after {
                    display: none;
                }

                .main-nav > li > a:hover {
                    background: #f5f6fb;
                }

            .main-nav > li.active > a {
                background: linear-gradient(90deg, rgba(124, 58, 237, .12), rgba(37, 99, 235, .12));
                color: #7c3aed;
            }

    /* ---------- Kill the desktop bridge on mobile ---------- */
    .has-submenu::after {
        display: none !important;
    }

    /* ---------- Accordion submenu (with !important overrides) ---------- */
    .main-nav .has-submenu > .submenu {
        display: block !important;
        position: static !important;
        top: auto !important;
        left: auto !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
        box-shadow: none !important;
        background: transparent !important;
        border-radius: 0 !important;
        padding: 0 0 0 12px !important;
        min-width: 0 !important;
        width: 100% !important;
        max-height: 0;
        overflow: hidden;
        transition: max-height .35s ease;
    }

        .main-nav .has-submenu > .submenu::before {
            display: none !important;
        }

    .main-nav .has-submenu.submenu-open > .submenu {
        max-height: 500px !important;
    }

    .main-nav .submenu a {
        display: block !important;
        padding: 12px 16px !important;
        font-size: 15px;
        border-radius: 8px;
        color: #4b4f63;
    }

        .main-nav .submenu a:hover {
            background: rgba(124, 58, 237, .08) !important;
            padding-left: 22px !important;
        }
}

/* ---------- Extra small ---------- */
@media (max-width: 480px) {
    .brand img {
        max-height: 69px;
    }

    .header-cta .btn-primary {
        display: none;
    }
}
