/* Mallow header — white bar, logo left, nav center, icon utilities right.
   Purple active underline, coral Sale link, coral cart count badge. */

.mw-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--color-border);
  transition: box-shadow var(--transition-base);
}
.mw-header.is-stuck { box-shadow: var(--shadow-md); }

.mw-header__inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 40px;
  height: var(--header-height-desktop);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  position: relative;
}

/* ── Logo (left) ─────────────────────────────────────────────────────── */
.mw-header__logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  justify-self: start;
  line-height: 1;
}
.mw-header__logo img { max-height: 48px; width: auto; object-fit: contain; }
.mw-header__logo-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  border-radius: 10px;
  background: var(--color-lilac);
  color: var(--color-primary);
}
.mw-header__wordmark {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 19px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--color-text);
  white-space: nowrap;
}

/* ── Nav (center) ────────────────────────────────────────────────────── */
.mw-header__nav {
  display: flex;
  align-items: center;
  gap: 28px;
  justify-self: center;
}
.mw-header__nav-item { position: relative; }
.mw-header__nav-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  color: inherit;
  white-space: nowrap;
  padding: 6px 0;
  position: relative;
}
.mw-header__nav-link:hover { color: var(--color-primary); }
.mw-header__nav-link.is-current { color: var(--color-primary); font-weight: 700; }
.mw-header__nav-link.is-current::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 2.5px;
  border-radius: 2px;
  background: var(--color-primary);
}
.mw-header__nav-link.is-sale { color: var(--color-accent); font-weight: 700; }
.mw-header__nav-link.is-sale:hover { color: var(--color-accent); opacity: 0.85; }
.mw-header__nav-caret { opacity: 0.55; }

.mw-header__dropdown {
  position: absolute;
  top: 100%;
  left: -18px;
  min-width: 210px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 10px 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity var(--transition-fast), transform var(--transition-fast), visibility var(--transition-fast);
  z-index: 50;
}
.mw-header__nav-item.has-dropdown:hover .mw-header__dropdown,
.mw-header__nav-item.has-dropdown:focus-within .mw-header__dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.mw-header__dropdown-link {
  display: block;
  padding: 9px 20px;
  font-size: 14px;
  color: var(--color-text-muted);
}
.mw-header__dropdown-link:hover { color: var(--color-primary); background: var(--color-lavender); }

/* ── Utilities (right) ───────────────────────────────────────────────── */
.mw-header__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-self: end;
}
.mw-header__iconbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border-radius: var(--radius-full);
  color: var(--color-text);
  transition: background var(--transition-fast), color var(--transition-fast);
}
.mw-header__iconbtn:hover { background: var(--color-lavender); color: var(--color-primary); }

.mw-header__cart { position: relative; }
.mw-header__cart-badge {
  position: absolute;
  top: 2px; right: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  background: var(--color-accent);
  color: #FFFFFF;
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

/* ── Burger (mobile only) ────────────────────────────────────────────── */
.mw-header__burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4.5px;
  width: 40px;
  height: 40px;
  padding: 8px;
  background: transparent;
  border: 0;
  border-radius: var(--radius-full);
  cursor: pointer;
}
.mw-header__burger span {
  display: block;
  height: 2px;
  width: 20px;
  border-radius: 2px;
  background: var(--color-text);
  transition: transform var(--transition-fast);
}

/* ── Mobile drawer ───────────────────────────────────────────────────── */
.mw-drawer { position: fixed; inset: 0; z-index: 120; }
.mw-drawer__backdrop {
  position: absolute; inset: 0;
  background: var(--color-overlay);
  opacity: 0;
  transition: opacity 240ms ease;
}
.mw-drawer__panel {
  position: absolute; top: 0; left: 0; bottom: 0;
  width: 320px; max-width: 86vw;
  background: var(--color-bg);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  transform: translateX(-100%);
  transition: transform 240ms cubic-bezier(0.2, 0.7, 0.2, 1);
  display: flex; flex-direction: column;
  overflow-y: auto;
}
.mw-drawer.is-open .mw-drawer__backdrop { opacity: 1; }
.mw-drawer.is-open .mw-drawer__panel   { transform: translateX(0); }

.mw-drawer__header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--color-border);
}
.mw-drawer__title {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 18px;
  color: var(--color-text);
}
.mw-drawer__close {
  width: 36px; height: 36px;
  background: transparent; border: 0; cursor: pointer;
  border-radius: var(--radius-full);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--color-text);
}
.mw-drawer__close:hover { background: var(--color-lavender); }
.mw-drawer__nav { display: flex; flex-direction: column; padding: 12px 0; }
.mw-drawer__link {
  padding: 13px 20px;
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
}
.mw-drawer__link:hover { color: var(--color-primary); }
.mw-drawer__sublist { display: flex; flex-direction: column; padding-bottom: 6px; }
.mw-drawer__sublink {
  padding: 9px 20px 9px 36px;
  font-size: 14px;
  color: var(--color-text-muted);
}
.mw-drawer__sublink:hover { color: var(--color-primary); }
.mw-drawer__actions {
  margin-top: auto;
  border-top: 1px solid var(--color-border);
  display: flex; flex-direction: column;
  padding: 12px 0 24px;
}
.mw-drawer__action {
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-muted);
}
.mw-drawer__action:hover { color: var(--color-primary); }

/* ── Breakpoints ─────────────────────────────────────────────────────── */
@media (max-width: 1120px) {
  .mw-header__inner { padding: 0 24px; }
  .mw-header__nav { gap: 18px; }
}
@media (max-width: 860px) {
  .mw-header__inner {
    grid-template-columns: auto 1fr auto;
    height: var(--header-height-mobile);
    padding: 0 12px;
    gap: 8px;
  }
  .mw-header__nav { display: none; }
  .mw-header__burger { display: flex; }
  .mw-header__logo { justify-self: center; }
  .mw-header__logo img { max-height: 34px; }
  .mw-header__wordmark { font-size: 15px; }
  .mw-header__logo-chip { width: 28px; height: 28px; border-radius: 8px; }
  .mw-header__iconbtn { width: 36px; height: 36px; }
  .mw-header__actions .mw-header__iconbtn:not(.mw-header__cart) { display: none; }
  .mw-header__actions .mw-header__cart { display: inline-flex; }
}
