:root {
  --cream: #fff9ef;
  --paper: #fffdf8;
  --ink: #35312d;
  --muted: #77716b;
  --teal: #28625d;
  --aqua: #eaf6f4;
  --blush: #f7edef;
  --line: rgba(53, 49, 45, .14);
  --shadow: 0 18px 50px rgba(75, 57, 40, .08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--cream); color: var(--ink); font-family: "Be Vietnam Pro", sans-serif; -webkit-font-smoothing: antialiased; }
button, input { font: inherit; }
a { color: inherit; }
button:not(:disabled), a[href], summary, [role="button"], [role="tab"], label[for], select, input[type="checkbox"], input[type="radio"] { cursor: pointer; }
button:disabled, [aria-disabled="true"] { cursor: not-allowed; }
[hidden] { display: none !important; }
.skip-link { position: fixed; left: 1rem; top: -5rem; z-index: 20; padding: .8rem 1rem; border-radius: .5rem; background: var(--ink); color: white; }
.skip-link:focus { top: 1rem; }

.checkout-header { min-height: 96px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 2rem; padding: .8rem clamp(1.25rem, 5vw, 5.5rem); border-bottom: 1px solid var(--line); background: rgba(255, 249, 239, .94); }
.checkout-brand { display: block; width: 180px; justify-self: center; }
.checkout-brand img { display: block; width: 100%; height: 58px; object-fit: contain; }
.back-link, .secure-label { display: inline-flex; align-items: center; gap: .55rem; font-size: .82rem; font-weight: 700; text-decoration: none; }
.back-link { justify-self: start; }
.secure-label { justify-self: end; color: var(--muted); }
.secure-label svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; }

