/* Ssentezo Commerce — buyer pages. Hand-written, no build step, ~8 KB. */
:root {
  --accent: #0f766e;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --success: #15803d;
  --success-bg: #dcfce7;
  --warning: #b45309;
  --warning-bg: #fef3c7;
  --danger: #b91c1c;
  --danger-bg: #fee2e2;
  --radius: 14px;
  --shadow: 0 1px 2px rgb(15 23 42 / 6%), 0 8px 24px rgb(15 23 42 / 6%);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1120;
    --surface: #111827;
    --text: #e5e7eb;
    --muted: #94a3b8;
    --line: #1f2937;
    --success: #4ade80;
    --success-bg: #052e16;
    --warning: #fbbf24;
    --warning-bg: #3b2a05;
    --danger: #f87171;
    --danger-bg: #3f0d0d;
    --shadow: none;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-variant-numeric: tabular-nums;
}
a { color: inherit; }
img { max-width: 100%; display: block; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.topbar .wrap { display: flex; align-items: center; gap: 12px; height: 56px; }
.topbar .brand { display: flex; align-items: center; gap: 10px; font-weight: 650; text-decoration: none; min-width: 0; }
.topbar .brand span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .spacer { flex: 1; }
.avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; flex: none; }
.bag-link { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; background: var(--accent); color: #fff; text-decoration: none; font-weight: 600; font-size: 14px; }
.bag-link svg { width: 18px; height: 18px; }

/* Banners */
.banner { padding: 10px 16px; text-align: center; font-size: 14px; }
.banner.preview { background: var(--warning-bg); color: var(--warning); }
.flash { margin: 16px 0; padding: 12px 14px; border-radius: 12px; font-size: 15px; }
.flash.ok { background: var(--success-bg); color: var(--success); }
.flash.error { background: var(--danger-bg); color: var(--danger); }

/* Store header */
.hero { position: relative; aspect-ratio: 16 / 6; max-height: 320px; width: 100%; background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #000)); overflow: hidden; }
.hero img { width: 100%; height: 100%; object-fit: cover; }
.store-head { display: flex; gap: 16px; align-items: flex-end; margin-top: -40px; position: relative; }
.store-head .logo { width: 88px; height: 88px; border-radius: 20px; border: 4px solid var(--surface); background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 34px; font-weight: 700; object-fit: cover; box-shadow: var(--shadow); flex: none; }
.store-head > div:last-child { padding-top: 46px; min-width: 0; }
.store-head h1 { margin: 0 0 4px; font-size: 24px; line-height: 1.2; }
.verified { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); padding: 2px 8px; border-radius: 999px; vertical-align: middle; }
.meta { color: var(--muted); font-size: 14px; }
.bio { margin: 12px 0 0; color: var(--muted); max-width: 640px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); text-decoration: none; font-size: 14px; font-weight: 550; cursor: pointer; color: var(--text); }
.chip:hover { border-color: var(--accent); }

