:root {
  --bg: #f4f6f9;
  --card: #ffffff;
  --text: #111827;
  --muted: #5b6472;
  --line: #e3e7ed;
  --brand: #1d4ed8;
  --brand-dark: #1e40af;
  --danger: #b91c1c;
  --ok: #15803d;
}
* { 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, Arial, sans-serif;
}
.wrap { max-width: 640px; margin: 0 auto; padding: 24px 16px 48px; }
.head { text-align: center; margin-bottom: 20px; }
.brand { margin: 0; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; font-size: 13px; color: var(--brand); }
h1 { margin: 6px 0 4px; font-size: 28px; line-height: 1.2; }
.lead { margin: 0; color: var(--muted); }

.products { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.loading { padding: 20px; text-align: center; color: var(--muted); }
.item {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px 14px 14px 18px;
}
.item.active { border-color: #9db5f5; box-shadow: 0 0 0 1px #9db5f5 inset; }
.info { flex: 1; min-width: 0; }
.name { font-weight: 600; font-size: 17px; }
.price { color: var(--muted); font-size: 14px; }
.sub { font-size: 14px; color: var(--brand-dark); font-weight: 600; }
.fixed-tag { display: inline-block; margin-left: 6px; font-size: 12px; color: var(--muted); font-weight: 500; }

.qty { display: flex; align-items: center; gap: 6px; }
.qty button {
  width: 52px; height: 52px; border-radius: 12px; border: 1px solid var(--line);
  background: #eef2fb; color: var(--brand-dark); font-size: 28px; font-weight: 600; line-height: 1;
  cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.qty button:hover:not(:disabled) { background: #dfe7fa; }
.qty button:active:not(:disabled) { transform: scale(.96); }
.qty button:disabled { opacity: .35; cursor: not-allowed; }
.qty output { width: 40px; text-align: center; font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }

.total-box {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 16px; padding: 18px; border-radius: 14px;
  background: var(--brand); color: #fff;
}
.total-box span { font-size: 17px; }
.total-box strong { font-size: 30px; font-variant-numeric: tabular-nums; }
.note { color: var(--muted); font-size: 14px; margin: 12px 2px 20px; }

.field { display: block; }
.field span { display: block; font-weight: 600; margin-bottom: 6px; }
.field input {
  width: 100%; font-size: 18px; padding: 14px; border-radius: 12px;
  border: 1px solid #c9d0da; background: #fff; color: var(--text);
}
.field input:focus { outline: 3px solid #bfd0fb; border-color: var(--brand); }

.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.error { color: var(--danger); background: #fdecec; border: 1px solid #f5c2c2; border-radius: 10px; padding: 12px 14px; margin: 16px 0 0; }

.submit {
  display: block; width: 100%; margin-top: 18px; padding: 18px; border: 0; border-radius: 14px;
  background: var(--ok); color: #fff; font-size: 20px; font-weight: 700; cursor: pointer;
  touch-action: manipulation;
}
.submit:hover:not(:disabled) { filter: brightness(1.07); }
.submit:disabled { opacity: .6; cursor: wait; }

.thanks { text-align: center; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 36px 20px; }
.check { width: 64px; height: 64px; margin: 0 auto 12px; border-radius: 50%; background: #dcfce7; color: var(--ok); font-size: 36px; line-height: 64px; font-weight: 700; }
.thanks h2 { margin: 0 0 6px; font-size: 22px; }
.thanks p { margin: 0; color: var(--muted); }

@media (max-width: 420px) {
  h1 { font-size: 24px; }
  .item { padding: 12px; gap: 8px; }
  .name { font-size: 16px; }
  .qty button { width: 46px; height: 46px; }
  .qty output { width: 32px; }
  .total-box strong { font-size: 26px; }
}
