/* =============================================================================
   Loan4All — Custom Header (nav.css)
   CLS-safe: NO JS dependency for initial layout.
   All transitions use transform/opacity only (no height/width changes on load).
   ============================================================================= */

/* ── Variables ─────────────────────────────────────────────────────────────── */
:root {
  --nh-blue: #00137d;
  --nh-blue-mid: #2c5282;
  --nh-blue-cta: #0227ff;
  --nh-blue-hover: #001ece;
  --nh-white: #ffffff;
  --nh-black: #1a202c;
  --nh-gray-bg: #f7fafc;
  --nh-gray-text: #4a5568;
  --nh-gray-light: #718096;
  --nh-gray-lighter: rgba(220, 233, 255, 0.45);
  --nh-border: #e2e8f0;
  --nh-green: #38a169;

  --nh-font: 'Heebo', sans-serif;
  --nh-ease: cubic-bezier(0.4, 0, 0.2, 1);
  --nh-fast: 0.3s;
  --nh-medium: 0.4s;

  --nh-topbar-h: 40px;
  --nh-ticker-h: 48px;
  --nh-nav-h: 68px;
  --nh-total-h: calc(var(--nh-topbar-h) + var(--nh-ticker-h) + var(--nh-nav-h));

  --nh-z-nav: 1000;
  --nh-z-ticker: 998;  /* below nav — mega panels (inside nav stacking context) must float above ticker */
  --nh-z-mega: 999;
  --nh-z-overlay: 1100;
  --nh-z-panel: 1200;
}

/* ── Skip navigation link (keyboard / screen-reader users) ─────────────────── */
/* SR-only when not focused: zero dimensions + clip = no overflow in any browser.
   Becomes a visible fixed banner on first Tab keypress. */
.nh-skip-link {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.nh-skip-link:focus {
  position: fixed;
  top: 0;
  right: 0;
  z-index: calc(var(--nh-z-panel) + 10);
  width: auto;
  height: auto;
  padding: 12px 24px;
  margin: 0;
  overflow: visible;
  clip: auto;
  background: var(--nh-blue-cta);
  color: #fff;
  font-family: var(--nh-font);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  border-radius: 0 0 8px 8px;
  white-space: nowrap;
  outline: 3px solid #fff;
  outline-offset: -3px;
}

/* ── Reset for header scope ────────────────────────────────────────────────── */
.nh-header *,
.nh-header *::before,
.nh-header *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ── Keyboard focus styles (WCAG 2.4.11) ───────────────────────────────────── */
/* Override any theme-level outline:0 reset */
.nh-header a:focus-visible,
.nh-header button:focus-visible,
.nh-header input:focus-visible,
.nh-header [tabindex]:focus-visible {
  outline: 2px solid var(--nh-blue-cta);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Suppress outline for mouse/pointer users only */
.nh-header a:focus:not(:focus-visible),
.nh-header button:focus:not(:focus-visible),
.nh-header input:focus:not(:focus-visible) {
  outline: none;
}

.nh-header {
  font-family: var(--nh-font);
  direction: rtl;
  width: 100%;
  position: relative;
  background: var(--nh-white);
  min-height: var(--nh-total-h);
  contain: style;
}

/* ══════════════════════════════════════════════════════════════════════════════
   1. TOP INFO BAR (desktop only)
   ══════════════════════════════════════════════════════════════════════════════ */

.nh-topbar {
  position: relative;
  z-index: var(--nh-z-nav);
  background: var(--nh-white);
  border-bottom: 1px solid var(--nh-border);
  height: var(--nh-topbar-h);
  display: flex;
  align-items: center;
  overflow: hidden;
  contain: layout style; /* no fixed/overflow children — safe to isolate layout */
}

.nh-topbar-inner {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 100%;
}

.nh-topbar-right {
  display: flex;
  align-items: center;
  gap: 0; /* gaps replaced by dividers */
}

/* Dividers between topbar items */
.nh-topbar-right .nh-topbar-item + .nh-topbar-item::before {
  content: '';
  display: block;
  width: 1px;
  height: 14px;
  background: var(--nh-border);
  flex-shrink: 0;
  margin: 0 14px;
}

.nh-topbar-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  color: #2d3748;
  white-space: nowrap;
  text-decoration: none;
}

.nh-topbar-item svg {
  width: 14px;
  height: 14px;
  color: var(--nh-blue);
  flex-shrink: 0;
}

.nh-topbar-link:hover {
  color: var(--nh-blue-cta);
}

.nh-topbar-legal {
  font-size: 12px;
  font-weight: 700;
  color: var(--nh-gray-text);
  max-width: 500px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ══════════════════════════════════════════════════════════════════════════════
   2. TICKER BAR
   ══════════════════════════════════════════════════════════════════════════════ */

.nh-ticker {
  position: relative;
  z-index: var(--nh-z-ticker);
  background: var(--nh-white);
  border-top: 1px solid var(--nh-border);
  height: var(--nh-ticker-h);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  contain: layout style; /* no fixed/overflow children — safe to isolate layout */
}

.nh-ticker-inner {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  /* The whole inner row is the pill */
  background: var(--nh-white);
  border: 1px solid var(--nh-border);
  border-radius: 99px;
  padding: 0 20px;
  height: 34px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.nh-ticker-live {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--nh-gray-text);
  white-space: nowrap;
}

/* Pulsing green dot */
.nh-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--nh-green);
  animation: nh-pulse 2s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes nh-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(56, 161, 105, 0.5);
  }
  50% {
    box-shadow: 0 0 0 5px rgba(56, 161, 105, 0);
  }
}