/* Product grid */
.section-title { font-size: 18px; margin: 28px 0 12px; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; } }
@media (min-width: 900px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.card { background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--line); text-decoration: none; display: flex; flex-direction: column; transition: transform .15s ease-out; }
.card:hover { transform: translateY(-2px); }
.card .thumb { aspect-ratio: 1; background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.card .body { padding: 10px 12px 12px; }
.card .title { font-size: 15px; font-weight: 550; margin: 0 0 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.price { font-weight: 700; }
.compare { color: var(--muted); text-decoration: line-through; font-weight: 400; font-size: 14px; margin-left: 6px; }
.tag { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--warning-bg); color: var(--warning); margin-top: 6px; }
.tag.out { background: var(--line); color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding: 48px 16px; background: var(--surface); border-radius: var(--radius); border: 1px dashed var(--line); }

/* Product page */
.product { display: grid; gap: 24px; margin: 20px 0 40px; }
@media (min-width: 860px) { .product { grid-template-columns: 1.1fr 1fr; gap: 40px; } }
.gallery { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; border-radius: var(--radius); }
.gallery img { flex: 0 0 100%; scroll-snap-align: start; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius); background: var(--surface); }
.gallery .placeholder { flex: 0 0 100%; aspect-ratio: 1; border-radius: var(--radius); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
.dots { display: flex; justify-content: center; gap: 6px; margin-top: 8px; }
.dots span { width: 6px; height: 6px; border-radius: 50%; background: var(--line); }
.product h1 { font-size: 26px; line-height: 1.2; margin: 0 0 8px; }
.product .price { font-size: 22px; }
.desc { color: var(--text); opacity: .9; }
.desc p { margin: 0 0 12px; }
fieldset { border: 0; padding: 0; margin: 20px 0; }
legend { font-weight: 600; font-size: 14px; margin-bottom: 8px; }
.options { display: flex; flex-wrap: wrap; gap: 8px; }
.option input { position: absolute; opacity: 0; pointer-events: none; }
.option span { display: inline-block; padding: 10px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; font-size: 14px; min-width: 48px; text-align: center; }
.option input:checked + span { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 25%, transparent); font-weight: 600; }
.option input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.option input:disabled + span { opacity: .45; text-decoration: line-through; cursor: not-allowed; }
.option small { display: block; color: var(--muted); font-size: 12px; }

