:root {
  --text: #3f3d5c;
  --black: #000;
  --page-bg: #fcfcfd;
  --outline: #acabba;
  --accent: #2c20df;
  --focus-ring: rgba(44, 32, 223, 0.14);
  --error: #d32f2f;
  --divider: #d9d9de;
  --secure-bar: #4f5050;
  --secure-bar-text: #ffffff;
  --wallet-bg: #f0f0f3;
  --footer-bg: #3f3d5c;
  --footer-bottom: #0e0d26;
  --price-red: #e53935;
  --pay-bg: #ffff00;
  --pay-fg: #0000ff;
  --pay-border: #0000ff;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { margin: 0; }

body {
  font-family: Figtree, sans-serif;
  font-size: 18px;
  color: var(--text);
  background: var(--page-bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

.page { flex: 1; }

.shell {
  max-width: 994px;
  margin: 4px auto 0;
  background: #fff;
  box-shadow: 0 2px 1px -1px rgba(0,0,0,.2), 0 1px 1px 0 rgba(0,0,0,.14), 0 1px 3px 0 rgba(0,0,0,.12);
}

/* ---------- Header ---------- */
.brand-header img { display: block; width: 100%; height: auto; }

.secure-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 0;
  background: var(--secure-bar);
  color: var(--secure-bar-text);
}
.secure-bar p { margin: 0; font-size: 20px; font-weight: 700; line-height: 1.5; }
.secure-bar .lock { width: 16px; height: 16px; }

/* ---------- Layout ---------- */
.checkout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 16px;
  padding-bottom: 16px;
}

.card-content { padding: 16px 24px 0; }
.card-content.no-top { padding-top: 0; }

.heading {
  margin: 0 0 16px;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--black);
}

.subtle { margin: 0; font-size: 14px; line-height: 1.5; color: var(--black); }

.helper {
  margin: 4px 14px 0;
  font-size: 14px;
  line-height: 1.33;
  color: var(--black);
}

/* ---------- Floating label fields ---------- */
.field {
  position: relative;
  height: 48px;
  margin-bottom: 16px;
  background: #fff;
  border: 1px solid var(--outline);
  border-radius: 4px;
  transition: border-color .15s, box-shadow .15s;
}
.field:hover { border-color: #7c7a92; }
.field:focus-within,
.field.is-focused {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
}
.field.is-invalid { border-color: var(--error); }
.field.is-invalid:focus-within,
.field.is-invalid.is-focused { box-shadow: 0 0 0 3px rgba(211,47,47,.12); }

.field input,
.field select {
  width: 100%;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  font-size: 16px;
  color: var(--black);
  padding: 21px 14px 8px 12px;
  border-radius: 4px;
}

.field label {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--black);
  pointer-events: none;
  transition: top .12s ease, font-size .12s ease, transform .12s ease;
  white-space: nowrap;
}

/* label shrinks when the field has a value or is focused */
.field input:focus + label,
.field input:not(:placeholder-shown) + label,
.field label.shrink,
.stripe-field.is-focused label,
.stripe-field.has-value label {
  top: 5px;
  transform: none;
  font-size: 11px;
  line-height: 1.3;
}

.field input::placeholder { color: transparent; }

/* Stripe element mount — matches native input padding */
.stripe-mount { padding: 21px 44px 8px 12px; height: 100%; }
.row-2 .stripe-mount { padding-right: 12px; }
.row-2 .stripe-field:has(.info) .stripe-mount { padding-right: 44px; }

.field-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  color: var(--black);
}
.field-icon svg { width: 24px; height: 24px; display: block; }
.field-icon.info { cursor: help; outline: none; }
.tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  right: -6px;
  width: 200px;
  padding: 8px 10px;
  border-radius: 4px;
  background: rgba(30, 30, 40, .92);
  color: #fff;
  font-size: 12px;
  line-height: 1.4;
  opacity: 0;
  visibility: hidden;
  transition: opacity .15s;
  z-index: 5;
}
.field-icon.info:hover .tooltip,
.field-icon.info:focus .tooltip { opacity: 1; visibility: visible; }

