/* ============================================================================
   storefront.css — the public OutBaking commerce pages (category · product ·
   content · cart · checkout). A warm, appetizing bakery aesthetic distinct from
   the neon CMS. TRI-THEME (DD-33): one token set, three modes — light / dark /
   system — switched by a root data-theme attribute + prefers-color-scheme, set
   FOUC-safe before paint. No hardcoded per-component colors; everything reads a
   token so a theme swap is total.
   ============================================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* The palette is GENERATED here from tools/designtokens/design-tokens.json (DD-42 SD-1/SD-2).
   DD-42 SD-5 is RESOLVED: the warm terracotta/cream and the --ink-N / --surface vocabulary this
   file used to carry are the INTERIM look the endorsed designs explicitly decided against
   (docs/design/rugelach-shop/rugelach-shop.design.md:57 chooses "the home's language, not the
   interim terracotta"; docs/design/content-pages/content-pages-kit.css inherits the home palette
   verbatim and says so). Converging is therefore implementing the endorsed design, not a new
   aesthetic call — and it closes the live --ink-3 WCAG failure (3.04:1 / 2.79:1 / 3.30:1 light) as
   a consequence rather than as a separate fix. Geometry stays per-surface: these pages are
   text-led, so --radius is 14px where the storefront language uses 20px. */
