:root {
  --bg: #f4f6f9;
  --bg-glow: #e8eef7;
  --surface: #ffffff;
  --surface-2: #f6f7f9;
  --text: #0b1220;
  --muted: #6b7280;
  --line: #e5e7eb;
  --line-strong: #d1d5db;
  --accent: #0ea5e9;
  --accent-soft: color-mix(in srgb, var(--accent) 9%, transparent);
  --primary: #0b1220;
  --primary-text: #ffffff;
  --danger: #dc2626;
  --ok: #059669;
  --radius: 16px;
  --shadow: 0 1px 2px rgb(15 23 42 / 0.04), 0 12px 40px rgb(15 23 42 / 0.06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0d14;
    --bg-glow: #111827;
    --surface: #121722;
    --surface-2: #171d2a;
    --text: #eef2f8;
    --muted: #94a0b4;
    --line: #232b3a;
    --line-strong: #323c50;
    --primary: #eef2f8;
    --primary-text: #0b1220;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 12px 40px rgb(0 0 0 / 0.35);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: radial-gradient(1200px 600px at 25% 40%, var(--bg-glow), transparent 70%), var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }

.announce {
  background: var(--primary);
  color: var(--primary-text);
  text-align: center;
  font-size: 13px;
  padding: 8px 16px;
}

/* ---------- Top bar ---------- */
.topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 18px clamp(16px, 4vw, 40px);
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; letter-spacing: -0.02em; color: inherit; text-decoration: none; }
.brand img { border-radius: 10px; box-shadow: 0 0 0 1px var(--line); background: #fff; }
.tabs {
  display: flex;
  gap: 4px;
  padding: 5px;
  background: color-mix(in srgb, var(--surface) 65%, var(--line));
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow-x: auto;
  scrollbar-width: none;
  max-width: 100%;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  border: 0;
  background: transparent;
  padding: 9px 18px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  color: var(--muted);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background-color .2s, color .2s, box-shadow .2s;
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgb(15 23 42 / .12); }
.swatch { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.top-actions { justify-self: end; }
.ghost-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: transparent; border: 1px solid transparent; border-radius: 999px;
  padding: 8px 12px; font-size: 14px; font-weight: 500;
}
.ghost-btn:hover { background: var(--surface); border-color: var(--line); }

/* ---------- Layout ---------- */
.layout {
  flex: 1;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px clamp(16px, 4vw, 40px) 48px;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: clamp(24px, 4vw, 56px);
  align-items: start;
}
.showcase { position: sticky; top: 24px; display: flex; flex-direction: column; align-items: center; text-align: center; padding-top: 40px; }
.stage { width: min(100%, 440px); aspect-ratio: 1; display: grid; place-items: center; position: relative; }
.stage::before {
  content: ""; position: absolute; inset: 12%;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%);
  filter: blur(30px);
  z-index: 0;
}
.stage > * { position: relative; z-index: 1; }
.stage img { width: 100%; height: 100%; object-fit: contain; border-radius: 24px; animation: fade .45s ease; }
.stage svg { width: 78%; height: 78%; animation: fade .45s ease; }
.stage svg .spin { transform-origin: 50% 50%; animation: spin 18s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .stage svg .spin, .stage img, .stage svg { animation: none; } }
.show-name { margin: 20px 0 6px; font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.show-desc { margin: 0; max-width: 380px; color: var(--muted); font-size: 14px; line-height: 1.55; }
.dots { display: flex; gap: 6px; margin-top: 18px; }
.dots button { width: 7px; height: 7px; padding: 0; border-radius: 99px; border: 0; background: var(--line-strong); transition: width .25s, background-color .25s; }
.dots button[aria-current="true"] { width: 22px; background: var(--muted); }

/* ---------- Card ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: clamp(20px, 3vw, 30px);
}
.buy h1 { margin: 0; font-size: clamp(28px, 3.4vw, 36px); font-weight: 800; letter-spacing: -0.03em; }
.lead { margin: 6px 0 22px; font-size: 15px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.field { margin-bottom: 22px; }
.row-between { display: flex; align-items: center; justify-content: space-between; }
.row-between .label { margin: 0; }
.label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 10px; }
.hint { font-size: 12px; color: var(--muted); margin: 8px 0 0; }

.plans { display: grid; gap: 10px; }
.plan {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px;
  text-align: left; width: 100%;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 14px;
  padding: 14px 16px;
  transition: border-color .15s, background-color .15s;
}
.plan:hover:not(:disabled) { border-color: var(--line-strong); }
.plan[aria-checked="true"] { border-color: var(--accent); background: var(--accent-soft); }
.plan:disabled { opacity: .5; cursor: not-allowed; }
.radio { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--line-strong); display: grid; place-items: center; }
[aria-checked="true"] > .radio { background: var(--accent); border-color: var(--accent); }
[aria-checked="true"] > .radio::after { content: ""; width: 7px; height: 4px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.plan-name { font-weight: 600; font-size: 14px; }
.plan-sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
.plan-price { text-align: right; white-space: nowrap; }
.plan-price small { font-size: 11px; font-weight: 600; color: var(--muted); margin-right: 4px; }
.plan-price strong { font-size: 19px; letter-spacing: -0.02em; }
.plan-price span { font-size: 11px; color: var(--muted); margin-left: 2px; }

.stepper { display: inline-flex; align-items: center; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 3px; }
.stepper button { width: 34px; height: 34px; border: 0; border-radius: 9px; background: transparent; font-size: 18px; color: var(--muted); }
.stepper button:not(:disabled):hover { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgb(0 0 0 / .08); }
.stepper button:disabled { opacity: .35; cursor: not-allowed; }
.stepper output { min-width: 40px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }

.input-wrap { position: relative; }
.input-wrap svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
input[type="email"], input[type="text"], input[type="search"], .lookup input, .modal input, textarea {
  width: 100%; border: 1px solid var(--line); background: var(--surface-2); border-radius: 12px;
  padding: 13px 14px; font-size: 16px; transition: border-color .15s, background-color .15s;
}
.input-wrap input { padding-left: 40px; }
input:focus, textarea:focus { outline: none; border-color: var(--accent); background: var(--surface); }
input.invalid { border-color: var(--danger); }

.methods { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.method {
  display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; text-align: left;
  border: 1.5px solid var(--line); background: var(--surface); border-radius: 14px; padding: 12px;
}
.method[aria-checked="true"] { border-color: var(--accent); background: var(--accent-soft); }
.badge { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 17px; }
.method-name { font-weight: 600; font-size: 14px; }
.method-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }

.agree { display: flex; gap: 10px; align-items: center; font-size: 13px; color: var(--muted); margin: 4px 0 20px; cursor: pointer; }
.agree input { width: 17px; height: 17px; accent-color: var(--accent); margin: 0; }
.link { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }

.total { display: flex; justify-content: space-between; align-items: flex-end; border-top: 1px solid var(--line); padding-top: 18px; margin-bottom: 16px; }
.total .label { margin: 0; }
.total .hint { margin-top: 4px; }
.amount small { font-size: 12px; font-weight: 600; margin-right: 6px; color: var(--muted); }
.amount strong { font-size: 30px; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }

.primary-btn {
  width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--primary); color: var(--primary-text); border: 0; border-radius: 14px;
  padding: 15px 18px; font-weight: 600; font-size: 15px;
  transition: transform .12s ease, opacity .15s;
}
.primary-btn:hover { opacity: .92; }
.primary-btn:active { transform: scale(.98); }
.primary-btn:disabled { opacity: .5; cursor: progress; }
.secondary-btn {
  width: 100%; background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 13px 18px; font-weight: 600;
}
.form-error { color: var(--danger); font-size: 13px; min-height: 0; margin: 0 0 10px; }
.form-error:empty { display: none; }

.empty { grid-column: 1 / -1; max-width: 520px; margin: 40px auto; text-align: center; }

.footer { display: flex; justify-content: space-between; gap: 12px; padding: 22px clamp(16px, 4vw, 40px); border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.footer a { color: inherit; text-decoration: none; }
.footer a:hover { color: var(--text); }

/* ---------- Modal & drawer ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgb(8 12 20 / .45); backdrop-filter: blur(4px);
  display: grid; place-items: center; padding: 16px;
  animation: overlayIn .2s ease;
}
@keyframes overlayIn { from { opacity: 0; } }
.modal {
  position: relative; width: min(100%, 460px); max-height: calc(100vh - 32px); overflow: auto;
  background: var(--surface); border-radius: 24px; padding: 28px; box-shadow: 0 30px 80px rgb(0 0 0 / .25);
  animation: modalIn .25s cubic-bezier(.2, .9, .3, 1);
}
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.modal h2 { margin: 0 0 4px; font-size: 22px; letter-spacing: -0.02em; }
.close {
  position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border-radius: 50%;
  border: 0; background: var(--surface-2); font-size: 20px; line-height: 1; color: var(--muted);
}
.close.static { position: static; }
.close:hover { color: var(--text); }
.summary { margin: 18px 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.summary div { display: flex; justify-content: space-between; gap: 16px; padding: 11px 14px; font-size: 14px; }
.summary div + div { border-top: 1px solid var(--line); }
.summary span:first-child { color: var(--muted); }
.summary span:last-child { text-align: right; font-weight: 500; word-break: break-word; }
.summary .grand span:last-child { font-weight: 700; font-size: 16px; }
.stack { display: grid; gap: 10px; }
.order-id {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--surface-2); border: 1px dashed var(--line-strong); border-radius: 12px; padding: 12px 14px; margin: 16px 0;
}
.order-id code { font-size: 17px; font-weight: 700; letter-spacing: .04em; }
.copy { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 6px 10px; font-size: 12px; font-weight: 600; }
.qr { display: block; width: min(100%, 240px); margin: 6px auto 14px; border-radius: 14px; border: 1px solid var(--line); background: #fff; }
.instructions { white-space: pre-wrap; font-size: 14px; line-height: 1.55; background: var(--surface-2); border-radius: 12px; padding: 14px; margin: 0 0 14px; word-break: break-word; }
.delivery { white-space: pre-wrap; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; line-height: 1.6; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin: 0 0 10px; word-break: break-word; }
.status { white-space: nowrap; flex-shrink: 0;
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600;
  padding: 4px 10px; border-radius: 999px; background: var(--surface-2); color: var(--muted);
}
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status.pending { color: #b45309; background: #fef3c7; }
.status.review { color: #1d4ed8; background: #dbeafe; }
.status.paid { color: #0e7490; background: #cffafe; }
.status.delivered { color: #047857; background: #d1fae5; }
.status.cancelled { color: #b91c1c; background: #fee2e2; }
.terms-text { white-space: pre-wrap; font-size: 14px; line-height: 1.6; color: var(--muted); }
.success-icon { width: 52px; height: 52px; border-radius: 50%; background: #d1fae5; color: #047857; display: grid; place-items: center; margin-bottom: 14px; }

.drawer-overlay { place-items: stretch end; padding: 0; }
.drawer {
  width: min(100vw, 420px); height: 100%; background: var(--surface); overflow: auto;
  box-shadow: -20px 0 60px rgb(0 0 0 / .2); animation: drawerIn .28s cubic-bezier(.2, .9, .3, 1);
}
@keyframes drawerIn { from { transform: translateX(30px); opacity: 0; } }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 22px 22px 6px; }
.drawer-head h2 { margin: 0; font-size: 20px; }
.lookup { display: grid; gap: 10px; padding: 8px 22px 22px; border-bottom: 1px solid var(--line); }
.lookup p { margin: 0 0 4px; }
.pad { padding: 18px 22px 4px; }
.order-list { padding: 4px 14px 24px; display: grid; gap: 6px; }
.order-item {
  display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; text-align: left; width: 100%;
  border: 1px solid var(--line); background: var(--surface); border-radius: 14px; padding: 12px 14px;
}
.order-item:hover { border-color: var(--line-strong); }
.order-item .oid { font-weight: 700; font-size: 14px; }
.order-item .meta { font-size: 12px; color: var(--muted); }
.order-item .amt { font-weight: 600; font-size: 14px; text-align: right; }
.empty-note { padding: 8px 8px; font-size: 13px; color: var(--muted); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .topbar { grid-template-columns: auto 1fr; }
  .center-nav { grid-column: 1 / -1; grid-row: 2; justify-self: center; max-width: 100%; }
  .layout { grid-template-columns: 1fr; padding-top: 8px; }
  .showcase { position: static; padding-top: 0; }
  .stage { width: min(70%, 280px); }
}
@media (max-width: 480px) {
  .ghost-btn span { display: none; }
  .methods { grid-template-columns: 1fr; }
  .card { border-radius: 22px; }
  .footer { flex-direction: column; align-items: center; }
}

/* ---------- Product switcher (used when there are many products) ---------- */
.center-nav { min-width: 0; display: flex; justify-content: center; }
.switcher { position: relative; }
.switch-btn {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  padding: 10px 14px 10px 16px; font-weight: 600; font-size: 14px;
  box-shadow: 0 1px 3px rgb(15 23 42 / .08);
  transition: border-color .15s, box-shadow .15s;
  max-width: min(420px, calc(100vw - 32px));
}
.switch-btn:hover, .switch-btn[aria-expanded="true"] { border-color: var(--line-strong); box-shadow: 0 4px 14px rgb(15 23 42 / .1); }
.switch-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.switch-count { font-size: 12px; font-weight: 600; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); padding: 1px 8px; border-radius: 99px; white-space: nowrap; }
.switch-btn svg { color: var(--muted); transition: transform .2s; flex-shrink: 0; }
.switch-btn[aria-expanded="true"] svg { transform: rotate(180deg); }

.picker {
  position: absolute; z-index: 40; top: calc(100% + 10px); left: 50%; transform: translateX(-50%);
  width: min(780px, calc(100vw - 32px)); max-height: min(72vh, 620px);
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: 22px;
  box-shadow: 0 24px 70px rgb(15 23 42 / .18);
  transform-origin: top center;
  animation: pickerIn .2s cubic-bezier(.2, .9, .3, 1);
}
@keyframes pickerIn { from { opacity: 0; transform: translateX(-50%) translateY(-6px) scale(.98); } }
.picker-top { padding: 14px 14px 10px; border-bottom: 1px solid var(--line); display: grid; gap: 10px; }
.picker-top input { padding: 11px 12px 11px 40px; font-size: 15px; }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: 6px 12px; font-size: 13px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.chip:hover { color: var(--text); border-color: var(--line-strong); }
.chip[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: var(--primary-text); }
.picker-body { overflow-y: auto; padding: 6px 14px 14px; overscroll-behavior: contain; }
.picker-group { margin-top: 10px; }
.picker-group h3 { margin: 4px 4px 8px; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.pick {
  display: grid; grid-template-columns: 44px 1fr; gap: 12px; align-items: center; text-align: left; width: 100%;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 14px; padding: 9px 12px 9px 9px;
  transition: border-color .15s, background-color .15s;
}
.pick:hover, .pick:focus-visible { border-color: var(--line-strong); background: var(--surface-2); outline: none; }
.pick[aria-current="true"] { border-color: var(--accent); background: var(--accent-soft); }
.pick-thumb { width: 44px; height: 44px; border-radius: 11px; object-fit: cover; display: block; }
.pick-name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-sub { font-size: 12px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-empty { padding: 30px 10px; text-align: center; color: var(--muted); font-size: 14px; }
@media (max-width: 480px) {
  .picker { position: fixed; top: auto; bottom: 0; left: 0; transform: none; width: 100%; max-height: 82vh; border-radius: 22px 22px 0 0; animation: sheetUp .25s cubic-bezier(.2, .9, .3, 1); }
  @keyframes sheetUp { from { transform: translateY(30px); opacity: 0; } }
  .picker-grid { grid-template-columns: 1fr; }
}
