/* ===== NAVBAR ===== */
.nav {
    position: sticky;
    top: 0;
    z-index: 500;
    background: #fff;
    border-bottom: 1px solid var(--t9);
    padding: 0 32px;
    height: 64px;
    display: flex;
    align-items: center;
}

.nav-in {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 28px;
}

/* ── Logo ── */
.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    flex-shrink: 0;
}

.crest {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2.5px solid var(--d3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--hd);
    font-weight: 700;
    font-size: 19px;
    color: var(--d3);
    background: var(--l4);
    flex-shrink: 0;
}

.logo-t {
    font-family: var(--hd);
    font-weight: 600;
    font-size: 16px;
    color: var(--t1);
    line-height: 1.15;
}

.logo-t small {
    font-family: var(--bd);
    font-weight: 400;
    font-size: 10px;
    color: var(--t6);
    letter-spacing: 0.04em;
    display: block;
    margin-top: 2px;
}

/* ── Desktop nav links ── */
.nlinks {
    display: flex;
    gap: 2px;
    list-style: none;
    padding-left: 0;
    margin-bottom: 0;
    align-items: center;
    flex: 1;
    justify-content: flex-end;
}

/* Plain link items */
.nlinks > li > a {
    font-size: 16px;
    font-weight: 600;
    color: var(--t4);
    padding: 7px 11px;
    border-radius: 0;
    transition: color .15s, background .15s;
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    white-space: nowrap;
}

.nlinks > li > a:hover {
    color: var(--d4);
    background: var(--l4);
}

.nlinks > li > a.apply {
    background: var(--d3);
    color: #fff !important;
    padding: 8px 18px;
    border-radius: 0;
    margin-left: 4px;
    white-space: nowrap;
}

.nlinks > li > a.apply:hover {
    background: var(--d4);
}

/* ── Dropdown trigger button ── */
.nav-btn {
    font-size: 16px;
    font-weight: 600;
    color: var(--t4);
    padding: 7px 11px;
    border-radius: 0;
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--bd);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: color .15s, background .15s;
    white-space: nowrap;
}

.nav-btn:hover {
    color: var(--d4);
    background: var(--l4);
}

.has-dropdown.open > .nav-btn,
.has-dropdown:hover > .nav-btn {
    color: var(--d4);
    background: var(--l4);
}

/* ── Chevron icon ── */
.chevron {
    width: 13px;
    height: 13px;
    transition: transform 0.2s ease;
    flex-shrink: 0;
    stroke: currentColor;
}

.has-dropdown:hover > .nav-btn .chevron,
.has-dropdown.open   > .nav-btn .chevron {
    transform: rotate(180deg);
}

/* ── Dropdown panel ── */
.has-dropdown {
    position: relative;
}

.dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%) translateY(-6px);
    min-width: 210px;
    background: #fff;
    border-radius: 0;
    border: 1px solid var(--t9);
    box-shadow: 0 8px 32px rgba(11, 30, 80, 0.13);
    padding: 5px;
    list-style: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity .16s ease, transform .16s ease, visibility .16s;
    pointer-events: none;
    z-index: 600;
}

/* Keep within viewport for last items */
.has-dropdown:last-child .dropdown,
.has-dropdown:nth-last-child(2) .dropdown {
    left: auto;
    right: 0;
    transform: translateY(-6px);
}
.has-dropdown:last-child .dropdown.dropdown-wide,
.has-dropdown:nth-last-child(2) .dropdown.dropdown-wide {
    right: 0;
    left: auto;
    transform: translateY(-6px);
}

.has-dropdown:hover .dropdown,
.has-dropdown.open  .dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
    pointer-events: all;
}

.has-dropdown:last-child .dropdown:hover,
.has-dropdown:last-child .dropdown.dropdown-wide:hover,
.has-dropdown:last-child:hover .dropdown,
.has-dropdown:last-child.open .dropdown,
.has-dropdown:nth-last-child(2):hover .dropdown,
.has-dropdown:nth-last-child(2).open .dropdown {
    transform: translateY(0);
}

/* ── Dropdown items ── */
.dropdown li a {
    display: flex;
    flex-direction: column;
    padding: 8px 12px;
    border-radius: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--t3);
    text-decoration: none;
    line-height: 1.3;
    transition: background .12s ease, color .12s ease;
}

.dropdown li a small {
    font-size: 11px;
    font-weight: 400;
    color: var(--t6);
    margin-top: 1px;
    line-height: 1.4;
}

.dropdown li a:hover {
    background: var(--g7);
    color: var(--d4);
}

.dropdown li a:hover small { color: var(--d3); }

.dropdown-divider {
    height: 1px;
    background: var(--t9);
    margin: 4px 8px;
    pointer-events: none;
}

/* ── Wide dropdown (2-col grid) ── */
.dropdown.dropdown-wide {
    min-width: 440px;
    left: auto;
    right: 0;
    transform: translateY(-6px);
    padding: 8px;
}

.dropdown.dropdown-wide .dropdown-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px;
}

.has-dropdown:hover .dropdown.dropdown-wide,
.has-dropdown.open  .dropdown.dropdown-wide {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    pointer-events: all;
}

