/* =============================================================
   Mega menu header. Five first-level links navigate directly to
   their hub page; each also reveals a full-width mega panel that
   lays out the whole section architecture for browsing.
   ============================================================= */

:root { --header-height: 80px; }

.site-header .nav-wrap {
  max-width: 1440px;
  min-height: 80px;
  padding-inline: 40px;
  gap: 24px;
}
.site-header .brand-logo { width: 150px; max-height: 44px; }

.site-header .primary-nav {
  display: flex;
  gap: 6px;
  align-self: stretch;
  align-items: stretch;
  justify-content: center;
  flex: 1;
  margin: 0;
  min-width: 0;
}

.nav-item {
  position: static;
  display: flex;
  align-items: stretch;
  min-width: 0;
}

.nav-top {
  position: relative;
  display: flex;
  align-items: center;
  padding: 0 12px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--ink);
  white-space: nowrap;
}
.nav-top::after {
  content: "";
  position: absolute;
  inset-inline: 12px;
  bottom: 0;
  height: 2px;
  background: var(--orange);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform .22s var(--ux-ease);
}
.nav-top:hover,
.nav-item.is-current .nav-top { color: var(--orange); }
.nav-item.is-current .nav-top::after,
.nav-item.is-open .nav-top::after { transform: scaleX(1); }

.nav-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  margin-inline-start: -4px;
  padding: 0;
  background: transparent;
  color: currentColor;
}
.nav-chevron { flex-shrink: 0; transition: transform .22s var(--ux-ease); }
.nav-item.is-open .nav-chevron { transform: rotate(180deg); }

/* Full-width mega panel anchored to the header. */
.nav-dropdown {
  position: absolute;
  inset-inline: 0;
  top: 100%;
  background: #fff;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--ux-shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity .2s var(--ux-ease), transform .2s var(--ux-ease), visibility .2s;
  pointer-events: none;
  z-index: 31;
  max-height: calc(100dvh - var(--header-height) - 24px);
  overflow: auto;
  overscroll-behavior: contain;
}
.nav-item.is-open .nav-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}
/* No-JavaScript / hover fallback on desktop: panels open on pointer hover. */
@media (min-width: 1280px) and (hover: hover) {
  .nav-item:hover .nav-dropdown,
  .nav-item:focus-within .nav-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
  }
  .nav-item:hover .nav-top::after,
  .nav-item:focus-within .nav-top::after { transform: scaleX(1); }
  .nav-item:hover .nav-chevron { transform: rotate(180deg); }
}

.nav-dropdown-inner {
  max-width: 1240px;
  margin-inline: auto;
  padding: 36px 40px 44px;
  display: flex;
  gap: 56px;
  align-items: flex-start;
}
.nav-dropdown-intro { flex: 0 0 300px; }
.nav-dropdown-eyebrow {
  display: block;
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--orange);
  margin-bottom: 14px;
}
.nav-dropdown-title {
  display: block;
  font-size: 26px;
  font-weight: 650;
  letter-spacing: -.025em;
  line-height: 1.2;
  color: var(--ink);
}
.nav-dropdown-title:hover { color: var(--orange); }
.nav-dropdown-intro p {
  font-size: 13px;
  line-height: 1.8;
  color: var(--muted);
  margin: 14px 0 18px;
  max-width: 300px;
}
.nav-dropdown-view {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--green);
  border-bottom: 1px solid #a9b7aa;
  padding-bottom: 3px;
  transition: color .18s var(--ux-ease), border-color .18s var(--ux-ease);
}
.nav-dropdown-view:hover { color: var(--orange); border-color: var(--orange); }

.nav-dropdown-body { flex: 1; min-width: 0; }

.nav-dropdown-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px 40px;
}
.nav-dropdown-list > li { margin: 0; padding: 0; }
.nav-dropdown-link {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  border-radius: 8px;
  text-align: start;
  transition: background .15s var(--ux-ease), color .15s var(--ux-ease);
}
.nav-dropdown-link > span { min-width: 0; overflow-wrap: anywhere; }
.nav-dropdown-link:hover,
.nav-dropdown-link:focus-visible,
.nav-dropdown-link[aria-current] { color: var(--green); background: #f1f5ef; }
.nav-dropdown-link[aria-current] { font-weight: 600; }

/* Applications: finished-product groups laid out as columns. */
.nav-app-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 28px;
}
.nav-app-group h4 {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #789082;
  margin: 0 0 8px;
  padding: 0 12px;
}
.nav-app-group ul { list-style: none; margin: 0; padding: 0; }
.nav-app-group li { margin: 0; padding: 0; }

