:root {
  --night-0: #09070d;
  --night-1: #100d16;
  --night-2: #17131f;
  --night-3: #211a2d;
  --line: rgba(255, 255, 255, .09);
  --line-strong: rgba(255, 255, 255, .16);
  --text: #f8f6ff;
  --muted: #a9a1b8;
  --purple: #7e47d1;
  --purple-light: #aa7df0;
  --teal: #63e9ba;
  --danger: #ff6b8f;
  --shadow: 0 24px 70px rgba(0, 0, 0, .38);
}

* { box-sizing: border-box; }

body.checkout-body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 14% 8%, rgba(126, 71, 209, .22), transparent 29rem),
    radial-gradient(circle at 88% 22%, rgba(99, 233, 186, .09), transparent 26rem),
    linear-gradient(145deg, var(--night-0), var(--night-1) 48%, #0c0912);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

a { color: inherit; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.checkout-header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1180px, calc(100% - 40px));
  min-height: 84px;
  margin: 0 auto;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -.02em;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  aspect-ratio: 1;
  border: 1px solid rgba(170, 125, 240, .45);
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(145deg, var(--purple), #4f258f);
  box-shadow: 0 8px 24px rgba(126, 71, 209, .28);
  font-size: 12px;
  letter-spacing: -.05em;
}

.header-basket, .secure-label {
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
}

.header-basket span {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 999px;
  color: var(--night-0);
  background: var(--teal);
  font-weight: 800;
}

.basket-shell, .checkout-shell, .completion-shell {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.page-heading { padding: 64px 0 36px; }
.page-heading h1, .checkout-title h1, .completion-card h1 {
  margin: 0;
  font-size: clamp(38px, 6vw, 64px);
  line-height: 1;
  letter-spacing: -.055em;
}
.page-heading > p:last-child { max-width: 600px; margin: 18px 0 0; color: var(--muted); }
.eyebrow {
  margin: 0 0 10px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.basket-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 34px; padding-bottom: 80px; }
.basket-items { min-width: 0; }
.basket-item {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr) auto;
  gap: 22px;
  align-items: center;
  padding: 22px 0;
  border-top: 1px solid var(--line);
}
.basket-item:last-of-type { border-bottom: 1px solid var(--line); }
.basket-image, .mini-image {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: linear-gradient(145deg, var(--night-3), #100c17);
}
.basket-image { width: 116px; height: 130px; }
.basket-image img, .mini-image img { width: 100%; height: 100%; object-fit: cover; }
.image-placeholder { color: rgba(255,255,255,.3); font-size: 24px; font-weight: 900; }
.basket-item-copy h2 { margin: 3px 0 6px; font-size: 19px; line-height: 1.25; }
.basket-item-copy h2 a { text-decoration: none; }
.sku-code, .unit-price { margin: 0; color: var(--muted); font-size: 13px; }
.sku-code { color: var(--purple-light); font-weight: 750; letter-spacing: .05em; }
.text-button { margin: 13px 0 0; padding: 0; border: 0; color: var(--muted); background: none; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.text-button.danger:hover { color: var(--danger); }
.basket-item-controls { display: flex; min-width: 120px; flex-direction: column; align-items: flex-end; gap: 18px; }
.quantity-control { display: grid; grid-template-columns: 34px 40px 34px; height: 38px; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--night-2); }
.quantity-control button, .quantity-control input { width: 100%; border: 0; color: var(--text); background: transparent; text-align: center; }
.quantity-control button { cursor: pointer; font-size: 18px; }
.quantity-control button:hover { background: rgba(255,255,255,.07); }
.quantity-control input { appearance: textfield; padding: 0; font-weight: 750; }
.quantity-control input::-webkit-outer-spin-button, .quantity-control input::-webkit-inner-spin-button { margin: 0; appearance: none; }
.basket-message { min-height: 24px; color: var(--teal); font-size: 13px; }
.basket-message.is-error, .field-message.is-error { color: var(--danger); }

.order-card, .checkout-summary {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(33, 26, 45, .9), rgba(17, 13, 24, .94));
  box-shadow: var(--shadow);
}
.order-card { position: sticky; top: 24px; align-self: start; padding: 28px; }
.summary-line, .summary-totals > div { display: flex; justify-content: space-between; gap: 20px; }
.summary-line { padding: 16px 0 20px; border-bottom: 1px solid var(--line); }
.delivery-progress { padding: 20px 0; }
.delivery-progress p { margin: 0 0 12px; color: var(--muted); font-size: 13px; }
.progress-track { display: block; height: 5px; overflow: hidden; border-radius: 99px; background: rgba(255,255,255,.08); }
.progress-track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--purple), var(--teal)); }
.summary-note { margin: 0 0 20px; color: var(--muted); font-size: 12px; }
.success-text { color: var(--teal) !important; }
.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 14px;
  cursor: pointer;
  font-weight: 800;
  text-decoration: none;
  transition: transform .18s ease, filter .18s ease, background-color .18s ease;
}
.button:hover { transform: translateY(-1px); filter: brightness(1.08); }
.button:disabled { cursor: wait; opacity: .65; transform: none; }
.button-primary { color: #fff; background: linear-gradient(135deg, var(--purple), #6840b4); box-shadow: 0 12px 30px rgba(126, 71, 209, .26); }
.button-secondary { border-color: var(--line-strong); color: var(--text); background: rgba(255,255,255,.055); }
.button-wide { width: 100%; }
.continue-link { display: block; margin: 17px 0; color: var(--muted); font-size: 13px; text-align: center; text-underline-offset: 3px; }
.payment-strip { display: flex; justify-content: center; gap: 8px; padding-top: 18px; border-top: 1px solid var(--line); }
.payment-strip span { padding: 4px 7px; border: 1px solid var(--line); border-radius: 6px; color: #cfc8da; font-size: 10px; font-weight: 800; }

.empty-state { max-width: 650px; margin: 90px auto; padding: 60px 30px; text-align: center; }
.empty-state h1, .empty-state h2 { margin: 0 0 12px; font-size: clamp(32px, 6vw, 54px); letter-spacing: -.045em; }
.empty-state p { max-width: 520px; margin: 0 auto 26px; color: var(--muted); }
.empty-orb { width: 78px; height: 78px; margin: 0 auto 26px; border: 1px solid rgba(170,125,240,.35); border-radius: 50%; background: radial-gradient(circle at 35% 30%, var(--purple-light), var(--purple) 35%, #24143c 72%); box-shadow: 0 0 50px rgba(126,71,209,.34); }

.checkout-shell { display: grid; grid-template-columns: minmax(0, 680px) 400px; justify-content: center; gap: 58px; padding: 52px 0 90px; }
.checkout-form-column { min-width: 0; }
.back-link { color: var(--muted); font-size: 13px; text-decoration: none; }
.back-link:hover { color: var(--text); }
.checkout-title { padding: 28px 0 32px; }
.checkout-title h1 { font-size: clamp(40px, 6vw, 58px); }
.checkout-loading { display: grid; min-height: 240px; place-items: center; align-content: center; color: var(--muted); }
.spinner { width: 32px; height: 32px; border: 3px solid rgba(255,255,255,.1); border-top-color: var(--purple-light); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.checkout-elements[hidden], .checkout-loading[hidden] { display: none; }
.checkout-section {
  position: relative;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 16px;
  margin-bottom: 18px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(23, 19, 31, .72);
  box-shadow: 0 16px 48px rgba(0,0,0,.17);
}
.express-section { display: block; }
.express-section[hidden], .or-divider[hidden] { display: none; }
.checkout-section h2 { margin: 0 0 18px; font-size: 19px; letter-spacing: -.025em; }
.section-content { min-width: 0; }
.section-number { display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid rgba(170,125,240,.32); border-radius: 10px; color: var(--purple-light); background: rgba(126,71,209,.09); font-size: 12px; font-weight: 900; }
.section-intro { margin: -10px 0 18px; color: var(--muted); font-size: 12px; }
.or-divider { display: flex; align-items: center; gap: 15px; margin: 22px 0; color: #766d85; font-size: 11px; text-transform: uppercase; letter-spacing: .12em; }
.or-divider::before, .or-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.delivery-choice { display: grid; grid-template-columns: 14px 1fr auto; gap: 12px; align-items: center; margin-top: 18px; padding: 15px; border: 1px solid rgba(99,233,186,.24); border-radius: 14px; background: rgba(99,233,186,.05); font-size: 13px; }
.delivery-choice small { display: block; margin-top: 2px; color: var(--muted); }
.delivery-dot { width: 10px; height: 10px; border: 3px solid var(--teal); border-radius: 50%; box-shadow: 0 0 0 3px rgba(99,233,186,.12); }
.promo-panel { margin: 0 0 18px; padding: 17px 20px; border: 1px solid var(--line); border-radius: 16px; background: rgba(23,19,31,.55); }
.promo-panel summary { cursor: pointer; color: #d9d4e2; font-size: 13px; font-weight: 700; }
.promo-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; margin-top: 15px; }
.promo-row input { min-width: 0; border: 1px solid var(--line-strong); border-radius: 13px; padding: 0 14px; color: var(--text); background: var(--night-2); outline: none; }
.promo-row input:focus { border-color: var(--purple-light); box-shadow: 0 0 0 3px rgba(126,71,209,.14); }
.field-message { min-height: 20px; margin: 8px 0 0; color: var(--teal); font-size: 12px; }
.checkout-error { margin: 12px 0; padding: 13px 15px; border: 1px solid rgba(255,107,143,.25); border-radius: 12px; color: #ffb0c3; background: rgba(255,107,143,.08); font-size: 13px; }
.checkout-error:empty, .checkout-error[hidden] { display: none; }
.pay-button { justify-content: space-between; min-height: 56px; padding: 0 23px; font-size: 15px; }
.pay-button.is-loading span::after { content: "…"; }
.legal-copy { max-width: 520px; margin: 17px auto 0; color: #7f768f; font-size: 11px; text-align: center; }
.legal-copy a { text-underline-offset: 2px; }
.checkout-fatal { color: var(--danger); }

.checkout-summary { position: sticky; top: 24px; align-self: start; padding: 26px; }
.summary-heading { display: flex; align-items: center; justify-content: space-between; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.summary-heading h2 { margin: 0; font-size: 18px; }
.summary-heading a { color: var(--purple-light); font-size: 12px; }
.mini-items { padding: 8px 0; border-bottom: 1px solid var(--line); }
.mini-item { display: grid; grid-template-columns: 54px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 0; font-size: 12px; }
.mini-image { width: 52px; height: 60px; overflow: visible; }
.mini-image img { overflow: hidden; border-radius: inherit; }
.mini-image > span { color: #645b72; font-weight: 900; }
.mini-image b { position: absolute; top: -7px; right: -7px; display: grid; place-items: center; min-width: 21px; height: 21px; padding: 0 5px; border-radius: 99px; color: #fff; background: var(--purple); font-size: 10px; }
.mini-item > div:nth-child(2) { min-width: 0; }
.mini-item strong, .mini-item small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-item small { margin-top: 3px; color: var(--muted); }
.summary-totals { padding: 17px 0; }
.summary-totals > div { padding: 5px 0; color: var(--muted); font-size: 13px; }
.summary-grand-total { margin-top: 10px; padding-top: 17px !important; border-top: 1px solid var(--line); color: var(--text) !important; font-size: 18px !important; }
.trust-note { display: flex; flex-direction: column; gap: 3px; padding: 15px; border-radius: 13px; color: var(--muted); background: rgba(255,255,255,.035); font-size: 11px; }
.trust-note strong { color: var(--teal); font-size: 12px; }

.completion-shell { display: grid; min-height: calc(100vh - 85px); place-items: center; padding: 50px 0 100px; }
.completion-card { width: min(580px, 100%); padding: 52px; border: 1px solid var(--line); border-radius: 26px; background: linear-gradient(145deg, rgba(33,26,45,.92), rgba(15,12,21,.96)); box-shadow: var(--shadow); text-align: center; }
.completion-card h1 { font-size: clamp(36px, 7vw, 56px); }
.completion-card > p:not(.eyebrow, .polling-note) { max-width: 440px; margin: 19px auto 26px; color: var(--muted); }
.completion-symbol { display: grid; place-items: center; width: 72px; height: 72px; margin: 0 auto 26px; border: 1px solid rgba(99,233,186,.35); border-radius: 50%; color: var(--teal); background: rgba(99,233,186,.08); box-shadow: 0 0 44px rgba(99,233,186,.1); font-size: 30px; font-weight: 900; }
.status-error .completion-symbol { border-color: rgba(255,107,143,.35); color: var(--danger); background: rgba(255,107,143,.08); }
.order-reference { display: flex; justify-content: space-between; gap: 15px; margin: 0 0 26px; padding: 15px 18px; border: 1px solid var(--line); border-radius: 14px; color: var(--muted); font-size: 13px; }
.order-reference strong { color: var(--text); }
.polling-note { color: var(--purple-light); font-size: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 920px) {
  .basket-layout, .checkout-shell { grid-template-columns: 1fr; }
  .order-card, .checkout-summary { position: static; }
  .checkout-summary { grid-row: 1; }
  .checkout-shell { max-width: 680px; gap: 28px; }
}

@media (max-width: 620px) {
  .checkout-header, .basket-shell, .checkout-shell, .completion-shell { width: min(100% - 24px, 1180px); }
  .checkout-header { min-height: 72px; }
  .secure-label { display: none; }
  .page-heading { padding-top: 44px; }
  .basket-layout { gap: 20px; }
  .basket-item { grid-template-columns: 82px minmax(0, 1fr); gap: 15px; }
  .basket-image { width: 82px; height: 98px; }
  .basket-item-controls { grid-column: 1 / -1; width: 100%; min-width: 0; flex-direction: row; justify-content: space-between; align-items: center; }
  .order-card, .checkout-summary, .completion-card { padding: 22px; border-radius: 18px; }
  .checkout-shell { padding-top: 30px; }
  .checkout-section { grid-template-columns: 1fr; padding: 18px; }
  .section-number { display: none; }
  .promo-row { grid-template-columns: 1fr; }
  .promo-row input { min-height: 48px; }
  .completion-card { padding-top: 38px; padding-bottom: 38px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
