:root {
  color-scheme: light;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  font-synthesis: none;
  --ink: #202524;
  --muted: #63706b;
  --line: #dce3de;
  --paper: #fff;
  --page: #f4f5f2;
  --orange: #f36d0b;
  --orange-dark: #c84f00;
  --green: #14854f;
  --red: #af2e23;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--page); color: var(--ink); line-height: 1.48; }
button, input { font: inherit; }
button { cursor: pointer; }
a { color: var(--orange-dark); }
img { max-width: 100%; }
[hidden] { display: none !important; }
:where(a, button, input, summary):focus-visible { outline: 3px solid var(--orange-dark); outline-offset: 3px; }
.skip-link { position: fixed; left: 14px; top: -90px; z-index: 10; padding: 12px 16px; border-radius: 9px; background: #fff; color: var(--ink); font-weight: 750; }
.skip-link:focus { top: 14px; }
[id] { scroll-margin-top: 20px; }

.site-header { background: var(--ink); color: #fff; }
.header-inner { width: min(1080px, calc(100% - 40px)); margin: auto; min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; }
.brand img { display: block; object-fit: contain; border-radius: 9px; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 1.05rem; line-height: 1.2; }
.brand small { color: #b8c4bd; font-size: .76rem; margin-top: 3px; }
.back-link { color: #fff; text-decoration: none; font-weight: 650; font-size: .9rem; }
.back-link:hover, .text-link:hover { text-decoration: underline; }

.page-shell { width: min(1080px, calc(100% - 40px)); margin: 0 auto; padding: 32px 0 56px; }
.page-heading { max-width: 720px; margin-bottom: 24px; }
.eyebrow { color: var(--orange-dark); font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .13em; margin: 0 0 6px; }
h1, h2, p { margin-top: 0; }
h1 { font-size: clamp(2rem, 4vw, 2.85rem); line-height: 1.1; letter-spacing: -.035em; margin-bottom: 10px; }
.page-heading > p:last-child { color: var(--muted); margin-bottom: 0; }
.status-banner { border: 1px solid var(--line); border-radius: 12px; padding: 13px 16px; margin: 0 0 22px; font-weight: 650; }
.status-neutral { background: #eaf0eb; color: #315044; }
.status-good { background: #e8f5eb; border-color: #b8dfc2; color: #135b36; }
.status-error { background: #fff0eb; border-color: #efc4b8; color: #862a1b; }
.status-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin: -8px 0 22px; }
.status-actions .text-link { margin: 0; }
.secondary-button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink); font-weight: 750; text-align: center; }
.secondary-button:hover:not(:disabled) { border-color: var(--orange-dark); color: var(--orange-dark); }
.secondary-button:disabled { opacity: .55; cursor: wait; }

.checkout-grid { min-width: 0; }
.checkout-flow { display: grid; grid-template-columns: minmax(0, 1fr) 340px; align-items: start; gap: 18px 22px; min-width: 0; }
.checkout-flow > .panel, .checkout-flow > .submit-panel { grid-column: 1; }
.panel, .summary-panel, .submit-panel, .success-panel { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 2px 12px rgb(23 35 27 / 3%); }
.panel { padding: 22px; }
.checkout-empty { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 26px; padding: 28px; }
.checkout-empty h2 { font-size: 1.25rem; margin-bottom: 8px; letter-spacing: -.02em; }
.checkout-empty p { max-width: 650px; color: var(--muted); margin: 0; line-height: 1.6; }
.empty-checkout-actions { display: grid; gap: 9px; min-width: 190px; }
.empty-checkout-actions a { text-decoration: none; }
.section-heading { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.section-heading h2 { font-size: 1.22rem; letter-spacing: -.02em; margin: -2px 0 2px; }
.section-heading p { color: var(--muted); font-size: .88rem; margin: 0; }
.step { flex: 0 0 28px; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: #fff0e5; color: var(--orange-dark); font-size: .82rem; font-weight: 800; }
.text-link { display: inline-block; margin-top: 11px; font-size: .87rem; font-weight: 700; text-decoration: none; }
.helper { color: var(--muted); font-size: .83rem; margin: 9px 0 0; }
.helper:empty { display: none; }

.cart-items { display: grid; gap: 0; }
.cart-line { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 18px; padding: 13px 0; border-bottom: 1px solid #edf0ed; }
.cart-line:first-child { padding-top: 0; }
.cart-line:last-child { border-bottom: 0; padding-bottom: 0; }
.cart-line-name { font-size: .94rem; font-weight: 700; overflow-wrap: anywhere; }
.cart-line-meta { color: var(--muted); font-size: .79rem; margin-top: 3px; }
.cart-line-price { font-size: .93rem; font-weight: 750; text-align: right; white-space: nowrap; }
.cart-line-unit { display: block; color: var(--muted); font-size: .76rem; font-weight: 450; margin-top: 2px; }
.cart-line-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.cart-line-action { min-width: 44px; min-height: 44px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); font: inherit; font-size: .86rem; font-weight: 750; cursor: pointer; }
.cart-line-action:hover:not(:disabled) { border-color: var(--orange); color: var(--orange-dark); }
.cart-line-action:focus-visible { outline: 3px solid rgb(243 109 11 / 24%); outline-offset: 2px; }
.cart-line-action:disabled { opacity: .45; cursor: not-allowed; }
.cart-line-quantity { min-width: 25px; text-align: center; font-size: .86rem; font-weight: 750; }
.cart-line-remove { margin-left: 6px; color: var(--red); font-size: .78rem; }

.choice-group { padding: 0; margin: 0; border: 0; display: grid; gap: 10px; }
.choice-card { display: flex; gap: 12px; align-items: center; min-height: 76px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.choice-card:has(input:checked) { border-color: var(--orange); background: #fff8f0; box-shadow: 0 0 0 1px var(--orange) inset; }
.choice-card:focus-within, .payment-choice:focus-within { outline: 2px solid var(--orange-dark); outline-offset: 3px; }
.choice-card:has(input:disabled) { background: #f5f6f4; color: var(--muted); cursor: not-allowed; }
.choice-card:has(input:disabled) .choice-price { color: var(--muted); }
.choice-card input { width: 18px; height: 18px; margin: 0; accent-color: var(--orange); flex: 0 0 auto; }
.choice-card > span:nth-child(2) { min-width: 0; flex: 1; }
.choice-card strong, .choice-card small { display: block; }
.choice-card strong { font-size: .92rem; }
.choice-card small { color: var(--muted); font-size: .79rem; margin-top: 3px; }
.choice-price { color: var(--orange-dark); font-size: .84rem; font-weight: 750; white-space: nowrap; }
.delivery-fields { display: grid; gap: 13px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.delivery-fields .helper { margin: -4px 0 2px; }
.field { display: grid; gap: 5px; font-size: .84rem; font-weight: 700; margin-bottom: 13px; }
.field:last-child { margin-bottom: 0; }
.field input { width: 100%; min-width: 0; height: 48px; padding: 10px 11px; border: 1px solid #bfc9c1; border-radius: 9px; background: #fff; color: var(--ink); font-size: 1rem; }
.field input:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgb(243 109 11 / 14%); }
.field input[aria-invalid="true"] { border-color: var(--red); }
.field-error { color: var(--red); font-size: .78rem; font-weight: 500; line-height: 1.4; }
.optional { color: var(--muted); font-weight: 450; }
.form-row { display: grid; gap: 13px; }
.form-row.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-row.two-wide { grid-template-columns: minmax(0, 1fr) 130px; }
.form-row .field { margin-bottom: 0; }

.payment-options { display: grid; gap: 10px; }
.payment-subheading { margin: 17px 0 9px; font-size: .91rem; }
.payment-subheading:first-of-type { margin-top: 0; }
.payment-choice { display: flex; align-items: flex-start; gap: 10px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 10px; font-size: .9rem; font-weight: 700; cursor: pointer; }
.payment-choice:has(input:checked) { border-color: var(--orange); background: #fff8f0; }
.payment-choice input { accent-color: var(--orange); margin-top: 3px; }
.submit-panel { padding: 24px; }
.submit-panel > p:first-child { font-size: .86rem; color: var(--muted); }
.primary-button { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 11px 20px; border: 0; border-radius: 10px; background: var(--orange-dark); color: #fff; font-weight: 800; text-decoration: none; text-align: center; }
.primary-button:hover:not(:disabled) { background: #aa4300; }
.primary-button:disabled { background: #a8afaa; color: #fff; cursor: not-allowed; }
.submit-panel .primary-button { width: 100%; }
.submit-panel .helper { color: var(--red); }
.submit-panel .secondary-button { width: 100%; margin-top: 12px; }
.checkout-help { display: block; text-align: center; padding: 9px 0; }
.privacy-note { color: var(--muted); font-size: .76rem; margin: 14px 0 0; }

.summary-panel { grid-column: 2; grid-row: 1 / span 5; align-self: start; padding: 22px; position: sticky; top: 20px; }
.summary-panel h2 { font-size: 1.1rem; margin-bottom: 14px; }
.summary-row, .summary-total { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 9px 0; font-size: .88rem; }
.summary-row span { color: var(--muted); }
.summary-row strong { text-align: right; }
.summary-choice { font-size: .82rem; }
.summary-choice strong { max-width: 65%; overflow-wrap: anywhere; }
.summary-total { border-radius: 8px; background: #f4f6f2; margin: 10px 0; padding: 12px 13px; font-size: 1.05rem; font-weight: 800; }
.summary-total strong { color: var(--orange-dark); font-size: 1.35rem; }
.summary-note { font-size: .77rem; color: var(--muted); margin: 16px 0 0; }

.success-panel { max-width: 720px; margin: 28px auto 0; padding: 36px; text-align: center; }
.success-icon { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%; background: #e5f5ea; color: var(--green); font-size: 2rem; font-weight: 700; margin: 0 auto 18px; }
.success-panel h2 { font-size: 1.8rem; margin-bottom: 10px; }
.success-panel p { color: var(--muted); }
.order-code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .9rem; overflow-wrap: anywhere; }
.pix-payment { margin: 22px 0; padding: 20px; border: 1px solid var(--line); border-radius: 12px; background: #fafcf9; text-align: left; }
.pix-payment h3 { margin: 0 0 10px; }
.pix-payment p { font-size: .86rem; margin: 10px 0; }
.pix-amount { display: block; font-size: 1.65rem; color: var(--ink); }
.pix-qr { width: 256px; max-width: 100%; padding: 12px; margin: 16px auto; background: #fff; }
.pix-qr img, .pix-qr canvas { display: block; width: 100%; height: auto; }
.pix-code-label { display: grid; gap: 6px; margin: 14px 0 10px; font-size: .84rem; font-weight: 700; }
.pix-code { width: 100%; resize: vertical; min-height: 84px; border: 1px solid var(--line); border-radius: 8px; padding: 10px; font: .75rem/1.4 ui-monospace, monospace; overflow-wrap: anywhere; }
.pix-manual { padding: 12px; border-radius: 8px; background: #fff0e5; color: var(--ink) !important; }
.pix-refresh { border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); padding: 9px 13px; font-weight: 700; }
.pix-refresh:disabled { opacity: .6; cursor: wait; }
.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: 800px) {
  .checkout-flow { grid-template-columns: 1fr; }
  .summary-panel { position: static; grid-column: 1; grid-row: auto; }
  .page-shell { padding-top: 26px; }
}

@media (max-width: 560px) {
  .header-inner, .page-shell { width: min(100% - 28px, 1080px); }
  .header-inner { min-height: 70px; }
  .brand strong { font-size: .89rem; }
  .brand small { display: none; }
  .brand img { width: 38px; height: 38px; }
  .site-header .back-link { max-width: 94px; min-height: 44px; display: flex; align-items: center; text-align: right; font-size: .76rem; }
  .panel, .summary-panel, .submit-panel { padding: 18px; }
  .choice-card { flex-wrap: wrap; }
  .choice-price { margin-left: 30px; }
  .form-row.two, .form-row.two-wide { grid-template-columns: 1fr; }
  .checkout-empty { grid-template-columns: 1fr; gap: 20px; }
  .empty-checkout-actions { min-width: 0; }
  .success-panel { padding: 24px 18px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
