/* Ochre header — 88px parchment bar: nav left, serif wordmark center,
   search field + icons right (Figma 63:4). */

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

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

/* ── Nav (left) ──────────────────────────────────────────────────────── */
.oc-header__nav {
  display: flex;
  align-items: center;
  gap: 32px;
  justify-self: start;
}
.oc-header__nav-item { position: relative; }
.oc-header__nav-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: inherit;
  white-space: nowrap;
  padding: 4px 0;
}
.oc-header__nav-link:hover,
.oc-header__nav-link.is-current { color: var(--color-accent); }
.oc-header__nav-caret { opacity: 0.6; }

.oc-header__dropdown {
  position: absolute;
  top: 100%;
  left: -16px;
  min-width: 200px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xs);
  box-shadow: var(--shadow-lg);
  padding: 8px 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity var(--transition-fast), transform var(--transition-fast), visibility var(--transition-fast);
  z-index: 50;
}
.oc-header__nav-item.has-dropdown:hover .oc-header__dropdown,
.oc-header__nav-item.has-dropdown:focus-within .oc-header__dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.oc-header__dropdown-link {
  display: block;
  padding: 9px 18px;
  font-size: 13px;
  color: var(--color-text-muted);
}
.oc-header__dropdown-link:hover { color: var(--color-accent); background: var(--color-bg); }

/* ── Logo (center) ───────────────────────────────────────────────────── */
.oc-header__logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-self: center;
  text-align: center;
  line-height: 1;
  text-transform: uppercase;
}
.oc-header__wordmark {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 32px;
  line-height: 1.1;
  color: var(--color-text);
}
.oc-header__tagline {
  margin-top: 2px;
  font-family: var(--font-body);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--color-accent);
}

/* ── Utilities (right) ───────────────────────────────────────────────── */
.oc-header__actions {
  display: flex;
  align-items: center;
  gap: 24px;
  justify-self: end;
}
.oc-header__search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 180px;
  padding: 8px 12px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
}
.oc-header__search:focus-within { border-color: var(--color-text); color: var(--color-text); }
.oc-header__search svg { flex: 0 0 auto; }
.oc-header__search-input {
  width: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--color-text);
  outline: none;
}
.oc-header__search-input::placeholder { color: var(--color-text-muted); }
.oc-header__search-input::-webkit-search-decoration,
.oc-header__search-input::-webkit-search-cancel-button { -webkit-appearance: none; }

.oc-header__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text);
}
.oc-header__icon:hover { color: var(--color-accent); }
.oc-header__icon--search-mobile { display: none; }

.oc-header__cart {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--color-text);
}
.oc-header__cart:hover { color: var(--color-accent); }
.oc-header__cart-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  padding: 2px 6px;
  background: var(--color-accent);
  color: #FFFFFF;
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

/* ── Burger (mobile only) ────────────────────────────────────────────── */
.oc-header__burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 36px;
  height: 36px;
  padding: 6px;
  background: transparent;
  border: 0;
  cursor: pointer;
}
.oc-header__burger span {
  display: block;
  height: 1.5px;
  width: 20px;
  background: var(--color-text);
  transition: transform var(--transition-fast);
}

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

.oc-drawer__header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--color-border);
}
.oc-drawer__title {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text);
}
.oc-drawer__close {
  width: 32px; height: 32px;
  background: transparent; border: 0; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--color-text);
}
.oc-drawer__nav { display: flex; flex-direction: column; padding: 12px 0; }
.oc-drawer__link {
  padding: 13px 20px;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
}
.oc-drawer__link:hover { color: var(--color-accent); }
.oc-drawer__sublist { display: flex; flex-direction: column; padding-bottom: 6px; }
.oc-drawer__sublink {
  padding: 9px 20px 9px 36px;
  font-size: 13px;
  color: var(--color-text-muted);
}
.oc-drawer__sublink:hover { color: var(--color-accent); }
.oc-drawer__actions {
  margin-top: auto;
  border-top: 1px solid var(--color-border);
  display: flex; flex-direction: column;
  padding: 12px 0 24px;
}
.oc-drawer__action {
  padding: 11px 20px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}
.oc-drawer__action:hover { color: var(--color-accent); }

/* ── Breakpoints ─────────────────────────────────────────────────────── */
@media (max-width: 1180px) {
  .oc-header__search { width: 150px; }
  .oc-header__nav { gap: 20px; }
}
@media (max-width: 1024px) {
  .oc-header__inner { padding: 0 32px; }
}
@media (max-width: 900px) {
  .oc-header__inner {
    grid-template-columns: auto 1fr auto;
    height: var(--header-height-mobile);
    padding: 0 16px;
    gap: 12px;
  }
  .oc-header__nav { display: none; }
  .oc-header__burger { display: flex; }
  .oc-header__search { display: none; }
  .oc-header__icon--search-mobile { display: inline-flex; }
  .oc-header__wordmark { font-size: 24px; }
  .oc-header__tagline { display: none; }
  .oc-header__actions { gap: 16px; }
  .oc-header__cart { position: relative; }
  .oc-header__cart-badge {
    position: absolute;
    top: -7px; right: -9px;
    min-width: 15px;
    padding: 1px 4px;
    font-size: 9px;
  }
}

/* Logo image cap — square/tall merchant logos must not blow up the header. */
.oc-header__logo img { max-height: 48px; width: auto; object-fit: contain; }
@media (max-width: 900px) {
  .oc-header__logo img { max-height: 34px; }
}
