/* ==========================================================================
   DRIVE ID — Sticker configurator (Phase 0 prototype)
   Guide §4.1 deliverable 2, final step of the flow.
   Captures intent at a real price. No payment, no account, no backend.
   ========================================================================== */

.order-shell { max-width: var(--wrap); margin-inline: auto; padding: var(--sp-6) var(--sp-5) var(--sp-8); }

.order-head { max-width: 60ch; margin-bottom: var(--sp-6); }
.order-head h1 { font-size: var(--step-2); margin-bottom: var(--sp-3); }
.order-head p { color: var(--text-muted); margin: 0; }

.order-grid { display: grid; gap: var(--sp-6); align-items: start; }
@media (min-width: 900px) { .order-grid { grid-template-columns: 1fr 380px; gap: var(--sp-7); } }

/* --- Option groups ---------------------------------------------------------
   Radio groups styled as cards. The native input stays in the DOM and keeps
   its semantics — keyboard, screen reader and form behaviour all intact. */
.optgroup { border: 0; padding: 0; margin: 0 0 var(--sp-6); }
.optgroup legend {
  padding: 0; margin-bottom: var(--sp-3);
  font-size: var(--step-0); font-weight: 650;
}
.optgroup .legend-hint {
  display: block; font-weight: 400; font-size: var(--step--1);
  color: var(--text-muted); margin-top: var(--sp-1);
}

.options { display: grid; gap: var(--sp-3); }
@media (min-width: 560px) { .options-2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 560px) { .options-3 { grid-template-columns: repeat(3, 1fr); } }

.opt { position: relative; display: block; }
.opt input {
  position: absolute; opacity: 0;
  width: 100%; height: 100%; margin: 0; cursor: pointer;
}
.opt .opt-body {
  display: grid; gap: var(--sp-1);
  min-height: 84px;
  padding: var(--sp-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color .15s ease, background-color .15s ease;
}
.opt:hover .opt-body { background: var(--surface-2); }
.opt input:checked + .opt-body {
  border-color: var(--fill-primary);
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--fill-primary);
}
/* Selection is never signalled by colour alone — a check mark appears too. */
.opt input:checked + .opt-body .opt-name::after {
  content: " \2713";
  color: var(--text-success);
}
.opt input:focus-visible + .opt-body { outline: 2px solid var(--text); outline-offset: 2px; }
.opt .opt-name { font-weight: 600; }
.opt .opt-desc { font-size: var(--step--1); color: var(--text-muted); line-height: 1.45; }
.opt .opt-price {
  font-size: var(--step--1); color: var(--text-muted);
  font-variant-numeric: tabular-nums; margin-top: auto;
}

/* --- Quantity -------------------------------------------------------------- */
.qty { display: flex; align-items: center; gap: var(--sp-3); }
.qty button {
  width: 48px; height: 48px; flex: none;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  font-size: var(--step-1); font-weight: 600; cursor: pointer; line-height: 1;
}
.qty button:hover { background: var(--surface-2); }
.qty output {
  min-width: 56px; text-align: center;
  font-size: var(--step-1); font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* --- Preview / summary panel ----------------------------------------------- */
.summary { position: sticky; top: 88px; }

.sticker-preview {
  display: grid; place-items: center; gap: var(--sp-2);
  padding: var(--sp-5);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: var(--sp-4);
}
/* The code itself is always pure black on pure white — never brand colours.
   Dark-on-dark is the commonest reason enthusiast QR stickers fail to scan
   in the field. Brand the surround, never the code. (guide §4.1 / tools/make-qr.py) */
.sticker-art {
  background: #ffffff;
  padding: 14px;                       /* the quiet zone, visible */
  border-radius: 4px;
  line-height: 0;
}
.sticker-art.round { border-radius: 50%; padding: 18px; }
.sticker-art svg { display: block; width: 104px; height: 104px; }
.sticker-caption {
  font-size: var(--step--1); font-weight: 600;
  letter-spacing: .04em; text-align: center;
  min-height: 1.2em;
}
.preview-label {
  font-size: var(--step--1); color: var(--text-muted);
  text-align: center; margin: 0;
}

.lines { margin-bottom: var(--sp-4); }
.lines div {
  display: flex; justify-content: space-between; gap: var(--sp-4);
  padding: var(--sp-2) 0;
  font-size: var(--step--1);
}
.lines dt { color: var(--text-muted); margin: 0; }
.lines dd { margin: 0; font-variant-numeric: tabular-nums; text-align: right; }

.total {
  display: flex; justify-content: space-between; align-items: baseline;
  padding-top: var(--sp-4); margin-bottom: var(--sp-5);
  border-top: 1px solid var(--border);
}
.total .label { font-weight: 600; }
.total .amount {
  font-size: var(--step-2); font-weight: 700;
  font-variant-numeric: tabular-nums; letter-spacing: -0.02em;
}

/* --- Prototype notice ------------------------------------------------------- */
.proto-note {
  margin-top: var(--sp-4);
  font-size: var(--step--1); color: var(--text-muted);
  text-align: center; line-height: 1.5;
}

/* --- Mobile price bar -------------------------------------------------------
   On a phone the summary panel sits at the bottom of a long form, so you could
   configure the whole sticker without ever seeing the total. This page exists
   to capture intent AT A PRICE (guide §4.4) — the price has to be on screen the
   whole time. Desktop already solves this with the sticky summary column, so
   the bar is mobile-only, and it hides itself once the real summary is visible
   rather than competing with it. */
.pricebar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 20;
  display: flex; align-items: center; gap: var(--sp-4);
  padding: var(--sp-3) var(--sp-5);
  padding-bottom: max(var(--sp-3), env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--border-strong);
  transform: translateY(0);
  transition: transform .2s ease, opacity .2s ease;
}
.pricebar[hidden] { display: none; }
.pricebar.is-tucked {
  transform: translateY(110%);
  opacity: 0;
  pointer-events: none;
}
.pricebar .bar-total { display: grid; line-height: 1.2; }
.pricebar .bar-label { font-size: var(--step--1); color: var(--text-muted); }
.pricebar .bar-amount {
  font-size: var(--step-1); font-weight: 700;
  font-variant-numeric: tabular-nums; letter-spacing: -0.02em;
}
.pricebar .btn { margin-left: auto; flex: none; }

/* Clear the bar so it never covers the last control. */
@media (max-width: 899px) {
  .order-shell { padding-bottom: 104px; }
}
@media (min-width: 900px) {
  .pricebar { display: none; }
}

/* --- Flow breadcrumb -------------------------------------------------------- */
.flow {
  display: flex; flex-wrap: wrap; gap: var(--sp-2);
  align-items: center;
  font-size: var(--step--1); color: var(--text-muted);
  margin-bottom: var(--sp-5);
}
.flow a { color: var(--text-muted); }
.flow .now { color: var(--text); font-weight: 600; }
.flow .sep { opacity: .5; }
