/* The sandbox shop. Plain and readable, light and dark. */
:root {
  --bg: #f6f5f2;
  --surface: #ffffff;
  --ink: #1c1b19;
  --ink-2: #5d5a54;
  --line: #e4e1da;
  --accent: #1f5f4a;
  --accent-ink: #ffffff;
  --ok: #1f7a4d;
  --no: #b3261e;
  --banner: #fff4d6;
  --banner-ink: #6b4e00;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141412;
    --surface: #1e1e1b;
    --ink: #f1efe9;
    --ink-2: #aaa69d;
    --line: #34332f;
    --accent: #6cc4a1;
    --accent-ink: #0c2a1f;
    --ok: #6cc4a1;
    --no: #f2918a;
    --banner: #3a3015;
    --banner-ink: #f3d98a;
  }
}

* { box-sizing: border-box; }

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

a { color: var(--accent); }

.banner {
  margin: 0;
  padding: 8px 16px;
  background: var(--banner);
  color: var(--banner-ink);
  font-size: 14px;
  text-align: center;
}

.top, main, .foot {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 16px;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
}

.brand { color: var(--ink); font-weight: 700; font-size: 20px; text-decoration: none; }
nav { display: flex; gap: 16px; }
nav a { text-decoration: none; font-weight: 500; }

.pill {
  display: inline-block;
  min-width: 22px;
  padding: 0 6px;
  border-radius: 11px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 13px;
  text-align: center;
}

main { outline: none; padding-bottom: 32px; }
h1 { font-size: 28px; margin: 16px 0; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.product {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.product h2 { font-size: 17px; margin: 0; }
.price { margin: 0; color: var(--ink-2); }
.product button { margin-top: auto; }

.art {
  display: grid;
  place-items: center;
  height: 120px;
  border-radius: 8px;
  background: var(--bg);
  font-size: 56px;
}

.art.small { height: 40px; width: 40px; font-size: 22px; }

button, .button {
  display: inline-block;
  min-height: 44px;
  padding: 10px 18px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-ink);
  font: inherit;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

button.ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--line);
}

button:disabled { opacity: 0.6; cursor: progress; }

input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

input[type="checkbox"] { width: auto; min-height: 0; }
label { display: block; font-weight: 500; margin: 12px 0 4px; }
label.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; color: var(--ink-2); }
label.amount { display: flex; gap: 6px; align-items: center; margin: 0; font-weight: 400; }

.lines { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }

.lines li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.lines .ghost { min-height: 36px; padding: 4px 12px; }
.grow { flex: 1; min-width: 0; }
.grow small { color: var(--ink-2); }
.qty { min-width: 24px; text-align: center; }
.money { min-width: 80px; text-align: right; font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-2); font-size: 14px; }
.total { font-size: 18px; }

.card-form, .order {
  max-width: 420px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.card-form button[type="submit"] { width: 100%; margin-top: 16px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.error { color: var(--no); min-height: 0; margin: 8px 0 0; }
.error:empty { display: none; }

.status { font-size: 20px; font-weight: 700; margin: 0 0 8px; }
.status.ok { color: var(--ok); }
.status.no { color: var(--no); }
.items { color: var(--ink-2); margin: 0 0 12px; }

dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0 0 16px; }
dt { color: var(--ink-2); }
dd { margin: 0; font-variant-numeric: tabular-nums; }

.act { display: flex; gap: 8px; align-items: center; margin-top: 12px; flex-wrap: wrap; }
.act label.amount { flex: 1; min-width: 120px; }

.foot {
  padding-top: 16px;
  padding-bottom: 32px;
  border-top: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 14px;
}

@media (max-width: 480px) {
  .lines li { flex-wrap: wrap; }
  .money { min-width: 0; }
}