/* Select */
.select-field select {
  appearance: none;
  -webkit-appearance: none;
  padding: 21px 32px 4px 12px;
  cursor: pointer;
}
.select-field .chevron {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  color: var(--black);
  pointer-events: none;
}

.row-2 { display: grid; grid-template-columns: 1fr 1fr; column-gap: 16px; }

.field:has(+ .helper) { margin-bottom: 0; }
.field.is-invalid { margin-bottom: 36px; }
.field.is-invalid + .helper { display: none; }
.field-error {
  position: absolute;
  top: 100%;
  left: 0;
  margin: 3px 14px 0;
  font-size: 13px;
  line-height: 1.3;
  white-space: nowrap;
  color: var(--error);
}

/* ---------- Wallet (Apple Pay / Google Pay) ---------- */
.wallet-box {
  margin-top: 24px;
  min-height: 48px;
  background: var(--wallet-bg);
}
.wallet-box.has-wallet { background: transparent; }
.wallet-placeholder { display: none; }
.wallet-box.is-placeholder {
  display: grid; place-items: center;
  border: 1.5px dashed #c9c8d6; background: var(--wallet-bg);
}
.wallet-box.is-placeholder .wallet-placeholder { display: block; font-size: 13px; color: #8a899e; }

/* ---------- Payment methods ---------- */
.payment-header { padding-bottom: 16px; }
.payment-header .heading { margin-bottom: 2px; }

.method { border-top: 1px solid var(--divider); }
.method-row {
  display: flex;
  align-items: center;
  min-height: 56px;
  padding: 16px 0;
  cursor: pointer;
}
.method-row input { position: absolute; opacity: 0; pointer-events: none; }
.radio {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  margin-right: 12px;
  border: 2px solid var(--outline);
  border-radius: 50%;
  position: relative;
  transition: border-color .15s;
}
.method-row input:checked + .radio { border-color: var(--accent); }
.method-row input:checked + .radio::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--accent);
}
.method-row input:focus-visible + .radio { box-shadow: 0 0 0 4px var(--focus-ring); }

.method-title { font-size: 18px; font-weight: 600; color: var(--black); }
.paypal-logo { height: 28px; width: auto; }
.card-logos { margin-left: auto; display: flex; gap: 8px; }
.card-logos img { width: 38px; height: 24px; display: block; }

.method-body { display: none; }
.method.is-active .method-body { display: block; }
#method-paypal .method-body { padding-bottom: 16px; }
.method-note { margin: 0; font-size: 14px; color: var(--black); line-height: 1.5; }

/* ---------- Shipping ---------- */
.shipping {
  margin: 0 24px;
  padding: 16px 0 0;
  border-top: 1px solid var(--divider);
}
.billing { margin-top: 20px; }

/* ---------- Checkbox ---------- */
.checkbox {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 0 0 0 4px;
  font-size: 16px;
  line-height: 1.33;
  color: var(--text);
  cursor: pointer;
}
.checkbox input { position: absolute; opacity: 0; pointer-events: none; }
.checkbox .box {
  flex: 0 0 15px;
  width: 15px;
  height: 15px;
  margin-top: 2px;
  border: 1.5px solid #000;
  border-radius: 2px;
  position: relative;
  background: #fff;
}
.checkbox input:checked + .box { background: #000; }
.checkbox input:checked + .box::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 0;
  width: 4px;
  height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.checkbox input:focus-visible + .box { box-shadow: 0 0 0 3px var(--focus-ring); }

/* ---------- Cart summary ---------- */
.product-summary { margin-bottom: 16px; }
.product-name {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 700;
  color: var(--black);
  line-height: 1.3;
}
.product-image {
  display: block;
  width: 100%;
  max-width: 400px;
  height: auto;
  margin: 24px auto 0;
}

.price-block { padding-top: 16px; }
.price-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
}
.price-row.normal { color: var(--price-red); font-weight: 600; }
.price-row.normal s { text-decoration-thickness: 2px; }
.price-row.yours { color: var(--black); }

