/* ============================================================
   HEADER & NAVIGATION
   ============================================================ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--white);
  border-bottom: 1px solid var(--grey-100);
  transition: box-shadow var(--duration) var(--ease);
}
.site-header.scrolled {
  box-shadow: 0 2px 20px rgba(9,22,41,0.10);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--space-6);
  gap: var(--space-8);
}

/* LOGO */
.site-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
}
.site-logo img { height: 44px; width: auto; }

/* PRIMARY NAV */
.primary-nav {
  display: flex;
  align-items: center;
  gap: 0;
  flex: 1;
  justify-content: center;
}
.nav-item {
  position: relative;
}

/* ── FIX: invisible bridge fills gap between link and menu ── */
.nav-item::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 16px; /* covers the gap */
  background: transparent;
  display: none;
}
.nav-item:hover::after { display: block; }

.nav-link {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--grey-800);
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--duration) var(--ease);
  border-radius: var(--radius-sm);
  line-height: 1;
}
.nav-link:hover,
.nav-item:hover > .nav-link,
.nav-link.active { color: var(--blue); }
.nav-link svg {
  width: 14px; height: 14px;
  transition: transform var(--duration) var(--ease);
}
.nav-item:hover > .nav-link svg { transform: rotate(180deg); }

/* ── MEGA MENU ── */
/* Key fix: top:100% not top:calc(100%+8px) so no gap exists.
   Add padding-top on the menu itself to give visual spacing.    */
.nav-mega {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--white);
  border: 1px solid var(--grey-100);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  padding: var(--space-3) var(--space-6) var(--space-6);
  padding-top: calc(var(--space-3) + 8px); /* visual gap via padding */
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 150ms ease, visibility 150ms ease;
  white-space: normal;
  z-index: 100;
}
.nav-mega--wide   { width: 720px; }
.nav-mega--medium { width: 560px; }

.nav-item:hover > .nav-mega {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
}

.nav-mega__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
}
.nav-mega__grid--3 { grid-template-columns: repeat(3, 1fr); }
.nav-mega-link {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius);
  text-decoration: none;
  transition: background var(--duration) var(--ease);
  align-items: flex-start;
}
.nav-mega-link:hover { background: var(--grey-50); }
.nav-mega-link__icon {
  width: 36px; height: 36px;
  background: rgba(26,111,212,0.08);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; color: var(--blue);
}
.nav-mega-link__icon svg { width: 18px; height: 18px; }
.nav-mega-link__title {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--navy);
  display: block;
  margin-bottom: var(--space-1);
}
.nav-mega-link__desc {
  font-size: var(--text-xs);
  color: var(--grey-400);
  line-height: 1.4;
}
.nav-mega__header {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--grey-400);
  margin-bottom: var(--space-4);
  padding: 0 var(--space-1);
}
.nav-mega-divider {
  height: 1px; background: var(--grey-100);
  margin: var(--space-4) 0 var(--space-3);
}

/* HEADER CTA */
.header-cta {
  display: flex; align-items: center; gap: var(--space-3); flex-shrink: 0;
}

/* MOBILE TOGGLE */
.mobile-toggle {
  display: none; flex-direction: column; gap: 5px;
  padding: var(--space-2); cursor: pointer; background: none; border: none;
}
.mobile-toggle span {
  display: block; width: 22px; height: 2px;
  background: var(--navy); border-radius: 2px;
  transition: all var(--duration) var(--ease);
}
.mobile-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.mobile-toggle.open span:nth-child(2) { opacity: 0; }
.mobile-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* MOBILE DRAWER */
.mobile-nav {
  display: none; position: fixed;
  top: 72px; left: 0; right: 0; bottom: 0;
  background: var(--white); overflow-y: auto;
  padding: var(--space-6); z-index: 999;
  border-top: 1px solid var(--grey-100);
}
.mobile-nav.open { display: block; }
.mobile-nav-section { margin-bottom: var(--space-5); }
.mobile-nav-title {
  font-size: var(--text-xs); font-weight: var(--weight-bold);
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--grey-400); margin-bottom: var(--space-3);
  padding: 0 var(--space-2);
}
.mobile-nav a {
  display: block; padding: var(--space-3) var(--space-2);
  font-size: var(--text-base); color: var(--grey-800);
  text-decoration: none; border-radius: var(--radius);
  transition: background var(--duration) var(--ease);
}
.mobile-nav a:hover { background: var(--grey-50); color: var(--blue); }
.mobile-nav-divider { height: 1px; background: var(--grey-100); margin: var(--space-4) 0; }
.mobile-nav-cta {
  margin-top: var(--space-6); display: flex;
  flex-direction: column; gap: var(--space-3);
}
.mobile-nav-cta .btn { width: 100%; justify-content: center; }

/* RESPONSIVE */
@media (max-width: 1024px) {
  .primary-nav { display: none; }
  .header-cta .btn--secondary { display: none; }
  .mobile-toggle { display: flex; }
}
@media (max-width: 480px) {
  .header-inner { height: 64px; }
  .site-logo img { height: 36px; }
  .mobile-nav { top: 64px; }
}