.nh-ticker-item {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.nh-ticker-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--nh-gray-text);
  white-space: nowrap;
}

/* Short labels hidden on desktop, swapped in on mobile */
.nh-lbl-short {
  display: none;
}

.nh-ticker-value-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nh-ticker-value {
  font-size: 14px;
  font-weight: 700;
  color: var(--nh-blue);
}

.nh-trend {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 99px;
}

.nh-trend--down {
  background: #f0fdf4;
  color: var(--nh-green);
}

.nh-trend--down svg {
  width: 8px;
  height: 8px;
}

.nh-trend--up {
  background: #fff0f0;
  color: #e53e3e;
}

.nh-trend--up svg {
  transform: rotate(180deg);
}

.nh-trend--same {
  background: #f7fafc;
  color: var(--nh-gray-text);
}

.nh-ticker-sep {
  width: 1px;
  height: 20px;
  background: var(--nh-border);
  flex-shrink: 0;
}

.nh-ticker-updated {
  font-size: 11px;
  color: var(--nh-gray-light);
  margin-right: auto; /* push to the left */
  white-space: nowrap;
}

/* ══════════════════════════════════════════════════════════════════════════════
   3. MAIN NAV BAR
   ══════════════════════════════════════════════════════════════════════════════ */

.nh-nav {
  position: relative;
  z-index: var(--nh-z-nav);
  background: var(--nh-white);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  height: var(--nh-nav-h);
  display: flex;
  align-items: center;
  /* contain: layout NOT applied — would create a new stacking context that traps
     the mega panel's z-index below the ticker (same z-index, later in DOM). */
}

.nh-nav-inner {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: stretch; /* stretch so li items fill full nav height */
  gap: 8px;
  height: 100%;
  position: relative; /* mega panel & dropdowns now positioned within this */
}

/* Logo */
.nh-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
  min-width: 140px;
  min-height: 56px;
}

.nh-logo-img {
  height: 56px;
  width: auto;
  display: block;
}

.nh-logo-text {
  font-size: 20px;
  font-weight: 700;
  color: var(--nh-blue);
}

/* Desktop nav menu */
.nh-menu {
  display: flex;
  align-items: stretch; /* items fill full nav height — no hover dead-zone */
  list-style: none;
  gap: 0;
  flex: 1;
  justify-content: center;
}

.nh-menu-item {
  display: flex;
  align-items: center; /* center content vertically within the full-height li */
  position: relative; /* needed for both simple dropdowns AND mega panels */
}

.nh-menu-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 10px;
  font-family: var(--nh-font);
  font-size: 14.5px;
  font-weight: 500;
  color: black;
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  /* border-radius: 6px; */
  transition:
    color var(--nh-fast) var(--nh-ease),
    background var(--nh-fast) var(--nh-ease);
  white-space: nowrap;
}