:root,:root[data-theme="light"]{
  color-scheme:light;
  /* brand */
  --ukraine-blue:#0057B7;
  --ukraine-yellow:#FFD700;
  --ukraine-blue-light:#4A90E2;
  --ukraine-yellow-light:#FFE55C;
  --ukraine-blue-hover:#0064cf;
  --ukraine-yellow-ink:#0A1628;
  --ukraine-gradient:linear-gradient(135deg,#0057B7 0%,#FFD700 100%);
  /* surfaces */
  --bg-primary:#FFFFFF;
  --bg-secondary:#F8F9FB;
  --bg-accent:#EEF2F7;
  --warm-tint:#FFFBEB;
  --warm-band:linear-gradient(180deg,#FFFCF2 0%,#F8F9FB 100%);
  /* text */
  --text-primary:#0A1628;
  --text-secondary:#475569;
  --text-tertiary:#636E7C;
  /* lines and elevation */
  --border:rgba(15,23,42,.08);
  --border-strong:rgba(15,23,42,.16);
  --shadow:0 4px 24px rgba(0,0,0,.06);
  --shadow-lg:0 12px 48px rgba(0,0,0,.10);
  --shadow-color:rgba(0,0,0,.18);
  --scrim:rgba(4,10,22,.55);
  /* accent */
  --accent:var(--ukraine-blue);
  --accent-ink:#0057B7;
  --on-accent:#FFFFFF;
  --fc:var(--ukraine-blue);
  /* semantic state */
  --ok:#1A7743;
  --ok-bg:rgba(26,119,67,.12);
  --warn:#846718;
  --warn-bg:rgba(255,215,0,.14);
  --danger:#CA2D2D;
  --danger-bg:rgba(202,45,45,.10);
  --info:#0057B7;
  --info-bg:rgba(0,87,183,.08);
  /* typography */
  --font:'Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;
}

:root[data-theme="dark"]{
  color-scheme:dark;
  /* brand */
  --ukraine-blue-light:#60A5FA;
  --ukraine-yellow-light:#FBBF24;
  --ukraine-blue-hover:#1f76d6;
  /* surfaces */
  --bg-primary:#0A1628;
  --bg-secondary:#0F1B2D;
  --bg-accent:#1E293B;
  --warm-tint:#15233c;
  --warm-band:linear-gradient(180deg,#12203a 0%,#0F1B2D 100%);
  /* text */
  --text-primary:#F8FAFC;
  --text-secondary:#CBD5E1;
  --text-tertiary:#8592A4;
  /* lines and elevation */
  --border:rgba(248,250,252,.08);
  --border-strong:rgba(248,250,252,.18);
  --shadow:0 4px 24px rgba(0,0,0,.5);
  --shadow-lg:0 12px 48px rgba(0,0,0,.7);
  --shadow-color:rgba(0,0,0,.5);
  /* accent */
  --accent-ink:#7DB2F5;
  /* semantic state */
  --ok:#5BD98C;
  --ok-bg:rgba(91,217,140,.14);
  --warn:#FBBF24;
  --warn-bg:rgba(251,191,36,.14);
  --danger:#E07171;
  --danger-bg:rgba(224,113,113,.12);
  --info:#7DB2F5;
  --info-bg:rgba(125,178,245,.10);
}

@media (prefers-color-scheme:dark){
:root:not([data-theme="light"]){
  color-scheme:dark;
  /* brand */
  --ukraine-blue-light:#60A5FA;
  --ukraine-yellow-light:#FBBF24;
  --ukraine-blue-hover:#1f76d6;
  /* surfaces */
  --bg-primary:#0A1628;
  --bg-secondary:#0F1B2D;
  --bg-accent:#1E293B;
  --warm-tint:#15233c;
  --warm-band:linear-gradient(180deg,#12203a 0%,#0F1B2D 100%);
  /* text */
  --text-primary:#F8FAFC;
  --text-secondary:#CBD5E1;
  --text-tertiary:#8592A4;
  /* lines and elevation */
  --border:rgba(248,250,252,.08);
  --border-strong:rgba(248,250,252,.18);
  --shadow:0 4px 24px rgba(0,0,0,.5);
  --shadow-lg:0 12px 48px rgba(0,0,0,.7);
  --shadow-color:rgba(0,0,0,.5);
  /* accent */
  --accent-ink:#7DB2F5;
  /* semantic state */
  --ok:#5BD98C;
  --ok-bg:rgba(91,217,140,.14);
  --warn:#FBBF24;
  --warn-bg:rgba(251,191,36,.14);
  --danger:#E07171;
  --danger-bg:rgba(224,113,113,.12);
  --info:#7DB2F5;
  --info-bg:rgba(125,178,245,.10);
}
}
:root {
  --radius: 14px;
}

html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg-primary); color: var(--text-primary);
  font: 16px/1.6 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  transition: background .3s ease, color .3s ease;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -.02em; font-weight: 800; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.site { max-width: 1080px; margin: 0 auto; padding: 28px 20px 80px; min-height: 60vh; }

/* header / footer */
.hdr { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg-primary) 88%, transparent);
  backdrop-filter: saturate(140%) blur(10px); border-bottom: 1px solid var(--border); }
.hdr__in, .ftr__in { max-width: 1080px; margin: 0 auto; padding: 14px 20px; display: flex; align-items: center; gap: 18px; }
.hdr__brand { font-weight: 800; font-size: 18px; letter-spacing: -.02em; }
.hdr__brand::first-letter { color: var(--accent); }
.hdr__nav { margin-left: auto; display: flex; align-items: center; gap: 20px; font-weight: 600; font-size: 14px; }
.hdr__nav a { color: var(--text-secondary); } .hdr__nav a:hover { color: var(--text-primary); }
.hdr__cart { display: inline-flex; align-items: center; gap: 7px; }
.cart-count { background: var(--accent); color: var(--on-accent); font-size: 11px; font-weight: 800;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; display: inline-grid; place-items: center; }
.theme-btn { border: 1px solid var(--border-strong); background: var(--bg-secondary); color: var(--text-secondary); cursor: pointer;
  width: 32px; height: 32px; border-radius: 999px; font-size: 14px; }
.theme-btn:hover { color: var(--accent); border-color: var(--accent); }

.ftr { border-top: 1px solid var(--border); background: var(--bg-accent); margin-top: 40px; }
.ftr__in { flex-direction: column; align-items: flex-start; gap: 12px; padding: 34px 20px; }
.ftr__brand { font-weight: 800; } .ftr__brand::first-letter { color: var(--accent); }
.ftr__nav { display: flex; flex-wrap: wrap; gap: 18px; font-size: 14px; }
.ftr__nav a { color: var(--text-secondary); } .ftr__nav a:hover { color: var(--text-primary); }
.ftr__meta { color: var(--text-tertiary); font-size: 13px; }

/* breadcrumb */
.crumbs { font-size: 13px; color: var(--text-tertiary); margin-bottom: 20px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.crumbs a { color: var(--text-secondary); } .crumbs a:hover { color: var(--accent); }
.crumbs .sep { color: var(--text-tertiary); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
  border: 1px solid var(--border-strong); background: var(--bg-secondary); color: var(--text-primary); font-weight: 700; font-size: 15px;
  padding: 12px 22px; border-radius: 999px; transition: transform .12s ease, background .16s, border-color .16s; }
.btn:hover { transform: translateY(-1px); }
.btn--primary { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.btn--primary:hover { background: var(--ukraine-blue-hover); }
.btn--ghost { background: transparent; color: var(--text-secondary); }
.btn--ghost:hover { color: var(--text-primary); border-color: var(--accent); }
.btn--lg { padding: 14px 28px; font-size: 16px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; }

/* badges */
.badge { display: inline-block; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em;
  padding: 4px 10px; border-radius: 999px; background: var(--bg-accent); color: var(--accent); }
.badge--limited { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.badge--seasonal { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }

/* PDP */
.pdp { display: grid; grid-template-columns: 1.1fr 1fr; gap: 44px; align-items: start; }
@media (max-width: 820px){ .pdp { grid-template-columns: 1fr; gap: 26px; } }
.pdp__gallery { display: flex; flex-direction: column; gap: 12px; }
.pdp__img { border-radius: var(--radius); overflow: hidden; background: var(--bg-accent); box-shadow: var(--shadow); aspect-ratio: 4/3; }
.pdp__img img { width: 100%; height: 100%; object-fit: cover; }
.pdp__img--thumb { aspect-ratio: 4/3; max-width: 40%; }
.pdp__img--empty { display: grid; place-items: center; font-size: 72px; }
.pdp__title { font-size: 34px; margin: 12px 0 10px; }
.pdp__price { display: flex; align-items: baseline; gap: 12px; margin-bottom: 18px; }
.price { font-size: 26px; font-weight: 800; color: var(--accent); }
.price--was { color: var(--text-tertiary); text-decoration: line-through; font-size: 18px; font-weight: 600; }
.price--tba { color: var(--text-secondary); font-size: 18px; }
.pdp__lede { font-size: 18px; color: var(--text-secondary); margin-bottom: 14px; }
.pdp__desc { color: var(--text-secondary); margin-bottom: 24px; }
.pdp__buy { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.pdp__note { flex-basis: 100%; color: var(--text-tertiary); font-size: 13px; margin-top: 4px; }

/* category hero + product grid */
.cathero { margin-bottom: 30px; }
.cathero__img { border-radius: var(--radius); overflow: hidden; margin-bottom: 18px; box-shadow: var(--shadow); max-height: 300px; }
.cathero__img img { width: 100%; height: 100%; object-fit: cover; }
.cathero__text h1 { font-size: 38px; margin-bottom: 8px; }
.cathero__text p { color: var(--text-secondary); font-size: 18px; max-width: 620px; }

.cards { display: flex; gap: 18px; overflow-x: auto; padding-bottom: 6px; }
.cards--grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px,1fr)); overflow: visible; }
.card { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
  min-width: 220px; transition: transform .14s ease, box-shadow .16s, border-color .16s; }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--border-strong); }
