/* =============================================================================
   Eternal Thread — Global Header
   ============================================================================= */

#masthead {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background: var(--surface);
  transition:
    background var(--transition-base),
    backdrop-filter var(--transition-base),
    -webkit-backdrop-filter var(--transition-base);
}

/* Glassmorphism on scroll */
#masthead.is-scrolled {
  background: rgba(250, 249, 246, 0.80);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

.et-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  max-width: var(--content-wide);
  margin-inline: auto;
  padding-inline: var(--gutter);
  height: 68px;
}

/* ── Logo ── */
.et-header__logo {
  text-decoration: none;
  display: flex;
  align-items: center;
}
.et-header__logo-text {
  font-family: var(--font-display);
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary);
  line-height: 1.2;
  max-width: 120px;
}

/* ── Primary nav ── */
.et-header__nav {
  display: flex;
  align-items: center;
  gap: var(--space-32);
  list-style: none;
  margin: 0;
  padding: 0;
}
.et-header__nav a {
  font-family: var(--font-ui);
  font-size: var(--text-micro);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--on-surface);
  transition: color var(--transition-fast);
  position: relative;
  padding-bottom: var(--space-4);
}
.et-header__nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--secondary);
  transition: width var(--transition-base);
}
.et-header__nav a:hover        { color: var(--secondary); }
.et-header__nav a:hover::after,
.et-header__nav a.current-menu-item::after { width: 100%; }

/* ── Icon actions ── */
.et-header__actions {
  display: flex;
  align-items: center;
  gap: var(--space-16);
  justify-content: flex-end;
}
.et-header__action {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  text-decoration: none;
  color: var(--on-surface);
  position: relative;
  transition: color var(--transition-fast);
}
.et-header__action:hover { color: var(--secondary); }
.et-header__action svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Cart count badge */
.et-cart-count {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--secondary);
  color: #fff;
  font-family: var(--font-ui);
  font-size: 0.55rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.et-cart-count:empty,
.et-cart-count[data-count="0"] { display: none; }

/* Push page content down from fixed header */
body { padding-top: 68px; }

/* ── Mobile nav toggle ── */
.et-header__burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: var(--space-8);
  background: none;
  border: none;
}
.et-header__burger span {
  display: block;
  width: 20px;
  height: 1.5px;
  background: var(--on-surface);
  transition: transform var(--transition-fast), opacity var(--transition-fast);
}

/* ── Mobile ── */
@media (max-width: 900px) {
  .et-header { grid-template-columns: 1fr auto; }

  .et-header__burger { display: flex; order: 3; }

  .et-header__nav-wrap {
    display: none;
    position: fixed;
    inset: 68px 0 0 0;
    background: var(--surface);
    padding: var(--space-48) var(--gutter);
    z-index: 199;
    flex-direction: column;
  }
  .et-header__nav-wrap.is-open { display: flex; }

  .et-header__nav {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-32);
  }
  .et-header__nav a { font-size: var(--text-title-sm); }

  .et-header__actions { gap: var(--space-12); }
}
