/* ───── VAPOR header ─────
   Sticky, transparent over hero, solid black with hairline divider when
   the page scrolls past 24px. Uppercase mono nav labels with a lime
   underline that wipes in from the left on hover. Action icons sit in a
   thin row on the right. Mobile collapses everything except the cart and
   hamburger. */

.vp-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background 280ms var(--ease), border-color 280ms var(--ease), backdrop-filter 280ms var(--ease);
  height: var(--header-h);
  display: flex;
  align-items: center;
}
/* Legibility scrim: while transparent over a hero, a subtle top-down darkening
   keeps the near-white logo/nav/icons readable over ANY merchant hero image
   (a light photo would otherwise wash them out). Fades away once .is-stuck's
   solid background takes over on scroll. */
.vp-header::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 180px;   /* extend well below the 72px header so the dark part of the
                      fade still covers the nav row, not just the top edge */
  background: linear-gradient(to bottom, rgba(0,0,0,0.55), rgba(0,0,0,0));
  pointer-events: none;
  opacity: 1;
  transition: opacity 280ms var(--ease);
}
.vp-header.is-stuck::before { opacity: 0; }
.vp-header.is-stuck {
  background: rgba(10,10,10,0.92);
  border-bottom-color: var(--color-border);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
}

.vp-header__inner {
  position: relative;   /* sit above the ::before scrim */
  z-index: 1;
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: clamp(1rem, 4vw, 3rem);
}

/* ── Logo / wordmark ── */
.vp-header__logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: var(--color-text);
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);   /* legible over a bright hero */
  letter-spacing: var(--tracking-tight);
}
/* Logo image is capped to 38px max so an oversized merchant logo can never
   grow the fixed-height header. width/height:auto + object-fit:contain keep
   the aspect ratio inside the box; the inline max-height clamps to
   min(logo_width, 32px). This backstop enforces the ceiling even if the
   inline style is dropped. */
.vp-header__logo-img {
  display: block;
  width: auto;
  height: auto;
  max-height: 32px;
  object-fit: contain;
}
.vp-header__wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  line-height: 1;
  white-space: nowrap;       /* long store names stay single-line, never grow the header */
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 42vw;
}
.vp-header__logo:hover { color: var(--color-accent); }

/* ── Nav ── */
.vp-header__nav {
  display: flex;
  justify-content: center;
  gap: clamp(1.25rem, 2.5vw, 2.5rem);
}
.vp-header__nav-link {
  position: relative;
  /* edge definition so labels stay legible over a bright hero; imperceptible
     once .is-stuck's dark background is behind them */
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: var(--tracking-mono);
  text-transform: uppercase;
  color: var(--color-text);
  padding: 6px 0;
  display: inline-block;
}
.vp-header__nav-link span {
  display: inline-block;
  position: relative;
}
.vp-header__nav-link span::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 1px;
  background: var(--color-accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 320ms var(--ease);
}
.vp-header__nav-link:hover { color: var(--color-text); }
.vp-header__nav-link:hover span::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* ── Dropdown for parent collections ── */
.vp-header__nav-group { position: relative; }
.vp-header__nav-link--has-children {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.vp-header__nav-link--has-children svg {
  opacity: 0.55;
  transition: transform 200ms var(--ease);
}
.vp-header__nav-group:hover .vp-header__nav-link--has-children svg,
.vp-header__nav-group:focus-within .vp-header__nav-link--has-children svg {
  transform: rotate(180deg);
}
.vp-header__dropdown {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: var(--color-bg, #fff);
  border: 1px solid rgba(0,0,0,0.08);
  box-shadow: 0 18px 36px -12px rgba(0,0,0,0.22);
  min-width: 220px;
  padding: 14px 8px;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 180ms var(--ease), transform 180ms var(--ease), visibility 0s linear 180ms;
  z-index: 50;
}
.vp-header__nav-group:hover .vp-header__dropdown,
.vp-header__nav-group:focus-within .vp-header__dropdown {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
  transition: opacity 180ms var(--ease), transform 180ms var(--ease), visibility 0s linear 0s;
}
.vp-header__dropdown-link {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-text);
  text-decoration: none;
  padding: 8px 14px;
  transition: background 160ms var(--ease);
  white-space: nowrap;
}
.vp-header__dropdown-link:hover { background: rgba(0,0,0,0.04); }
.nav-drawer__link--child { padding-left: 24px; font-size: 13px; opacity: 0.8; }

/* ── Action icons ── */
.vp-header__actions {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-self: end;
}
.vp-header__icon, .vp-header__cart, .vp-header__menu {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  color: var(--color-text);
  cursor: pointer;
  transition: color var(--transition);
  position: relative;
  border-radius: var(--radius-xs);
}
.vp-header__icon svg, .vp-header__cart svg {
  width: 18px;
  height: 18px;
}
.vp-header__icon:hover, .vp-header__cart:hover, .vp-header__menu:hover {
  color: var(--color-accent);
}

/* ── Cart count pill ── */
.vp-header__cart-count {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  background: var(--color-accent);
  color: var(--color-accent-ink);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.vp-header__cart-count[data-cart-count="0"] { display: none; }

/* ── Hamburger (mobile) ── */
.vp-header__menu { display: none; }
.vp-header__menu > span {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  width: 18px;
}
.vp-header__menu > span > span {
  display: block;
  height: 1px;
  background: currentColor;
  transition: width 200ms var(--ease);
}
.vp-header__menu > span > span:nth-child(1) { width: 100%; }
.vp-header__menu > span > span:nth-child(2) { width: 70%; }
.vp-header__menu > span > span:nth-child(3) { width: 90%; }
.vp-header__menu:hover > span > span { width: 100% !important; }

/* ── Responsive ── */
@media (max-width: 960px) {
  .vp-header__nav { display: none; }
  .vp-header__menu { display: inline-flex; }
  .vp-header__icon--md { display: none; } /* hide secondary icons (account, wishlist) on small screens */
  .vp-header__logo-img { max-height: 28px; }  /* smaller cap within the mobile header */
  .vp-header__wordmark { max-width: 50vw; }
}