.card__img { aspect-ratio: 4/3; background: var(--bg-accent); display: grid; place-items: center; font-size: 40px; position: relative; }
.card__img img { width: 100%; height: 100%; object-fit: cover; }
.card__img .badge { position: absolute; left: 10px; top: 10px; }
.card__body { padding: 14px 16px; }
.card__name { font-weight: 700; margin-bottom: 4px; }
.card__desc { color: var(--text-secondary); font-size: 13px; margin-bottom: 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card__price { color: var(--accent); font-weight: 800; }

/* related shelves */
.shelf { margin-top: 48px; }
.shelf__title { font-size: 22px; margin-bottom: 16px; }

/* prose content pages */
.prose { max-width: 720px; margin: 0 auto; }
.prose h1 { font-size: 34px; margin-bottom: 18px; }
.prose__body { color: var(--text-secondary); font-size: 17px; }
.prose__body p { margin-bottom: 16px; }

/* cart + checkout */
.cart, .checkout { max-width: 720px; margin: 0 auto; }
.cart h1, .checkout h1 { font-size: 32px; margin-bottom: 22px; }
.cart-lines { list-style: none; display: flex; flex-direction: column; gap: 12px; margin-bottom: 22px; }
.cart-line { display: flex; align-items: center; gap: 14px; background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px; }
.cart-line__name { font-weight: 700; }
.cart-line__qty { color: var(--text-secondary); font-size: 14px; }
.cart-line__price { margin-left: auto; font-weight: 800; color: var(--accent); }
.cart-line__rm { border: 0; background: transparent; color: var(--text-tertiary); cursor: pointer; font-size: 18px; }
.cart-line__rm:hover { color: var(--danger); }
.cart-foot, .cart-subtotal { display: flex; align-items: center; gap: 14px; }
.cart-subtotal { justify-content: space-between; font-size: 18px; margin: 18px 0; }
.cart-subtotal b { font-size: 22px; color: var(--accent); }
.cart-foot { justify-content: flex-end; }

.gate { text-align: center; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 40px 28px; box-shadow: var(--shadow); }
.gate__badge { display: inline-block; background: var(--bg-accent); color: var(--accent); font-weight: 800;
  padding: 6px 14px; border-radius: 999px; font-size: 13px; margin-bottom: 16px; }
.gate h2 { font-size: 24px; margin-bottom: 10px; }
.gate p { color: var(--text-secondary); max-width: 460px; margin: 0 auto 20px; }
.gate .cart-summary { text-align: left; max-width: 440px; margin: 0 auto 22px; }
.gate__actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.gate__note { color: var(--text-tertiary); font-size: 13px; margin-top: 16px; }

/* empty / 404 */
.empty-state, .cart-empty { text-align: center; padding: 60px 24px; }
.empty-state .ico, .cart-empty .ico { font-size: 54px; margin-bottom: 14px; }
.empty-state h1, .empty-state h2, .cart-empty h2 { font-size: 26px; margin-bottom: 10px; }
.empty-state p, .cart-empty p { color: var(--text-secondary); max-width: 420px; margin: 0 auto 20px; }
.empty-state--404 { padding-top: 80px; }

/* ============================================================================
   checkout + confirmation (square-checkout). Form fields + the two-column
   checkout + the receipt. All colors read the tri-theme tokens above, so
   light / dark / system all work with no per-component color. */
.ink-2 { color: var(--text-secondary); } .ink-3 { color: var(--text-tertiary); }
.txt-sm { font-size: 13px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }

/* form fields (shared) */
.field { margin-bottom: 14px; }
.field > label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; color: var(--text-secondary); }
.field .opt { color: var(--text-tertiary); font-weight: 500; }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; color: var(--text-primary); background: var(--bg-secondary);
  border: 1px solid var(--border-strong); border-radius: 10px; padding: 11px 13px; transition: border-color .15s ease, box-shadow .15s ease;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--bg-accent);
}
.field textarea { resize: vertical; min-height: 60px; }

