/* ===========================================================
   STANIMAL — Header CSS v2
   Sticky site-header, brand mark, nav, search pill,
   icon buttons, mega-menu.
   Editorial-Industrial 2026.
   =========================================================== */

/* ---------- Site Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--line-strong);
  backdrop-filter: blur(6px);
}
.site-header .header-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 64px;
  gap: var(--space-6);
}

/* ---------- Brand mark ---------- */
.brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.04em;
  font-variation-settings: "wdth" 75;
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
}
.brand .brand-name { line-height: 1; }
.brand .brand-tld {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--ink-500);
  text-transform: uppercase;
  padding-bottom: 2px;
}
.brand-mark {
  display: inline-flex; align-items: center; gap: 12px;
  text-decoration: none;
  color: var(--ink-900);
}
.brand-mark .glyph {
  width: 22px; height: 22px;
  background: var(--ink-900);
  position: relative;
  clip-path: polygon(0 0, 100% 0, 100% 60%, 60% 100%, 0 100%);
  flex-shrink: 0;
}
.brand-mark .glyph::after {
  content: "";
  position: absolute;
  top: 6px; left: 6px;
  width: 4px; height: 4px;
  background: var(--hot);
}

/* ---------- Nav ---------- */
.nav-main { display: flex; gap: var(--space-8); justify-content: center; }
.nav-main a {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 6px 0;
  position: relative;
  color: var(--ink-700);
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
}
.nav-main a:hover { color: var(--ink-900); }
.nav-main a .num {
  font-size: 9px;
  color: var(--ink-400);
  letter-spacing: 0.02em;
}
.nav-main a.active,
.nav-main a.current-menu-item { color: var(--ink-900); }
.nav-main a.active::after,
.nav-main a.current-menu-item::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 2px;
  background: var(--hot);
}

/* ---------- Header actions ---------- */
.header-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-1);
  align-items: center;
}
.header-actions .divider-v {
  width: 1px; height: 22px;
  background: var(--line);
  margin: 0 8px;
}
.icon-btn {
  width: 38px; height: 38px;
  display: inline-flex; align-items: center; justify-content: center;
  position: relative;
  color: var(--ink-900);
  transition: color .18s ease;
}
.icon-btn:hover { color: var(--hot); }
.icon-btn .badge,
.icon-btn .cart-badge {
  position: absolute; top: 2px; right: 2px;
  background: var(--hot); color: #fff;
  min-width: 16px; height: 16px;
  font-family: var(--font-mono);
  font-size: 9px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 4px;
  border-radius: 0;
}

/* ---------- Search pill ---------- */
.search-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-500);
  min-width: 220px;
  cursor: pointer;
  background: transparent;
  transition: border-color .18s ease, color .18s ease;
}
.search-pill:hover { border-color: var(--ink-900); color: var(--ink-900); }
.search-pill .kbd {
  margin-left: auto;
  font-size: 10px;
  padding: 2px 6px;
  border: 1px solid var(--line);
  color: var(--ink-500);
}

/* ---------- Mega menu ---------- */
.mega {
  position: absolute; left: 0; right: 0; top: 100%;
  background: var(--bg);
  border-bottom: 1px solid var(--line-strong);
  padding: var(--space-10) 0 var(--space-12);
  display: none;
  z-index: 49;
}
.mega.open,
.mega.is-open,
.mega[aria-hidden="false"] { display: block; }

/* Legacy class alias */
.mega-menu { position: absolute; left: 0; right: 0; top: 100%; background: var(--bg); border-bottom: 1px solid var(--line-strong); padding: var(--space-10) 0 var(--space-12); display: none; z-index: 49; }
.mega-menu.is-open,
.mega-menu[aria-hidden="false"] { display: block; }

.mega-grid { display: grid; grid-template-columns: 1.2fr 1fr 1fr 1.2fr; gap: var(--space-12); }
.mega-col h5 {
  font-family: var(--font-mono);
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--ink-500); margin-bottom: var(--space-4);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  font-weight: 500;
}
.mega-col a {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 10px 0;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 22px;
  letter-spacing: -0.02em;
  font-variation-settings: "wdth" 90;
  border-bottom: 1px solid var(--line-soft);
  transition: color .15s ease, padding .15s ease;
  color: var(--ink-900);
}
.mega-col a:hover { color: var(--hot); padding-left: 6px; }
.mega-col a .count {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--ink-400);
}
.mega-feature {
  position: relative;
  border-left: 1px solid var(--line);
  padding-left: var(--space-6);
}
.mega-feature .placeholder {
  aspect-ratio: 5/4;
  background: var(--ink-100);
  margin-bottom: var(--space-3);
  position: relative;
  overflow: hidden;
}
.mega-feature .placeholder img {
  width: 100%; height: 100%; object-fit: cover;
}
.mega-feature .ed-tag {
  position: absolute; top: 12px; left: 12px;
  background: var(--ink-900); color: var(--bg);
  font-family: var(--font-mono);
  font-size: 10px; letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 5px 8px;
}
.mega-feature .mono-label { margin-top: 12px; }
.mega-feature .feature-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1;
  margin-top: 4px;
}
.mega-feature .feature-sub {
  font-size: 13px;
  color: var(--ink-500);
  margin-top: 6px;
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .nav-main { display: none; }
  .search-pill { display: none; }
}
