/* ==========================================================================
   SEMITA NEXIS SM — HEADER, MEGA-MENU, DRAWER & SEARCH STYLESHEET (header.css)
   Matches Old Theme (smnxtheme) Header Height, Logo Size & Brand Color Palette
   ========================================================================== */

.hdr {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 65;
  background-color: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 2px solid rgba(0, 32, 96, 0.14);
  box-shadow: 0 2px 12px rgba(11, 31, 58, 0.05);
  transition: border-bottom-color 0.28s ease, box-shadow 0.28s ease;
}

.hdr.is-scrolled {
  border-bottom-color: var(--sn-brand-blue);
  box-shadow: 0 6px 22px rgba(0, 32, 96, 0.14);
}

/* Line & Scroll Progress Bar Below Header Menu */
.hdr-scroll-line {
  position: relative;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, rgba(0, 32, 96, 0.18) 0%, rgba(0, 166, 166, 0.25) 50%, rgba(0, 32, 96, 0.18) 100%);
  overflow: hidden;
}

.hdr-scroll-bar {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #002060 0%, #0052CC 50%, #00A6A6 100%);
  box-shadow: 0 0 10px rgba(0, 32, 96, 0.45);
  transition: width 0.08s linear;
}

.hdr .wrap {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 86px;
  padding-top: 6px;
  padding-bottom: 6px;
}

@media (min-width: 1131px) {
  .hdr .wrap {
    max-width: 100%;
    padding-left: clamp(24px, 3.5vw, 56px);
    padding-right: clamp(24px, 3.5vw, 56px);
  }
}

.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  margin-right: auto;
  flex-shrink: 0;
  line-height: 1;
}

.brand img,
.brand .smnx-logo-img {
  height: 52px;
  max-height: 56px;
  width: auto;
  display: block;
  object-fit: contain;
  transition: opacity 0.2s ease;
}

.brand:hover img {
  opacity: 0.92;
}

@media (max-width: 1024px) {
  .brand img,
  .brand .smnx-logo-img {
    height: 44px;
    max-height: 48px;
  }
}

@media (max-width: 768px) {
  .brand img,
  .brand .smnx-logo-img {
    height: 38px;
    max-height: 42px;
  }
}

.logo-dark {
  display: none;
}

/* Primary Navigation */
.nav {
  display: flex;
  align-items: center;
  gap: clamp(6px, 1vw, 14px);
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav > li {
  position: relative;
}

.nav > li > button,
.nav > li > a {
  all: unset;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--sn-navy);
  border-radius: var(--r);
  white-space: nowrap;
  transition: background 0.18s ease, color 0.18s ease;
}

.nav > li > button:hover,
.nav > li > a:hover,
.nav > li > button[aria-expanded="true"] {
  background: var(--sn-soft-bg);
  color: var(--sn-teal);
}

.nav > li > button:focus-visible,
.nav > li > a:focus-visible {
  outline: 2px solid var(--sn-teal);
}

.nav > li.on > button,
.nav > li.on > a {
  color: var(--sn-teal);
  box-shadow: inset 0 -2px 0 var(--sn-teal);
}

.nav > li.first > button {
  color: var(--sn-brand-blue);
  font-weight: 700;
}

.nav > li.first.on > button,
.nav > li.first > button:hover,
.nav > li.first > button[aria-expanded="true"] {
  color: var(--sn-teal);
}

.chev {
  width: 10px;
  height: 10px;
  transition: transform 0.2s ease;
  color: var(--sn-teal);
}

.nav > li > button[aria-expanded="true"] .chev {
  transform: rotate(180deg);
}

/* Mega Menu Dropdowns */
.mega {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: #FFFFFF;
  border: 1px solid var(--sn-line);
  border-top: 3px solid var(--sn-teal);
  border-radius: 10px;
  box-shadow: 0 20px 44px rgba(11, 31, 58, 0.18);
  padding: 22px;
  display: grid;
  gap: 22px;
  min-width: 300px;
  z-index: 66;
}

.mega.cols3 {
  grid-template-columns: repeat(3, minmax(215px, 1fr));
  min-width: 780px;
}

.mega.cols1 {
  grid-template-columns: 1fr;
  min-width: 310px;
  gap: 2px;
}

.nav > li:nth-last-child(-n+3) .mega.cols1 {
  left: auto;
  right: 0;
}

.mega h5 {
  margin: 0 0 10px;
  font: 700 0.72rem/1 var(--f-body);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sn-brand-blue);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--sn-line-light);
}

.mega a {
  display: block;
  padding: 8px 10px;
  margin: 0 -10px;
  border-radius: var(--r);
  text-decoration: none;
  color: var(--sn-ink);
  transition: background 0.15s ease, color 0.15s ease, padding-left 0.15s ease;
}