.nh-menu-link:hover,
.nh-menu-item.is-open > .nh-menu-link {
  background: var(--nh-gray-lighter);
}

/* Chevron icon */
.nh-chevron {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  transition: transform var(--nh-fast) var(--nh-ease);
  color: var(--nh-blue-mid);
}

.nh-menu-item.is-open > .nh-menu-btn .nh-chevron {
  transform: rotate(180deg);
}

/* ── Split button: page link + chevron side by side ─────────────────────── */

.nh-menu-split {
  display: flex;
  align-items: center;

  overflow: hidden;
  transition: background var(--nh-fast) var(--nh-ease);
}

.nh-menu-split:hover,
.nh-menu-item.is-open > .nh-menu-split {
  background: var(--nh-gray-lighter);
}

/* Suppress individual hover — wrapper handles the highlight */
.nh-menu-split .nh-menu-link:hover,
.nh-menu-split .nh-chevron-btn:hover {
  background: none;
}

.nh-chevron-btn {
  display: flex;
  align-items: center;
  padding: 8px 4px 8px 8px;
  height: 100%;
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  flex-shrink: 0;
}

.nh-menu-item.is-open > .nh-menu-split .nh-chevron-btn .nh-chevron {
  transform: rotate(180deg);
}

/* ── Mega panel ──────────────────────────────────────────────────────────── */

.nh-mega-panel {
  position: absolute;
  top: 80%;
  right: 0;
  left: auto;
  width: max-content;
  max-width: min(1200px, calc(100vw - 40px));
  background: var(--nh-white);
  border: 1px solid var(--nh-border);
  border-top: 1px solid var(--nh-blue-cta);
  box-shadow: 0 16px 48px rgba(0, 19, 125, 0.13);
  border-radius: 0 0 16px 16px;
  z-index: var(--nh-z-mega);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-8px);
  transition:
    opacity var(--nh-fast) var(--nh-ease),
    visibility 0s var(--nh-fast),
    transform var(--nh-fast) var(--nh-ease);
  content-visibility: hidden; /* Skip rendering of hidden mega panels — saves paint cost on first load */
}

/* Open on hover via JS-controlled .is-open */
.nh-has-mega.is-open .nh-mega-panel {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
  content-visibility: visible;
  transition:
    opacity var(--nh-fast) var(--nh-ease),
    visibility 0s,
    transform var(--nh-fast) var(--nh-ease);
}

.nh-mega-inner {
  padding: 18px;
  display: flex;
  flex-wrap: nowrap; /* keep all columns in one row */
  gap: 0;
  align-items: flex-start;
}

.nh-mega-col {
  flex: 0 0 200px; /* fixed width — prevents layout shift on hover */
  width: 200px;
  padding: 0 10px;
}

/* Spacing between multiple groups stacked in one column */
.nh-mega-group + .nh-mega-group {
  margin-top: 20px;
  padding-top: 16px;
}

.nh-mega-heading {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 15px;
  font-weight: 700;
  color: #0d1b2a;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--nh-border);
  white-space: normal;
  line-height: 1.3;
}

.nh-mega-heading svg {
  width: 15px;
  height: 15px;
  color: #0d1b2a;
  flex-shrink: 0;
  margin-top: 1px;
}

.nh-mega-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.nh-mega-list a {
  display: block;
  font-size: 13.5px;
  color: var(--nh-gray-text);
  text-decoration: none;
  padding: 6px 8px 6px 22px; /* 22px left space reserved for arrow */
  border-radius: 5px;
  position: relative;
  transition:
    color var(--nh-fast) var(--nh-ease),
    background var(--nh-fast) var(--nh-ease),
    padding-right var(--nh-fast) var(--nh-ease);
  line-height: 1.4;
}

/* Arrow icon — hidden, starts 5px to the left of final position */
.nh-mega-list a::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 50%;
  width: 12px;
  height: 12px;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 5l-5 5 5 5' stroke='%230227ff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  transform: translateY(-50%) translateX(-5px);
  opacity: 0;
  transition:
    opacity var(--nh-fast) var(--nh-ease),
    transform var(--nh-fast) var(--nh-ease);
}

