/* =========================================================
   dd-theme — header.css
   Class-based translation of the approved mockup Header inline
   styles (components.jsx 270-349). Sticky bar, brand wordmark,
   search, desktop nav, cart badge, category strip, and the
   mobile-drawer panel (toggled by assets/js/drawer.js).

   IMPORTANT: the <=820px hide/show rules for .dd-header-nav,
   .dd-header-search, .dd-cat-strip (display:none) and
   .dd-hamb (display:flex) already live in components.css from
   plan 01-02 — they are NOT redefined here. This file adds only
   the desktop/structural rules and the drawer panel styles.
   Contract spacing (header bar 14px 28px, cat-strip 10px 28px)
   ported verbatim per UI-SPEC §Spacing exceptions — do NOT round.
   ========================================================= */

/* Sticky header — UI-SPEC §Interaction Contracts / RESEARCH §Pattern 6. */
.dd-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--cream);
}

.dd-header__wrap {
  border-bottom: 1px solid var(--hair);
}

/* Main bar — contract padding 14px 28px (UI-SPEC §Spacing exceptions). */
.dd-header__bar {
  padding: 14px 28px;
  gap: 20px;
}

/* Brand / logo wordmark. */
.dd-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink-1);
  flex-shrink: 0;
}
.dd-brand__mark { width: 38px; height: 38px; }
.dd-brand__words { display: flex; flex-direction: column; line-height: 1; }
.dd-brand__name {
  font-weight: 800; font-size: 15px;
  letter-spacing: -0.01em; color: var(--ink-1);
}
.dd-brand__sub { font-size: 18px; color: var(--ink-1); }

/* Search field — paper bg, fully-rounded, left-padded for the search icon. */
.dd-header-search {
  position: relative;
  flex: 1;
  max-width: 520px;
}
.dd-header-search__icon {
  position: absolute;
  left: 14px; top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  display: inline-flex;
  pointer-events: none;
}
.dd-header-search__input {
  padding-left: 42px;
  border-radius: 999px;
  background: var(--paper);
}

/* Desktop nav. */
.dd-header-nav {
  display: flex;
  align-items: center;
  gap: 18px;
}
.dd-header-nav__list {
  display: flex;
  align-items: center;
  gap: 18px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.dd-header-nav__link,
.dd-header-nav__list a {
  text-decoration: none;
  font-size: 14px;
  color: var(--ink);
}

/* Right cluster — cart + hamburger. */
.dd-header__cluster {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}
.dd-cart {
  position: relative;
  background: none;
  border: 0;
  cursor: pointer;
  color: var(--ink);
  padding: 6px;
  display: inline-flex;
  text-decoration: none;
}
/* Cart badge — terracotta pill (UI-SPEC: terracotta reserved for cart badge). */
.dd-cart__badge {
  position: absolute;
  top: -2px; right: -4px;
  background: var(--terracotta);
  color: var(--cream);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  min-width: 18px;
  text-align: center;
  line-height: 1.2;
}

/* Category strip — contract padding 10px 28px, horizontal scroll. */
.dd-cat-strip {
  padding: 10px 28px;
  display: flex;
  gap: 16px;
  overflow-x: auto;
  align-items: center;
}
.dd-cat-strip__label {
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.dd-cat-strip__link {
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-soft);
  white-space: nowrap;
}
.dd-cat-strip__all {
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink-1);
  white-space: nowrap;
}

/* =========================================================
   Mobile drawer — hidden by default (components.css sets
   .dd-mobile-drawer display:none). drawer.js adds .is-open
   to reveal it as a fixed overlay. Panel slides in from the
   right (mockup 322-349).
   ========================================================= */
.dd-mobile-drawer {
  position: fixed;
  inset: 0;
  z-index: 60;
}
.dd-mobile-drawer.is-open {
  display: flex;
  justify-content: flex-end;
}
.dd-drawer__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 15, 74, 0.55);
  border: 0;
  cursor: pointer;
}
.dd-drawer__panel {
  position: relative;
  width: min(82vw, 360px);
  height: 100%;
  background: var(--cream);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.25s ease;
}
.dd-mobile-drawer.is-open .dd-drawer__panel {
  transform: translateX(0);
}
.dd-drawer__head {
  padding: 18px 22px;
  border-bottom: 1px solid var(--hair);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.dd-drawer__title { font-size: 22px; color: var(--ink-1); }
.dd-drawer__close {
  background: none;
  border: 0;
  font-size: 24px;
  cursor: pointer;
  color: var(--ink);
  line-height: 1;
}
.dd-drawer__search {
  padding: 18px 22px;
  border-bottom: 1px solid var(--hair);
  position: relative;
}
.dd-drawer__search-icon {
  position: absolute;
  left: 36px; top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  display: inline-flex;
  pointer-events: none;
  z-index: 1;
}
.dd-drawer__search-input {
  padding-left: 42px;
  border-radius: 999px;
  background: var(--paper);
}
.dd-drawer__nav { padding: 8px 0; }
.dd-drawer__nav-link,
.dd-drawer__nav-list a {
  display: block;
  width: 100%;
  padding: 14px 22px;
  text-align: left;
  font-size: 18px;
  font-weight: 600;
  color: var(--ink-1);
  text-decoration: none;
}
.dd-drawer__nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.dd-drawer__areas {
  padding: 14px 22px;
  border-top: 1px solid var(--hair);
}
.dd-drawer__areas-label {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}
.dd-drawer__areas-list {
  display: flex;
  flex-direction: column;
}
.dd-drawer__area-link {
  padding: 10px 0;
  text-align: left;
  font-size: 14px;
  color: var(--ink-soft);
  text-decoration: none;
}
