/* Main navigation — desktop mega menu + mobile accordion */

/* Responsive nav (fallback if Tailwind responsive utilities are missing) */
@media (max-width: 1023px) {
    .site-nav-desktop {
        display: none !important;
    }

    #mobileMenuBtn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

@media (min-width: 1024px) {
    .site-nav-desktop {
        display: flex !important;
    }

    #mobileMenuBtn,
    #mobileMenu {
        display: none !important;
    }
}

/* ---- Desktop nav bar ---- */
.site-nav-desktop {
    flex: 1;
    min-width: 0;
    justify-content: flex-end;
}

.site-nav-list {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 0.15rem 0.35rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.site-nav-item {
    flex-shrink: 0;
}

.site-nav-link,
.site-nav-mega-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.4rem 0.55rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #374151;
    text-decoration: none;
    background: none;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
    transition: color 0.15s ease, background 0.15s ease;
    line-height: 1.25;
}

.site-nav-link:hover,
.site-nav-mega-trigger:hover,
.site-nav-mega-trigger.is-active {
    color: #2563eb;
    background: #f8fafc;
}

.site-nav-mega-trigger i.fa-chevron-down {
    font-size: 0.55rem;
    opacity: 0.7;
    transition: transform 0.2s ease;
}

.site-nav-mega-trigger.is-active i.fa-chevron-down {
    transform: rotate(180deg);
}

.site-nav-link::after,
.site-nav-mega-trigger::after {
    display: none !important;
}

.site-nav-cta {
    display: inline-flex;
    align-items: center;
    padding: 0.45rem 1rem;
    margin-left: 0.25rem;
    border-radius: 999px;
    background: #2563eb;
    color: #fff !important;
    font-size: 0.8125rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s ease;
}

.site-nav-cta:hover {
    background: #1d4ed8;
}

/* ---- Mega menu (single shared panel) ---- */
header.site-header {
    z-index: 10050;
}

.site-mega {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    z-index: 40;
}

.site-mega[hidden] {
    display: none !important;
}

.site-mega__backdrop {
    position: fixed;
    inset: 0;
    top: 0;
    background: rgba(15, 23, 42, 0.18);
    z-index: 1;
}

.site-mega__shell {
    position: relative;
    z-index: 2;
    background: #fff;
    border-top: 1px solid #e5e7eb;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
    max-height: min(70vh, 520px);
    overflow: auto;
}

.site-mega__inner {
    padding-top: 1rem;
    padding-bottom: 1.25rem;
}

.site-mega__panel[hidden] {
    display: none !important;
}

.site-mega__panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.85rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #f1f5f9;
}

.site-mega__label {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
}

.site-mega__desc {
    margin: 0.15rem 0 0;
    font-size: 0.8rem;
    color: #64748b;
}

.site-mega__viewall {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #2563eb;
    text-decoration: none;
    padding: 0.4rem 0.75rem;
    border-radius: 0.5rem;
    background: #eff6ff;
    white-space: nowrap;
    flex-shrink: 0;
}

.site-mega__viewall:hover {
    background: #dbeafe;
}

.site-mega__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.35rem;
}

.site-mega__panel--wide .site-mega__grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.site-mega__link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 0.65rem;
    border-radius: 0.5rem;
    text-decoration: none;
    color: #334155;
    transition: background 0.15s ease, color 0.15s ease;
    min-width: 0;
}

.site-mega__link:hover {
    background: #f8fafc;
    color: #2563eb;
}

.site-mega__link-icon {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 0.45rem;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #64748b;
    font-size: 0.75rem;
}

.site-mega__link:hover .site-mega__link-icon {
    background: #dbeafe;
    color: #2563eb;
}

.site-mega__link-text {
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.35;
    white-space: normal;
}

@media (max-width: 1280px) {
    .site-mega__panel--wide .site-mega__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 1024px) {
    .site-mega__grid,
    .site-mega__panel--wide .site-mega__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* ---- Mobile accordion ---- */
.site-mobile-nav-group {
    border-bottom: 1px solid #f1f5f9;
}

.site-mobile-nav-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.65rem 0;
    background: none;
    border: none;
    cursor: pointer;
    font: inherit;
    font-weight: 500;
    color: #374151;
    text-align: left;
}

.site-mobile-nav-toggle i.fa-chevron-down {
    font-size: 0.7rem;
    color: #9ca3af;
    transition: transform 0.2s ease;
}

.site-mobile-nav-group.is-open .site-mobile-nav-toggle i.fa-chevron-down {
    transform: rotate(180deg);
}

.site-mobile-nav-sub {
    display: none;
    padding: 0 0 0.65rem 0.5rem;
}

.site-mobile-nav-group.is-open .site-mobile-nav-sub {
    display: block;
}

.site-mobile-nav-sub a {
    display: block;
    padding: 0.4rem 0;
    font-size: 0.875rem;
    color: #6b7280;
    text-decoration: none;
}

.site-mobile-nav-sub a:hover { color: #2563eb; }

.site-mobile-nav-sub .view-all {
    font-weight: 600;
    color: #2563eb;
    margin-top: 0.25rem;
}
