/* ───── Linen header ─────
   Thin sticky cream bar. Italic serif wordmark left, mono nav center,
   icons right. Adds a hairline + slight blur on scroll. */
.linen-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(244, 239, 228, 0.92);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition), background var(--transition);
}
.linen-header--solid {
  background: rgba(244, 239, 228, 0.98);
  border-bottom-color: var(--hairline);
}
.linen-header__top {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: clamp(1rem, 4vw, 2.5rem);
  /* Fixed, content-independent height — the logo is centered inside it and
     capped (below) so it can never stretch the header. */
  height: 72px;
  padding-top: 0;
  padding-bottom: 0;
}

/* Logo */
.linen-header__logo {
  font-family: var(--font-display);
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  color: var(--color-text);
}
.linen-header__logo-mark em {
  font-style: italic;
  font-weight: 400;
}
.linen-header__logo-mark { white-space: nowrap; }
/* Logo fits the 72px header. header.liquid clamps the merchant's logo_width
   to min(N, 32px) inline (respects a smaller value, caps the ceiling); this
   rule backstops width/aspect and the 38px cap when no inline is present. */
.linen-header__logo img {
  display: block;
  width: auto;
  height: auto;
  max-height: 32px;
  object-fit: contain;
}

/* Nav (center) */
.linen-header__nav {
  display: flex;
  justify-content: center;
  gap: clamp(1.25rem, 2.5vw, 2.25rem);
}
.linen-header__nav-link {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--color-text);
  position: relative;
  padding: 4px 0;
}
.linen-header__nav-link::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: var(--color-accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--transition);
}
.linen-header__nav-link:hover { color: var(--color-accent); }
.linen-header__nav-link:hover::after { transform: scaleX(1); transform-origin: left; }

/* Dropdown for parent collections */
.linen-header__nav-group { position: relative; }
.linen-header__nav-link--has-children {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.linen-header__nav-link--has-children svg {
  opacity: 0.55;
  transition: transform 200ms var(--ease);
}
.linen-header__nav-group:hover .linen-header__nav-link--has-children svg,
.linen-header__nav-group:focus-within .linen-header__nav-link--has-children svg {
  transform: rotate(180deg);
}
.linen-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.16);
  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;
}
.linen-header__nav-group:hover .linen-header__dropdown,
.linen-header__nav-group:focus-within .linen-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;
}
.linen-header__dropdown-link {
  font-size: 13px;
  color: var(--color-text);
  text-decoration: none;
  padding: 8px 14px;
  transition: background 160ms var(--ease);
  white-space: nowrap;
}
.linen-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 */
.linen-header__actions {
  display: flex;
  gap: var(--space-1);
  justify-self: end;
}
.linen-header__icon {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text);
  position: relative;
  transition: color var(--transition);
}
.linen-header__icon svg { width: 18px; height: 18px; }
.linen-header__icon:hover { color: var(--color-accent); }

.linen-header__cart-pill {
  position: absolute;
  top: 4px;
  right: 4px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  background: var(--color-accent);
  color: var(--color-accent-ink);
  width: 16px;
  height: 16px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.linen-header__cart-pill[data-cart-count="0"] { display: none; }

.linen-header__menu-bars {
  position: relative;
  width: 16px;
  height: 10px;
  display: inline-block;
}
.linen-header__menu-bars span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 1px;
  background: currentColor;
}
.linen-header__menu-bars span:first-child { top: 0; }
.linen-header__menu-bars span:last-child  { bottom: 0; width: 60%; }

@media (max-width: 900px) {
  .linen-header__nav { display: none; }
}
@media (min-width: 901px) {
  .linen-header__menu { display: none; }
}