.nh-mega-list li:last-child a {
  border-bottom: none;
}

.nh-mega-list a:hover {
  color: var(--nh-blue); /* dark navy */
  background: #eef1f9; /* soft grey-blue */
  padding-right: 13px; /* keep existing text shift */
}

.nh-mega-list a:hover::after {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

/* ── Simple dropdown ─────────────────────────────────────────────────────── */

.nh-has-dropdown {
  position: relative;
}

.nh-dropdown {
  position: absolute;
  top: 80%; /* no gap */
  right: 0;
  min-width: 200px;
  background: var(--nh-white);
  border: 1px solid var(--nh-border);
  border-top: 1px solid var(--nh-blue-cta);
  border-radius: 0 0 10px 10px;
  box-shadow: 0 8px 24px rgba(0, 19, 125, 0.1);
  z-index: var(--nh-z-mega);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-4px);
  transition:
    opacity var(--nh-fast) var(--nh-ease),
    visibility 0s var(--nh-fast),
    transform var(--nh-fast) var(--nh-ease);
  padding: 8px 0;
}

.nh-has-dropdown:hover .nh-dropdown,
.nh-has-dropdown.is-open .nh-dropdown {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
  transition:
    opacity var(--nh-fast) var(--nh-ease),
    visibility 0s,
    transform var(--nh-fast) var(--nh-ease);
}

.nh-dropdown-list {
  list-style: none;
}

.nh-dropdown-list a {
  display: block;
  padding: 9px 20px 9px 36px; /* 36px left for arrow */
  font-size: 14px;
  color: var(--nh-gray-text);
  text-decoration: none;
  position: relative;
  border-radius: 5px;
  margin: 0 6px;
  transition:
    background var(--nh-fast) var(--nh-ease),
    color var(--nh-fast) var(--nh-ease),
    padding-right var(--nh-fast) var(--nh-ease);
}

.nh-dropdown-list a::after {
  content: '';
  position: absolute;
  left: 10px;
  top: 50%;
  width: 12px;
  height: 12px;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 5l-5 5 5 5' stroke='%230227ff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  transform: translateY(-50%) translateX(-5px);
  opacity: 0;
  transition:
    opacity var(--nh-fast) var(--nh-ease),
    transform var(--nh-fast) var(--nh-ease);
}

.nh-dropdown-list a:hover {
  background: #eef1f9;
  color: var(--nh-blue);
  padding-right: 26px;
}

.nh-dropdown-list a:hover::after {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

/* ── Search ──────────────────────────────────────────────────────────────── */

.nh-search {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--nh-gray-bg);
  border: 1px solid var(--nh-border);
  border-radius: 8px;
  padding: 6px 12px;
  flex-shrink: 0;
  /* Fixed width — prevents reflow when search input is focused */
  width: 170px;
  height: 38px; /* explicit height — don't stretch to full nav height */
  align-self: center; /* override align-items:stretch on nav-inner */
  transition: border-color var(--nh-fast) var(--nh-ease);
}

.nh-search:focus-within {
  border-color: var(--nh-blue-cta);
}

.nh-search-icon {
  display: flex;
  align-items: center;
  color: var(--nh-gray-light);
  flex-shrink: 0;
  cursor: pointer;
}

.nh-search-icon svg {
  width: 15px;
  height: 15px;
}

.nh-search-input {
  border: none;
  background: transparent;
  font-family: var(--nh-font);
  font-size: 13px;
  color: var(--nh-gray-text);
  width: 100%;
  outline: none;
  direction: rtl;
}

.nh-search-input::placeholder {
  color: var(--nh-gray-light);
}

/* ── CTA button ──────────────────────────────────────────────────────────── */

.nh-cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 22px;
  height: 40px; /* explicit height — don't stretch to full nav height */
  align-self: center; /* override align-items:stretch on nav-inner */
  background: var(--nh-blue-cta);
  color: var(--nh-white);
  font-family: var(--nh-font);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  border-radius: 8px;
  white-space: nowrap;
  flex-shrink: 0;
  transition:
    background var(--nh-fast) var(--nh-ease),
    transform var(--nh-fast) var(--nh-ease);
}

