/* Shared shop components: cards, filters, quick view, cart drawer, checkout. Each option defines its own tokens and layout.
   Tokens an option must define: --bg --surface --ink --muted --line --sky --accent --accent-ink --good --font-display --font-body --radius */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 16px; line-height: 1.5;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
h1, h2, h3 { font-family: var(--font-display); line-height: 1.1; margin: 0; text-wrap: balance; }
p { margin: 0; }
img { max-width: 100%; }
button, select, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
.wrap { max-width: var(--maxw, 1180px); margin: 0 auto; }

.btn { border: 2px solid var(--ink); background: transparent; padding: 11px 20px; font-weight: 600; border-radius: var(--radius, 4px); text-decoration: none; display: inline-block; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn:hover { filter: brightness(1.08); }
.btn[disabled] { opacity: 0.4; cursor: not-allowed; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--surface); padding: 7px 14px; border-radius: 999px; font-weight: 500; font-size: 15px; display: inline-flex; gap: 8px; align-items: baseline; }
.chip .n { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip[aria-pressed="true"] .n { color: inherit; opacity: 0.7; }
.field-input, .tools input, .tools select { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius, 4px); padding: 9px 12px; min-width: 0; }
.count { color: var(--muted); font-size: 14px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--card-min, 230px), 1fr)); gap: var(--gap, 20px); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius, 6px); display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.art { background: var(--sky); aspect-ratio: var(--art-ratio, 10 / 7); display: grid; place-items: center; width: 100%; border: 0; padding: 0; overflow: hidden; }
.art svg { width: 100%; height: 100%; padding: 12px; }
.ph { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center 30%; }
.card .body { padding: 14px 14px 16px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card h3 { font-size: 18px; line-height: 1.2; }
.card .meta { color: var(--muted); font-size: 14px; display: flex; justify-content: space-between; gap: 8px; }
.price { font-family: var(--font-display); font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.opts { display: grid; gap: 8px; }
.opts select { width: 100%; min-width: 0; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius, 4px); padding: 8px; }
.row { display: flex; gap: 8px; margin-top: auto; }
.add { flex: 1; background: var(--accent); color: var(--accent-ink); border: 0; border-radius: var(--radius, 4px); padding: 10px 14px; font-weight: 600; white-space: nowrap; }
.add:hover { filter: brightness(1.08); }
.hint { color: var(--accent); font-size: 13px; min-height: 18px; }
.link { background: none; border: 0; padding: 0; text-decoration: underline; color: var(--muted); font-size: 14px; text-align: left; }
.empty { padding: 40px 0; color: var(--muted); grid-column: 1 / -1; }

/* tile cards: photo first, almost no chrome */
.card.tile { background: transparent; border: 0; border-radius: 0; overflow: visible; }
.card.tile .art { aspect-ratio: 4 / 5; border-radius: var(--radius, 4px); }
.card.tile .body { padding: 12px 2px 0; gap: 6px; }
.card.tile .meta { align-items: baseline; }
.card.tile .price { font-size: 20px; }
.card.tile .add { margin-top: 6px; background: transparent; color: var(--ink); border: 1px solid var(--line); }
.card.tile .add:hover { border-color: var(--accent); filter: none; }

.info { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 28px 36px; }
.info h3 { font-size: 20px; margin-bottom: 8px; }
.info p, .info li { color: var(--muted); font-size: 15px; }
.info ul { margin: 0; padding-left: 18px; }
.vault { border: 2px solid var(--ink); border-radius: var(--radius, 6px); padding: 22px; display: flex; gap: 20px; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.vault h3 { font-size: 24px; }
.vault p { color: var(--muted); max-width: 60ch; margin-top: 6px; }
.foot { border-top: 1px solid var(--line); padding-block: 26px 90px; color: var(--muted); font-size: 14px; display: flex; gap: 12px 32px; flex-wrap: wrap; justify-content: space-between; }
.demo { font-size: 13px; color: var(--muted); }

.fab { position: fixed; right: calc(16px + env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); background: var(--ink); color: var(--bg); border: 0; border-radius: 999px; padding: 13px 20px; font-weight: 600; box-shadow: 0 6px 22px rgba(0, 0, 0, 0.3); z-index: 20; }
.fab .n { background: var(--accent); color: var(--accent-ink); border-radius: 999px; padding: 1px 9px; margin-left: 8px; font-variant-numeric: tabular-nums; }
.scrim { position: fixed; inset: 0; background: rgba(5, 12, 18, 0.6); z-index: 30; }
.panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100%); background: var(--surface); color: var(--ink); z-index: 31; display: flex; flex-direction: column; padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); border-left: 1px solid var(--line); }
.panel header { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.panel header h2 { font-size: 24px; }
.x { background: none; border: 0; font-size: 28px; line-height: 1; padding: 4px 8px; }
.panel .scroll { overflow-y: auto; padding: 8px 20px; flex: 1; }
.panel footer { border-top: 1px solid var(--line); padding: 16px 20px; display: grid; gap: 10px; }
.ship { height: 8px; background: var(--sky); border-radius: 999px; overflow: hidden; }
.ship i { display: block; height: 100%; background: var(--good); transition: width 0.25s; }
.shiptxt { font-size: 14px; color: var(--muted); }
.line { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); align-items: start; }
.line .thumb { background: var(--sky); border-radius: 4px; overflow: hidden; }
.line .thumb .ph { aspect-ratio: 1; }
.line .t { font-weight: 600; line-height: 1.25; }
.line .s { font-size: 14px; color: var(--muted); }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 4px; margin-top: 8px; }
.qty button { background: none; border: 0; width: 30px; height: 30px; font-size: 18px; }
.qty span { min-width: 26px; text-align: center; font-variant-numeric: tabular-nums; }
.sum { display: flex; justify-content: space-between; font-variant-numeric: tabular-nums; }
.sum.total { font-weight: 700; font-size: 18px; }
.modal { position: fixed; z-index: 31; inset: 0; display: grid; place-items: center; padding: 16px; pointer-events: none; }
.modal .box { pointer-events: auto; background: var(--surface); color: var(--ink); border-radius: 8px; width: min(820px, 100%); max-height: 100%; overflow-y: auto; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); border: 1px solid var(--line); }
.modal .pic { background: var(--sky); display: grid; place-items: center; }
.modal .pic .ph { aspect-ratio: 4 / 5; max-height: 80vh; }
.modal .pic svg { padding: 24px; }
.modal .txt { padding: 24px; display: grid; gap: 12px; align-content: start; position: relative; }
.modal .txt h2 { font-size: 28px; padding-right: 36px; }
.modal .txt .x { position: absolute; top: 12px; right: 12px; }
.modal ul { margin: 0; padding-left: 18px; color: var(--muted); }
.field { display: grid; gap: 4px; font-size: 14px; color: var(--muted); }
.field input, .field select { background: var(--bg); border: 1px solid var(--line); border-radius: 4px; padding: 9px; color: var(--ink); width: 100%; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ok { color: var(--good); font-weight: 600; }
@media (max-width: 760px) {
  .modal .box { grid-template-columns: minmax(0, 1fr); }
  .two { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { .ship i { transition: none; } html { scroll-behavior: auto; } }