/* Search trigger. */
.site-header .nav-actions { gap: 10px; margin: 0; flex-shrink: 0; }
.nav-search {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  transition: border-color .18s var(--ux-ease), color .18s var(--ux-ease);
}
.nav-search:hover { border-color: var(--green); color: var(--green); }
.nav-search svg { width: 18px; height: 18px; flex-shrink: 0; }

.site-header .nav-actions .button { min-height: 44px; padding: 12px 18px; font-size: 13px; line-height: 1.6; }
.site-header .language-menu summary { min-height: 44px; font-size: 13px; }
.site-header .language-options { z-index: 33; }
.site-header .menu-toggle { display: none; }

@media (min-width: 1280px) and (max-width: 1439px) {
  .site-header .nav-wrap { padding-inline: 28px; gap: 20px; }
  .nav-top { font-size: 13px; padding-inline: 9px; }
  .nav-top::after { inset-inline: 9px; }
  .site-header .brand-logo { width: 140px; }
  .nav-search-label { display: none; }
  .nav-search { padding-inline: 11px; }
}

@media (max-width: 1279px) {
  :root { --header-height: 76px; }
  .site-header .nav-wrap { min-height: 76px; flex-wrap: wrap; padding-inline: 28px; gap: 14px; }
  .site-header .brand { margin-inline-end: auto; }
  .site-header .menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
    min-width: 44px;
    min-height: 44px;
    padding: 10px;
    background: #f3f5ef;
    border: 1px solid var(--line);
    border-radius: 8px;
  }
  .site-header .menu-toggle span { width: 20px; height: 2px; background: var(--green); transition: transform .2s var(--ux-ease), opacity .2s var(--ux-ease); }
  .site-header .menu-toggle[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
  .site-header .menu-toggle[aria-expanded="true"] span:last-child { transform: translateY(-4px) rotate(-45deg); }
  .site-header .primary-nav {
    display: none;
    order: 5;
    flex: 0 0 100%;
    width: 100%;
    margin: 0;
    padding: 0 0 12px;
    max-height: calc(100dvh - 145px);
    gap: 0;
    flex-direction: column;
    align-self: auto;
    align-items: stretch;
    justify-content: start;
    overflow: auto;
    overscroll-behavior: contain;
  }
  .site-header .primary-nav.is-open { display: flex; }
  .nav-item { position: relative; flex-direction: column; border-top: 1px solid var(--line); flex-shrink: 0; }
  .nav-item:last-child { border-bottom: 1px solid var(--line); }
  .nav-top { min-height: 54px; padding: 14px 56px 14px 12px; font-size: 16px; }
  .nav-top::after { display: none; }
  .nav-item.is-current .nav-top { color: var(--green); background: #f3f5ef; }
  .nav-toggle { position: absolute; inset-inline-end: 4px; top: 0; width: 48px; height: 54px; margin: 0; }
  .nav-chevron { width: 12px; height: 7px; }
  .nav-dropdown {
    position: static;
    inset: auto;
    display: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    pointer-events: auto;
    border: 0;
    box-shadow: none;
    max-height: none;
    overflow: visible;
    transition: none;
  }
  .nav-item.is-open .nav-dropdown { display: block; }
  .nav-dropdown-inner { display: block; padding: 4px 12px 16px; max-width: none; }
  .nav-dropdown-intro { display: none; }
  .nav-dropdown-cta { display: none; }
  .nav-dropdown-list { grid-template-columns: 1fr; gap: 0; }
  .nav-dropdown-link { padding: 10px 14px; min-height: 44px; font-size: 14px; }
  .nav-app-groups { grid-template-columns: 1fr; gap: 12px; }
  .site-header .nav-actions { gap: 8px; }
}

@media (max-width: 700px) {
  :root { --header-height: 72px; }
  .site-header .nav-wrap { min-height: 72px; padding-inline: 20px; gap: 10px; }
  .site-header .brand-logo { width: 130px; max-height: 38px; }
  .site-header .nav-actions .button { display: none; }
  .nav-search-label { display: none; }
  .nav-search { padding-inline: 11px; }
  .site-header .language-menu summary { min-width: 44px; }
  .site-header .primary-nav { max-height: calc(100dvh - 205px); padding-bottom: 0; }
  .nav-top { padding-inline: 10px 56px; font-size: 15px; }
  .nav-dropdown-inner { padding-inline: 0; }
}

@media (max-width: 360px) {
  .site-header .brand-logo { width: 112px; }
  .site-header .nav-wrap { gap: 6px; }
}
