/* Zac's Cookies: brand tokens from the media kit */
:root {
  --navy: #0c305b;
  --navy-deep: #082242;
  --cream: #f7f4e9;
  --cream-deep: #efe9d6;
  --paper: #fffdf7;
  --tan: #d99b52;
  --tan-soft: #f5e3c8;
  --tan-ink: #8a5316; /* tan dark enough for text on cream */
  --choc: #4a2816;
  --sky: #b9daf2;
  --sky-soft: #e3f0fa;
  --ink: #0c305b;
  --muted: #55657a;
  --line: rgba(12, 48, 91, 0.14);
  --line-strong: rgba(12, 48, 91, 0.32);
  --danger: #a3341f;
  --danger-soft: #fbe7e2;
  --ok: #2d6a3e;
  --ok-soft: #e2f1e5;

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(12, 48, 91, 0.06), 0 8px 24px rgba(12, 48, 91, 0.07);
  --header-h: 72px;
  --gutter: 20px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font: 400 1rem/1.55 var(--font-body);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 800; line-height: 1.1; margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
button, input, textarea, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.wrap { width: min(1160px, 100% - 2 * var(--gutter)); margin-inline: auto; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; margin: -1px;
}
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--navy); color: var(--cream); padding: 10px 14px; border-radius: var(--radius-sm);
}
.skip-link:focus { top: 12px; }

:focus-visible { outline: 3px solid var(--tan); outline-offset: 2px; }

/* ---- Eyebrow label, echoing the "— COOKIES —" lockup -------------------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 0.7rem;
  font: 700 0.78rem/1 var(--font-body);
  letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--tan-ink);
}
.eyebrow::before,
.eyebrow::after { content: ""; width: 1.5rem; height: 2px; background: currentColor; opacity: 0.6; }
.eyebrow--light { color: var(--tan); }

/* ---- Buttons ----------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 44px; padding: 0.7rem 1.4rem;
  border: 0; border-radius: 999px;
  background: var(--navy); color: var(--cream);
  font-weight: 700; text-decoration: none; cursor: pointer;
  transition: background-color 0.15s, transform 0.15s;
}
.btn:hover { background: var(--navy-deep); }
.btn:active { transform: translateY(1px); }
.btn:disabled { cursor: default; opacity: 0.75; }
.btn--tan { background: var(--tan); color: var(--navy); }
.btn--tan:hover { background: #e4ab66; }
.btn--sm { min-height: 40px; padding: 0.45rem 1.1rem; font-size: 0.95rem; }
.btn--block { width: 100%; }
.btn--ghost { background: transparent; color: var(--navy); box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.btn--ghost:hover { background: rgba(12, 48, 91, 0.06); }
.btn.is-loading::before {
  content: ""; width: 1em; height: 1em; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Notices ------------------------------------------------------------ */
.notice {
  padding: 0.8rem 1rem; border-radius: var(--radius-sm);
  background: var(--paper); border: 1px solid var(--line); color: var(--muted);
}
.notice--info { background: var(--sky-soft); border-color: transparent; color: var(--navy); }
.notice--warn { background: var(--danger-soft); border-color: transparent; color: var(--danger); }

.demo-banner {
  background: var(--tan-soft); color: var(--choc);
  padding: 0.55rem var(--gutter); text-align: center; font-size: 0.9rem;
}
.demo-banner code { font-size: 0.85em; background: rgba(74, 40, 22, 0.08); padding: 0.1em 0.35em; border-radius: 4px; }

/* ---- Header ------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(247, 244, 233, 0.92);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { height: var(--header-h); display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand img { height: 50px; width: auto; }
.header-nav { display: flex; align-items: center; gap: 0.4rem; }
.nav-link {
  text-decoration: none; font-weight: 500; padding: 0.5rem 0.8rem; border-radius: 999px;
}
.nav-link:hover { background: rgba(12, 48, 91, 0.06); }
.order-pill {
  display: inline-flex; align-items: center; gap: 0.45rem;
  min-height: 44px; padding: 0.45rem 0.55rem 0.45rem 1rem; margin-left: 0.4rem;
  border-radius: 999px; background: var(--navy); color: var(--cream);
  text-decoration: none; font-weight: 700;
}
.order-pill:hover { background: var(--navy-deep); }
.order-count {
  min-width: 1.75rem; height: 1.75rem; padding: 0 0.45rem; border-radius: 999px;
  display: inline-grid; place-items: center;
  background: var(--tan); color: var(--navy); font-size: 0.85rem; font-variant-numeric: tabular-nums;
}
.order-count.is-empty { background: rgba(247, 244, 233, 0.18); color: var(--cream); }

/* ---- Hero --------------------------------------------------------------- */
.hero {
  background:
    radial-gradient(ellipse 60% 80% at 85% 40%, rgba(185, 218, 242, 0.16), transparent 70%),
    var(--navy);
  color: var(--cream);
  overflow: hidden;
}
.hero-inner {
  display: grid; grid-template-columns: 1.1fr 0.9fr; align-items: center; gap: 2.5rem;
  padding-block: clamp(3rem, 7vw, 5.5rem);
}
.hero h1 { font-size: clamp(2.5rem, 5.5vw, 4.25rem); margin-top: 1rem; }
.hero h1 em { font-style: normal; color: var(--tan); display: block; }
.lede { font-size: 1.15rem; max-width: 34rem; margin-top: 1.1rem; color: rgba(247, 244, 233, 0.86); }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; margin-top: 2rem; }
.next-pickup { color: rgba(247, 244, 233, 0.8); }
.next-pickup strong { color: var(--cream); }
.hero-art img {
  width: 100%; max-width: 520px; margin-inline: auto;
  transform: rotate(-3deg);
  filter: drop-shadow(0 18px 30px rgba(0, 0, 0, 0.3));
}