.checkout-shell { width: min(1420px, calc(100% - 2rem)); margin: 0 auto; padding: clamp(2.5rem, 5vw, 5.5rem) 0 6rem; }
.checkout-heading { max-width: 760px; margin-bottom: 2.5rem; }
.checkout-heading p, .section-heading p, .order-title-row p { margin: 0 0 .35rem; color: var(--teal); font-size: .72rem; font-weight: 800; letter-spacing: .16em; }
.checkout-heading h1 { margin: 0; font-family: "Noto Serif", serif; font-size: clamp(2.2rem, 4.2vw, 4.6rem); line-height: 1.08; }
.checkout-heading > span { display: block; margin-top: .8rem; color: var(--muted); font-size: .86rem; }
.checkout-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(390px, .85fr); align-items: start; gap: clamp(1.4rem, 3vw, 3.25rem); }
.checkout-information { display: grid; gap: 1.25rem; }
.checkout-card, .order-card, .empty-checkout { border: 1px solid var(--line); border-radius: 1.4rem; background: rgba(255, 253, 248, .88); box-shadow: var(--shadow); }
.checkout-card { padding: clamp(1.35rem, 3vw, 2.4rem); }
.section-heading { display: flex; align-items: flex-start; gap: 1rem; margin-bottom: 1.7rem; }
.section-heading > span { display: grid; flex: 0 0 40px; width: 40px; height: 40px; place-items: center; border-radius: 50%; background: var(--aqua); color: var(--teal); font-size: .72rem; font-weight: 800; }
.section-heading h2, .order-title-row h2, .empty-checkout h2 { margin: 0; font-family: "Noto Serif", serif; font-size: clamp(1.25rem, 2vw, 1.7rem); line-height: 1.25; }
.section-heading.compact { margin-bottom: 1.25rem; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.field { display: grid; gap: .5rem; }
.field-wide { grid-column: 1 / -1; }
.field span, .discount-block label { font-size: .72rem; font-weight: 700; }
.field b { color: #c95d52; }
.field input, .discount-block input { width: 100%; min-height: 54px; border: 1px solid rgba(53, 49, 45, .22); border-radius: .7rem; background: white; color: var(--ink); padding: 0 1rem; outline: none; }
.field input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(40, 98, 93, .12); }
.field input[readonly] { background: #f5f1e9; color: var(--muted); }
.pending-option, .payment-option { display: flex; align-items: center; gap: 1rem; min-height: 76px; border: 1px solid var(--line); border-radius: 1rem; background: white; padding: 1rem 1.15rem; }
.pending-option svg, .payment-option svg { flex: 0 0 28px; width: 28px; fill: none; stroke: var(--teal); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.pending-option div, .payment-option > span:last-child { display: grid; gap: .25rem; }
.pending-option strong, .payment-option strong { font-size: .82rem; }
.pending-option span, .payment-option small { color: var(--muted); font-size: .72rem; }
.payment-options { display: grid; gap: .75rem; }
.payment-option { position: relative; cursor: pointer; }
.payment-option input { position: absolute; opacity: 0; }
.radio-mark { flex: 0 0 20px; width: 20px; height: 20px; border: 1.5px solid #9a938c; border-radius: 50%; }
.payment-option:has(input:checked) { border-color: var(--teal); background: var(--aqua); }
.payment-option input:checked + .radio-mark { border: 6px solid var(--teal); }

.order-column { position: sticky; top: 1.5rem; }
.order-card { padding: clamp(1.35rem, 3vw, 2.2rem); }
.order-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding-bottom: 1.25rem; border-bottom: 1px solid var(--line); }
.order-title-row > span { flex: 0 0 auto; border-radius: 999px; background: var(--aqua); color: var(--teal); padding: .5rem .75rem; font-size: .7rem; font-weight: 800; }
.checkout-items { display: grid; gap: 1rem; padding: 1.2rem 0; border-bottom: 1px solid var(--line); }
.checkout-item { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 1rem; }
.checkout-item img { width: 90px; height: 90px; border-radius: .75rem; background: #f4efe5; object-fit: cover; }
.checkout-item-info { min-width: 0; display: grid; align-content: start; gap: .4rem; }
.checkout-item-info strong { font-size: .78rem; line-height: 1.45; }
.checkout-item-info > span { color: var(--muted); font-size: .7rem; }
.checkout-item-actions { display: flex; align-items: center; justify-content: space-between; gap: .8rem; margin-top: .25rem; }
.checkout-quantity { display: grid; grid-template-columns: 34px 38px 34px; min-height: 36px; border: 1px solid rgba(53, 49, 45, .25); border-radius: .55rem; overflow: hidden; }
.checkout-quantity button, .checkout-quantity output { display: grid; place-items: center; border: 0; background: white; color: var(--ink); font-size: .76rem; }
.checkout-quantity button { cursor: pointer; }
.checkout-quantity button:disabled { color: #c6c0b9; cursor: not-allowed; }
.checkout-remove { min-height: 36px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: .68rem; text-decoration: underline; text-underline-offset: 3px; }
.discount-block { display: grid; gap: .6rem; padding: 1.2rem 0; border-bottom: 1px solid var(--line); }
.discount-block > div { display: grid; grid-template-columns: 1fr auto; gap: .55rem; }
.discount-block input:disabled { background: #f4f0e9; }
.discount-block button { min-width: 90px; border: 0; border-radius: .7rem; background: #c7beb4; color: white; font-size: .72rem; font-weight: 700; }
.discount-block small { color: var(--muted); font-size: .66rem; }
.order-totals { display: grid; gap: .8rem; margin: 0; padding: 1.25rem 0; }
.order-totals > div { display: flex; justify-content: space-between; gap: 1rem; font-size: .76rem; }
.order-totals dd { margin: 0; font-weight: 700; }
.order-totals .grand-total { padding-top: 1rem; border-top: 1px solid var(--line); font-size: .9rem; font-weight: 800; }
.place-order { width: 100%; min-height: 56px; border: 0; border-radius: .7rem; background: var(--teal); color: white; font-weight: 800; cursor: pointer; }
.place-order:disabled { background: #bdb3a7; cursor: not-allowed; }
.prototype-note { margin: .9rem 0 0; color: var(--muted); font-size: .65rem; line-height: 1.6; text-align: center; }
.checkout-assurance { display: flex; flex-wrap: wrap; gap: .8rem 1.25rem; padding: 1rem .5rem; color: var(--muted); font-size: .65rem; }
.checkout-assurance span { display: inline-flex; align-items: center; gap: .35rem; }
.checkout-assurance svg { width: 17px; fill: none; stroke: var(--teal); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.empty-checkout { padding: 3rem; text-align: center; }
.empty-checkout p { color: var(--muted); }
.empty-checkout a { display: inline-grid; min-height: 50px; place-items: center; margin-top: 1rem; border-radius: 999px; background: var(--teal); color: white; padding: 0 1.5rem; font-size: .76rem; font-weight: 800; text-decoration: none; }
.checkout-success { max-width: 720px; margin: 3rem auto; border: 1px solid var(--line); border-radius: 1.5rem; background: white; padding: clamp(2rem, 6vw, 4rem); text-align: center; box-shadow: var(--shadow); }
.checkout-success .success-icon { display: grid; width: 58px; height: 58px; place-items: center; margin: 0 auto 1rem; border-radius: 50%; background: var(--aqua); color: var(--teal); font-size: 1.4rem; font-weight: 800; }
.checkout-success > p { color: var(--muted); }
.checkout-success > strong { display: block; margin: .75rem 0; color: var(--teal); font-size: 1.1rem; letter-spacing: .08em; }
.checkout-success > div { display: flex; justify-content: center; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }
.checkout-success a { display: inline-grid; min-height: 48px; place-items: center; border: 1px solid var(--teal); border-radius: 999px; color: var(--teal); padding: 0 1.25rem; font-size: .72rem; font-weight: 800; text-decoration: none; }

@media (max-width: 900px) {
  .checkout-header { min-height: 80px; padding-inline: 1rem; }
  .checkout-brand { width: 145px; }
  .checkout-brand img { height: 46px; }
  .back-link span, .secure-label { font-size: 0; }
  .back-link { font-size: 1.25rem; }
  .secure-label svg { width: 22px; }
  .checkout-shell { width: min(100% - 1.25rem, 680px); padding-top: 2.25rem; }
  .checkout-heading { margin-inline: .35rem; }
  .checkout-heading h1 { font-size: clamp(2rem, 10vw, 3.2rem); }
  .checkout-layout { grid-template-columns: 1fr; }
  .order-column { position: static; order: -1; }
}

@media (max-width: 560px) {
  .checkout-header { gap: .5rem; }
  .checkout-brand { width: 128px; }
  .checkout-shell { width: calc(100% - 1rem); padding-bottom: 3.5rem; }
  .checkout-heading > span { font-size: .72rem; line-height: 1.55; }
  .checkout-card, .order-card { border-radius: 1.15rem; padding: 1.15rem; }
  .field-grid { grid-template-columns: 1fr; }
  .field-wide { grid-column: auto; }
  .field input { min-height: 50px; }
  .section-heading { gap: .7rem; }
  .section-heading > span { flex-basis: 34px; width: 34px; height: 34px; }
  .checkout-item { grid-template-columns: 74px minmax(0, 1fr); }
  .checkout-item img { width: 74px; height: 74px; }
  .order-title-row { align-items: center; }
  .checkout-assurance { display: grid; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
