:root {
  --font: -apple-system, "system-ui", "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  --text: #000;
  --muted: #707070;
  --border: #dedede;
  --border-dark: #000;
  --gray: #f5f5f5;
  --error: #dd1d1d;
  --radius: 12px;
  --input-h: 48px;
  --divider: calc(50% + 48px);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.4;
  color: var(--text);
  background: #fff;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
button, input, select { font: inherit; color: inherit; }
a { color: inherit; }
h2, h3, p { margin: 0; }
[hidden] { display: none !important; }

.skip { position: absolute; left: -9999px; top: 0; }
.skip:focus { left: 8px; top: 8px; background: #fff; padding: 8px; z-index: 100; }

/* Header */
.header { border-bottom: 1px solid #dfdfdf; background: #fff; }
.header__inner {
  position: relative;
  max-width: 1056px;
  margin: 0 auto;
  padding: 20px 38px;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 121px;
}
.header__logo img { height: 80px; width: auto; }

/* Mobile summary bar */
.mobile-summary { display: none; background: var(--gray); border-bottom: 1px solid var(--border); }
.mobile-summary__toggle {
  width: 100%; display: flex; justify-content: space-between; align-items: center;
  padding: 18px 16px; background: none; border: 0; cursor: pointer; text-align: left;
}
.mobile-summary__label { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
.mobile-summary__total { font-size: 19px; font-weight: 600; }
.mobile-summary__toggle[aria-expanded="true"] .chev { transform: rotate(180deg); }
.chev { transition: transform .15s; }
.mobile-summary__panel { padding: 0 16px 20px; }

/* Layout */
.page { display: flex; min-height: calc(100vh - 122px); }
.main {
  width: var(--divider);
  display: flex; justify-content: flex-end;
}
.main__inner {
  width: 100%; max-width: 576px;
  padding: 32px 40px 24px 38px;
  display: flex; flex-direction: column; min-height: 100%;
}
.aside {
  width: calc(100% - var(--divider));
  background: var(--gray);
  border-left: 1px solid var(--border);
}
.aside__inner { max-width: 481px; padding: 38px 38px 38px 43px; position: sticky; top: 0; }

/* Express */
.express { margin-bottom: 8px; }
.express__label { text-align: center; color: var(--muted); font-size: 12px; margin-bottom: 14px; }
#express-checkout-element { min-height: 48px; }
.or { display: flex; align-items: center; gap: 16px; margin: 18px 0 20px; color: var(--muted); font-size: 12px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* Sections */
.section { margin-bottom: 38px; }
.section__title { font-size: 20px; font-weight: 600; line-height: 1.2; margin-bottom: 14px; letter-spacing: -.01em; }
.section__desc { color: var(--muted); font-size: 14px; margin: -9px 0 12px; }
.section__title--sm { font-size: 16px; line-height: 1.4; }
.row { display: flex; gap: 14px; }
.row > .field { flex: 1 1 0; min-width: 0; }

/* Fields */
.field { position: relative; margin-bottom: 14px; }
.field input, .field select, .field .stripe-mount {
  width: 100%; height: var(--input-h);
  border: 1px solid var(--border); border-radius: var(--radius);
  background: #fff; padding: 0 11px; outline: none;
  transition: border-color .1s, box-shadow .1s;
  -webkit-appearance: none; appearance: none;
}
.field input { padding-top: 14px; }
.field input:focus, .field select:focus, .field--stripe.is-focused .stripe-mount {
  border-color: var(--border-dark); box-shadow: 0 0 0 1px var(--border-dark);
}
.field label {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--muted); font-size: 14px; pointer-events: none;
  transition: all .12s ease; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: calc(100% - 24px);
}
.field:has(.field__icon) label, .field--select label { max-width: calc(100% - 44px); }
.field input:focus + label, .field input:not(:placeholder-shown) + label,
.field--select label, .field--stripe.is-focused label, .field--stripe.is-filled label {
  top: 8px; transform: none; font-size: 12px;
}
.field--select select { padding: 14px 40px 0 11px; cursor: pointer; }
.field__chev { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.field__icon {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  color: var(--muted); display: inline-flex; cursor: help; z-index: 2;
}
.field__icon--static { cursor: default; }
.field__icon--inline { position: static; transform: none; vertical-align: -3px; margin-left: 2px; }
.field__icon[data-tip]::after {
  content: attr(data-tip); position: absolute; right: -6px; bottom: calc(100% + 10px);
  background: #000; color: #fff; font-size: 12px; line-height: 1.4; padding: 8px 10px;
  border-radius: 6px; width: 220px; white-space: normal; opacity: 0; visibility: hidden; transition: opacity .1s; z-index: 10;
}
.field__icon[data-tip]:hover::after, .field__icon[data-tip]:focus::after { opacity: 1; visibility: visible; }
.field.is-invalid input, .field.is-invalid .stripe-mount { border-color: var(--error); box-shadow: 0 0 0 1px var(--error); }
.field__error { color: var(--error); font-size: 12px; margin-top: 6px; display: flex; gap: 6px; align-items: flex-start; }
.field__error::before { content: "!"; flex: none; width: 14px; height: 14px; border-radius: 50%; background: var(--error); color: #fff; font-size: 10px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; margin-top: 1px; }

/* Stripe mounted elements */
.field--stripe .stripe-mount { padding: 17px 40px 0 11px; }
.field--stripe .stripe-mount .StripeElement, .field--stripe .stripe-mount iframe { height: 20px; }
.field--stripe .fallback-input { border: 0; padding: 0; height: 20px; width: 100%; outline: none; background: transparent; }

/* Checkbox */
.checkbox { display: flex; align-items: center; gap: 10px; cursor: pointer; margin: 2px 0 0; }
.checkbox input { position: absolute; opacity: 0; width: 0; height: 0; }
.checkbox__box {
  width: 18px; height: 18px; border: 1px solid var(--border); border-radius: 4px; background: #fff;
  display: inline-flex; align-items: center; justify-content: center; flex: none; transition: background .1s, border-color .1s;
}
.checkbox__box svg { opacity: 0; }
.checkbox input:checked + .checkbox__box { background: #000; border-color: #000; }
.checkbox input:checked + .checkbox__box svg { opacity: 1; }
.checkbox input:focus-visible + .checkbox__box { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #000; }

/* Radio */
.radio { width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--border); background: #fff; flex: none; display: inline-block; }
.radio--checked { border: 6px solid #000; }

/* Shipping */
.shipping__option {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: var(--input-h); padding: 14px 14px;
  border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; background: #fff;
}
.shipping__option input { position: absolute; opacity: 0; width: 0; height: 0; }
.shipping__option--selected { border-color: #000; box-shadow: 0 0 0 1px #000; background: var(--gray); }
.shipping__name { font-weight: 600; }
.shipping__price { font-weight: 600; }

/* Payment */
.payment { border: 1px solid var(--border); border-radius: var(--radius); background: #fff; }
.payment__head {
  display: flex; align-items: center; gap: 10px; padding: 14px 14px; height: 50px;
  background: #f6f6f6; border-radius: 11px 11px 0 0; position: relative;
}
.payment__head::after {
  content: ""; position: absolute; inset: -1px; border: 1px solid #000; border-radius: var(--radius) var(--radius) 0 0;
  pointer-events: none; z-index: 1;
}
.payment__title { font-weight: 600; flex: 1; }
.payment__icons { display: inline-flex; align-items: center; gap: 4px; }
.payment__icons img { width: 38px; height: 24px; border-radius: 3px; }
.payment__more { font-size: 10px; color: #000; height: 24px; min-width: 24px; padding: 0 3px; display: inline-flex; align-items: center; justify-content: center; background: #fff; border: 1px solid var(--border); border-radius: 3px; margin-left: 2px; }
.payment__body { background: rgba(0,0,0,.043); border-top: 1px solid var(--border); padding: 14px; border-radius: 0 0 11px 11px; }
.payment__body .field { margin-bottom: 10px; }
.payment__body .row { gap: 10px; }
.payment__body .checkbox { margin-top: 14px; }
.billing { margin-top: 20px; }
.billing__title { font-size: 14px; font-weight: 600; margin-bottom: 12px; }

.form-error { color: var(--error); font-size: 13px; margin-top: 12px; }
.form-error--inline { margin-top: -6px; margin-bottom: 12px; font-size: 12px; }

/* Pay button */
.pay-button {
  width: 100%; height: 50px; border: 0; border-radius: var(--radius);
  background: #000; color: #fff; font-size: 16px; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; position: relative;
  margin-top: 2px;
}
.pay-button:hover { background: #1a1a1a; }
.pay-button:disabled { background: #333; cursor: default; }
.pay-button__spinner { display: none; width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
.pay-button.is-loading .pay-button__spinner { display: inline-block; }
.pay-button.is-loading .pay-button__label { opacity: .7; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Footer */
.footer {
  margin-top: auto; padding-top: 20px; border-top: 1px solid var(--border);
  display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: 12px;
}
.footer a { color: #000; text-decoration: underline; }

/* Summary */
.summary__lines { display: flex; flex-direction: column; gap: 14px; margin-bottom: 24px; }
.line { display: flex; align-items: center; gap: 14px; }
.line__thumb { position: relative; flex: none; width: 64px; height: 64px; border: 1px solid var(--border); border-radius: 8px; background: #fff; overflow: visible; }
.line__thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 7px; }
.line__qty {
  position: absolute; top: -8px; right: -8px; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 10px; background: #000; color: #fff; font-size: 12px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center;
}
.line__info { flex: 1; min-width: 0; }
.line__title { font-size: 14px; font-weight: 500; }
.line__variant { font-size: 12px; color: var(--muted); margin-top: 2px; }
.line__price { font-size: 14px; white-space: nowrap; }

.discount { display: flex; margin-bottom: 24px; }
.discount .field { flex: 1; margin: 0; }
.discount .field input { border-radius: var(--radius) 0 0 var(--radius); border-right: 0; }
.discount .field input:focus { position: relative; z-index: 1; border-right: 1px solid #000; }
.discount__apply {
  height: var(--input-h); padding: 0 14px; border: 1px solid var(--border); border-left: 1px solid var(--border);
  border-radius: 0 var(--radius) var(--radius) 0; background: #f6f6f6; color: var(--muted);
  font-weight: 500; cursor: pointer; transition: background .1s, color .1s;
}
.discount__apply:not(:disabled) { background: #000; color: #fff; border-color: #000; }
.discount__tags { display: flex; flex-wrap: wrap; gap: 8px; margin: -12px 0 20px; }
.discount__tags:empty { display: none; }
.tag { display: inline-flex; align-items: center; gap: 6px; background: #fff; border: 1px solid var(--border); border-radius: 6px; padding: 5px 8px; font-size: 12px; font-weight: 600; }
.tag button { border: 0; background: none; padding: 0 2px; cursor: pointer; color: var(--muted); font-size: 14px; line-height: 1; }

.totals__row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.totals__row--total { margin-top: 12px; font-size: 16px; font-weight: 600; }
.totals__row--total span:last-child { font-size: 19px; }

.notice {
  position: fixed; left: 16px; bottom: 16px; max-width: 360px; background: #111; color: #fff;
  padding: 12px 14px; border-radius: 10px; font-size: 12px; line-height: 1.45; z-index: 50; box-shadow: 0 6px 20px rgba(0,0,0,.25);
}
.notice code { font-family: ui-monospace, Menlo, monospace; color: #ffd166; }
.notice__close { position: absolute; top: 4px; right: 6px; background: none; border: 0; color: #fff; font-size: 16px; cursor: pointer; }
.notice { padding-right: 28px; }

/* Responsive */
@media (max-width: 999px) {
  .header__inner { min-height: 64px; padding: 12px 16px; }
  .header__logo img { height: 40px; }
  .mobile-summary { display: block; }
  .page { display: block; min-height: 0; }
  .main { width: 100%; display: block; }
  .main__inner { max-width: none; padding: 20px 16px 24px; }
  .aside { display: none; }
  .section__title { font-size: 21px; }
  .field__icon[data-tip]::after { width: 200px; }
}
@media (max-width: 480px) {
  .row { flex-direction: column; gap: 0; }
}
