/* Shared shopper checkout. Fixed Coco-compatible palette; no merchant CSS/fonts. */
:root {
  color-scheme: light;
  --paper: #f5f0e8;
  --ink: #30271f;
  --muted: #6e6258;
  --cocoa: #6b513b;
  --line: #d9cfc2;
  --surface: #eae2d7;
  --field: #fffcf7;
  --danger: #853c30;
  --success: #425b42;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); font-size: 15px; line-height: 1.55; }
main { width: min(1120px, calc(100% - 80px)); margin: auto; padding-bottom: 80px; }
a { color: inherit; text-underline-offset: 5px; }
h1, h2, legend { font-family: Georgia, 'Times New Roman', serif; font-weight: 400; line-height: 1.15; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(38px, 4.5vw, 58px); letter-spacing: -1.7px; }
h2, legend { font-size: 26px; letter-spacing: -.5px; }
p, a, h1, h2, legend, label, button, b { overflow-wrap: anywhere; }
.checkout-header { display: flex; align-items: center; justify-content: space-between; gap: 32px; padding: 24px 0; border-bottom: 1px solid var(--line); }
.back-link { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; font-size: 13px; flex-shrink: 0; text-decoration: none; }
.back-link:hover { text-decoration: underline; }
.back-link span { font-size: 22px; }
.sandbox { max-width: 510px; padding: 10px 16px; border: 1px solid #c5b59b; border-radius: 8px; color: #604b32; font-size: 11px; line-height: 1.6; }
.checkout-intro { padding: 40px 0 30px; }
.checkout-intro p { margin-top: 12px; color: var(--muted); font-size: 14px; }
.checkout-progress { margin-bottom: 36px; border-bottom: 1px solid var(--line); }
.checkout-progress ol { display: flex; padding: 0; margin: 0; list-style: none; gap: 40px; }
.checkout-progress li { position: relative; padding: 0 0 17px; color: var(--muted); font-size: 13px; }
.checkout-progress li span { display: inline-flex; align-items: center; justify-content: center; margin-right: 8px; width: 28px; height: 28px; border: 1px solid var(--line); border-radius: 50%; font-size: 10px; }
.checkout-progress li[aria-current] { color: var(--ink); font-weight: 600; }
.checkout-progress li[aria-current]:after { content: ''; position: absolute; bottom: -1px; height: 2px; inset-inline: 0; background: var(--cocoa); }
.checkout-progress li[aria-current] span { border-color: var(--cocoa); background: var(--cocoa); color: var(--field); }
.checkout-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, .9fr); gap: 72px; align-items: start; }
.checkout-flow { min-width: 0; }
#status { color: var(--muted); font-size: 13px; margin-bottom: 28px; }
[data-state='loading'] #status, [data-state='processing'] #status { display: flex; align-items: baseline; gap: 12px; }
[data-state='loading'] #status:before, [data-state='processing'] #status:before { content: ''; flex: 0 0 10px; width: 10px; height: 10px; border: 1px solid var(--cocoa); border-radius: 50%; background: var(--surface); }
[data-state='error'] #status { color: var(--danger); padding: 16px; background: #f3e3dc; border: 1px solid #c99d90; border-radius: 8px; }
[data-state='paid'] #status { color: var(--success); padding: 20px; background: #e7ebe0; border: 1px solid #9ca68d; border-radius: 8px; font-size: 15px; }
[data-state='empty'] #status { font-family: Georgia, 'Times New Roman', serif; color: var(--ink); font-size: 26px; padding: 22px 0; }
noscript { display: block; margin-bottom: 24px; color: var(--danger); }
fieldset { border: 0; min-width: 0; padding: 0; margin: 0 0 30px; }
legend { padding: 0; margin-bottom: 20px; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.full-width { grid-column: 1 / -1; }
label { display: block; min-width: 0; font-size: 13px; }
input, select, button { font: inherit; max-width: 100%; }
input, select { display: block; width: 100%; min-height: 50px; margin-top: 7px; border: 1px solid #9b8c7d; border-radius: 7px; background: var(--field); color: var(--ink); padding: 11px 13px; font-size: 16px; line-height: 1.4; }
select { padding-right: 30px; }
input:hover, select:hover { border-color: var(--cocoa); }
input:user-invalid { border-color: var(--danger); }
.country { color: var(--muted); font-size: 12px; margin-top: 18px; }
button { min-width: 44px; min-height: 48px; border: 1px solid var(--cocoa); border-radius: 7px; padding: 12px 18px; cursor: pointer; color: var(--cocoa); background: transparent; font-size: 13px; line-height: 1.5; text-align: left; }
button:hover { background: #e4d9cb; }
.primary-action { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-color: var(--cocoa); background: var(--cocoa); color: #fffcf7; padding: 14px 20px; }
.primary-action:hover { background: #503c2b; border-color: #503c2b; }
.primary-action span { font-size: 20px; line-height: 1; }
button:disabled { opacity: .55; cursor: wait; }
#edit-details { margin-bottom: 24px; }
#resume { margin-top: 20px; }
:focus-visible { outline: 3px solid var(--cocoa); outline-offset: 4px; }
#status:focus { outline: 2px solid var(--cocoa); outline-offset: 6px; }
.order-summary { position: sticky; top: 24px; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 28px; }
.order-summary h2 { font-size: 25px; margin-bottom: 22px; }
#summary p { margin-bottom: 18px; font-size: 13px; overflow-wrap: anywhere; }
#summary .order-line { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; }
.line-description { min-width: 0; }
.line-price { font-variant-numeric: tabular-nums; white-space: nowrap; }
#summary strong { display: block; border-top: 1px solid #cbbdac; padding-top: 18px; font-size: 18px; font-weight: 500; font-variant-numeric: tabular-nums; }
#order-reference { margin-top: 18px; font-size: 11px; color: var(--muted); }
#order-reference b { font-weight: 400; color: var(--ink); }
.summary-note, .payment-note { color: var(--muted); font-size: 12px; line-height: 1.7; }
.summary-note { margin-top: 18px; }
[data-state='paid'] .summary-note, [data-state='empty'] .order-summary, [data-state='unavailable'] .order-summary { display: none; }
#payment h2 { margin-bottom: 20px; }
.payment-total { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 22px; font-size: 14px; }
.payment-total strong { font-weight: 500; font-size: 22px; font-variant-numeric: tabular-nums; }
#payment-element { min-height: 160px; margin: 0 0 18px; }
.payment-note { margin: 18px 0 24px; }
/* The empty summary is only a loading surface, never fabricated order data. */
[data-state='loading'] #summary:empty { min-height: 70px; border-block: 1px solid var(--line); }
[hidden] { display: none !important; }
@media (max-width: 900px) {
  main { width: min(650px, calc(100% - 48px)); }
  .checkout-header { gap: 18px; }
  .sandbox { max-width: 340px; }
  .checkout-grid { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .order-summary { position: static; order: -1; padding: 22px; }
  .order-summary h2 { font-size: 23px; margin-bottom: 16px; }
  #summary p { margin-bottom: 12px; }
  #summary strong { padding-top: 14px; }
  .summary-note { margin-top: 12px; }
  .checkout-progress { margin-bottom: 26px; }
}
@media (max-width: 520px) {
  main { width: calc(100% - 40px); padding-bottom: 48px; }
  .checkout-header { display: block; padding: 14px 0 20px; }
  .sandbox { max-width: none; margin-top: 10px; padding: 9px 12px; }
  .checkout-intro { padding: 26px 0; }
  .checkout-intro p { font-size: 13px; max-width: 32ch; }
  .checkout-progress ol { gap: 0; justify-content: space-between; }
  .checkout-progress li { font-size: 12px; padding-bottom: 14px; }
  .checkout-progress li span { margin-right: 4px; width: 24px; height: 24px; }
  .order-summary { padding: 20px; border-radius: 12px; }
  .field-grid { gap: 16px 12px; }
  h2, legend { font-size: 25px; }
  #status { margin-bottom: 24px; }
  #resume { width: 100%; }
}
@media (max-width: 360px) {
  .field-grid { grid-template-columns: minmax(0, 1fr); }
  .checkout-progress li span { display: none; }
  #summary .order-line { gap: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *:before, *:after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