/* checkout layout */
.co-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 26px; align-items: start; }
.co-sec { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px 22px; box-shadow: var(--shadow); margin-bottom: 18px; }
.co-h { font-size: 16px; margin-bottom: 14px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.row3 { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 12px; }
.co-card { min-height: 56px; padding: 6px 0; }               /* Square injects its iframe here */
.co-err { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger);
  border: 1px solid color-mix(in srgb, var(--danger) 40%, transparent); border-radius: 10px;
  padding: 10px 13px; font-size: 14px; font-weight: 600; margin: 4px 0 14px; }
.co-badge { display: inline-block; background: var(--bg-accent); color: var(--accent); font-weight: 700;
  padding: 5px 12px; border-radius: 999px; font-size: 12.5px; margin-bottom: 14px; }
.co-secure { color: var(--text-tertiary); font-size: 12.5px; margin-top: 12px; }
.btn.is-busy { opacity: .7; pointer-events: none; }
.co-side { position: sticky; top: 88px; }
.co-summary { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px 22px; box-shadow: var(--shadow); }
.co-back { display: inline-block; margin-top: 14px; color: var(--accent); font-weight: 600; font-size: 14px; }
.co-empty { text-align: center; padding: 50px 24px; }
.co-empty .ico { font-size: 48px; margin-bottom: 12px; }
.co-empty h2 { font-size: 24px; margin-bottom: 8px; }
.co-empty p { color: var(--text-secondary); margin: 0 auto 18px; max-width: 380px; }

