/* Mobile-first. The whole flow is one screen: see it, name it, order it. */
:root {
  --ink: #16181d;
  --muted: #6b7280;
  --line: #e3e6ea;
  --bg: #f6f7f9;
  --card: #ffffff;
  --red: #c12e1f;
  --red-dark: #a02618;
  --ok: #1a7f4b;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 8px 24px rgba(16, 24, 40, .06);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}

a { color: inherit; }

.wrap { max-width: 720px; margin: 0 auto; padding: 0 16px 132px; }

header.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 16px 12px; max-width: 720px; margin: 0 auto;
}
/* The wordmark is a link home, so it needs the anchor styling stripped back to
   what the plain <div> used to render as. */
.brand {
  font-weight: 800; letter-spacing: -.02em; font-size: 18px;
  color: var(--ink); text-decoration: none;
}
.brand span { color: var(--red); }
.top .price-tag { color: var(--muted); font-size: 14px; }

/* ---------- 3D stage ---------- */
.stage {
  position: relative;
  background: radial-gradient(120% 100% at 50% 0%, #3c414c 0%, #21242b 60%, #1a1c22 100%);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  aspect-ratio: 4 / 3;
  touch-action: none;
}
@media (min-width: 640px) { .stage { aspect-ratio: 16 / 9; } }
.stage canvas { width: 100%; height: 100%; display: block; cursor: grab; }
.stage canvas:active { cursor: grabbing; }

.stage-hint {
  position: absolute; left: 0; right: 0; bottom: 10px;
  text-align: center; color: #ffffff8c; font-size: 12px; pointer-events: none;
  transition: opacity .4s;
}
.stage-tools { position: absolute; top: 10px; right: 10px; display: flex; gap: 8px; }
.chip-btn {
  border: 0; border-radius: 999px; padding: 8px 14px; font-size: 13px; font-weight: 600;
  background: #ffffff1f; color: #fff; backdrop-filter: blur(6px); cursor: pointer;
  transition: background .18s, transform .18s;
}
.chip-btn:hover { background: #ffffff33; }
.chip-btn:active { transform: scale(.95); }

/* ---------- form blocks ---------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; margin-top: 14px; box-shadow: var(--shadow);
}
.label { font-weight: 650; font-size: 14px; margin-bottom: 8px; display: block; }
.hint { color: var(--muted); font-size: 13px; margin-top: 8px; }

input[type=text], input[type=tel], textarea {
  width: 100%; padding: 14px; font-size: 16px; color: var(--ink);
  border: 1.5px solid var(--line); border-radius: 12px; background: #fff;
  font-family: inherit; transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus {
  outline: 0; border-color: var(--red); box-shadow: 0 0 0 4px rgba(193, 46, 31, .12);
}
#reg {
  font: 800 24px/1.2 "Arial Narrow", "Roboto Condensed", system-ui, sans-serif;
  letter-spacing: .12em; text-transform: uppercase; text-align: center;
}
.field-msg { font-size: 13px; margin-top: 8px; min-height: 18px; }
.field-msg.err { color: var(--red); }
.field-msg.ok { color: var(--ok); }
.field-msg.warn { color: #9a6b00; }

/* ---------- brand picker ---------- */
.brands { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: none; }
.brands::-webkit-scrollbar { display: none; }
.brand-opt {
  flex: 0 0 auto; width: 96px; height: 76px; border-radius: 14px; cursor: pointer;
  border: 1.5px solid var(--line); background: #fff; display: grid; place-items: center;
  gap: 4px; padding: 8px; transition: border-color .15s, transform .15s, box-shadow .15s;
}
.brand-opt:active { transform: scale(.96); }
.brand-opt img { max-width: 100%; max-height: 30px; object-fit: contain; }
.brand-opt .nm { font-size: 11px; color: var(--muted); }
.brand-opt.on { border-color: var(--red); box-shadow: 0 0 0 3px rgba(193, 46, 31, .12); }
.brand-opt.on .nm { color: var(--ink); font-weight: 600; }
.brand-opt .none { font-size: 22px; color: var(--muted); }

/* ---------- quantity ---------- */
.qty { display: flex; align-items: center; gap: 14px; }
.qty button {
  width: 46px; height: 46px; border-radius: 12px; border: 1.5px solid var(--line);
  background: #fff; font-size: 22px; cursor: pointer; color: var(--ink);
  transition: border-color .15s, transform .12s;
}
.qty button:hover:not(:disabled) { border-color: var(--red); }
.qty button:active:not(:disabled) { transform: scale(.92); }
.qty button:disabled { opacity: .35; cursor: not-allowed; }
.qty output { font-size: 22px; font-weight: 700; min-width: 40px; text-align: center; }
.qty .line-total { margin-left: auto; color: var(--muted); font-size: 14px; }

/* ---------- basket ---------- */
.basket-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 0;
  border-top: 1px solid var(--line);
  animation: slidein .22s ease;
}
@keyframes slidein { from { opacity: 0; transform: translateY(-6px); } }
.basket-item:first-child { border-top: 0; }
.basket-item .reg { font-weight: 700; letter-spacing: .06em; }
.basket-item .sub { color: var(--muted); font-size: 13px; }
.basket-item .amt { margin-left: auto; font-weight: 650; }
.icon-btn {
  border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 18px;
  padding: 6px; border-radius: 8px;
}
.icon-btn:hover { color: var(--red); background: #f3f4f6; }

/* ---------- sticky action bar ---------- */
.bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  background: #fffffff2; backdrop-filter: blur(10px); border-top: 1px solid var(--line);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
}
.bar-in { max-width: 720px; margin: 0 auto; display: flex; align-items: center; gap: 14px; }
.bar .total-lbl { font-size: 12px; color: var(--muted); }
.bar .total-amt { font-size: 20px; font-weight: 800; letter-spacing: -.01em; }
.btn {
  flex: 1; border: 0; border-radius: 12px; padding: 15px 20px; font-size: 16px;
  font-weight: 700; color: #fff; background: var(--red); cursor: pointer;
  transition: background .15s, transform .12s;
}
.btn:hover:not(:disabled) { background: var(--red-dark); }
.btn:active:not(:disabled) { transform: scale(.985); }
.btn:disabled { background: #cfd3d9; cursor: not-allowed; }
.btn.ghost { background: #fff; color: var(--ink); border: 1.5px solid var(--line); flex: 0 0 auto; }

.steps { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 13px; margin: 18px 0 2px; }
.steps b { color: var(--ink); }

.errors { background: #fdecea; border: 1px solid #f5c6c2; color: #8a1c11;
          border-radius: 12px; padding: 12px 14px; font-size: 14px; margin-top: 14px; }
.errors ul { margin: 6px 0 0; padding-left: 18px; }

.done { text-align: center; padding: 40px 0 20px; }
.done .tick {
  width: 64px; height: 64px; border-radius: 50%; background: #e8f6ee; color: var(--ok);
  display: grid; place-items: center; font-size: 32px; margin: 0 auto 16px;
}
.summary { text-align: left; }
