/* The store pages (checkout, order, admin): one readable column of cards in the maker's look */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.6;
  padding: 16px max(16px, env(safe-area-inset-right, 0px)) 48px max(16px, env(safe-area-inset-left, 0px));
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:is(a, button, input, select, textarea, summary):focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.page { max-width: 1040px; margin: 0 auto; display: grid; gap: 20px; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.logo { font-size: 32px; }
.top h1 { margin: 0; font-size: 22px; font-weight: 600; }
.top .meta { color: var(--muted); font-size: 13px; }

.cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 20px; align-items: start; }
.cols > * { display: grid; gap: 20px; min-width: 0; }
@media (max-width: 820px) { .cols { grid-template-columns: minmax(0, 1fr); } }

.card { background: var(--raised); border-radius: 20px; padding: 20px; box-shadow: 0 1px 3px var(--shadow); }
.card h2 { margin: 0 0 14px; font-size: 16px; font-weight: 600; }
.card > :last-child { margin-bottom: 0; }
.muted { color: var(--muted); }
.note { margin: 0; font-size: 13px; color: var(--muted); }

.preview { aspect-ratio: 4 / 5; max-height: 520px; width: 100%; border: 0; border-radius: 20px; background: var(--stage); display: block; }

.sheet { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 14px; }
.sheet dt { color: var(--muted); }
.sheet dd { margin: 0; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.sheet .total { font-weight: 600; font-size: 16px; padding-top: 8px; border-top: 1px solid var(--line); }

.form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; font-size: 13px; font-weight: 600; }
.field small { color: var(--muted); font-weight: 400; }
.field :is(input, select, textarea) {
  width: 100%; min-height: 46px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--bg);
  font-size: 16px; font-weight: 400;
}
.field textarea { min-height: 84px; resize: vertical; }
.field [aria-invalid="true"] { border-color: var(--danger); }
.field .err { color: var(--danger); font-weight: 500; font-size: 12px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .row2 { grid-template-columns: 1fr; } }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border: 0; border-radius: 24px;
  background: var(--brand); color: var(--on-brand); font-size: 15px; font-weight: 600;
  text-decoration: none; cursor: pointer;
}
.btn:disabled { opacity: .55; cursor: default; }
.btn.quiet { background: var(--track); color: var(--ink); }
.btn.small { min-height: 38px; padding: 0 16px; font-size: 14px; }
.btn.wide { width: 100%; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }

.banner { padding: 14px 18px; border-radius: 16px; background: var(--track); font-size: 14px; }
.banner.ok { background: color-mix(in srgb, var(--ok) 14%, var(--raised)); }
.banner.warn { background: color-mix(in srgb, var(--warn) 16%, var(--raised)); }
.banner.danger { background: color-mix(in srgb, var(--danger) 14%, var(--raised)); }
.banner strong { display: block; font-size: 15px; }

.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 12px;
  background: var(--track); font-size: 12px; font-weight: 600; white-space: nowrap;
}
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.pending_payment, .pill.unpaid { color: var(--warn); }
.pill.confirmed, .pill.in_production, .pill.shipped { color: var(--ink); }
.pill.delivered, .pill.paid { color: var(--ok); }
.pill.cancelled, .pill.failed, .pill.refunded { color: var(--danger); }

/* Order progress: one step per status, the reached ones filled */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; font-size: 12px; }
.steps li { display: grid; gap: 6px; color: var(--muted); text-align: center; }
.steps li::before { content: ""; height: 6px; border-radius: 3px; background: var(--track); }
.steps li.done { color: var(--ink); font-weight: 600; }
.steps li.done::before { background: var(--ok); }

.status-msg { min-height: 1.6em; margin: 0; font-size: 14px; }
.status-msg.error { color: var(--danger); }
.center { min-height: 50vh; display: grid; place-items: center; text-align: center; }