.nh-cta-btn:hover {
  background: var(--nh-blue-hover);
  transform: translateY(-1px);
}

/* ── Mobile actions wrapper (phone + hamburger) ──────────────────────────── */

.nh-mobile-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Phone button — hidden on desktop, shown on mobile */
.nh-mob-phone-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: none;
  border: 1px solid var(--nh-border);
  border-radius: 8px;
  color: var(--nh-blue);
  text-decoration: none;
  flex-shrink: 0;
  transition: border-color var(--nh-fast) var(--nh-ease);
}

.nh-mob-phone-btn:hover {
  border-color: var(--nh-blue-cta);
}

.nh-mob-phone-btn svg {
  width: 20px;
  height: 20px;
}

/* ── Hamburger (mobile only) ─────────────────────────────────────────────── */

.nh-hamburger {
  display: none; /* shown in mobile MQ below */
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  background: none;
  border: 1px solid var(--nh-border);
  border-radius: 8px;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  transition: border-color var(--nh-fast) var(--nh-ease);
}

.nh-hamburger:hover {
  border-color: var(--nh-blue-cta);
}

.nh-hamburger-bar {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--nh-blue);
  border-radius: 2px;
  transition:
    transform var(--nh-medium) var(--nh-ease),
    opacity var(--nh-medium) var(--nh-ease);
}

/* Hamburger → X animation */
.nh-header.nav-open .nh-hamburger-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nh-header.nav-open .nh-hamburger-bar:nth-child(2) {
  opacity: 0;
}
.nh-header.nav-open .nh-hamburger-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ══════════════════════════════════════════════════════════════════════════════
   4. MOBILE OVERLAY
   ══════════════════════════════════════════════════════════════════════════════ */

.nh-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: var(--nh-z-overlay);
  /* display:none when inactive — same fix as the panel.
     visibility:hidden alone still creates a position:fixed layer that some
     mobile browsers include in viewport overflow calculations. */
  display: none;
}

.nh-header.nav-open .nh-overlay {
  display: block;
  opacity: 1;
  pointer-events: auto;
  animation: nh-fade-in var(--nh-medium) var(--nh-ease) both;
}

@keyframes nh-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ══════════════════════════════════════════════════════════════════════════════
   5. MOBILE PANEL
   Slides in from the right (RTL site).
   No height changes — pure translateX + opacity — ZERO CLS.
   ══════════════════════════════════════════════════════════════════════════════ */

.nh-mobile-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: min(430px, 100vw);
  height: 100dvh;
  background: var(--nh-white);
  z-index: var(--nh-z-panel);
  flex-direction: column;
  overflow: hidden;

  /* HIDDEN via display:none — the ONLY safe way to prevent mobile browsers
     from including a position:fixed off-screen element in the scrollable area.
     transform:translateX() on fixed elements causes horizontal overflow on
     iOS Safari and Android Chrome regardless of overflow:hidden on html/body. */
  display: none;
}

/* Slide-in / slide-out keyframes (RTL: slides from right) */
@keyframes nh-slide-in {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}
@keyframes nh-slide-out {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(100%);
  }
}

.nh-mobile-panel.is-open {
  display: flex;
  animation: nh-slide-in var(--nh-medium) var(--nh-ease) both;
  box-shadow: -4px 0 32px rgba(0, 0, 0, 0.18);
  will-change: transform; /* Promote to compositor layer for smooth animation */
}

/* Closing: slide out, then JS removes this class → display:none */
.nh-mobile-panel.is-closing {
  display: flex;
  animation: nh-slide-out var(--nh-medium) var(--nh-ease) forwards;
  will-change: transform;
}

/* Panel header */
.nh-mobile-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--nh-border);
  flex-shrink: 0;
}

.nh-mobile-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px; /* WCAG 2.5.8: minimum 44×44 touch target */
  height: 44px;
  background: var(--nh-gray-bg);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  color: var(--nh-blue);
  flex-shrink: 0;
}

