/* ============================================================================
   SorbiTech R2 â Header / Navigation  (nav.css)
   V8.3 brand identity (mono-blue). Uses tokens defined in main.css.
   ========================================================================== */

/* ââ Site header â sticky on scroll, compacts when scrolled âââââââââââââââââ
   .is-scrolled toggled by JS once window.scrollY > 60.
   Default state: 76px tall Â· subtle hairline shadow.
   Scrolled state: 60px tall Â· stronger shadow Â· backdrop blur for depth. */
.st-site-header {
  position: sticky; top: 0; z-index: 1000;
  background: var(--st-white);
  border-bottom: 1px solid var(--st-gray-200);
  box-shadow: 0 1px 0 var(--st-gray-200);
  transition: box-shadow 240ms ease, background 240ms ease, backdrop-filter 240ms ease;
  will-change: box-shadow, background;
}
.st-site-header.is-scrolled {
  background: rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  backdrop-filter: saturate(180%) blur(10px);
  box-shadow: 0 6px 22px rgba(15, 42, 92, 0.10), 0 1px 0 var(--st-gray-200);
}

/* V9 Â§14.5: 4-entity strip in header REMOVED (decision #11) */

/* ââ Main nav bar â height transitions on scroll for compact mode ââââââââââ */
.st-nav-bar { height: 76px; display: flex; align-items: center; transition: height 240ms ease; }
.st-nav-bar .st-container { display: flex; align-items: center; gap: var(--st-space-4); height: 100%; }
.st-site-header.is-scrolled .st-nav-bar { height: 60px; }

/* ââ Logo â scales down with the compact header âââââââââââââââââââââââââââ */
.st-logo { display: flex; align-items: center; margin-right: auto; flex-shrink: 0; }
.st-logo img { height: 72px; width: auto; filter: none; display: block; transition: height 240ms ease; }
.st-site-header.is-scrolled .st-logo img { height: 52px; }

/* ââ Primary nav ââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ */
.st-primary-nav { display: flex; align-items: stretch; gap: 0; height: 100%; }
.st-nav-item { position: relative; display: flex; align-items: center; height: 100%; }
.st-nav-btn,
.st-nav-link {
  display: flex; align-items: center; gap: var(--st-space-1);
  padding: 0 var(--st-space-4); height: 100%;
  font-family: var(--st-font-sans);
  font-size: 0.95rem; font-weight: 600;
  color: var(--st-gray-800);
  background: none; border: none;
  text-decoration: none; white-space: nowrap;
  position: relative; cursor: pointer;
  transition: color var(--st-transition);
}
.st-nav-btn::after,
.st-nav-link::after {
  content: ""; position: absolute; bottom: 0;
  left: var(--st-space-4); right: var(--st-space-4); height: 3px;
  background: var(--st-blue-500);
  transform: scaleX(0);
  transition: transform var(--st-transition);
}
.st-nav-btn:hover::after,
.st-nav-link:hover::after,
.st-nav-btn[aria-expanded="true"]::after,
.st-nav-item.is-active .st-nav-btn::after,
.st-nav-link.current-menu-item::after { transform: scaleX(1); }
.st-nav-btn:hover,
.st-nav-link:hover,
.st-nav-btn[aria-expanded="true"] { color: var(--st-blue-700); text-decoration: none; }

.st-nav-btn__arrow { transition: transform var(--st-transition); }
.st-nav-btn[aria-expanded="true"] .st-nav-btn__arrow { transform: rotate(180deg); }

/* ââ Simple dropdown ââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ */
.st-dropdown {
  position: absolute; top: 100%; left: 0;
  min-width: 260px;
  background: var(--st-white);
  border: 1px solid var(--st-gray-200);
  border-top: 2px solid var(--st-blue-500);
  box-shadow: var(--st-shadow-md);
  padding: var(--st-space-2) 0;
  z-index: 200;
  display: none;
}
.st-dropdown.is-open { display: block; }
.st-dropdown a {
  display: block;
  padding: var(--st-space-3) var(--st-space-4);
  font-size: 0.95rem;
  color: var(--st-gray-800);
  text-decoration: none;
  transition: background var(--st-transition), color var(--st-transition);
}
.st-dropdown a:hover {
  background: var(--st-blue-50);
  color: var(--st-blue-700);
  text-decoration: none;
}
.st-dropdown__all a {
  border-top: 1px solid var(--st-gray-200);
  margin-top: var(--st-space-1);
  font-weight: 600;
  color: var(--st-blue-700);
}
.st-dropdown__divider {
  border-top: 1px solid var(--st-gray-200);
  margin-top: var(--st-space-1);
}

/* ââ Mega-menu ââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ */
.st-mega-menu {
  position: absolute; top: 100%; left: -120px;
  width: 640px;
  background: var(--st-white);
  border: 1px solid var(--st-gray-200);
  border-top: 2px solid var(--st-blue-500);
  box-shadow: var(--st-shadow-md);
  z-index: 200;
  display: none;
}
.st-mega-menu.is-open { display: block; }
.st-mega-menu__inner { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
/* Column is a flex column so the list inside can stretch to full height,
   pushing the "All X â" link to the bottom regardless of how many items
   are above. Both columns share the same height (grid stretch default),
   so both "All â" links land on the same Y line. */
.st-mega-menu__col {
  padding: var(--st-space-5);
  border-right: 1px solid var(--st-gray-200);
  display: flex;
  flex-direction: column;
}
.st-mega-menu__col:last-child { border-right: 0; }
.st-mega-menu__heading {
  display: block;
  font-size: 0.7rem; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--st-blue-700);
  margin-bottom: var(--st-space-1);
}
/* Description text. Both columns get the SAME min-height so the link lists
   below start at exactly the same Y position regardless of wrap differences. */
