:root {
  --flour: #FDFCF8;
  --ink: #1E2A4A;
  --ink-soft: #4C5775;
  --gingham: #6E97D3;
  --tint: #E7EEF9;
  --butter: #F3C246;
  --butter-deep: #E5AE22;
  --line: #D5DBE8;
  --alert: #B3361F;
  --display: "Bricolage Grotesque", "Trebuchet MS", system-ui, sans-serif;
  --body: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--flour);
  color: var(--ink);
  font: 400 1.0625rem/1.5 var(--body);
  padding-bottom: 6.5rem;
}

h1, h2 { font-family: var(--display); line-height: 1.15; 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;
}

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

/* ---------- masthead: gingham tablecloth with the logo on a tag ---------- */
.band {
  height: 112px;
  background-color: #fff;
  background-image:
    linear-gradient(rgba(110, 151, 211, .5) 50%, transparent 50%),
    linear-gradient(90deg, rgba(110, 151, 211, .5) 50%, transparent 50%);
  background-size: 32px 32px;
  border-bottom: 3px solid var(--ink);
}
.masthead { text-align: center; padding: 0 1rem 1rem; }
.tag {
  display: inline-block;
  margin-top: -64px;
  min-width: 132px;
  padding: .6rem .9rem;
  background: var(--flour);
  border: 3px solid var(--ink);
  border-radius: 18px;
}
.tag img { display: block; margin: 0 auto; height: auto; width: auto; max-height: 112px; max-width: min(260px, 70vw); }
.brand { font-size: clamp(1.7rem, 6vw, 2.4rem); font-weight: 800; padding: .15rem .4rem; }
.tagline { margin: .8rem 0 0; color: var(--ink-soft); }

/* ---------- shelf ---------- */
main { max-width: 680px; margin: 0 auto; padding: 0 1rem; }
section { margin-top: 1.4rem; }
section h2 { font-size: 1.6rem; font-weight: 800; }
.rows { list-style: none; margin: .4rem 0 0; padding: 0; }

.row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .25rem 1rem;
  align-items: center;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
}
.row-head { display: flex; align-items: baseline; gap: .5rem; }
.name { font-family: var(--display); font-weight: 700; font-size: 1.2rem; }
.leader { flex: 1; min-width: 1rem; border-bottom: 2px dotted var(--gingham); transform: translateY(-.3rem); }
.price { font-weight: 700; font-variant-numeric: tabular-nums; }
.desc { margin: .15rem 0 0; color: var(--ink-soft); font-size: .98rem; }
.stock { margin: .2rem 0 0; font-size: .9rem; color: var(--ink-soft); }
.stock.low { color: var(--alert); font-weight: 600; }
.stock.out { color: var(--alert); font-weight: 700; }
.row.soldout .name, .row.soldout .price { opacity: .5; }
.row-action { min-width: 96px; text-align: right; }

#bundles { margin-top: .8rem; }
.row.bundle {
  background: var(--tint);
  border: 2px solid var(--ink);
  border-radius: 14px;
  padding: 1rem;
  margin-bottom: .8rem;
}
.includes { margin: .25rem 0 0; font-size: .95rem; }

/* ---------- buttons ---------- */
.btn {
  font: 700 1rem var(--body);
  color: var(--ink);
  background: var(--butter);
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: .55rem 1.3rem;
  min-height: 44px;
  cursor: pointer;
}
.btn:hover:not(:disabled) { background: var(--butter-deep); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.quiet { background: transparent; }
.btn.quiet:hover:not(:disabled) { background: var(--tint); }

.stepper { display: inline-flex; align-items: center; background: #fff; border: 2px solid var(--ink); border-radius: 999px; }
.stepper button {
  width: 44px; height: 40px; border: 0; background: none; border-radius: 999px;
  font: 700 1.3rem var(--body); color: var(--ink); cursor: pointer;
}
.stepper button:hover:not(:disabled) { background: var(--tint); }
.stepper button:disabled { opacity: .3; cursor: not-allowed; }
.stepper span { min-width: 1.6rem; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }

.linkbtn { background: none; border: 0; padding: .3rem 0; font: inherit; font-size: .95rem; color: var(--ink-soft); text-decoration: underline; cursor: pointer; }

.empty, .notice { color: var(--ink-soft); padding: 1.2rem 0; }
.notice { color: var(--alert); font-weight: 600; }

/* ---------- news blurb ---------- */
.news {
  max-width: 680px;
  margin: 2.5rem auto 0;
  padding: 1.1rem 1.2rem;
  background: var(--tint);
  border-top: 3px solid var(--ink);
}
.news h2 { font-size: 1.2rem; font-weight: 800; margin-bottom: .3rem; }
.news p { margin: 0; white-space: pre-line; }
@media (min-width: 720px) { .news { border-radius: 14px; border: 2px solid var(--ink); } }

/* ---------- cart bar ---------- */
.cartbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  background: var(--ink); color: var(--flour);
  padding: .7rem 1rem calc(.7rem + env(safe-area-inset-bottom));
}
.cartbar-inner { max-width: 680px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.cartbar-sum { font-weight: 600; }
.cartbar-sum strong { font-family: var(--display); font-size: 1.15rem; }

/* ---------- order dialog ---------- */
dialog {
  width: 100%; max-width: none; max-height: 92dvh; margin: auto 0 0; padding: 0; border: 0;
  background: var(--flour); color: var(--ink);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -8px 40px rgba(30, 42, 74, .3);
}
dialog::backdrop { background: rgba(30, 42, 74, .55); }
@media (min-width: 640px) { dialog { max-width: 520px; margin: auto; border-radius: 20px; } }

.sheet { padding: 1.25rem 1.25rem 1.5rem; }
.sheet h2 { font-size: 1.6rem; font-weight: 800; }

.lines { list-style: none; margin: 1rem 0 0; padding: 0; }
.line { display: grid; grid-template-columns: 1fr auto; gap: .2rem .8rem; align-items: center; padding: .8rem 0; border-bottom: 1px solid var(--line); }
.lname { font-weight: 700; }
.lname small { display: block; font-weight: 400; color: var(--ink-soft); }
.ltotal { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.lrm { text-align: right; }

.total { display: flex; justify-content: space-between; font-family: var(--display); font-size: 1.4rem; font-weight: 800; padding: .8rem 0 1rem; }

.field { display: block; margin: 0 0 .9rem; }
.field span { display: block; font-weight: 600; margin-bottom: .25rem; }
.field input {
  width: 100%; min-height: 46px; padding: .6rem .8rem;
  font: inherit; color: var(--ink); background: #fff;
  border: 2px solid var(--ink); border-radius: 10px;
}

.sure { display: flex; gap: .7rem; align-items: flex-start; margin: 1rem 0; padding: .85rem; background: var(--tint); border-radius: 10px; font-weight: 600; cursor: pointer; }
.sure input { flex: none; width: 1.35rem; height: 1.35rem; margin-top: .1rem; accent-color: var(--ink); }

.err { min-height: 1.4em; margin: .4rem 0; color: var(--alert); font-weight: 600; }
.actions { display: flex; flex-wrap: wrap; gap: .7rem; }
.actions .primary { flex: 1; }
.done p { margin: .6rem 0 1.2rem; }