/* ---- How it works ------------------------------------------------------- */
.how { background: var(--paper); border-bottom: 1px solid var(--line); }
.steps {
  list-style: none; margin: 0; padding: 2.25rem 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem 2.5rem;
}
.steps li { display: grid; grid-template-columns: auto 1fr; column-gap: 0.9rem; align-items: start; }
.step-num {
  grid-row: span 2;
  width: 2.4rem; height: 2.4rem; border-radius: 50%;
  display: grid; place-items: center;
  border: 2px solid var(--navy); font: 800 1.1rem/1 var(--font-display);
}
.steps h3 { font-size: 1.15rem; margin-top: 0.15rem; }
.steps p { color: var(--muted); margin-top: 0.3rem; }

/* ---- Shop layout -------------------------------------------------------- */
.shop {
  display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 2.5rem; align-items: start;
  padding-block: 3.5rem 4.5rem;
}
.section-head { margin-bottom: 1.5rem; }
.section-head h2 { font-size: clamp(1.9rem, 3.5vw, 2.6rem); margin-top: 0.6rem; }
.menu-col > .notice { margin-bottom: 1rem; }

.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1.25rem; }
.product {
  display: flex; flex-direction: column;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.product.in-cart { border-color: var(--navy); box-shadow: 0 0 0 1px var(--navy), var(--shadow); }
.product-art { position: relative; aspect-ratio: 16 / 10; display: grid; place-items: center; }
.product-art img { width: 46%; filter: drop-shadow(0 8px 10px rgba(74, 40, 22, 0.18)); transition: transform 0.25s; }
.product:hover .product-art img { transform: rotate(-6deg) scale(1.03); }
.product-art.has-photo img { width: 100%; height: 100%; object-fit: cover; filter: none; }
.tone-0 { background: var(--tan-soft); }
.tone-1 { background: var(--sky-soft); }
.tone-2 { background: var(--cream-deep); }
.badge {
  position: absolute; top: 0.75rem; left: 0.75rem;
  background: var(--navy); color: var(--cream);
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.04em;
  padding: 0.3rem 0.65rem; border-radius: 999px;
}
.product-body { display: flex; flex-direction: column; flex: 1; padding: 1.1rem 1.15rem 1.15rem; }
.product h3 { font-size: 1.3rem; }
.product-desc { color: var(--muted); margin-top: 0.4rem; font-size: 0.95rem; flex: 1; }
.product-foot { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-top: 1rem; min-height: 44px; }
.price { font: 800 1.25rem/1 var(--font-display); }
.price span { font: 500 0.85rem var(--font-body); color: var(--muted); }
.is-soldout .product-art img { filter: grayscale(1); opacity: 0.55; }
.soldout-tag {
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); border: 1.5px dashed var(--line-strong); border-radius: 999px; padding: 0.35rem 0.8rem;
}