.all-details { padding-bottom: 16px; }
.detail-row {
  display: flex;
  justify-content: space-between;
  font-size: 16px;
  line-height: 1.5;
  color: var(--black);
  border-bottom: 1px solid var(--divider);
}
.detail-row.total { font-weight: 700; border-bottom: 1px solid var(--black); }

.optin {
  padding: 16px 0 16px 4px;
  border-bottom: 1px solid var(--divider);
}

.pay-area { padding: 16px 0 16px; text-align: center; }
.terms { margin: 0 0 16px; font-size: 12px; color: var(--black); }
.terms a { color: var(--accent); }

.pay-button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 15px;
  border: 3px solid var(--pay-border);
  border-radius: 12px;
  background: var(--pay-bg);
  color: var(--pay-fg);
  font: inherit;
  font-size: 24px;
  font-weight: 700;
  cursor: pointer;
  transition: filter .15s, transform .05s;
}
.pay-button .button-text { text-decoration: underline; line-height: 1.33; }
.pay-button:hover { filter: brightness(0.96); }
.pay-button:active { transform: translateY(1px); }
.pay-button:disabled { cursor: progress; filter: saturate(.6); }
.pay-button .spinner {
  display: none;
  width: 22px;
  height: 22px;
  border: 3px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
.pay-button.is-loading .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.form-error {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 4px;
  background: #fdecea;
  color: var(--error);
  font-size: 14px;
  text-align: left;
}

.powered {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 16px;
  font-size: 12px;
  color: #6b6a80;
}
.powered svg { width: 14px; height: 14px; }

/* ---------- Footer ---------- */
.site-footer { margin-top: 24px; color: #fff; }
.footer-main { background: var(--footer-bg); }
.footer-grid {
  max-width: 994px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}
.footer-col { padding: 16px 32px; }
.footer-col:first-child { padding-left: 24px; padding-right: 0; }
.footer-col h3 { margin: 0 0 12px; font-size: 16px; font-weight: 700; line-height: 1.33; }
.footer-col p { margin: 0 0 12px; font-size: 14px; line-height: 1.6; }
.footer-col p.strong { font-weight: 700; }
.footer-col a { color: #fff; }
.footer-logo { font-size: 20px; font-weight: 600; letter-spacing: .14em; }

.footer-bottom {
  background: var(--footer-bottom);
  padding: 8px 40px;
  text-align: center;
}
.footer-bottom p { margin: 8px 0; font-size: 14px; line-height: 1.6; }

/* ---------- Mobile ---------- */
@media (max-width: 767px) {
  .shell { margin-top: 0; box-shadow: none; }
  .checkout { grid-template-columns: 1fr; padding: 0 0 16px; }
  .card-content { padding-left: 20px; padding-right: 20px; }
  .shipping { margin: 0 20px; padding-left: 0; padding-right: 0; }
  .card-content.payment-header { padding-top: 24px; }
  .heading { font-size: 22px; }
  .row-2 { grid-template-columns: 1fr; }
  .shipping .row-2 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-col, .footer-col:first-child { padding: 16px 20px 0; }
  .footer-col:last-child { padding-bottom: 20px; }
  .footer-bottom { padding: 8px 20px; }
}

/* ---------- States ---------- */
body.is-loading .page, body.is-loading .site-footer { visibility: hidden; }
.preview-banner {
  position: sticky; top: 0; z-index: 20;
  padding: 8px 16px; text-align: center;
  background: #fff3cd; color: #6b4e00; font-size: 14px; font-weight: 600;
}
.unavailable { padding: 60px 24px; text-align: center; font-size: 18px; color: #000; }
.product-description { margin: 0 0 8px; font-size: 15px; line-height: 1.5; color: var(--text); white-space: pre-line; }
.customer-name-field { margin-top: 16px; }
.terms a, .footer-col a { overflow-wrap: anywhere; }