.dropdown-wide .dropdown-header {
    grid-column: span 2;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--t6);
    padding: 6px 12px 2px;
}

/* ── Hamburger button ── */
.hbtn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 0;
    flex-shrink: 0;
}

.hbtn svg {
    width: 22px;
    height: 22px;
    stroke: var(--t3);
}

.hbtn:hover { background: var(--t10); }

/* ══════════════════════════════════════
   MOBILE MENU
══════════════════════════════════════ */
.mmenu {
    display: none;
    position: fixed;
    top: 64px;
    right: 0;
    width: 280px;
    background: #fff;
    border: 1px solid var(--t9);
    border-top: none;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.10);
    z-index: 600;
    max-height: calc(100vh - 64px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.mmenu.on {
    display: block;
}

.mmenu-inner {
    padding: 8px 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

/* Plain links in mobile menu */
.mmenu-inner > a {
    display: block;
    padding: 12px 14px;
    font-size: 15px;
    font-weight: 500;
    border-radius: 0;
    color: var(--t3);
    text-decoration: none;
    transition: background .12s;
}

.mmenu-inner > a:hover { background: var(--t10); }

.mmenu-inner > a.apply {
    background: var(--d3);
    color: #fff !important;
    font-weight: 700;
    text-align: center;
    margin-top: 6px;
}

.mmenu-inner > a.apply:hover { background: var(--d4); }

/* ── Mobile accordion trigger ── */
.mmenu-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    font-size: 15px;
    font-weight: 500;
    background: none;
    border: none;
    cursor: pointer;
    border-radius: 0;
    color: var(--t3);
    font-family: var(--bd);
    text-align: left;
    transition: background .12s;
}

.mmenu-toggle:hover { background: var(--t10); }
.mmenu-toggle.open  { color: var(--d4); background: var(--g7); }

.mmenu-toggle .chevron {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.mmenu-toggle.open .chevron { transform: rotate(180deg); }

/* ── Mobile accordion sub-panel ── */
.mmenu-sub {
    display: none;
    flex-direction: column;
    gap: 1px;
    padding: 4px 0 4px 12px;
    margin: 0 0 4px 14px;
    border-left: 2px solid var(--t9);
}

.mmenu-sub.open { display: flex; }

.mmenu-sub a {
    display: block;
    padding: 9px 12px;
    font-size: 13.5px;
    font-weight: 500;
    border-radius: 0;
    color: var(--t4);
    text-decoration: none;
    transition: background .12s, color .12s;
}

.mmenu-sub a:hover {
    background: var(--g7);
    color: var(--d4);
}

/* ── Mobile breakpoint ── */
@media (max-width: 960px) {
    .nlinks { display: none; }
    .hbtn   { display: block; }
    .nav { padding: 0 20px; }
    .nav-right { margin-left: auto; }
}

@media (max-width: 520px) {
    .nav { padding: 0 16px; }
}

/* Full-width panel on phones */
@media (max-width: 520px) {
    .mmenu.on {
        width: 100%;
        left: 0;
        right: 0;
        top: 64px;
        border-left: none;
        border-right: none;
    }
    .mmenu-inner { padding: 8px 16px 24px; }
    .mmenu-inner > a,
    .mmenu-toggle { padding: 14px 16px; font-size: 16px; min-height: 48px; }
    .mmenu-sub a { padding: 12px 16px; font-size: 15px; min-height: 44px; }
}

/* Hide logo text on very small screens */
@media (max-width: 380px) {
    .logo-t { display: none; }
    .crest { width: 38px; height: 38px; font-size: 16px; }
}

/* ── Homepage navbar class aliases ── */
.logo-mark {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    background: none;
    object-fit: contain;
    flex-shrink: 0;
}

.logo-name {
    font-family: 'Montserrat', var(--bd);
    font-weight: 700;
    font-size: 18px;
    color: var(--t1);
    display: block;
}

.logo-sub {
    font-size: 11px;
    font-weight: 400;
    color: var(--t6);
    display: block;
    margin-top: -2px;
}

.nav-links {
    display: flex;
    gap: 2px;
    list-style: none;
    padding-left: 0;
    margin-bottom: 0;
    align-items: center;
    flex: 1;
    justify-content: flex-end;
}

.nav-links > li > a,
.nav-links > li > .nav-btn {
    font-size: 14.5px;
    font-weight: 500;
    color: var(--t3);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 7px 11px;
    transition: color .15s, background .15s;
    background: none;
    border: none;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    border-radius: 6px;
    text-decoration: none;
}

.nav-links > li > a:hover,
.nav-links > li > .nav-btn:hover {
    color: var(--d4);
    background: var(--t10);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    transition: all .18s;
    white-space: nowrap;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.btn-primary {
    background: #0a2540;
    color: #fff;
}
.btn-primary:hover {
    background: #163a5a;
    color: #fff;
    transform: translateY(-1px);
}

.mmenu-inner > a.apply-m {
    background: var(--d3);
    color: #fff !important;
    font-weight: 700;
    text-align: center;
    margin-top: 6px;
    border-radius: 999px;
}
.mmenu-inner > a.apply-m:hover { background: var(--d4); }

@media (max-width: 900px) {
    .nav-links { display: none; }
    .btn-primary { display: none; }
}