.nh-mobile-close svg {
  width: 18px;
  height: 18px;
}

.nh-mobile-close:hover {
  background: var(--nh-border);
}

/* Panel search */
.nh-mobile-search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 16px 20px 8px;
  padding: 10px 14px;
  background: var(--nh-gray-bg);
  border: 1px solid var(--nh-border);
  border-radius: 10px;
  flex-shrink: 0;
}

.nh-mobile-search input {
  border: none;
  background: transparent;
  font-family: var(--nh-font);
  font-size: 14px;
  color: var(--nh-gray-text);
  width: 100%;
  outline: none;
  direction: rtl;
}

.nh-mobile-search input::placeholder {
  color: var(--nh-gray-light);
}

/* Panel nav (scrollable) */
.nh-mobile-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden; /* prevent horizontal bleed on full-width panel */
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.nh-mobile-menu {
  list-style: none;
  padding: 8px 0;
  width: 100%;
}

.nh-mob-item {
  border-bottom: 1px solid var(--nh-border);
  width: 100%;
}

.nh-mob-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-sizing: border-box; /* guard against theme overrides */
  width: 100%;
  max-width: 100%;
  padding: 12px 16px;
  font-family: var(--nh-font);
  font-size: 15px;
  font-weight: 500;
  color: var(--nh-blue);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  text-align: right;
}

.nh-mob-link--active {
  color: var(--nh-blue-cta);
  font-weight: 700;
}

.nh-mob-link:hover:not(.nh-mob-link--active) {
  background: #eef1f9;
}

.nh-mob-link .nh-chevron {
  transition: transform var(--nh-fast) var(--nh-ease);
}

.nh-mob-toggle[aria-expanded='true'] .nh-chevron {
  transform: rotate(180deg);
}

/* Mobile split: page link + chevron toggle side by side */
.nh-mob-split {
  display: flex;
  align-items: stretch;
}

.nh-mob-split .nh-mob-link {
  flex: 1;
  width: auto; /* override width: 100% */
}

.nh-mob-chevron-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  flex-shrink: 0;
  background: none;
  border: none;
  border-right: 1px solid var(--nh-border); /* RTL: divider between text and chevron */
  cursor: pointer;
  color: var(--nh-blue);
  transition: background var(--nh-fast) var(--nh-ease);
}

.nh-mob-chevron-btn:hover {
  background: #eef1f9;
}

/* Accordion sub-panel */
.nh-mob-sub {
  background: var(--nh-gray-bg);
  padding: 12px 20px 16px;
  border-top: 1px solid var(--nh-border);
  /* Reveal with max-height (used for accordion — after initial load only) */
}

.nh-mob-sub[hidden] {
  display: none;
}

.nh-mob-section-heading {
  font-size: 11px;
  font-weight: 600;
  color: #1a202c; /* near-black */
  margin-top: 16px;
  margin-bottom: 4px;
}

.nh-mob-section-heading:first-child {
  margin-top: 4px;
}

.nh-mob-list {
  list-style: none;
  border-right: 2px solid var(--nh-border);
  padding-right: 10px;
  margin-right: 2px;
  margin-bottom: 4px;
}

.nh-mob-list a {
  display: block;
  padding: 8px 6px 8px 20px; /* 20px left reserved for arrow */
  font-size: 13.5px;
  color: var(--nh-gray-text);
  text-decoration: none;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  line-height: 1.4;
  position: relative;
  border-radius: 5px;
  transition:
    color var(--nh-fast) var(--nh-ease),
    background var(--nh-fast) var(--nh-ease),
    padding-right var(--nh-fast) var(--nh-ease);
}

/* Arrow icon for sub-items — same pattern as desktop */
.nh-mob-list a::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 50%;
  width: 11px;
  height: 11px;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 5l-5 5 5 5' stroke='%230227ff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  transform: translateY(-50%) translateX(-4px);
  opacity: 0;
  transition:
    opacity var(--nh-fast) var(--nh-ease),
    transform var(--nh-fast) var(--nh-ease);
}

.nh-mob-list a:hover {
  color: var(--nh-blue);
  background: #eef1f9;
  padding-right: 12px;
}

