:root {
  color-scheme: light;
  --ink: #333333;
  --muted: #707070;
  --line: #d9d9d9;
  --line-dark: #b8b8b8;
  --surface: #ffffff;
  --summary: #f7f7f7;
  --accent: #1976d2;
  --accent-hover: #155fa8;
  --focus: rgba(25, 118, 210, .2);
  --danger: #b42318;
  --success: #1f7a4d;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--surface); }
body { margin: 0; background: var(--surface); color: var(--ink); font-size: 14px; }
button, input, select { font: inherit; }
button, input, select, a { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
.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; }

.checkout-layout {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(390px, 5fr);
  max-width: 1140px;
  min-height: 100vh;
  margin: 0 auto;
}
.checkout-main { padding: 0 54px 48px 12px; background: var(--surface); }
.main-inner { width: 100%; max-width: 650px; margin-left: auto; }
.checkout-header { min-height: 108px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.neutral-checkout-title { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); font-size: 20px; font-weight: 600; }
.neutral-checkout-title svg, .provider-placeholder svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

h1 { margin: 5px 0 30px; font-size: 24px; line-height: 1.25; font-weight: 500; }
.checkout-section { margin: 0 0 31px; padding: 0; border: 0; }
.checkout-section h2, .checkout-section legend { margin: 0 0 14px; padding: 0; font-size: 18px; line-height: 1.3; font-weight: 500; }
.section-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 14px; }
.section-heading h2 { margin: 0; }
.section-heading > span { color: var(--muted); font-size: 12px; }

