:root {
  color-scheme: light;
  --ink: #172f2c;
  --muted: #526763;
  --teal: #0f3d3e;
  --line: #d8e4dd;
  --surface: #fff;
  --page: #f2f6f2;
  --notice: #eef5f0;
  font: 16px/1.55 system-ui, "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--page);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
a { color: var(--teal); text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid #956917;
  outline-offset: 2px;
}
button:disabled { opacity: .55; cursor: not-allowed; }
h1, h2, p, dl, ul, dd { margin: 0; }
h1 { font-size: clamp(2rem, 5vw, 3rem); line-height: 1.2; margin-bottom: .5rem; }
h2 { font-size: 1.2rem; line-height: 1.3; }
.wrap { width: min(1080px, calc(100% - 32px)); margin: auto; }
main.wrap { padding-block: 2rem 3rem; }
.top { background: var(--surface); border-bottom: 1px solid var(--line); }
.top-inner { min-height: 62px; display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.brand { font-weight: 750; overflow-wrap: anywhere; text-decoration: none; }
.top-inner > a:last-child { flex-shrink: 0; }
.page-heading { margin-bottom: 1.5rem; }
.eyebrow { color: #775719; font-weight: 700; font-size: .88rem; margin-bottom: .4rem; overflow-wrap: anywhere; }
.muted { color: var(--muted); }
.checkout-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: start; gap: 1rem; }
.checkout-details { display: grid; gap: 1rem; min-width: 0; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 1rem; padding: clamp(1rem, 3vw, 1.5rem); min-width: 0; }
.section-heading { display: flex; align-items: center; gap: .65rem; margin-bottom: 1rem; }
.step { display: grid; place-items: center; width: 1.9rem; height: 1.9rem; border-radius: 50%; background: var(--teal); color: white; font-weight: 750; }
.fields { border: 0; padding: 0; margin: 0; min-width: 0; }
.products { list-style: none; padding: 0; }
.product { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .75rem; padding-block: .85rem; }
.product + .product { border-top: 1px solid var(--line); }
.product-details { overflow-wrap: anywhere; }
.product-details strong { display: block; }
.product-price { display: block; color: var(--teal); font-weight: 700; }
.product .qty { width: 5.75rem; }
.qty span, .fine-print { font-size: .86rem; }
.notice { padding: .75rem 1rem; border-radius: .65rem; background: var(--notice); color: var(--teal); overflow-wrap: anywhere; }
.notice[data-error="true"] { color: #81292b; background: #fff1ef; }
.form-fields { display: grid; gap: .8rem; }
.form-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .75fr); gap: .75rem; }
label { display: grid; gap: .3rem; font-weight: 620; }
input, select, textarea { min-width: 0; width: 100%; min-height: 44px; border: 1px solid #a7b8b0; border-radius: .55rem; color: var(--ink); background: white; padding: .45rem .65rem; }
textarea { resize: vertical; }
.totals { display: grid; gap: .45rem; }
.totals > div { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .65rem; }
.totals dd { text-align: end; font-weight: 680; overflow-wrap: anywhere; }
.grand-total { border-top: 1px solid var(--line); padding-top: .55rem; margin-top: .2rem; }
.summary .notice, .actions, .fine-print { margin-top: .8rem; }
.actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.actions > button { flex: 1 1 8rem; }
.primary, .secondary {
  border: 1px solid var(--teal);
  border-radius: .6rem;
  padding: .6rem .9rem;
  min-height: 44px;
  font-weight: 700;
  cursor: pointer;
}
.primary { background: var(--teal); color: white; }
.secondary { background: var(--surface); color: var(--teal); }
.button { display: inline-flex; align-items: center; text-decoration: none; }
.receipt { max-width: 540px; }
.receipt .totals, .receipt .payment { margin-block: .85rem; }
.payment { padding: .75rem; border-radius: .6rem; background: var(--notice); overflow-wrap: anywhere; }
.payment p + p { margin-top: .25rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

@media (max-width: 700px) {
  .checkout-grid { grid-template-columns: minmax(0, 1fr); }
  main.wrap { padding-top: 1.4rem; }
}
