:root {
  --bg: #f7f7f8;
  --surface: #fff;
  --text: #16161a;
  --muted: #6f6f78;
  --tertiary: #92929a;
  --line: #dedee3;
  --green: #1fc88b;
  --green-dark: #16a875;
  --red: #ff1747;
  --red-dark: #e60d3b;
  --focus: #078f64;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg);
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--bg); font-size: 14px; line-height: 1.45; }
button, input, select { font: inherit; color: inherit; }
button, select { cursor: pointer; }
button { border: 0; }
svg { display: block; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }

.skip-link { position: fixed; z-index: 10; left: 12px; top: -50px; color: #fff; background: #111; padding: 10px 14px; }
.skip-link:focus { top: 10px; }
.page { min-height: 100vh; padding: 64px 8px 80px; }
.checkout-grid { width: min(100%, 1320px); margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr) 480px; gap: 32px; align-items: start; }
.billing-form, .summary-card { min-width: 0; background: var(--surface); }
.billing-form { min-height: 880px; display: flex; flex-direction: column; }
.form-content { width: 100%; min-width: 0; max-width: 100%; padding: 32px 32px 24px; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 24px; font-size: 32px; line-height: 1.1; letter-spacing: 0; }
h2 { margin-bottom: 24px; font-size: 24px; line-height: 1.25; letter-spacing: 0; }
.security-note { display: flex; align-items: flex-start; gap: 12px; margin: 0 0 10px; color: var(--muted); font-size: 16px; }
.security-note span { min-width: 0; overflow-wrap: anywhere; }
.security-note svg { flex: 0 0 20px; width: 20px; height: 20px; margin-top: 1px; color: var(--green-dark); }
.fields { min-width: 0; margin-top: 28px; }
.field-label { display: block; margin: 20px 0 8px; font-size: 16px; font-weight: 650; }
.field-heading { min-height: 34px; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-top: 20px; }
.field-heading .field-label { margin-top: 0; }
.contact-toggle { flex: 0 0 auto; height: 34px; display: inline-grid; grid-template-columns: 1fr 1fr; gap: 2px; border: 1px solid #d7dadd; border-radius: 5px; background: #f3f4f4; padding: 2px; }
.contact-mode { min-width: 58px; border-radius: 3px; background: transparent; padding: 0 12px; color: var(--muted); font-size: 14px; font-weight: 650; }
.contact-mode.active { color: var(--text); background: #fff; box-shadow: 0 1px 3px #16221e1f; }
.contact-mode:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.select-wrap { position: relative; width: 100%; min-width: 0; max-width: 100%; height: 42px; display: flex; align-items: center; overflow: hidden; border: 1px solid #d7dadd; border-radius: 4px; background: #fff; }
.select-wrap:focus-within, .text-input:focus { border-color: var(--focus); box-shadow: 0 0 0 1px var(--focus); outline: 0; }
.select-wrap select { width: 100%; min-width: 0; height: 100%; appearance: none; border: 0; outline: 0; background: transparent; padding: 0 48px 0 54px; font-size: 16px; }
.region-select select { padding-left: 16px; }
.select-wrap > svg { position: absolute; right: 18px; width: 20px; height: 20px; pointer-events: none; }
.country-flag { flex: 0 0 24px; width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }
.native-select-hidden { position: absolute !important; width: 1px !important; height: 1px !important; margin: -1px !important; padding: 0 !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; white-space: nowrap !important; border: 0 !important; }
.combo { position: relative; width: 100%; min-width: 0; }
.combo-trigger { width: 100%; min-width: 0; height: 42px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border: 1px solid #d7dadd; border-radius: 4px; background: #fff; padding: 0 18px; text-align: left; font-size: 16px; }
.combo-trigger:hover { border-color: #b9bdbf; }
.combo-trigger:focus, .combo-trigger[aria-expanded="true"] { border-color: var(--focus); box-shadow: 0 0 0 1px var(--focus); outline: 0; }
.combo-trigger > svg { flex: 0 0 20px; width: 20px; height: 20px; transition: transform .16s ease; }
.combo-trigger[aria-expanded="true"] > svg { transform: rotate(180deg); }
.combo-value { min-width: 0; display: flex; align-items: center; gap: 12px; }
.combo-placeholder { color: #898991; }
.combo-menu { position: absolute; z-index: 12; top: calc(100% + 4px); left: 0; width: 100%; overflow: hidden; border: 1px solid #d7dadd; border-radius: 6px; background: #fff; box-shadow: 0 10px 30px #1a29251f; }
.combo-search { height: 52px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid #e6e8e9; padding: 0 14px; }
.combo-search svg { flex: 0 0 18px; width: 18px; height: 18px; color: var(--muted); }
.combo-search input { min-width: 0; width: 100%; height: 100%; border: 0; outline: 0; background: transparent; font-size: 16px; }
.combo-search input::-webkit-search-cancel-button { cursor: pointer; }
.combo-list { max-height: 330px; overflow-y: auto; overscroll-behavior: contain; padding: 4px 6px; }
.combo-option { width: 100%; min-height: 52px; display: flex; align-items: center; gap: 12px; border-radius: 4px; background: #fff; padding: 10px 14px; text-align: left; font-size: 17px; }
.combo-option:hover, .combo-option:focus-visible, .combo-option[aria-selected="true"] { outline: 0; background: #e3e8e7; }
.country-option img { flex: 0 0 24px; width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }
.combo-empty { margin: 0; padding: 22px 14px; color: var(--muted); text-align: center; }
.text-input { width: 100%; height: 42px; border: 1px solid #d7dadd; border-radius: 4px; outline: 0; background: #fff; padding: 0 16px; font-size: 16px; }
.contact-input-wrap { display: flex; width: 100%; min-width: 0; }
.contact-input-wrap .phone-country-code { flex: 0 0 82px; width: 82px; height: 42px; border: 1px solid #d7dadd; border-right: 0; border-radius: 4px 0 0 4px; background: #fff; padding: 0 8px; font-size: 16px; }
.contact-input-wrap .phone-country-code:focus { position: relative; z-index: 1; border-color: var(--focus); outline: 0; box-shadow: 0 0 0 1px var(--focus); }
.contact-input-wrap .contact-input { min-width: 0; }
.contact-input-wrap .phone-country-code:not([hidden]) + .contact-input { border-radius: 0 4px 4px 0; }
.text-input::placeholder { color: #898991; }
.text-button { width: fit-content; padding: 0; color: #086b55; background: none; text-decoration: underline; font-weight: 650; }
.address-line-toggle { display: inline-block; margin-top: 14px; color: var(--text); font-size: 16px; }
.continue-row { margin-top: auto; padding: 16px 32px 32px; }
.continue-button { width: min(100%, 220px); height: 50px; border-radius: 999px; background: var(--red); color: #fff; font-size: 15px; font-weight: 750; position: relative; transition: background 0.2s ease; }
.continue-button:hover { background: var(--red-dark); }
.continue-button:focus-visible { outline: 3px solid #ff9bb1; outline-offset: 2px; }
.continue-button:disabled { background: var(--red-dark); cursor: wait; }
.continue-button.loading .button-text { opacity: 0; }
.continue-button .button-text { transition: opacity 0.2s ease; }
.continue-button .spinner { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 20px; height: 20px; border: 2px solid rgba(255, 255, 255, 0.3); border-top-color: #fff; border-radius: 50%; opacity: 0; animation: spin 0.8s linear infinite; transition: opacity 0.2s ease; }
.continue-button.loading .spinner { opacity: 1; }
@keyframes spin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

.summary-card { position: sticky; top: 16px; padding: 32px; }
.products { display: flex; flex-direction: column; gap: 16px; }
.product { display: grid; grid-template-columns: 48px minmax(100px, 1fr) auto; grid-template-rows: auto auto; column-gap: 16px; align-items: center; }
.product img { width: 48px; height: 48px; grid-row: 1 / span 2; border-radius: 0; object-fit: cover; }
.product-copy h3 { margin-bottom: 2px; font-size: 16px; line-height: 1.25; }
.product-copy p { margin-bottom: 0; color: var(--muted); font-size: 16px; font-variant-numeric: tabular-nums; }
.product-controls { display: flex; align-items: center; gap: 12px; }
.quantity { width: 82px; min-width: 82px; height: 42px; appearance: none; -webkit-appearance: none; border: 1px solid #e0e2e3; border-radius: 999px; background: #fff; padding: 0 14px; font-size: 16px; text-align: left; text-align-last: left; }
.product-price { grid-column: 3; margin-top: 4px; text-align: right; font-size: 16px; font-weight: 500; font-variant-numeric: tabular-nums; }
.fee-row, .total-row { display: flex; justify-content: space-between; font-variant-numeric: tabular-nums; }
.fee-row { margin: 48px 0 42px; font-size: 17px; font-weight: 500; }
.summary-card hr { border: 0; border-top: 1px solid var(--line); margin: 0; }
.total-row { margin-top: 28px; font-size: 21px; font-weight: 700; }
.pay-method { margin-top: 9px; font-size: 17px; }
.rates { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; margin-top: 17px; }
.rates p { display: flex; gap: 8px; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.35; }
.rates svg { flex: 0 0 16px; width: 16px; height: 16px; color: var(--tertiary); }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 20; transform: translate(-50%, 25px); padding: 11px 16px; border-radius: 4px; color: #fff; background: #222; opacity: 0; pointer-events: none; transition: .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 959px) {
  .page { padding-top: 24px; }
  .checkout-grid { grid-template-columns: minmax(0, 1fr); width: min(100%, 680px); }
  .summary-card { position: static; }
  .billing-form { min-height: 500px; }
  .form-content { width: 100%; }
}

@media (max-width: 560px) {
  .page { padding: 0 0 50px; min-height: 100vh; }
  .checkout-grid { gap: 0; }
  .summary-card, .billing-form { border-width: 0 0 1px; }
  .summary-card { padding: 24px 16px; }
  .billing-form { min-height: 490px; }
  .form-content { padding: 28px 16px 22px; }
  h1 { font-size: 26px; }
  .contact-toggle { margin-top: 0; }
  .contact-mode { min-width: 52px; padding: 0 9px; }
  .continue-row { padding: 16px; }
  .continue-button { width: 100%; max-width: none; }
  .product { grid-template-columns: 48px minmax(76px, 1fr) auto; column-gap: 10px; }
  .product img { width: 48px; height: 48px; }
  .product-copy h3 { font-size: 15px; }
  .product-copy p { font-size: 13px; }
  .product-controls { gap: 4px; }
  .quantity { width: 68px; min-width: 68px; height: 40px; padding: 0 10px; font-size: 14px; }
  .product-price { font-size: 14px; }
}
