/* Shared pieces of the demo stores. Every store sets its own tokens:
   --bg --ink --soft --line --brand --on-brand --r (corner) --body --display */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 1rem; line-height: 1.7; overflow-x: clip; }
img { display: block; max-width: 100%; }
h1, h2, h3, p, ul, figure, fieldset { margin: 0; padding: 0; }
h1, h2, h3 { text-wrap: balance; line-height: 1.2; font-family: var(--display); }
ul { list-style: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--focus, var(--brand)); outline-offset: 3px; }
.wrap { max-width: 1180px; margin-inline: auto; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); }

.ribbon { background: var(--ribbon, var(--ink)); color: var(--ribbon-ink, var(--bg)); font-size: .84rem; }
.ribbon .wrap { display: flex; justify-content: space-between; gap: 12px; padding-block: 8px; flex-wrap: wrap; }
.ribbon a { font-weight: 600; text-underline-offset: 4px; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 50px; padding: 10px 26px; border: 2px solid var(--brand); border-radius: var(--r); background: var(--brand); color: var(--on-brand); font-family: var(--body); font-weight: 700; text-decoration: none; transition: filter .15s, transform .1s; }
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: scale(.98); }
.btn.ghost { background: transparent; color: var(--ink); border-color: currentColor; }
.cart-btn { position: relative; min-height: 44px; padding: 6px 18px; border: 2px solid currentColor; border-radius: var(--r); background: none; font-weight: 700; }
.cart-btn b { display: inline-block; min-width: 1.5em; margin-inline-start: 6px; padding: 0 5px; border-radius: 99px; background: var(--brand); color: var(--on-brand); font-size: .82rem; text-align: center; }

.sheet { position: fixed; inset: 0 auto 0 0; width: min(440px, 100%); height: 100%; max-height: none; max-width: none; margin: 0; padding: 0; border: 0; background: var(--sheet, var(--bg)); color: var(--sheet-ink, var(--ink)); overflow-y: auto; overscroll-behavior: contain; }
.sheet[open] { display: flex; flex-direction: column; animation: slide .28s cubic-bezier(.2, .8, .2, 1); }
.sheet::backdrop { background: rgb(10 8 14 / .55); }
@keyframes slide { from { transform: translateX(-40px); opacity: .3; } }
.sheet-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: calc(16px + env(safe-area-inset-top, 0px)) 20px 14px; background: inherit; border-bottom: 1px solid var(--line); }
.sheet-head h2 { font-size: 1.35rem; }
.sheet-x { width: 44px; height: 44px; border: 0; background: none; font-size: 1.1rem; }
.sheet-body { flex: 1; display: flex; flex-direction: column; gap: 18px; padding: 20px; }
.sheet-foot { position: sticky; bottom: 0; display: grid; gap: 12px; padding: 16px 20px calc(16px + env(safe-area-inset-bottom, 0px)); background: inherit; border-top: 1px solid var(--line); }
.row { display: flex; justify-content: space-between; gap: 12px; font-variant-numeric: tabular-nums; }
.row.big { font-size: 1.12rem; padding-top: 10px; border-top: 1px solid var(--line); }
.lines { display: grid; gap: 16px; }
.lines li { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: 14px; align-items: center; }
.lines img { width: 72px; height: 84px; object-fit: cover; border-radius: min(var(--r), 14px); }
.lines strong, .lines small, .lines span { display: block; }
.lines small { opacity: .7; }
.qty { display: grid; justify-items: center; border: 1px solid var(--line); border-radius: min(var(--r), 14px); }
.qty button { width: 40px; height: 34px; border: 0; background: none; font-size: 1.1rem; }
.free { display: grid; gap: 8px; font-size: .92rem; }
.free i { display: block; height: 8px; border-radius: 9px; background: var(--line); overflow: hidden; }
.free b { display: block; height: 100%; border-radius: 9px; background: var(--brand); transition: width .3s; }
.co { display: grid; gap: 14px; }
.co label { display: grid; gap: 4px; font-weight: 600; font-size: .95rem; }
.co input, .co select { width: 100%; min-height: 50px; padding: 8px 14px; border: 1.5px solid var(--line); border-radius: min(var(--r), 14px); background: var(--field, #fff); color: var(--field-ink, #1b1b1f); font-weight: 400; }
.co input[dir=ltr] { text-align: right; }
.co-err { padding: 10px 14px; border-radius: 10px; background: #fde5e2; color: #8e1b12; font-weight: 600; }
.co-note, .sheet-empty { font-size: .9rem; opacity: .75; }
.done { align-items: stretch; }
.done-no { font-size: 2.4rem; font-weight: 800; direction: ltr; text-align: right; font-family: var(--display); }
.pd-img { width: 100%; aspect-ratio: 4 / 4.4; object-fit: cover; border-radius: var(--r); }
.price { display: flex; gap: 10px; align-items: baseline; font-variant-numeric: tabular-nums; }
.price b { font-size: 1.15em; }
.price s { opacity: .6; }
.opts { display: flex; flex-wrap: wrap; gap: 8px; border: 0; }
.opts legend { font-weight: 700; margin-bottom: 8px; }
.opts input { position: absolute; opacity: 0; }
.opts span { display: grid; place-items: center; min-width: 50px; min-height: 46px; padding: 4px 16px; border: 1.5px solid var(--line); border-radius: min(var(--r), 14px); cursor: pointer; }
.opts input:checked + span { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.opts input:focus-visible + span { outline: 3px solid var(--focus, var(--brand)); outline-offset: 2px; }

.next { border-top: 1px solid var(--line); } .next:has(~ .bar) { padding-bottom: 80px; } .next .wrap { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding-block: 8px; }
.next a { display: grid; padding-block: 14px; text-decoration: none; font-weight: 700; font-size: 1.2rem; } .next a:nth-child(2) { text-align: center; } .next a:nth-child(3) { text-align: left; } .next small { font-size: .85rem; font-weight: 400; opacity: .75; } .next a:hover { text-decoration: underline; text-underline-offset: 6px; }
@view-transition { navigation: auto; }
@media (max-width: 560px) {
  .sheet { inset: auto 0 0 0; width: 100%; height: auto; max-height: 92%; border-radius: 22px 22px 0 0; }
  @keyframes slide { from { transform: translateY(60px); opacity: .3; } }
  .sheet-head { padding-top: 14px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