.stepper {
  display: inline-flex; align-items: center;
  border: 1.5px solid var(--navy); border-radius: 999px; background: var(--paper);
}
.stepper button {
  width: 40px; height: 40px; border: 0; background: none; border-radius: 50%;
  font-size: 1.25rem; font-weight: 700; color: var(--navy); cursor: pointer;
}
.stepper button:hover:not(:disabled) { background: rgba(12, 48, 91, 0.08); }
.stepper button:disabled { opacity: 0.3; cursor: default; }
.stepper-qty { min-width: 1.6rem; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---- Order panel: double-ruled like the logo sign ----------------------- */
.order-col {
  position: sticky; top: calc(var(--header-h) + 0.75rem);
  /* if the panel is taller than the window, it scrolls on its own so the
     checkout button is always reachable */
  max-height: calc(100vh - var(--header-h) - 1.5rem);
  overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin;
}
.order-panel {
  background: var(--paper);
  border: 2px solid var(--navy);
  border-radius: 20px;
  box-shadow: 0 0 0 5px var(--paper), 0 0 0 6.5px var(--navy), var(--shadow);
  padding: 1.5rem;
  margin: 7px;
}
.order-panel h2 { font-size: 1.6rem; }
.order-panel h2:focus { outline: none; }
.order-panel > .notice { margin-top: 1rem; }
.cart-empty { text-align: center; color: var(--muted); padding: 1.5rem 0 0.5rem; }
.cart-empty img { width: 72px; margin: 0 auto 0.75rem; opacity: 0.9; }

.cart-list { list-style: none; margin: 1rem 0 0; padding: 0; }
.cart-line {
  display: grid; grid-template-columns: 1fr auto; grid-template-areas: "info total" "step total";
  gap: 0.4rem 0.75rem; align-items: center;
  padding: 0.85rem 0; border-bottom: 1px dashed var(--line-strong);
}
.cart-line:first-child { border-top: 1px dashed var(--line-strong); }
.line-info { grid-area: info; }
.cart-line .stepper { grid-area: step; justify-self: start; }
.cart-line .stepper button { width: 34px; height: 34px; font-size: 1.1rem; }
.line-name { font-weight: 700; }
.line-meta { color: var(--muted); font-size: 0.875rem; }
.line-total { grid-area: total; font-weight: 700; font-variant-numeric: tabular-nums; }

.checkout { margin-top: 1.25rem; display: grid; gap: 1rem; }
.field { display: grid; gap: 0.35rem; border: 0; margin: 0; padding: 0; min-width: 0; }
.field legend, .field label { font-weight: 700; font-size: 0.92rem; padding: 0; }
.field legend { margin-bottom: 0.4rem; }
.field-hint { font-weight: 400; color: var(--muted); }
.field-row { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.field input, .field textarea {
  width: 100%; padding: 0.7rem 0.8rem; min-height: 44px;
  background: #fff; border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm);
}
.field textarea { resize: vertical; min-height: 64px; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px var(--sky); }
.field input:user-invalid { border-color: var(--danger); }

.pickup-options { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
.pickup-chip { position: relative; cursor: pointer; }
.pickup-chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.pickup-chip span {
  display: grid; place-items: center; min-height: 44px; padding: 0.5rem;
  border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm); background: #fff;
  font-weight: 500; font-size: 0.92rem; text-align: center;
}
.pickup-chip:hover span { border-color: var(--navy); }
.pickup-chip input:checked + span { background: var(--navy); border-color: var(--navy); color: var(--cream); font-weight: 700; }
.pickup-chip input:focus-visible + span { outline: 3px solid var(--tan); outline-offset: 2px; }

.total-row {
  display: flex; align-items: baseline; justify-content: space-between;
  padding-top: 0.9rem; border-top: 2px solid var(--navy);
  font-weight: 700;
}
.total-row strong { font: 800 1.75rem/1 var(--font-display); font-variant-numeric: tabular-nums; }
.form-error { background: var(--danger-soft); color: var(--danger); padding: 0.7rem 0.9rem; border-radius: var(--radius-sm); font-weight: 500; }
.fine-print { display: flex; gap: 0.4rem; align-items: center; justify-content: center; color: var(--muted); font-size: 0.8rem; text-align: center; }

/* ---- Footer ------------------------------------------------------------- */
.site-footer { background: var(--navy); color: rgba(247, 244, 233, 0.85); }
.footer-inner { display: flex; align-items: center; gap: 1.5rem; padding-block: 2.5rem; flex-wrap: wrap; }
.footer-badge { width: 84px; }
.footer-title { font: 800 1.3rem var(--font-display); color: var(--cream); }
.site-footer a { color: var(--tan); }
.footer-copy { margin-left: auto; font-size: 0.875rem; }

/* ---- Mobile "View order" bar ------------------------------------------- */
.mobile-bar { display: none; }

/* ---- Responsive --------------------------------------------------------- */
@media (max-width: 980px) {
  .shop { grid-template-columns: minmax(0, 1fr); }
  .order-col { position: static; max-height: none; overflow: visible; max-width: 560px; width: 100%; justify-self: center; }
  .mobile-bar:not([hidden]) {
    display: flex; align-items: center; justify-content: space-between;
    position: fixed; z-index: 30;
    left: var(--gutter); right: var(--gutter);
    bottom: calc(14px + env(safe-area-inset-bottom));
    padding: 0.95rem 1.25rem; border-radius: 14px;
    background: var(--navy); color: var(--cream); text-decoration: none; font-weight: 700;
    box-shadow: 0 10px 30px rgba(8, 34, 66, 0.35);
  }
  .mobile-bar strong { font: 800 1.15rem var(--font-display); }
  .site-footer { padding-bottom: 80px; }
}

.order-panel { container-type: inline-size; }
@container (min-width: 420px) {
  .field-row { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  :root { --header-h: 64px; --gutter: 16px; }
  .brand img { height: 40px; }
  .nav-link { display: none; }
  .hero-inner { grid-template-columns: 1fr; gap: 1.5rem; }
  .hero-art { order: -1; }
  .hero-art img { max-width: 300px; }
  .steps { grid-template-columns: 1fr; padding-block: 1.75rem; }
  .product-art { aspect-ratio: 2 / 1; }
  .product-art img { width: 34%; }
  .footer-copy { margin-left: 0; width: 100%; }
}

@media (max-width: 420px) {
  .order-pill { padding-left: 0.8rem; }
  .order-panel { padding: 1.2rem; }
}
