:root {
  --text: #1f2933;
  --muted: #616e7c;
  --accent: #1c64f2;
  --accent-text: #ffffff;
  --problem: #b42318;
  --background: #ffffff;
  --surface: #f5f7fa;
  --line: #e4e7eb;
}

@media (prefers-color-scheme: dark) {
  :root {
    --text: #e4e7eb;
    --muted: #9aa5b1;
    --accent: #76a9fa;
    --accent-text: #12161c;
    --problem: #f97066;
    --background: #12161c;
    --surface: #1b212a;
    --line: #2a313c;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.6;
  color: var(--text);
  background: var(--background);
}

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

h1 {
  line-height: 1.2;
}

.site-header,
.site-main,
.site-footer {
  max-width: 60rem;
  margin: 0 auto;
  padding: 1rem;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.site-name {
  font-weight: 700;
  text-decoration: none;
  color: var(--text);
}

.site-footer {
  color: var(--muted);
  font-size: 0.875rem;
  border-top: 1px solid var(--line);
}

.muted {
  color: var(--muted);
}

.block {
  display: block;
  font-size: 0.875rem;
}

.problem {
  color: var(--problem);
}

.notice {
  padding: 0.75rem 1rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: var(--surface);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* The catalogue: one column on a phone, more as the screen allows. */
.product-grid {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr));
  gap: 1.5rem;
}

.product-card a {
  display: block;
  text-decoration: none;
  color: var(--text);
}

.product-name {
  display: block;
  margin-top: 0.5rem;
  font-weight: 600;
}

.product-image {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 0.5rem;
  background: var(--surface);
}

.price {
  font-variant-numeric: tabular-nums;
}

.price-large {
  font-size: 1.5rem;
  font-weight: 700;
}

.badge {
  margin-left: 0.5rem;
  padding: 0 0.5rem;
  font-size: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
}

.product {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 40rem) {
  .product {
    grid-template-columns: 1fr 1fr;
  }
}

.add-to-cart {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

input {
  font: inherit;
  color: var(--text);
  background: var(--background);
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 0.375rem;
}

input[type="number"] {
  width: 5rem;
}

.button,
.link-button {
  font: inherit;
  cursor: pointer;
}

.button {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  color: var(--accent-text);
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 0.375rem;
  text-decoration: none;
}

.button-secondary {
  color: var(--accent);
  background: transparent;
}

.button-large {
  width: 100%;
  padding: 0.9rem;
  font-weight: 600;
}

.link-button {
  padding: 0;
  color: var(--accent);
  background: none;
  border: none;
  text-decoration: underline;
}

.actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.lines {
  width: 100%;
  border-collapse: collapse;
}

.lines th,
.lines td {
  padding: 0.6rem 0.5rem 0.6rem 0;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

.lines .amount {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.lines tfoot th,
.lines tfoot td {
  font-weight: 700;
  border-bottom: none;
}

.checkout {
  max-width: 36rem;
}

fieldset {
  margin: 0 0 1.5rem;
  padding: 0;
  border: none;
}

legend {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 0.75rem;
}

.field input {
  width: 100%;
}

.field-row {
  display: flex;
  gap: 0.75rem;
}

.field-row .field:first-child {
  flex: 0 0 7rem;
}

.grow {
  flex: 1;
}

.choice {
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
  padding: 0.5rem 0;
}

.test-shop {
  margin: 0;
  padding: 0.5rem 1rem;
  background: #fff3cd;
  color: #664d03;
  border-bottom: 1px solid #ffe69c;
  text-align: center;
}