.nh-mob-list a:hover::after {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

/* Panel footer — two rounded buttons with padding and gap */
.nh-mobile-footer {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  gap: 10px;
  padding: 16px;
  border-top: 1px solid var(--nh-border);
  background: var(--nh-white);
}

.nh-mob-cta-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 20px;
  background: var(--nh-blue-cta);
  color: var(--nh-white);
  font-family: var(--nh-font);
  font-size: 16px;
  font-weight: 800;
  text-decoration: none;
  letter-spacing: 0.4px;
  gap: 8px;
  border-radius: 12px;
}

.nh-mob-cta-btn:hover {
  background: var(--nh-blue-hover);
}

.nh-mob-phone-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 20px;
  background: #f0f4ff;
  color: var(--nh-blue);
  font-family: var(--nh-font);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  border-radius: 12px;
  border: 1px solid #d0dcf8;
}

.nh-mob-phone-bar svg {
  width: 16px;
  height: 16px;
  color: var(--nh-blue-cta);
}

.nh-mob-phone-bar:hover {
  background: #e0e9ff;
}

/* ══════════════════════════════════════════════════════════════════════════════
   6. RESPONSIVE — Tablet & Mobile
   ══════════════════════════════════════════════════════════════════════════════ */

@media (max-width: 1500px) {
  .nh-menu-link {
    font-size: 13.5px;
    padding: 8px 8px;
  }

  .nh-search {
    width: 130px;
  }

  .nh-cta-btn {
    padding: 9px 16px;
    font-size: 14px;
  }
}

@media (max-width: 1200px) {
  /* Hide desktop-only elements */
  .nh-menu,
  .nh-search,
  .nh-cta-btn {
    display: none;
  }

  /* Prevent any child from creating horizontal overflow on mobile.
     Safe here because .nh-menu (with mega panels) is display:none,
     and the mobile panel + overlay are position:fixed (unaffected). */
  .nh-header {
    overflow: hidden;
  }

  /* Show hamburger and phone button */
  .nh-hamburger {
    display: flex;
  }

  .nh-mob-phone-btn {
    display: flex;
  }

  /* Nav height on mobile */
  :root {
    --nh-topbar-h: 30px;
    --nh-nav-h: 60px;
    --nh-ticker-h: 44px;
    --nh-total-h: calc(
      var(--nh-topbar-h) + var(--nh-nav-h) + var(--nh-ticker-h)
    );
  }

  .nh-nav-inner {
    justify-content: space-between;
  }

  /* Topbar on mobile: show only the legal text strip */
  .nh-topbar {
    height: auto;
    padding: 5px 16px;
  }

  .nh-topbar-inner {
    padding: 0;
    justify-content: center;
  }

  .nh-topbar-right {
    display: none;
  }

  .nh-topbar-legal {
    font-size: 11px;
    font-weight: 600;
    max-width: 100%;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    text-align: center;
    line-height: 1.3;
  }

  /* Simplified ticker fits on screen — center the pill */
  .nh-ticker {
    justify-content: center;
  }

  .nh-ticker-updated {
    display: none;
  }

  /* Simplified ticker: dot only, short labels, no trend badges */
  .nh-ticker-live-text {
    display: none;
  }
  .nh-trend {
    display: none;
  }
  .nh-lbl-full {
    display: none;
  }
  .nh-lbl-short {
    display: inline;
  }
}

/* Full-width panel on actual phone screens */
@media (max-width: 750px) {
  .nh-mobile-panel {
    width: 100vw;
  }
}

@media (max-width: 480px) {
  .nh-ticker {
    height: 40px;
  }

  :root {
    --nh-ticker-h: 40px;
  }

  /* Short label already shown via the ≤1200px rule above */
}

/* ══════════════════════════════════════════════════════════════════════════════
   7. ACCESSIBILITY — Reduced motion
   ══════════════════════════════════════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
  .nh-mobile-panel,
  .nh-overlay,
  .nh-mega-panel,
  .nh-dropdown,
  .nh-hamburger-bar,
  .nh-chevron {
    transition: none;
    animation: none;
  }

  .nh-pulse-dot {
    animation: none;
  }
}