.mega a:hover {
  background: var(--sn-soft-bg);
  color: var(--sn-brand-blue);
  padding-left: 14px;
}

.mega a b {
  display: block;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--sn-navy);
}

.mega a:hover b {
  color: var(--sn-brand-blue);
}

.mega a small {
  display: block;
  color: var(--sn-muted);
  font-size: 0.79rem;
  line-height: 1.35;
}

.mega a.feat {
  background: rgba(0, 166, 166, 0.1);
  border: 1px solid rgba(0, 166, 166, 0.28);
  padding: 12px;
  margin: 4px 0 8px;
}

.mega a.feat b {
  color: var(--sn-brand-blue);
}

.mega a.all {
  color: var(--sn-teal);
  font-weight: 700;
  font-size: 0.88rem;
  margin-top: 6px;
}

.mega a.all b {
  color: var(--sn-teal);
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: var(--r);
  border: 1px solid var(--sn-line);
  background: transparent;
  color: var(--sn-navy);
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}

.icon-btn:hover {
  border-color: var(--sn-teal);
  color: var(--sn-teal);
  background: var(--sn-soft-bg);
}

.menu-btn {
  display: none;
}

@media (max-width: 1250px) {
  .hdr-cta {
    display: none;
  }
}

@media (max-width: 1130px) {
  .nav {
    display: none;
  }
  .menu-btn {
    display: grid;
  }
}

/* Mobile Drawer */
.drawer {
  position: fixed;
  inset: 0;
  z-index: 85;
  background: var(--bg);
  overflow-y: auto;
  padding: calc(env(safe-area-inset-top, 0px) + 8px) 0 calc(env(safe-area-inset-bottom, 0px) + 28px);
}

.drawer .top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 12px;
  border-bottom: 1px solid var(--sn-line);
  margin-bottom: 8px;
}

.drawer .top img {
  height: 40px;
  width: auto;
}

.drawer details {
  border-bottom: 1px solid var(--sn-line-light);
}

.drawer summary {
  list-style: none;
  cursor: pointer;
  padding: 16px 0;
  font: 700 1.15rem/1.2 var(--f-display);
  color: var(--sn-navy);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.drawer summary::-webkit-details-marker {
  display: none;
}

.drawer summary::after {
  content: "+";
  font: 600 1.4rem/1 var(--f-body);
  color: var(--sn-teal);
}

.drawer details[open] summary::after {
  content: "−";
}

.drawer details div {
  padding: 0 0 16px;
  display: grid;
}

.drawer details a {
  display: block;
  padding: 9px 0 9px 14px;
  color: var(--sn-graphite);
  font-size: 0.93rem;
  font-weight: 500;
  border-left: 2px solid var(--sn-line);
}

.drawer details a:hover {
  border-left-color: var(--sn-teal);
  color: var(--sn-brand-blue);
}

.drawer .btn {
  width: 100%;
  margin-top: 22px;
}

/* Search Modal */
.search-ov {
  position: fixed;
  inset: 0;
  z-index: 95;
  background: rgba(6, 18, 36, 0.72);
  backdrop-filter: blur(5px);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: calc(env(safe-area-inset-top, 0px) + 10vh) 16px 16px;
}

.search-box {
  width: min(680px, 100%);
  background: var(--bg);
  border: 1px solid var(--sn-line);
  border-top: 3px solid var(--sn-teal);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.search-in {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--sn-line);
  color: var(--sn-muted);
}

.search-in input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  font: 500 1.05rem var(--f-body);
  color: var(--sn-ink);
  min-width: 0;
  padding: 0;
}

.search-close {
  border: 1px solid var(--sn-line);
  background: transparent;
  color: var(--sn-muted);
  border-radius: 4px;
  font: 500 0.74rem var(--f-mono);
  padding: 5px 8px;
  cursor: pointer;
}

.search-res {
  max-height: 60vh;
  overflow: auto;
  padding: 8px;
}

.search-res a {
  display: block;
  padding: 10px 12px;
  border-radius: var(--r);
  color: var(--sn-ink);
}

.search-res a:hover,
.search-res a.on {
  background: var(--sn-soft-bg);
}

.search-res b {
  display: flex;
  gap: 10px;
  align-items: baseline;
  font-weight: 600;
  color: var(--sn-navy);
}

.search-res span {
  display: block;
  color: var(--sn-muted);
  font-size: 0.86rem;
}

.search-res .k {
  display: inline;
  font: 700 0.64rem var(--f-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sn-teal);
}

.search-empty {
  padding: 18px 12px;
  color: var(--sn-muted);
  font-size: 0.92rem;
}
