/* Checkout refinements. Loaded after the shared gateway styles. */
:root {
  --muted: #667087;
  --success: #237346;
  --border-focus: #16233f;
}

html { scroll-padding-top: 96px; }
.checkout-header { padding: 22px 20px 0; animation: none; }
.checkout-logo { font-size: 22px; line-height: 1.25; }
.breadcrumb { margin-top: 12px; }
.breadcrumb-step.active { font-weight: 700; }
.breadcrumb-step.done { color: var(--success); }
.checkout-page { max-width: 1120px; padding: 20px 24px 48px; }
.checkout-grid { grid-template-columns: minmax(0, 1fr) 360px; gap: 32px; margin-top: 0; }
.checkout-main { min-width: 0; }
.checkout-intro { margin-bottom: 24px; }
.checkout-intro h1 { font: 700 clamp(28px, 3.1vw, 38px)/1.18 'Recoleta', serif; color: var(--heading); letter-spacing: -.025em; }
.checkout-intro > p { margin-top: 9px; font-size: 15px; line-height: 1.55; }
.checkout-reassurance { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin-top: 14px; color: var(--heading); font-size: 12px; line-height: 1.5; }
.checkout-reassurance > span { display: inline-flex; align-items: center; gap: 6px; }
.checkout-reassurance svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--success); }
.animate-in, .order-summary { opacity: 1; animation: none; transform: none; }
.checkout-card { padding: 26px 26px 24px; transition: none; }
.section-header { margin-bottom: 19px; gap: 10px; }
.section-title { font-size: 21px; line-height: 1.3; }
.section-number { width: 28px; height: 28px; background: var(--heading); color: #fff; transition: background-color 160ms ease; }
.section-number.done { background: var(--success); }
.section-help, .field-help, .checkout-field-help { font-size: 13px; line-height: 1.5; color: var(--body); }
.section-help { margin: -8px 0 18px; }
.field-help, .checkout-field-help { margin: 6px 0 0 2px; }

/* Clear fields, readable labels and predictable validation. */
.float-field input, .float-field select, .promo-input { font-size: 16px; }
.float-field input, .float-field select { height: 58px; border-color: #c9c6c0; padding-top: 24px; padding-bottom: 8px; }
.float-field input { padding-right: 40px; }
/* Anchor the empty label to the 58px input, not helper/error text below it. */
.float-field label { top: 29px; color: #667087; transition: color 140ms ease, top 140ms ease, transform 140ms ease, font-size 140ms ease; }
.float-field input:focus ~ label, .float-field select:focus ~ label { color: var(--heading); }
.float-field input:focus, .float-field select:focus, .promo-input:focus { border-color: var(--heading); box-shadow: 0 0 0 3px rgb(22 35 63 / 12%); }
.float-field input.valid ~ label { color: var(--success); }
.float-field input.invalid:focus { border-color: var(--error); box-shadow: 0 0 0 3px rgb(192 57 43 / 12%); }
.validation-icon, .foxentry-spinner { top: 29px; }
.float-field input.valid ~ .validation-icon.check { animation: none; }
.field-error, .field-warning, .email-suggestion, .phone-preview { font-size: 13px; line-height: 1.45; }
.field-error { margin-top: 6px; }
.float-field { scroll-margin-top: 104px; }
.smart-fill-banner { background: var(--light); border-color: var(--border); color: var(--body); }
.smart-fill-banner .smart-fill-text strong { color: var(--heading); }
.company-toggle, .billing-toggle { min-height: 48px; background: #fbfaf7; border-color: var(--border); border-radius: 9px; }
.company-toggle input[type='checkbox'], .billing-toggle input[type='checkbox'] { accent-color: var(--heading); }
.company-fields, .billing-fields, .promo-form { transition: opacity 160ms ease; }
.company-fields:not(.is-open), .billing-fields:not(.is-open), .promo-form:not(.is-open) { visibility: hidden; }
.company-fields.is-open, .billing-fields.is-open { max-height: none; overflow: visible; }
.phone-warning-actions button, .email-warning-actions button { min-height: 44px; font-size: 13px; }
.phone-warning-confirm, .email-warning-confirm { color: var(--heading); }
.foxentry-item { min-height: 44px; padding: 12px 14px; }
.foxentry-item:hover, .foxentry-item.is-active { background: var(--light); }

/* Quantity options stay visible so bundles can be compared directly. */
.checkout-quantity { background: #fff; border: 1px solid var(--border); border-radius: 12px; margin-bottom: 18px; }
.checkout-quantity-heading { margin: 0; padding: 16px 18px; color: var(--heading); font: inherit; font-size: 14px; line-height: 1.45; }
.checkout-quantity-heading strong { font-weight: 700; }
.checkout-quantity .bundle-section { border: 0; padding: 0 16px 16px; margin: 0; border-radius: 0; }
.checkout-quantity .bundle-section-title { font-family: inherit; font-size: 13px; color: var(--body); font-weight: 400; }
.bundle-option { border-color: var(--border); transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease; }
.bundle-option.selected { border-color: var(--heading); background: #f8f5ec; box-shadow: 0 0 0 1px var(--heading); }
.bundle-option.selected .bundle-radio { border-color: var(--heading); }
.bundle-radio-dot { background: var(--heading); }
.bundle-badge { color: var(--heading); background: #f6d98f; font-size: 9px; }
.bundle-bonus { font-size: 12px; }

/* Additions remain optional and visually subordinate to payment. */
.checkout-extras { padding: 24px 26px; background: #fff; border: 1px solid var(--border); border-top: 0; }
.checkout-extras-title { font: 600 18px/1.35 'Recoleta', serif; color: var(--heading); margin-bottom: 5px; }
.checkout-extras > p { font-size: 13px; line-height: 1.5; margin-bottom: 16px; }
.order-bump { background: #fbfaf7; border: 1px solid var(--border); border-radius: 10px; box-shadow: none; margin-bottom: 10px; transition: border-color 160ms ease, background-color 160ms ease; }
.order-bump:last-child { margin-bottom: 0; }
.order-bump::before { display: none; animation: none; }
.order-bump.checked { border-color: var(--heading); background: #f8f5ec; box-shadow: 0 0 0 1px var(--heading); }
.order-bump-header { min-height: 88px; padding: 14px 12px; gap: 10px; }
.order-bump-title { line-height: 1.35; }
.order-bump-title em { color: var(--heading); }
.order-bump-new-price, .order-bump-prices-inline .order-bump-new-price { color: var(--heading); }
.order-bump.checked .order-bump-checkbox { background: var(--heading); border-color: var(--heading); }
.order-bump-tag { background: #eee8dd; color: var(--heading); }
.order-bump-save-tag { background: #e5f0e6; color: #237346; }
.order-bump-expand { min-width: 44px; min-height: 44px; padding: 8px 12px; border-radius: 8px; border-color: #c9c6c0; background: #fff; color: var(--heading); font-size: 12px; transition: background-color 160ms ease, border-color 160ms ease; }
.order-bump-expand:hover { transform: none; background: var(--light); border-color: var(--heading); }
.order-bump-detail { transition: opacity 180ms ease; }
.order-bump-detail:not(.open) { visibility: hidden; }
.order-bump-detail.open { max-height: none; }
.multi-bumps { padding: 24px 0; margin: 0; }
.multi-bumps-title { font-size: 20px; }
.multi-bumps-sub { line-height: 1.5; }
/* Two clear decisions: inspect the book, or explicitly add it to the order. */
.multi-bump-card { margin-top: 14px; border-radius: 16px; transition: border-color 160ms ease, box-shadow 160ms ease; }
.multi-bump-card.checked { border-width: 1.5px; border-color: #237349; box-shadow: 0 0 0 1px #237349; }
.multi-bump-header { grid-template-columns: 80px minmax(0, 1fr); gap: 0 18px; align-items: start; padding: 20px 20px 0; cursor: default; }
.multi-bump-header > .bump-cover-preview { align-self: center; }
.multi-bump-cover { width: 80px; height: 112px; border-radius: 4px; }
.multi-bump-copy { min-width: 0; }
.multi-bump-top { margin-bottom: 7px; gap: 7px; }
.multi-bump-tag { background: #f2ead8; color: #765100; font-size: 9px; letter-spacing: .05em; }
.multi-bump-discount { font-size: 10px; }
.multi-bump-name { margin: 0; font: 700 18px/1.3 'DM Sans', sans-serif; color: var(--heading); text-wrap: balance; }
.multi-bump-author { font-size: 12px; margin: 5px 0 8px; }
.multi-bump-desc { font-size: 13px; line-height: 1.5; }
.multi-bump-expand { grid-column: auto; margin: 4px 0 0; padding: 8px 0; width: fit-content; min-height: 44px; border: 0; border-radius: 4px; background: transparent; color: var(--heading); font-size: 12px; justify-content: flex-start; gap: 7px; text-decoration: underline; text-underline-offset: 3px; }
.multi-bump-expand:hover { background: transparent; color: #946000; }
.multi-bump-actions { grid-column: 1 / -1; display: flex; flex-direction: row; justify-content: space-between; align-items: center; gap: 16px; margin: 12px -20px 0; padding: 14px 20px; background: #faf8f3; border-top: 1px solid var(--border); }
.multi-bump-card.checked .multi-bump-actions { background: #edf6ef; }
.multi-bump-price { grid-column: auto; display: flex; flex-wrap: wrap; gap: 2px 9px; align-items: baseline; text-align: left; white-space: normal; }
.multi-bump-price .multi-bump-old { display: block; font-size: 12px; }
.multi-bump-price .multi-bump-new { display: block; font-size: 22px; line-height: 1.2; }
.multi-bump-price .multi-bump-save { display: block; flex-basis: 100%; font-size: 11px; }
.multi-bump-check { position: relative; display: flex; align-items: center; justify-content: center; gap: 9px; flex-shrink: 0; width: auto; min-width: 148px; height: auto; min-height: 46px; padding: 10px 14px; border: 1.5px solid #d9a733; border-radius: 9px; background: #f8d67e; color: var(--heading); appearance: none; cursor: pointer; font: 700 13px/1.2 'DM Sans',sans-serif; transition: background-color 160ms ease, transform 160ms ease; }
.multi-bump-check-icon { width: 18px; height: 18px; display: grid; place-items: center; border: 1.5px solid currentColor; border-radius: 4px; }
.multi-bump-check svg { width: 13px; }
.multi-bump-card.checked .multi-bump-check { color: #17623a; background: #fff; border-color: #237349; }
.multi-bump-check:focus-visible, .multi-bump-expand:focus-visible { outline: 3px solid #31598e; outline-offset: 3px; }
@media (hover: hover) and (pointer: fine) {
  .multi-bump-check:hover { background: #f3c44d; transform: translateY(-1px); }
  .multi-bump-card.checked .multi-bump-check:hover { background: #e3f1e6; }
}
.multi-bump-check:active { transform: translateY(1px); }
.multi-bump-detail { transition: opacity 180ms ease; }
.multi-bump-detail:not(.open) { visibility: hidden; }
.multi-bump-detail.open { max-height: none; }
.multi-bump-add { min-height: 48px; transition: transform 160ms ease, background-color 160ms ease; }
.multi-bump-add:hover { background: #f5bc39; transform: translateY(-1px); }
.multi-bump-add:active { transform: translateY(1px); }

/* Covers can be inspected without selecting the optional book. */
.bump-cover-preview { position: relative; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: max-content; min-width: 44px; min-height: 44px; padding: 0; border: 0; border-radius: 5px; background: transparent; cursor: zoom-in; line-height: 0; transition: transform 180ms ease-out; }
.bump-cover-preview img { display: block; }
.order-bump-thumb, .order-bump-img { overflow: visible; }
.order-bump-thumb .bump-cover-preview, .order-bump-img .bump-cover-preview { width: 100%; height: 100%; }
.bump-cover-preview:focus-visible { outline: 3px solid #31598e; outline-offset: 4px; }
.bump-cover-dialog { box-sizing: border-box; width: min(480px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); margin: auto; padding: 16px; border: 1px solid var(--border); border-radius: 14px; background: #fffdf9; color: var(--heading); box-shadow: 0 20px 80px rgb(22 35 63 / 25%); }
.bump-cover-dialog::backdrop { background: rgb(22 35 63 / 72%); }
.bump-cover-dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.bump-cover-dialog-title { margin: 0; font-size: 16px; line-height: 1.4; }
.bump-cover-dialog-close { flex-shrink: 0; min-width: 44px; min-height: 44px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--heading); font: inherit; font-size: 14px; cursor: pointer; }
.bump-cover-dialog-close:focus-visible { outline: 3px solid #31598e; outline-offset: 3px; }
.bump-cover-dialog-image { display: block; width: 100%; max-height: calc(100dvh - 150px); object-fit: contain; }

/* Payment selection reinforces the user's choice without shifting rows. */
.payment-method, .brite-alt-method, .klarna-parent { min-height: 68px; transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease; }
.payment-method.selected, .brite-alt-method.selected, .klarna-parent.expanded { border-color: var(--heading); background: #f8f5ec; box-shadow: 0 0 0 1px var(--heading); }
.payment-method.selected .pm-radio, .brite-alt-method.selected .pm-radio { border-color: var(--heading); }
.pm-radio-dot, .klarna-sub-radio-dot { background: var(--heading); }
.pm-name { font-size: 15px; }
.pm-desc { font-size: 12px; line-height: 1.4; margin-top: 3px; }
.pm-badge { color: #5f4914; background: #f6e6b9; }
.pm-icon { border-color: var(--border); }
.pm-radio, .pm-radio-dot, .klarna-sub-radio-dot { transition-duration: 160ms; }
.klarna-sub-method { min-height: 56px; }
.klarna-sub-method.selected { background: #f8f5ec; }
.klarna-sub-method.selected .klarna-sub-radio { border-color: var(--heading); }

/* One clear, stable primary action. */
.checkout-btn-wrap { padding: 24px 26px 26px; }
.checkout-btn { min-height: 60px; background: #efb122; color: var(--heading); border: 2px solid var(--heading); border-radius: 10px; box-shadow: 0 4px 0 var(--heading); font-size: 17px; line-height: 1.4; letter-spacing: 0; padding: 16px 20px; transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease; }
.checkout-btn::before { display: none; }
.checkout-btn:hover { background: #f5bc39; box-shadow: 0 5px 0 var(--heading); transform: translateY(-1px); }
.checkout-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--heading); }
.checkout-btn:disabled, .checkout-btn:disabled:hover { background: #efb122; box-shadow: 0 4px 0 var(--heading); transform: none; }
.checkout-btn.loading { opacity: .9; }
.checkout-btn .spinner { border-color: rgb(22 35 63 / 25%); border-top-color: var(--heading); }
.btn-subtext, .btn-loading-sub { margin-top: 14px; color: var(--body); font-size: 12px; line-height: 1.6; }
.checkout-trust { gap: 8px 16px; }
.checkout-trust-item { color: var(--body); font-size: 12px; }
.submit-validation-msg { text-align: left; line-height: 1.5; }
.checkout-help { margin-top: 16px; font-size: 13px; text-align: center; line-height: 1.5; }
.checkout-help a { color: var(--heading); text-underline-offset: 3px; }

/* Totals remain the strongest part of the order summary. */
.order-summary { top: 24px; padding: 24px; box-shadow: 0 8px 30px rgb(22 35 63 / 4%); }
.summary-title { font-size: 23px; margin-bottom: 20px; }
.summary-product-img { width: 84px; height: 109px; }
.summary-product-name { font-size: 17px; }
.summary-product-author, .summary-product-format { font-size: 12px; line-height: 1.4; }
.summary-product-price { color: var(--heading); }
.summary-bonus { color: var(--success); background: #eef5ec; font-size: 12px; line-height: 1.45; }
.summary-line { gap: 12px; line-height: 1.5; }
.summary-line.total { padding-top: 16px; margin-top: 12px; border-top: 1px solid var(--heading); }
.summary-line.total .price { color: var(--heading); font-size: 30px; }
.guarantee-box { border-color: var(--border); background: var(--light); padding: 16px; }
.guarantee-box .title { font-size: 15px; }
.guarantee-box .desc { color: var(--body); }
.summary-shipping-info { background: transparent; padding: 12px 0 0; border: 0; border-radius: 0; }
.summary-shipping-row svg { color: var(--heading); }
.summary-payments img, .summary-payments img:hover { transition: none; transform: none; box-shadow: none; }
.promo-toggle { min-height: 44px; color: var(--body); font-size: 13px; }
.promo-input { width: 0; min-width: 0; }
.promo-apply-btn, .promo-remove { min-height: 44px; }
.promo-remove { min-width: 44px; }
.promo-apply-btn:hover { transform: none; }
.secure-badge { color: var(--success); }

/* Visible keyboard focus also applies to custom radio/checkbox rows. */
.checkout-page :is(button, a, summary, [role='button'], [role='radio']):focus-visible,
.checkout-header a:focus-visible,
.checkout-footer a:focus-visible,
.mobile-summary-bar .msb-header:focus-visible { outline: 3px solid #31598e; outline-offset: 4px; }
.payment-method:focus-within, .bundle-option:focus-within, .brite-alt-method:focus-within,
.klarna-sub-method:focus-within, .company-toggle:focus-within, .billing-toggle:focus-within { outline: 3px solid #31598e; outline-offset: 3px; }

@media (hover: hover) and (pointer: fine) {
  .bump-cover-preview:hover { z-index: 2; transform: scale(1.12); }
  .payment-method:hover, .brite-alt-method:hover, .klarna-parent:hover, .bundle-option:hover { border-color: #7d879a; background: #fbf8f3; box-shadow: 0 0 0 1px #7d879a; }
  .payment-method.selected:hover, .brite-alt-method.selected:hover, .bundle-option.selected:hover { border-color: var(--heading); background: #f8f5ec; box-shadow: 0 0 0 1px var(--heading); }
  .company-toggle:hover, .billing-toggle:hover { background: var(--light); border-color: #7d879a; }
}

@media (max-width: 1050px) and (min-width: 881px) {
  .checkout-grid { grid-template-columns: minmax(0, 1fr) 310px; gap: 24px; }
  .checkout-page { padding-left: 20px; padding-right: 20px; }
  .order-summary { padding: 20px; }
}

@media (max-width: 880px) {
  .checkout-header { padding: 16px 16px 12px; }
  .checkout-logo { font-size: 20px; }
  .breadcrumb { margin-top: 10px; }
  .checkout-page { max-width: 640px; padding: 20px 18px 36px; }
  .checkout-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .checkout-intro { margin-bottom: 20px; }
  .checkout-intro h1 { font-size: 30px; }
  .checkout-intro > p { font-size: 14px; }
  .checkout-reassurance { gap: 6px 14px; font-size: 12px; }
  .mobile-summary-bar { border-radius: 0; border: 0; border-block: 1px solid var(--border); margin-bottom: 16px; background: #fffdf9; backdrop-filter: none; -webkit-backdrop-filter: none; box-shadow: 0 3px 12px rgb(22 35 63 / 5%); transition: none; will-change: auto; }
  .mobile-summary-bar.compact { box-shadow: 0 3px 12px rgb(22 35 63 / 5%); }
  .msb-label, .mobile-summary-bar.compact .msb-label { display: none; }
  .mobile-summary-bar .msb-header, .mobile-summary-bar.compact .msb-header { min-height: 64px; width: 100%; padding: 10px 18px; transition: none; border: 0; background: transparent; text-align: left; color: var(--heading); font-family: inherit; }
  .msb-thumb, .mobile-summary-bar.compact .msb-thumb { width: 30px; height: 40px; transition: none; }
  .msb-title, .mobile-summary-bar.compact .msb-title { font-family: inherit; font-size: 13px; font-weight: 700; transition: none; }
  .msb-subtitle, .mobile-summary-bar.compact .msb-subtitle { max-height: none; opacity: 1; margin-top: 2px; font-size: 11px; transition: none; }
  .msb-price, .mobile-summary-bar.compact .msb-price { font-size: 21px; transition: none; }
  .msb-items-label, .mobile-summary-bar.compact .msb-items-label { max-height: none; opacity: 1; margin-top: 1px; font-size: 10px; transition: none; }
  .msb-info, .msb-price-col { transition: none; }
  .msb-chevron { color: var(--heading); transition-duration: 160ms; }
  .msb-content { transition: opacity 160ms ease; }
  .mobile-summary-bar:not(.open) .msb-content { visibility: hidden; }
  .mobile-summary-bar.open .msb-content { max-height: min(65vh, 520px); overflow-y: auto; padding: 0 18px 16px; }
  .msb-line { font-size: 13px; gap: 12px; }
  .msb-tax-note { color: var(--body); font-size: 11px; }
  .checkout-footer { padding-top: 8px; }
}

@media (max-width: 520px) {
  .checkout-page { padding: 20px 12px 28px; }
  .checkout-intro { padding: 0 4px; }
  .checkout-intro h1 { font-size: 29px; }
  .checkout-card, .checkout-extras { padding: 22px 18px; }
  .checkout-btn-wrap { padding: 22px 18px 24px; }
  .section-title { font-size: 20px; }
  .checkout-quantity-heading { padding: 14px 16px; }
  .bundle-option { padding: 12px 10px; gap: 9px; }
  .bundle-label { font-size: 14px; }
  .bundle-badge { white-space: normal; text-align: right; }
  .order-bump-header { flex-wrap: wrap; }
  .order-bump-expand { margin-left: auto; }
  .order-bump-header-text { min-width: 120px; }
  .multi-bump-header { grid-template-columns: 64px minmax(0, 1fr); gap: 0 14px; padding: 16px 16px 0; }
  .multi-bump-cover { width: 64px; height: 92px; }
  .multi-bump-name { font-size: 16px; }
  .multi-bump-actions { margin: 10px -16px 0; padding: 12px 16px; gap: 10px; }
  .multi-bump-check { min-width: 130px; padding: 10px; }
  .payment-method, .brite-alt-method, .klarna-parent { gap: 10px; padding: 14px 12px; }
  .pm-badge { font-size: 9px; padding: 4px 6px; }
  .checkout-btn { font-size: 16px; padding-inline: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .animate-in, .order-summary { opacity: 1 !important; transform: none !important; }
  .checkout-btn:hover, .checkout-btn:active { transform: none; }
  .bump-cover-preview:hover { transform: none; }
}

.checkout-sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
button.klarna-parent{width:100%;font:inherit;color:inherit;text-align:left}