.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.field { position: relative; }
.field.full { grid-column: 1 / -1; }
.field input, .field select {
  display: block;
  width: 100%;
  height: 48px;
  padding: 0 13px;
  border: 1px solid var(--line-dark);
  border-radius: 5px;
  outline: 0;
  background: #fff;
  color: var(--ink);
  transition: border-color .12s ease, box-shadow .12s ease;
}
.field input::placeholder { color: #737373; opacity: 1; }
.field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #777 50%), linear-gradient(135deg, #777 50%, transparent 50%); background-position: calc(100% - 17px) 20px, calc(100% - 12px) 20px; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
.field input:focus, .field select:focus { border-color: var(--accent); box-shadow: 0 0 0 2px var(--focus); }
.field.invalid input, .field.invalid select { border-color: var(--danger); }
.field-error { display: block; min-height: 0; color: var(--danger); font-size: 11px; }
.field-error:not(:empty) { margin: 5px 2px 0; }

.shipping-summary {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 13px 15px;
  border: 1px solid var(--accent);
  border-radius: 5px;
  background: #f8fbff;
}
.shipping-summary > span { display: grid; gap: 4px; }
.shipping-summary small { color: var(--muted); line-height: 1.35; }

.payment-box, .choice-box { overflow: hidden; border: 1px solid var(--line-dark); border-radius: 5px; background: #fff; }
.payment-title { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 11px 14px; background: #f7f7f7; border-bottom: 1px solid var(--line); }
.payment-title img { width: 142px; height: 30px; object-fit: contain; object-position: right center; }
.psp-hosted-fields { min-height: 108px; padding: 15px; }
.provider-placeholder { min-height: 76px; display: flex; align-items: center; gap: 12px; padding: 13px; border: 1px dashed #c4c4c4; border-radius: 4px; background: #fafafa; color: var(--muted); }
.provider-placeholder > span, .provider-status > div { display: grid; gap: 4px; }
.provider-placeholder strong { color: var(--ink); }
.provider-placeholder small, .provider-status span { font-size: 12px; }
.provider-owned-surface { display: grid; }
.provider-unavailable { min-height: 92px; display: grid; align-content: center; gap: 6px; padding: 15px; border: 1px solid #d2d7d4; border-radius: 4px; background: #f8f9f8; }
.provider-unavailable span { color: var(--muted); font-size: 12px; line-height: 1.45; }
.provider-load-error { min-height: 92px; display: grid; align-content: center; gap: 6px; padding: 15px; border: 1px solid #d8a8a8; border-radius: 4px; background: #fff7f7; }
.provider-load-error span { color: var(--muted); font-size: 12px; line-height: 1.45; }
.provider-card-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.provider-field { position: relative; display: grid; gap: 5px; }
.provider-field.full { grid-column: 1 / -1; }
.provider-field label { color: #4a4a4a; font-size: 12px; font-weight: 600; }
.provider-field input { width: 100%; height: 48px; padding: 0 13px; border: 1px solid var(--line-dark); border-radius: 5px; outline: 0; background: #fff; color: var(--ink); font-size: 16px; }
.provider-field input:focus { border-color: var(--accent); box-shadow: 0 0 0 2px var(--focus); }
.provider-field.invalid input { border-color: var(--danger); }
.provider-error { min-height: 0; color: var(--danger); font-size: 11px; }
.provider-error:not(:empty) { margin: 1px 2px 0; }
.provider-brand { position: absolute; top: 28px; right: 10px; width: 34px; height: 22px; object-fit: contain; opacity: 0; transition: opacity .12s ease; pointer-events: none; }
.provider-brand.visible { opacity: 1; }
.provider-security { display: flex; align-items: center; gap: 8px; margin-top: 13px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.provider-security svg { width: 14px; height: 14px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.billing-section legend { width: 100%; }
.choice-box > label { min-height: 54px; display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
.choice-box > label:last-of-type { border-bottom: 0; }
.choice-box input[type="radio"] { margin: 0; accent-color: var(--accent); }
.billing-fields { padding: 14px; border-top: 1px solid var(--line); background: #fafafa; }

.conversion-modules { display: grid; gap: 10px; margin: 0 0 24px; }
.conversion-card { padding: 13px 14px; border: 1px solid var(--line); border-radius: 5px; background: #fafafa; }
.conversion-card strong { display: block; }
.conversion-card p { margin: 5px 0 0; color: var(--muted); line-height: 1.45; }
.conversion-card a { color: var(--accent); }
.conversion-review-summary { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.conversion-stars { color: #b66a00; letter-spacing: .06em; }
.conversion-review-list { display: grid; gap: 10px; margin-top: 10px; }
.conversion-review { padding-top: 10px; border-top: 1px solid var(--line); }
.conversion-review q { display: block; line-height: 1.45; }
.conversion-review small { display: block; margin-top: 5px; color: var(--muted); }
.countdown-value { margin-top: 5px; font-size: 20px; font-variant-numeric: tabular-nums; }
.error-notice { margin: 0 0 18px; padding: 14px; border: 1px solid #efc6c0; border-radius: 5px; background: #fff6f5; color: var(--danger); }
.error-notice p { margin: 5px 0 0; line-height: 1.45; }
.validation-summary { margin: 0 0 22px; padding: 13px 14px; border: 1px solid #efc6c0; border-radius: 5px; background: #fff6f5; color: var(--danger); }
.validation-summary p { margin: 4px 0 0; }

.pay-button {
  position: relative;
  width: 100%;
  min-height: 55px;
  padding: 12px 20px;
  border: 1px solid var(--accent);
  border-radius: 5px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  transition: background .12s ease;
}
.pay-button:hover:not(:disabled) { background: var(--accent-hover); }
.pay-button:focus-visible { outline: 0; box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--accent); }
.pay-button:disabled { cursor: not-allowed; opacity: .55; }
.button-spinner { display: none; position: absolute; width: 18px; height: 18px; inset: 50% auto auto 50%; margin: -9px; border: 2px solid rgba(255,255,255,.45); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
.pay-button.loading > span:first-child { visibility: hidden; }
.pay-button.loading .button-spinner { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }
.legal-copy { margin: 11px auto 0; max-width: 520px; color: var(--muted); text-align: center; font-size: 11px; line-height: 1.5; }
.checkout-footer { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 38px; padding-top: 20px; border-top: 1px solid var(--line); }
.checkout-footer a { color: var(--accent); font-size: 11px; }

.order-summary { position: relative; background: var(--summary); border-left: 1px solid #eeeeee; }
.order-summary::after { content: ""; position: fixed; z-index: -1; top: 0; bottom: 0; left: 50%; right: 0; background: var(--summary); }
.summary-inner { width: 100%; max-width: 450px; padding: 63px 28px 50px 46px; }
.summary-inner h2 { margin: 0 0 27px; font-size: 18px; font-weight: 500; }
.line-item { display: grid; grid-template-columns: 64px minmax(0,1fr) auto; align-items: center; gap: 13px; padding-bottom: 23px; border-bottom: 1px solid var(--line); }
.product-media { position: relative; width: 64px; height: 64px; border: 1px solid #d7d7d7; border-radius: 6px; background: #fff; }
.product-media img { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; border-radius: 5px; object-fit: cover; background: #fff; }
.product-fallback { position: absolute; inset: 0; display: grid; place-items: center; overflow: hidden; border-radius: 5px; background: linear-gradient(145deg, #eef1ef, #fff); }
.product-fallback span { width: 24px; height: 38px; border-radius: 4px 4px 7px 7px; background: linear-gradient(150deg, #34785c, #99c2b0); }
.quantity-badge { position: absolute; z-index: 2; top: -9px; right: -9px; min-width: 22px; height: 22px; display: grid; place-items: center; padding: 0 6px; border-radius: 20px; background: #777; color: #fff; font-size: 11px; font-weight: 700; }
.item-copy { min-width: 0; display: grid; gap: 4px; }
.item-copy strong { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.35; }
.item-copy span { color: var(--muted); font-size: 12px; }
.item-price { white-space: nowrap; font-variant-numeric: tabular-nums; }
.costs { display: grid; gap: 13px; margin: 23px 0 18px; }
.costs div, .total-row { display: flex; justify-content: space-between; gap: 22px; }
.costs dt, .costs dd { margin: 0; }
.costs dd { text-align: right; font-variant-numeric: tabular-nums; }
.total-row { align-items: baseline; padding-top: 19px; border-top: 1px solid var(--line); font-size: 17px; }
.total-row small { margin-left: 5px; color: var(--muted); font-size: 11px; font-weight: 400; }
.total-row strong { font-size: 24px; font-variant-numeric: tabular-nums; }

.mobile-summary-toggle, .mobile-summary { display: none; }
.success-state { padding: 72px 0 40px; text-align: center; }
.success-icon { display: grid; place-items: center; width: 58px; height: 58px; margin: 0 auto 19px; border-radius: 50%; background: #e6f4ec; color: var(--success); font-size: 27px; font-weight: 800; }
.success-state .eyebrow { margin: 0 0 8px; color: var(--success); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; font-weight: 700; }
.success-state h2 { margin: 0 0 9px; font-size: 25px; font-weight: 500; }
.success-state > p { color: var(--muted); }
.confirmation-card { display: flex; justify-content: space-between; gap: 18px; margin: 24px auto 0; padding: 15px; border: 1px solid var(--line); border-radius: 5px; background: var(--summary); text-align: left; }

@media (max-width: 991px) {
  .checkout-layout { display: flex; flex-direction: column; max-width: none; min-height: 100vh; }
  .checkout-main { order: 1; padding: 0; }
  .main-inner { max-width: 680px; margin: 0 auto; }
  .checkout-header { min-height: 78px; justify-content: center; padding: 0 20px; }
  .neutral-checkout-title { font-size: 18px; }
  .mobile-summary-toggle { width: 100%; min-height: 62px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 20px; border: 0; border-block: 1px solid var(--line); background: var(--summary); color: var(--accent); cursor: pointer; }
  .mobile-summary-toggle > span { display: inline-flex; align-items: center; gap: 8px; }
  .mobile-summary-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
  .mobile-summary-toggle strong { color: var(--ink); font-size: 16px; }
  .mobile-summary { display: block; padding: 19px 20px 24px; border-bottom: 1px solid var(--line); background: var(--summary); }
  .mobile-summary .summary-inner { max-width: none; padding: 0; }
  .mobile-summary .summary-inner h2 { display: none; }
  .order-summary { display: none; }
  .main-inner > h1, #checkout-form, .success-state, .checkout-footer { margin-left: 20px; margin-right: 20px; }
  .main-inner > h1 { margin-top: 29px; margin-bottom: 27px; }
  .checkout-footer { margin-bottom: 30px; }
}

@media (max-width: 575px) {
  body { font-size: 14px; }
  .checkout-header { min-height: 70px; }
  .main-inner > h1, #checkout-form, .success-state, .checkout-footer { margin-left: 16px; margin-right: 16px; }
  .mobile-summary-toggle { padding-inline: 16px; }
  .mobile-summary { padding: 18px 16px 22px; }
  .field-grid { grid-template-columns: 1fr; gap: 10px; }
  .field.full { grid-column: auto; }
  .field input, .field select { height: 50px; font-size: 16px; }
  .section-heading { display: block; }
  .section-heading > span { display: block; margin-top: 4px; line-height: 1.4; }
  .payment-title img { width: 126px; }
  .provider-card-grid { grid-template-columns: 1fr; }
  .provider-field.full { grid-column: auto; }
  .checkout-section { margin-bottom: 28px; }
  .checkout-footer { justify-content: center; }
}

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