/* Forms and buttons */
.btn { display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 48px; padding: 12px 20px; border-radius: 999px; border: 0; font: inherit; font-weight: 650; cursor: pointer; text-decoration: none; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { background: transparent; border: 1.5px solid var(--line); color: var(--text); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .6; cursor: progress; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-row .btn { flex: 1 1 160px; }
label.field { display: block; margin: 0 0 14px; }
label.field span { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
label.field small { color: var(--muted); font-weight: 400; }
input[type=text], input[type=tel], input[type=email], textarea, select {
  width: 100%; font: inherit; padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); color: var(--text);
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
.qty { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--surface); }
.qty button { width: 40px; height: 40px; border: 0; background: transparent; font-size: 20px; cursor: pointer; color: var(--text); }
.qty input { width: 44px; text-align: center; border: 0; padding: 0; background: transparent; box-shadow: none; }
.error-text { color: var(--danger); font-size: 13px; margin-top: 4px; }

/* Bag and checkout */
.panel { background: var(--surface); border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow); padding: 16px; }
.checkout { display: grid; gap: 20px; margin: 20px 0 48px; }
@media (min-width: 860px) { .checkout { grid-template-columns: 1.2fr 1fr; align-items: start; } }
.line { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.line:last-child { border-bottom: 0; }
.line img, .line .ph { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
.line .name { font-weight: 600; font-size: 15px; }
.line .sub { color: var(--muted); font-size: 13px; }
.line .controls { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.link-btn { background: none; border: 0; color: var(--muted); font: inherit; font-size: 13px; text-decoration: underline; cursor: pointer; padding: 0; }
.totals { display: flex; justify-content: space-between; align-items: baseline; padding-top: 12px; margin-top: 4px; border-top: 1px solid var(--line); }
.totals strong { font-size: 22px; }
.secure { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 13px; margin-top: 12px; }
.secure svg { width: 16px; height: 16px; flex: none; }
.notice { font-size: 13px; color: var(--muted); }

/* Live payment status */
.status { text-align: center; padding: 28px 16px; }
.status h1 { font-size: 22px; margin: 16px 0 8px; }
.status p { color: var(--muted); margin: 0 auto 12px; max-width: 420px; }
.pulse { width: 88px; height: 88px; margin: 0 auto; border-radius: 50%; background: color-mix(in srgb, var(--accent) 14%, transparent); display: grid; place-items: center; position: relative; }
.pulse::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--accent); animation: ring 1.6s ease-out infinite; }
.pulse svg { width: 40px; height: 40px; color: var(--accent); }
@keyframes ring { from { transform: scale(.9); opacity: .9; } to { transform: scale(1.35); opacity: 0; } }
.badge-ok { width: 88px; height: 88px; margin: 0 auto; border-radius: 50%; background: var(--success-bg); color: var(--success); display: grid; place-items: center; animation: pop .35s ease-out; }
.badge-ok svg { width: 44px; height: 44px; }
.badge-bad { width: 88px; height: 88px; margin: 0 auto; border-radius: 50%; background: var(--danger-bg); color: var(--danger); display: grid; place-items: center; }
.badge-bad svg { width: 40px; height: 40px; }
@keyframes pop { from { transform: scale(.6); } to { transform: scale(1); } }
.countdown { font-weight: 700; color: var(--text); }
.receipt { margin-top: 20px; text-align: left; }
.receipt dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; font-size: 14px; }
.receipt dt { color: var(--muted); }
.receipt dd { margin: 0; text-align: right; font-weight: 550; }
.steps { display: flex; gap: 6px; margin: 16px 0 0; }
.steps span { flex: 1; height: 6px; border-radius: 999px; background: var(--line); }
.steps span.on { background: var(--accent); }
[hidden] { display: none !important; }

/* Footer */
.footer { border-top: 1px solid var(--line); margin-top: 32px; padding: 20px 0 40px; color: var(--muted); font-size: 13px; }
.footer .wrap { display: flex; flex-wrap: wrap; gap: 8px 16px; justify-content: space-between; }
.pager { display: flex; justify-content: center; gap: 8px; margin: 24px 0; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 12px 18px; border-radius: 12px; font-size: 14px; box-shadow: var(--shadow); z-index: 20; max-width: calc(100% - 32px); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Utilities (no inline styles: the page's CSP blocks them) */
.mt-0 { margin-top: 0; }
.narrow { max-width: 640px; }
.center { text-align: center; }
.retry-form { max-width: 360px; margin: 16px auto 0; text-align: left; }
.line.plain { grid-template-columns: 1fr auto; }
.receipt .facts { margin-top: 12px; }
.notice.center { margin-top: 16px; }

/* Delivery choice */
.delivery { margin: 4px 0 8px; }
.choice { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1.5px solid var(--line); border-radius: 12px; margin-bottom: 8px; cursor: pointer; background: var(--surface); }
.choice:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 20%, transparent); }
.choice input { margin-top: 4px; accent-color: var(--accent); }
.choice small { display: block; color: var(--muted); font-size: 13px; }
.small-totals { border-top: 0; margin-top: 0; padding-top: 4px; font-size: 14px; color: var(--muted); }
.mt-gap { margin-top: 20px; }
form .totals { margin-bottom: 16px; }

/* Events */
.event-hero { aspect-ratio: 16 / 7; }
.event-facts { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; font-size: 15px; }
.event-facts a { color: var(--accent); }
.tier { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.tier .name { font-weight: 650; }
.tier .sub { color: var(--muted); font-size: 13px; }
.tier.off { opacity: .6; }
.unlock { display: flex; gap: 8px; align-items: flex-end; margin-top: 12px; }
.unlock .field { flex: 1; margin: 0; }
.event-card { display: grid; grid-template-columns: 72px 1fr; gap: 12px; align-items: center; padding: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; margin-bottom: 10px; }
.event-card .date { text-align: center; border-radius: 12px; background: color-mix(in srgb, var(--accent) 12%, var(--surface)); padding: 8px 0; color: var(--accent); font-weight: 700; line-height: 1.1; }
.event-card .date span { display: block; font-size: 24px; }
.ticket { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 16px 0; text-align: center; background: var(--surface); }
.ticket .qr { width: 240px; max-width: 100%; margin: 8px auto; background: #fff; padding: 10px; border-radius: 12px; }
.ticket .qr svg { width: 100%; height: auto; display: block; }
.ticket .serial { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 18px; letter-spacing: 2px; font-weight: 700; }
.ticket.used .qr { opacity: .35; }