/* confirmation / receipt */
.confirm { max-width: 620px; margin: 0 auto; }
.confirm__hero { text-align: center; margin-bottom: 26px; }
.confirm__tick { width: 64px; height: 64px; border-radius: 999px; display: grid; place-items: center;
  margin: 0 auto 16px; font-size: 30px; color: var(--on-accent); background: var(--ok); }
.confirm__hero h1 { font-size: 30px; margin-bottom: 8px; }
.confirm__hero p { color: var(--text-secondary); }
.confirm__card { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px 24px; box-shadow: var(--shadow); }
.confirm__row { display: flex; justify-content: space-between; gap: 14px; padding: 7px 0; border-bottom: 1px solid var(--border); }
.confirm__lines { list-style: none; margin: 14px 0; }
.confirm__line { display: flex; justify-content: space-between; gap: 14px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.confirm__price { font-weight: 800; color: var(--accent); white-space: nowrap; }
.confirm__total { display: flex; justify-content: space-between; align-items: center; padding-top: 14px; font-size: 18px; }
.confirm__total b { font-size: 22px; color: var(--accent); }
.confirm__ship { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); line-height: 1.5; }
.confirm__actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 24px; }

@media (max-width: 720px) {
  .co-grid { grid-template-columns: 1fr; }
  .co-side { position: static; }
  .row2, .row3 { grid-template-columns: 1fr; }
}

/* Header brand mark (QA item 2a) — the real logo replacing the "◆" glyph placeholder. Sized to the
   header rhythm; the dark-theme lift mirrors the home template's own rule so a dark logo does not sink
   into a dark bar. Rendered from the shared _brand.html partial on every public shell. */
/* flex-shrink:0 — same pair, same reason as shop-kit.css:68 + :434 and cart.css. The <picture> is
   the flex item and is not a replaced element, so min-width:auto floors it at 0 under header
   pressure; the rule on the wrapper is the one that does the work. `.hdr__brand` is not a flex
   container on this shell today, so both declarations are inert here — they are stated anyway so
   this surface cannot acquire the defect by becoming one, which is exactly how the shop shell got
   it (a <span> that could not shrink was swapped for a <picture> that could). */
.hdr__brand picture{ flex-shrink:0; }
.brand-mark{ width:34px; height:34px; border-radius:9px; object-fit:contain; display:block; flex-shrink:0; }
[data-theme="dark"] .brand-mark{ filter:brightness(1.25); }
