/* sexy fortunes · one stylesheet for every page.
   Colors, fonts and shapes come from the brand book: plum lines, cream paper,
   pill buttons with hard shadows. No inline styles anywhere, so the strict
   Content-Security-Policy in _headers can block injected ones. */

/* ---------- Fonts (self-hosted, no third-party requests) ---------- */
@font-face { font-family: "Fraunces Soft"; src: url("/assets/fonts/FrauncesSoft-VF.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Fraunces Soft"; src: url("/assets/fonts/FrauncesSoft-Italic-VF.woff2") format("woff2"); font-weight: 100 900; font-style: italic; font-display: swap; }
@font-face { font-family: "DM Sans"; src: url("/assets/fonts/DMSans-VF.woff2") format("woff2"); font-weight: 100 1000; font-style: normal; font-display: swap; }
@font-face { font-family: "DM Mono"; src: url("/assets/fonts/DMMono-Medium.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }

/* ---------- Brand tokens ---------- */
:root {
  --plum: #2a1232;
  --cream: #fff7ec;
  --sand: #f7d9a6;
  --pink: #ff5a7e;
  --pink-light: #ffd6e2;
  --yellow: #ffd03d;
  --green: #3dcc8e;
  --muted: #5e4766;
  --orange: #ff8f40;
  --blue: #55a2ff;
  --purple: #ac80ff;
  --scrim: rgba(42, 18, 50, .62);

  --display: "Fraunces Soft", Fraunces, Georgia, serif;
  --sans: "DM Sans", system-ui, sans-serif;
  --mono: "DM Mono", ui-monospace, monospace;

  --gutter: clamp(20px, 4vw, 40px);
  --hdr-h: 84px; /* updated by shop.js to the real header height */
  color-scheme: light;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
/* Page containers: 1200px of content plus the side gutters, as in the design. */
.wrap, .hero, .hdr__in, .ftr__in { box-sizing: content-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--hdr-h) + 12px); }
body { margin: 0; background: var(--cream); color: var(--plum); font: 16px/24px var(--sans); }
img, svg { display: block; max-width: 100%; }
img { height: auto; }
a, a:hover { color: var(--plum); }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--plum); outline-offset: 2px; }
[tabindex="-1"]:focus { outline: none; }
[hidden] { display: none !important; }
h1, h2, h3, p, figure, blockquote { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.muted { color: var(--muted); }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 16px; border: 2px solid var(--plum); border-radius: 999px; background: var(--yellow); font-weight: 700; text-decoration: none; }
.skip:focus { top: 12px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

/* Small uppercase mono label: "HOW MANY COOKIES?", "5 COOKIES", footer headings */
.label { font: 500 12px/16px var(--mono); letter-spacing: .08em; text-transform: uppercase; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 20px;
  border: 2px solid var(--plum); border-radius: 999px; background: var(--cream); box-shadow: 2px 2px 0 var(--plum);
  color: var(--plum); font: 700 16px/22px var(--sans); text-decoration: none; text-align: center; cursor: pointer;
}
.btn:active:not(:disabled) { transform: translate(1px, 1px); box-shadow: 1px 1px 0 var(--plum); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn--pink { background: var(--pink); }
.btn--lg { min-height: 56px; padding: 14px 24px; font-size: 18px; }
.btn--xl { min-height: 88px; padding: 14px 28px; font-size: 18px; } /* the big pink calls to action on the shop page */
.btn--sm { min-height: 44px; padding: 0 18px; font-size: 15px; }
.btn--block { display: flex; width: 100%; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 44px; height: 44px; padding: 0; border: 2px solid var(--plum); border-radius: 999px; background: var(--cream); cursor: pointer;
}
.link-btn { min-height: 44px; padding: 0 4px; border: 0; background: none; font-size: 14px; color: var(--muted); text-decoration: underline; cursor: pointer; }
.link-btn--plum { min-height: 32px; padding: 0; color: var(--plum); }

/* ---------- Header (sticky, so the basket is always in reach) ---------- */
.hdr { position: sticky; top: 0; z-index: 40; background: var(--cream); border-bottom: 2px solid transparent; }
.hdr.is-stuck, .is-basket-open .hdr { border-bottom-color: var(--plum); }
.hdr__in { max-width: 1200px; margin: 0 auto; padding: 20px var(--gutter); display: flex; align-items: center; justify-content: space-between; gap: 16px 32px; flex-wrap: wrap; }
.hdr__logo { display: block; }
.logo { height: 44px; width: auto; }
.nav { display: flex; gap: 8px 28px; flex-wrap: wrap; font-weight: 600; }
.nav a { text-decoration: none; }
.hdr__right { display: flex; align-items: center; gap: 12px; }

.hdr__basket {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; min-width: 44px; padding: 8px 18px 8px 14px;
  border: 2px solid var(--plum); border-radius: 999px; background: var(--cream); font-weight: 700; cursor: pointer;
}
.hdr__basket[aria-expanded="true"] { background: var(--pink); }
.badge {
  position: absolute; top: -10px; right: -8px; min-width: 24px; height: 24px; padding: 0 6px;
  border: 2px solid var(--plum); border-radius: 999px; background: var(--yellow);
  font: 500 12px/20px var(--mono); text-align: center;
}
.hdr__buy { min-height: 44px; padding: 10px 20px; }
.hdr__menu { display: none; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 2px solid var(--plum); border-radius: 999px; background: var(--cream); cursor: pointer; }
.hdr__menu[aria-expanded="true"] { background: var(--yellow); }

.noscript { margin: 0; padding: 12px var(--gutter); background: var(--yellow); text-align: center; font-weight: 600; }

/* ---------- Page sections ---------- */
.wrap { max-width: 1200px; margin: 0 auto; padding: clamp(56px, 8vw, 96px) var(--gutter); }
.intro { display: flex; flex-direction: column; gap: 16px; max-width: 760px; }
.intro--tight { gap: 12px; }
.h2 { font: 800 clamp(36px, 4.4vw, 56px)/1 var(--display); letter-spacing: -0.02em; text-wrap: balance; }
.lead { font-size: 20px; line-height: 30px; font-weight: 500; }

/* Hero */
.hero {
  max-width: 1200px; margin: 0 auto; padding: 24px var(--gutter) clamp(56px, 7vw, 88px);
  display: grid; gap: 24px 48px; align-items: start;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  grid-template-areas: "text art" "buy art";
}
.hero__text { grid-area: text; display: flex; flex-direction: column; gap: 24px; }
.hero__title { font: 800 clamp(32px, 3.9vw, 56px)/.95 var(--display); letter-spacing: -0.02em; text-wrap: balance; }
.hero__lead { max-width: 34em; }
.hero__buy { grid-area: buy; display: flex; flex-direction: column; gap: 24px; }
.hero__art { grid-area: art; align-self: center; padding: 12px; overflow: hidden; background: var(--pink-light); border: 2px solid var(--plum); border-radius: 28px; box-shadow: 4px 4px 0 var(--plum); }
.hero__art img { width: 100%; }

.buybox { display: flex; flex-direction: column; gap: 16px; padding: clamp(16px, 4vw, 24px); border: 2px solid var(--plum); border-radius: 28px; background: var(--cream); box-shadow: 4px 4px 0 var(--plum); }
.picker { margin: 0; padding: 0; border: 0; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.picker legend { padding: 0; float: left; width: 100%; } /* float lets the flex gap apply to the legend */
.chips { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.chip { position: relative; min-width: 0; }
.chip input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.chip > span { display: flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 4px; border: 2px solid var(--plum); border-radius: 999px; background: var(--cream); font-size: 18px; font-weight: 700; }
.chip input:checked + span { background: var(--pink); box-shadow: 2px 2px 0 var(--plum); }
.chip input:focus-visible + span { outline: 3px solid var(--plum); outline-offset: 2px; }
.buybox__sel { color: var(--muted); }
.buybox__sel strong, .buybox__ship strong { color: var(--plum); }
.buybox__ship { display: flex; align-items: center; gap: 8px; font-size: 14px; line-height: 20px; color: var(--muted); }
.buybox__ship svg { flex: none; color: var(--plum); }
.usp { margin: 0; padding: 0; list-style: none; display: flex; gap: 12px 28px; flex-wrap: wrap; font-weight: 600; }
.usp li { display: flex; align-items: center; gap: 8px; }

/* What's inside (dark) */
.inside { background: var(--plum); color: var(--cream); }
.inside a { color: var(--cream); }
.inside__in { display: flex; flex-direction: column; gap: 40px; }
.eyebrow { color: var(--yellow); }
.fortunes { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 24px; }
.fortune { display: flex; flex-direction: column; gap: 10px; padding: 20px 24px; border-radius: 4px; background: var(--cream); color: var(--plum); transform: rotate(var(--tilt, 0deg)); }
.fortune blockquote { font: italic 500 22px/1.3 var(--display); }
.fortune figcaption { color: var(--muted); }
.fortune:nth-child(1) { --tilt: -1.5deg; }
.fortune:nth-child(2) { --tilt: 1deg; }
.fortune:nth-child(3) { --tilt: -.5deg; }
.fortune:nth-child(4) { --tilt: 1.2deg; }
.fortune:nth-child(5) { --tilt: -1deg; }
.fortune:nth-child(6) { --tilt: .8deg; }
.fortune:nth-child(7) { --tilt: -.8deg; }
.fortune:nth-child(8) { --tilt: 1.4deg; }
.fortune:nth-child(9) { --tilt: -1.2deg; }
.madefor { display: flex; flex-direction: column; gap: 12px; }
.madefor__title { font-size: 18px; font-weight: 600; }
.tags { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.tags li { padding: 6px 14px; border-radius: 999px; background: var(--tag, var(--pink)); color: var(--plum); font: 500 13px/24px var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.tags li:nth-child(2) { --tag: var(--orange); }
.tags li:nth-child(3) { --tag: var(--yellow); }
.tags li:nth-child(4) { --tag: var(--green); }
.tags li:nth-child(5) { --tag: var(--blue); }
.tags li:nth-child(6) { --tag: var(--purple); }
.tags li:nth-child(7) { --tag: var(--pink-light); }

/* Packs */
.shop { display: flex; flex-direction: column; gap: 32px; }
.packs { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 20px; }
.pack { position: relative; display: flex; flex-direction: column; overflow: hidden; border: 2px solid var(--plum); border-radius: 28px; background: var(--cream); box-shadow: 4px 4px 0 var(--plum); }
.pack--featured { border-width: 3px; }
.pack__img { padding: 12px; background: var(--pink-light); border-bottom: 2px solid var(--plum); }
.pack__img img { width: 100%; }
.pack__body { display: flex; flex-direction: column; gap: 6px; padding: 20px; flex-grow: 1; }
.pack__name { font: 700 26px/1.1 var(--display); }
.pack__desc { color: var(--muted); }
.pack__price { margin-top: auto; padding-top: 12px; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.pack .btn { margin-top: 12px; min-height: 52px; }
.price { font: 800 32px/1 var(--display); }
.price--md { font-size: 28px; }
.each { font-size: 14px; color: var(--muted); }
.tag-badge { position: absolute; top: 12px; left: 12px; z-index: 1; padding: 4px 10px; border: 2px solid var(--plum); border-radius: 999px; background: var(--yellow); font: 500 12px/16px var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.tag-badge--green { background: var(--green); }
.strip { display: flex; gap: 8px 24px; flex-wrap: wrap; font-weight: 600; }

/* Food information under the packs (required before purchase) */
.foodinfo { padding: 0 20px; border: 2px solid var(--plum); border-radius: 20px; background: var(--cream); }
.foodinfo summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 0; cursor: pointer; list-style: none; font: 700 20px/1.25 var(--display); }
.foodinfo summary::-webkit-details-marker { display: none; }
.foodinfo summary::after { content: "+"; font: 700 26px/1 var(--sans); }
.foodinfo[open] summary::after { content: "\2212"; }
.foodinfo__list { margin: 0 0 16px; display: grid; grid-template-columns: minmax(0, 180px) minmax(0, 1fr); gap: 8px 20px; font-size: 15px; line-height: 22px; }
.foodinfo__list dt { font-weight: 700; }
.foodinfo__list dd { margin: 0; }
.nutri { width: 100%; max-width: 420px; margin: 0 0 20px; border-collapse: collapse; font-size: 15px; line-height: 22px; }
.nutri caption { padding-bottom: 6px; text-align: left; font-weight: 700; }
.nutri th, .nutri td { padding: 6px 0; border-top: 1px solid var(--sand); text-align: left; font-weight: 400; }
.nutri td { text-align: right; }

/* Stickers & goodies */
.goodies-sec { background: var(--pink-light); border-top: 2px solid var(--plum); border-bottom: 2px solid var(--plum); }
.goodies { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 24px; }
.goodie { display: flex; flex-direction: column; overflow: hidden; border: 2px solid var(--plum); border-radius: 28px; background: var(--cream); box-shadow: 4px 4px 0 var(--plum); }
.goodie__img { padding: 12px; background: var(--sand); border-bottom: 2px solid var(--plum); }
.goodie__img img { width: 100%; }
.goodie__body { display: flex; flex-direction: column; gap: 6px; padding: 20px; flex-grow: 1; }
.goodie__name { font: 700 24px/1.1 var(--display); }
.goodie__buy { margin-top: auto; padding-top: 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.goodie__buy .btn { min-height: 48px; }

/* Wholesale */
.wholesale { background: var(--sand); }
.wholesale__in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 28px 64px; }
.wholesale__text { flex: 1 1 520px; min-width: 0; max-width: 760px; display: flex; flex-direction: column; gap: 16px; }
.wholesale__cta { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }

/* FAQ */
.faq { display: flex; flex-wrap: wrap; gap: 32px 64px; align-items: flex-start; }
.faq__intro { flex: 1 1 280px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.faq__lead { font-size: 18px; line-height: 28px; }
.faq__list { flex: 2 1 560px; min-width: 0; display: flex; flex-direction: column; border-top: 2px solid var(--plum); }
.faq__list details { padding: 20px 0; border-bottom: 2px solid var(--plum); }
.faq__list summary { cursor: pointer; list-style: none; font: 700 22px/1.25 var(--display); }
.faq__list summary::-webkit-details-marker { display: none; }
.faq__list p { margin-top: 12px; font-size: 17px; line-height: 26px; }

/* Footer */
.ftr { background: var(--plum); color: var(--cream); }
.ftr a { color: var(--cream); }
.stripe { display: flex; flex-direction: column; gap: 2px; padding: 2px 0; }
.stripe span { height: 4px; background: var(--pink); }
.stripe span:nth-child(2) { background: var(--orange); }
.stripe span:nth-child(3) { background: var(--yellow); }
.stripe span:nth-child(4) { background: var(--green); }
.stripe span:nth-child(5) { background: var(--blue); }
.stripe span:nth-child(6) { background: var(--purple); }
.ftr__in { max-width: 1200px; margin: 0 auto; padding: 56px var(--gutter) 40px; display: flex; flex-direction: column; gap: 40px; }
.ftr__top { display: flex; flex-wrap: wrap; gap: 40px 64px; justify-content: space-between; }
.ftr__brand { display: flex; flex-direction: column; gap: 16px; flex: 1 1 260px; }
.ftr__brand img { height: 44px; width: auto; align-self: flex-start; }
.ftr__tag { font: italic 700 26px/1.2 var(--display); color: var(--yellow); }
.ftr__nav { display: flex; flex-wrap: wrap; gap: 32px 64px; }
.ftr__nav div { display: flex; flex-direction: column; gap: 10px; }
.ftr__nav .label { color: var(--yellow); }
.ftr__fine { font-size: 14px; line-height: 20px; }

/* Keyboard focus rings stay visible on the dark plum areas. */
.inside :focus-visible, .ftr :focus-visible, .bar :focus-visible { outline-color: var(--cream); }

/* ---------- Basket drawer ---------- */
.overlay { position: fixed; top: var(--hdr-h); left: 0; right: 0; bottom: 0; z-index: 20; background: var(--scrim); }
.basket {
  position: fixed; top: var(--hdr-h); right: 0; bottom: 0; z-index: 30;
  width: 480px; max-width: 100%;
  display: flex; flex-direction: column;
  background: var(--cream); border-left: 3px solid var(--plum);
}
.is-basket-open { overflow: hidden; } /* stops the page scrolling behind the basket */
@media (prefers-reduced-motion: no-preference) {
  .basket:not([hidden]) { animation: slide-in .2s ease-out; }
  @keyframes slide-in { from { transform: translateX(24px); opacity: 0; } }
}
.basket__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 28px 18px; border-bottom: 2px solid var(--plum); }
.basket__title { display: flex; align-items: baseline; gap: 12px; }
.basket__title h2 { font: 800 34px/1 var(--display); letter-spacing: -0.02em; }
.basket__body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 16px; padding: 20px 28px; }

.notice { padding: 10px 14px; border: 2px solid var(--plum); border-radius: 16px; background: var(--pink-light); font-size: 15px; line-height: 21px; font-weight: 600; }

/* 1 · meter */
.meter { display: flex; flex-direction: column; gap: 8px; padding: 12px 16px 10px; border: 2px solid var(--plum); border-radius: 20px; background: var(--cream); box-shadow: 2px 2px 0 var(--plum); }
.meter__title { display: flex; align-items: center; gap: 8px; font-size: 17px; line-height: 22px; font-weight: 700; }
.meter__title svg { flex: none; }
.meter__check, .meter.is-free .meter__truck { display: none; }
.meter.is-free .meter__check { display: block; }
.meter__track { height: 14px; overflow: hidden; border: 2px solid var(--plum); border-radius: 999px; background: var(--cream); }
.meter__fill { height: 100%; width: 0; background: var(--pink); }
.meter.is-free .meter__fill { background: var(--green); }
.meter__note { align-self: flex-end; font: 500 11px/16px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }

/* 2 · one-tap nudge */
.nudge { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px 12px 10px 10px; border: 2px dashed var(--plum); border-radius: 20px; background: var(--yellow); }
.nudge__img { padding: 4px; border-radius: 12px; background: var(--cream); }
.nudge__text { font-size: 15px; line-height: 20px; font-weight: 600; }

.empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 20px 8px 8px; text-align: center; }
.empty img { width: 84px; }
.empty__title { font: 800 26px/1.1 var(--display); }
.empty__text { font-size: 15px; line-height: 22px; color: var(--muted); }
.empty .btn { padding: 0 24px; }

/* lines */
.lines { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 16px; }
.lines:empty { display: none; }
.line { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; column-gap: 14px; row-gap: 8px; padding: 12px; border: 2px solid var(--plum); border-radius: 20px; background: var(--cream); box-shadow: 2px 2px 0 var(--plum); }
.line__img { grid-row: 1 / 3; align-self: start; padding: 4px; border-radius: 14px; background: var(--pink-light); }
.line__info { min-width: 0; }
.line__name { font: 700 19px/1.2 var(--display); }
.line__detail { font-size: 14px; line-height: 20px; color: var(--muted); }
.line__total { font: 800 20px/1.2 var(--display); white-space: nowrap; }
.line__ctrl { grid-column: 2 / 4; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stepper { display: flex; align-items: center; border: 2px solid var(--plum); border-radius: 999px; }
.stepper__btn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 999px; background: transparent; cursor: pointer; }
.stepper__n { min-width: 24px; text-align: center; font-weight: 700; }

/* 3 · add-ons, a row that scrolls sideways */
.addons { display: flex; flex-direction: column; gap: 10px; }
.addons__row { margin: 0 -28px 0 0; padding: 0 28px 10px 0; list-style: none; display: flex; gap: 10px; overflow-x: auto; }
.addon { flex: none; width: 204px; display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 6px 8px 6px 6px; border: 2px solid var(--plum); border-radius: 16px; background: var(--cream); }
.addon__img { width: 52px; height: 52px; display: flex; align-items: center; justify-content: center; padding: 4px; border-radius: 12px; background: var(--pink-light); }
.addon__img img { max-height: 44px; width: auto; }
.addon__info { min-width: 0; }
.addon__name { font-size: 14px; line-height: 18px; font-weight: 700; }
.addon__price { font-size: 13px; line-height: 18px; color: var(--muted); }
.addon__add { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 2px solid var(--plum); border-radius: 999px; background: var(--pink); box-shadow: 2px 2px 0 var(--plum); cursor: pointer; }

/* discount code */
.code { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.code__form { display: flex; gap: 8px; width: 100%; }
.code__input { flex: 1; min-width: 0; min-height: 44px; padding: 0 16px; border: 2px solid var(--plum); border-radius: 999px; background: var(--cream); font: 500 14px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.code__input::placeholder { color: var(--muted); text-transform: none; letter-spacing: 0; font-family: var(--sans); }
.code__applied { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.code__msg { font-size: 14px; line-height: 20px; color: var(--muted); }
.code__msg:empty { display: none; }

/* summary and checkout */
.basket__foot { display: flex; flex-direction: column; gap: 12px; padding: 16px 28px 24px; border-top: 2px solid var(--plum); background: var(--cream); }
.sum { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; row-gap: 4px; column-gap: 16px; font-size: 15px; line-height: 22px; }
.sum__val { text-align: right; }
.sum__note { grid-column: 1 / 3; margin-top: -2px; font-size: 13px; line-height: 18px; color: var(--muted); }
.sum__total { font-size: 18px; font-weight: 700; }
.sum__total-val { font: 800 22px/30px var(--display); white-space: nowrap; }
.pill-free { padding: 1px 10px; border: 2px solid var(--plum); border-radius: 999px; background: var(--green); font: 500 12px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.age { display: flex; align-items: flex-start; gap: 10px; }
.age input { flex: none; width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--plum); cursor: pointer; }
.age label { font-size: 15px; line-height: 22px; font-weight: 600; cursor: pointer; }
.error { padding: 10px 14px; border: 2px solid var(--plum); border-radius: 16px; background: var(--yellow); font-size: 14px; line-height: 20px; font-weight: 600; }
.pay-note { text-align: center; font-size: 13px; line-height: 18px; color: var(--muted); }
.pay-note__short { display: none; }

/* ---------- Mobile basket bar ---------- */
.bar { display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; background: var(--plum); color: var(--cream); }
.bar__track { height: 6px; background: var(--muted); }
.bar__fill { height: 100%; width: 0; background: var(--pink); }
.bar.is-free .bar__fill { background: var(--green); }
.bar__in { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px 16px 20px; }
.bar__text { min-width: 0; }
.bar__sum { font-size: 17px; line-height: 22px; font-weight: 700; }
.bar__status { font: 500 11px/16px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--yellow); }
.bar.is-free .bar__status { color: var(--green); }
.bar__btn { min-height: 48px; padding: 0 22px; border-color: var(--cream); background: var(--pink); box-shadow: none; white-space: nowrap; }

/* ---------- Simple pages (thanks, legal, 404) ---------- */
.page-hdr { position: static; border-bottom: 2px solid var(--plum); }
.page-hdr .hdr__in { padding-top: 16px; padding-bottom: 16px; }
.page-hdr .btn { min-height: 44px; }
.ftr__in--compact { padding-top: 32px; padding-bottom: 32px; gap: 12px; }
.ftr__links { display: flex; flex-wrap: wrap; gap: 8px 24px; font-weight: 600; }
.doc { max-width: 760px; margin: 0 auto; padding: clamp(40px, 6vw, 72px) var(--gutter) clamp(56px, 8vw, 96px); display: flex; flex-direction: column; gap: 16px; }
.doc h1 { font: 800 clamp(36px, 4.4vw, 56px)/1 var(--display); letter-spacing: -0.02em; margin-bottom: 8px; }
.doc h2 { font: 700 24px/1.2 var(--display); margin-top: 16px; }
.doc p, .doc li { font-size: 17px; line-height: 26px; }
.doc ul, .doc ol { margin: 0; padding-left: 1.3em; display: flex; flex-direction: column; gap: 6px; }
.doc .note { padding: 12px 16px; border: 2px dashed var(--plum); border-radius: 16px; background: var(--yellow); font-weight: 600; }
.doc .doc__lead { font-size: 20px; line-height: 30px; font-weight: 500; }

/* Legal page: three parts with a small table of contents */
.toc { display: flex; flex-wrap: wrap; gap: 8px; }
.toc a { padding: 6px 14px; border: 2px solid var(--plum); border-radius: 999px; font-weight: 600; font-size: 15px; text-decoration: none; }
.doc__part { display: flex; flex-direction: column; gap: 14px; margin-top: 16px; padding-top: 32px; border-top: 2px solid var(--plum); }
.doc .doc__part > h2 { margin-top: 0; font: 800 clamp(30px, 3.6vw, 42px)/1.05 var(--display); letter-spacing: -0.02em; }
.doc h3 { margin-top: 10px; font: 700 20px/1.25 var(--display); }

.thanks__order { color: var(--muted); }
.thanks__order span { color: var(--plum); }

/* Printing the legal page: just the text. */
@media print {
  .skip, .hdr, .ftr, .note, .toc { display: none !important; }
  body { background: #fff; }
  .doc { max-width: none; padding: 0; }
  a { text-decoration: none; }
}

.thanks { display: flex; justify-content: center; padding: clamp(32px, 6vw, 72px) var(--gutter) clamp(56px, 8vw, 96px); }
.thanks__card { width: min(100%, 520px); display: flex; flex-direction: column; align-items: center; gap: 18px; padding: clamp(32px, 6vw, 48px) clamp(20px, 5vw, 40px); text-align: center; border: 3px solid var(--plum); border-radius: 40px; background: var(--pink-light); box-shadow: 4px 4px 0 var(--plum); }
.thanks__card > img { width: 110px; }
.thanks__title { font: 800 clamp(32px, 5vw, 44px)/1.02 var(--display); letter-spacing: -0.01em; text-wrap: balance; }
.thanks__text { font-size: 17px; line-height: 26px; }
.bonus { padding: 16px 20px; border: 2px solid var(--plum); border-radius: 4px; background: var(--cream); box-shadow: 2px 2px 0 var(--plum); transform: rotate(-2deg); }
.bonus .label { color: var(--muted); margin-bottom: 6px; }
.bonus blockquote { font: italic 500 22px/1.25 var(--display); }
.thanks__actions { align-self: stretch; display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.thanks__actions .btn { box-shadow: 2px 2px 0 var(--plum); }

/* ---------- Responsive ---------- */
/* Not enough room for everything in one row: drop the extra "buy cookies" button first. */
@media (max-width: 1080px) {
  .hdr__buy { display: none; }
}

/* Compact top bar: logo · basket · menu. The links move behind the menu button. */
@media (max-width: 1000px) {
  .hdr__in { padding-top: 12px; padding-bottom: 12px; column-gap: 12px; }
  .logo { height: 28px; }
  .hdr__basket-word { display: none; }
  .hdr__basket { padding: 0; }
  .hdr__menu { display: inline-flex; }

  /* The main links become a dropdown under the top bar. */
  .nav { display: none; position: fixed; top: var(--hdr-h); left: 0; right: 0; z-index: 35; flex-direction: column; gap: 0; padding: 8px var(--gutter) 16px; background: var(--cream); border-bottom: 2px solid var(--plum); }
  .nav.is-open { display: flex; }
  .nav a { padding: 12px 0; font-size: 20px; border-bottom: 1px solid var(--sand); }
  .nav a:last-child { border-bottom: 0; }
}

@media (max-width: 860px) {
  .hero { grid-template-columns: minmax(0, 1fr); grid-template-areas: "text" "art" "buy"; }

  /* Basket bar at the bottom while shopping */
  .bar.is-on { display: block; }
  .has-bar .ftr { padding-bottom: 90px; } /* so the bar never covers the footer */
}

@media (max-width: 640px) {
  .lead { font-size: 16px; line-height: 23px; }
  .foodinfo__list { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .foodinfo__list dd { margin-bottom: 8px; }
  .pack { display: grid; grid-template-columns: 116px minmax(0, 1fr); }
  .pack__img { display: flex; align-items: center; border-bottom: 0; border-right: 2px solid var(--plum); }
  .pack__desc { display: none; }
  .tag-badge { top: 8px; left: 8px; padding: 2px 6px; font-size: 10px; line-height: 14px; } /* fits inside the picture column */
}

/* The basket fills the screen on phones; tighter spacing as in the mobile design. */
@media (max-width: 600px) {
  .basket { border-left: 0; }
  .basket__head { padding: 12px 16px; }
  .basket__title { flex: 1; justify-content: space-between; }
  .basket__title h2 { font-size: 28px; }
  .basket__body { gap: 12px; padding: 12px 16px; }
  .meter { padding: 10px 14px 8px; }
  .meter__title { font-size: 16px; }
  .meter__note { font-size: 10px; line-height: 14px; }
  .nudge { grid-template-columns: 48px minmax(0, 1fr) auto; gap: 10px; padding: 8px 10px 8px 8px; }
  .nudge__text { font-size: 14px; line-height: 19px; }
  .nudge .btn { padding: 0 16px; }
  .lines { gap: 12px; }
  .line { grid-template-columns: 64px minmax(0, 1fr) auto; column-gap: 12px; row-gap: 4px; padding: 8px 10px; }
  .line__img { border-radius: 12px; }
  .line__name { font-size: 18px; }
  .line__detail { font-size: 13px; line-height: 18px; }
  .line__total { font-size: 18px; }
  .line__ctrl { gap: 10px; }
  .addons__row { margin-right: -16px; padding-right: 16px; }
  .addon { width: 196px; }
  .basket__foot { gap: 10px; padding: 12px 16px 16px; }
  .sum { font-size: 14px; line-height: 20px; row-gap: 2px; }
  .sum:not(.has-discount) .sum__sub { display: none; } /* keep it when a code makes the maths less obvious */
  .sum__note { font-size: 12px; line-height: 16px; }
  .sum__total { font-size: 17px; }
  .basket__foot .btn--lg { min-height: 54px; padding: 12px 20px; }
  .pay-note { font-size: 12px; line-height: 16px; }
  .pay-note__long { display: none; }
  .pay-note__short { display: inline; }
}

@media (max-width: 420px) {
  .logo { height: 22px; }
  .hdr__right { gap: 8px; }
  .badge { top: -8px; right: -6px; min-width: 22px; height: 22px; padding: 0 5px; font-size: 11px; line-height: 18px; }
}

/* Short screens (phones held sideways): the whole basket scrolls as one, so the
   checkout part at the bottom can't squeeze the items out of view. */
@media (max-height: 600px) {
  .basket { overflow-y: auto; overscroll-behavior: contain; }
  .basket__body { flex: none; overflow: visible; }
}

/* Small phones: a little tighter, so the top bar stays on one row. Below 350px the
   logo switches to the rainbow alone (see the <picture> in the header). */
@media (max-width: 380px) {
  :root { --gutter: 16px; }
  .hdr__in { column-gap: 8px; }
  .hdr__right { gap: 6px; }
  .logo { height: 20px; }
}