.st-mega-menu__desc {
  font-size: 0.85rem; color: var(--st-gray-600);
  margin-bottom: var(--st-space-3);
  line-height: 1.45;
  min-height: calc(1.45em * 2);
}
/* List grows to fill the column's remaining height so the "All â" item
   pinned to the bottom (via margin-top: auto below) lands on the same Y
   line in both columns. */
.st-mega-menu__list { display: flex; flex-direction: column; flex: 1; }
.st-mega-menu__list a {
  display: block;
  padding: var(--st-space-2) var(--st-space-3);
  font-size: 0.95rem; color: var(--st-gray-800);
  text-decoration: none;
  transition: background var(--st-transition), color var(--st-transition);
  margin-inline: calc(var(--st-space-3) * -1);
}
.st-mega-menu__list a:hover {
  background: var(--st-blue-50);
  color: var(--st-blue-700);
  text-decoration: none;
}
/* margin-top: auto pushes the "All â" item to the bottom of the flex list,
   so both columns' "All Products â" and "All Systems â" align horizontally
   regardless of how many items are above them. */
.st-mega-menu__all { margin-top: auto; }
.st-mega-menu__all a {
  border-top: 1px solid var(--st-gray-200);
  margin-top: var(--st-space-2);
  padding-top: var(--st-space-3);
  font-weight: 600;
  color: var(--st-blue-700);
}

/* ââ Nav CTA button âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ */
.st-nav-cta { margin-left: var(--st-space-3); flex-shrink: 0; }

/* ââ Hamburger (mobile) âââââââââââââââââââââââââââââââââââââââââââââââââââââââ */
.st-hamburger {
  display: none;
  flex-direction: column; justify-content: center; gap: 5px;
  padding: var(--st-space-2);
  background: none;
  border: 1px solid var(--st-gray-300);
  margin-left: auto;
}
.st-hamburger__bar {
  display: block; width: 22px; height: 2px;
  background: var(--st-gray-800);
  transition: transform var(--st-transition), opacity var(--st-transition);
}
.st-hamburger[aria-expanded="true"] .st-hamburger__bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.st-hamburger[aria-expanded="true"] .st-hamburger__bar:nth-child(2) { opacity: 0; }
.st-hamburger[aria-expanded="true"] .st-hamburger__bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ââ Mobile drawer ââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ */
.st-mobile-drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 340px; max-width: 90vw;
  background: var(--st-white);
  z-index: 2000;
  transform: translateX(100%);
  transition: transform 0.28s ease;
  display: flex; flex-direction: column;
  overflow-y: auto;
}
.st-mobile-drawer.is-open { transform: translateX(0); }
.st-mobile-drawer__inner {
  display: flex; flex-direction: column;
  padding: var(--st-space-5);
  flex: 1;
}
.st-mobile-drawer__close {
  align-self: flex-end;
  background: none;
  border: 1px solid var(--st-gray-300);
  padding: var(--st-space-2);
  margin-bottom: var(--st-space-4);
  color: var(--st-gray-800);
}
.st-mobile-nav { flex: 1; }
.st-mobile-nav__item { border-bottom: 1px solid var(--st-gray-200); }
.st-mobile-nav__toggle {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%;
  padding: var(--st-space-4) 0;
  font-family: var(--st-font-sans);
  font-size: 1rem; font-weight: 600;
  color: var(--st-gray-800);
  background: none; border: none; cursor: pointer;
}
.st-mobile-nav__toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.st-mobile-nav__sub { display: none; padding-bottom: var(--st-space-3); }
.st-mobile-nav__sub.is-open { display: block; }
.st-mobile-nav__sub a {
  display: block;
  padding: var(--st-space-2) var(--st-space-4);
  font-size: 0.95rem;
  color: var(--st-gray-800);
  text-decoration: none;
}
.st-mobile-nav__sub a:hover { color: var(--st-blue-700); }
.st-mobile-nav__link {
  display: block;
  padding: var(--st-space-4) 0;
  font-size: 1rem; font-weight: 600;
  color: var(--st-gray-800);
  text-decoration: none;
  border-bottom: 1px solid var(--st-gray-200);
}
.st-mobile-drawer__contact {
  padding-top: var(--st-space-5);
  border-top: 2px solid var(--st-blue-500);
  margin-top: auto;
}

/* ââ Mobile overlay âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ */
.st-mobile-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(15,42,92,0.55);
  z-index: 1999;
}
.st-mobile-overlay.is-open { display: block; }

/* ââ Funnel header (stripped, navy) âââââââââââââââââââââââââââââââââââââââââââ */
.st-site-header--funnel {
  background: var(--st-blue-900);
  height: 64px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}
.st-funnel-header-inner {
  display: flex; align-items: center;
  height: 64px;
  gap: var(--st-space-5);
}
.st-site-header--funnel .st-logo img { filter: brightness(0) invert(1); }
.st-funnel-header__group {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.7);
  margin-left: auto;
}

/* ââ Responsive: hide desktop nav, show hamburger ââââââââââââââââââââââââââââ */
@media (max-width: 1024px) {
  .st-primary-nav { display: none; }
  .st-nav-cta { display: none; }
  .st-hamburger { display: flex; }
  .st-group-strip__nav { display: none; }
}
