:root {
    --bg: #f4f5f7;
    --card-bg: #ffffff;
    --text: #2b2b2b;
    --muted: #6b6f76;
    --border: #e1e1e1;
    --brand: #0a74d7;
    --error: #c62828;
    --success: #2e7d32;
}
* { box-sizing: border-box; }

/* Hide scrollbar chrome globally but keep scroll functional */
html, body, * { scrollbar-width: none; -ms-overflow-style: none; }
html::-webkit-scrollbar,
body::-webkit-scrollbar,
*::-webkit-scrollbar { width: 0; height: 0; display: none; }

body { font-family: "Segoe UI", Arial, sans-serif; background: var(--bg); color: var(--text); margin: 0; padding: 24px 16px 40px; }
.shell { max-width: 520px; margin: 0 auto; }
.card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 14px; padding: 24px; box-shadow: 0 10px 24px rgba(0,0,0,0.06); }
.header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.product-box { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; background: #fff; box-shadow: 0 4px 12px rgba(0,0,0,0.04); }
.product-header { display: flex; flex-direction: row; justify-content: flex-start; align-items: center; gap: 12px; margin-bottom: 0; }
.product-meta { text-align: left; max-width: 70%; flex: 1; }
.product-meta .label { margin-bottom: 4px; }
.product-name { font-weight: 700; font-size: 17px; margin: 0 0 4px 0; color: var(--text); }
.product-desc { margin: 0 0 6px 0; color: var(--muted); font-size: 13px; }
.product-price { font-weight: 700; font-size: 14px; color: #2e7d32; }
.thumb { width: 76px; height: 76px; border-radius: 10px; object-fit: cover; }
h1 { margin: 0 0 8px 0; font-size: 26px; }
h2 { margin: 18px 0 10px 0; font-size: 18px; }
.section { margin-bottom: 18px; }
.label { display: block; font-weight: 600; margin-bottom: 8px; font-size: 14px; color: var(--muted); }
.input-group { border: 1px solid var(--border); border-radius: 12px; background: #fff; box-shadow: 0 4px 12px rgba(0,0,0,0.06); overflow: visible; }
.input-group > .input-row:first-child { border-radius: 12px 12px 0 0; }
.input-group > .input-row:last-child { border-radius: 0 0 12px 12px; }
.input-row { display: flex; align-items: center; gap: 10px; padding: 12px 14px; position: relative; background: #fff; }
.input-row input, .input-row select { border: none; outline: none; font-size: 16px; flex: 1; }
.divider { height: 1px; background: var(--border); }
.icon { width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; color: #7a7a7a; flex: 0 0 20px; }
.phone-row { padding: 0 !important; gap: 0 !important; align-items: stretch !important; }
.country-select { display: flex; align-items: center; gap: 8px; padding: 0 14px; background: linear-gradient(to right, #f5f6f8, #f9fafb); cursor: pointer; font-size: 14px; min-width: 100px; position: relative; z-index: 100; border: none; border-right: 1px solid var(--border); transition: background 0.15s; }
.country-select:hover { background: linear-gradient(to right, #ebedf0, #f0f1f3); }
.country-flag { width: 24px; height: 18px; border-radius: 3px; background-size: cover; flex-shrink: 0; box-shadow: 0 1px 3px rgba(0,0,0,0.12); }
.country-code { color: var(--text); font-weight: 600; font-size: 15px; }
.country-arrow { color: #999; font-size: 10px; margin-left: 2px; }
.custom-code-input { width: 70px; border: none; outline: none; font-size: 15px; font-weight: 600; color: var(--text); background: transparent; padding: 0; }
.country-dropdown { position: absolute; top: calc(100% + 8px); left: -1px; min-width: 320px; max-height: 340px; overflow-y: auto; background: #fff; border: 1px solid #ddd; border-radius: 12px; box-shadow: 0 16px 48px rgba(0,0,0,0.18); z-index: 1000; display: none; }
.country-dropdown.open { display: block; animation: dropdownFade 0.15s ease-out; }
@keyframes dropdownFade { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
.country-search { width: 100%; padding: 14px 16px; border: none; border-bottom: 1px solid var(--border); font-size: 14px; outline: none; background: #fafbfc; border-radius: 12px 12px 0 0; }
.country-list { list-style: none; margin: 0; padding: 6px 0; }
.country-item { display: flex; align-items: center; gap: 12px; padding: 11px 16px; cursor: pointer; transition: background 0.12s; }
.country-item:hover { background: #f5f7fa; }
.country-item.selected { background: #e6f2ff; }
.country-item-flag { width: 26px; height: 19px; border-radius: 3px; background-size: cover; flex-shrink: 0; }
.country-item-name { flex: 1; font-size: 14px; }
.country-item-code { color: #888; font-size: 14px; font-weight: 600; }
.phone-input { flex: 1; border: none; outline: none; font-size: 16px; min-width: 0; padding: 14px 16px; background: transparent; }
.payment-tabs { display: flex; gap: 0; margin-bottom: 18px; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.payment-tab { flex: 1; padding: 11px 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; font-weight: 600; font-size: 12px; cursor: pointer; background: #f9fafb; color: var(--muted); border-right: 1px solid var(--border); transition: all 0.2s; line-height: 1.2; }
.payment-tab:last-child { border-right: none; }
.payment-tab.active { background: var(--brand); color: #fff; }
.payment-tab:hover:not(.active) { background: #eef0f3; }
.payment-tab svg { width: 22px; height: 22px; flex-shrink: 0; }
.payment-tab[data-method="pix"] svg { fill: #32BCAD; }
.payment-tab[data-method="pix"].active svg { fill: #fff; }
.card-box { border: 1px solid var(--border); border-radius: 12px; background: #fff; box-shadow: 0 4px 12px rgba(0,0,0,0.06); overflow: hidden; }
.card-number-row { display: flex; align-items: center; gap: 10px; padding: 12px 14px; }
.stripe-field { flex: 1; padding: 6px 0; }
.card-row { display: grid; grid-template-columns: 1fr 1px 1fr; align-items: center; }
.v-divider { width: 1px; height: 100%; background: var(--border); }
.card-cell { padding: 12px 14px; display: flex; align-items: center; gap: 10px; }
.brands { display: flex; gap: 6px; align-items: center; }
.brand { width: 34px; height: 22px; border: 1px solid #d7d7d7; border-radius: 4px; background: #fff; display: inline-flex; align-items: center; justify-content: center; overflow: hidden; }
.brand svg { width: 100%; height: 100%; display: block; }
.text-field { width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); font-size: 16px; box-shadow: 0 4px 12px rgba(0,0,0,0.06); }
.text-field:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(10,116,215,0.1); }
.button { width: 100%; border: none; background: var(--brand); color: #fff; font-size: 18px; padding: 14px; border-radius: 12px; cursor: pointer; font-weight: 600; margin-top: 8px; box-shadow: 0 8px 16px rgba(0,0,0,0.18); }
.button:disabled { opacity: 0.6; cursor: not-allowed; }
.button.pix-btn { background: var(--brand); box-shadow: 0 8px 16px rgba(0,0,0,0.18); }
.button.boleto-btn { background: var(--brand); box-shadow: 0 8px 16px rgba(0,0,0,0.18); }
.status { margin-top: 12px; font-weight: 600; font-size: 14px; }
.status.error { color: var(--error); }
.status.success { color: var(--success); }
.status.warning { color: #b8860b; }

.checkout-sim-banner {
    margin: 0 0 16px;
    padding: 12px 14px;
    font-size: 14px;
    line-height: 1.45;
    color: #1a3a5c;
    background: #e8f4fc;
    border-radius: 10px;
    border-left: 4px solid var(--brand, #0a74d7);
}
.order-bump { border: 1px dashed var(--border); border-radius: 12px; padding: 14px; background: #fafafa; }
.order-bump-title { font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); margin-bottom: 4px; }
.order-bump-card { display: flex; align-items: center; gap: 12px; cursor: pointer; padding: 8px 0; }
.order-bump-card input { width: 18px; height: 18px; flex-shrink: 0; }
.order-bump-body { flex: 1; min-width: 0; }
.order-bump-thumb { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; border: 1px solid var(--border); flex-shrink: 0; }
.order-bump-name { font-weight: 700; margin-bottom: 4px; }
.order-bump-desc { color: var(--muted); font-size: 13px; }
.order-bump-price {
    font-weight: 700;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.2;
    white-space: nowrap;
}
/* Mobile: preço vai pra linha nova, alinhado com o nome/descrição (após checkbox + thumb) */
@media (max-width: 560px) {
    .order-bump-card {
        flex-wrap: wrap;
        align-items: center;
        row-gap: 6px;
    }
    .order-bump-card input { align-self: flex-start; margin-top: 4px; }
    .order-bump-thumb { align-self: flex-start; }
    /* Body fica do lado do thumb na linha 1, ocupa o resto do espaço sem forçar wrap */
    .order-bump-body { flex: 1 1 0; min-width: 0; }
    /* Price quebra pra linha 2, indentado pra alinhar com a coluna do body
       (18px checkbox + 12px gap + 48px thumb + 12px gap = 90px) */
    .order-bump-price {
        flex-basis: 100%;
        padding-left: 90px;
        margin-top: 0;
        flex-direction: row;
        gap: 8px;
        align-items: baseline;
        justify-content: flex-start;
        font-size: 14px;
    }
    .order-bump-old-price { font-size: 11px; }
}

.order-bump-old-price {
    color: var(--muted);
    text-decoration: line-through;
    font-weight: 500;
    font-size: 12px;
    margin-right: 0;
    margin-bottom: 2px;
}
.order-total { margin-top: 8px; font-weight: 700; font-size: 18px; text-align: right; padding: 4px 0 0; }
.pix-result { text-align: center; padding: 20px 0; }
.pix-result img { max-width: 200px; border-radius: 12px; margin-bottom: 12px; }
.pix-copy-code { width: 100%; padding: 12px; border: 1px solid var(--border); border-radius: 10px; font-size: 12px; word-break: break-all; background: #f9fafb; margin-bottom: 12px; font-family: monospace; }
.pix-timer { font-size: 24px; font-weight: 700; color: var(--brand); margin: 12px 0; }
.copy-btn { padding: 10px 20px; border: 1px solid var(--brand); background: #fff; color: var(--brand); border-radius: 10px; cursor: pointer; font-weight: 600; font-size: 14px; }
.copy-btn:hover { background: #f0f7ff; }
.boleto-result { text-align: center; padding: 20px 0; }
.boleto-barcode { width: 100%; padding: 12px; border: 1px solid var(--border); border-radius: 10px; font-size: 13px; word-break: break-all; background: #f9fafb; margin-bottom: 12px; font-family: monospace; }
.footer { margin-top: 18px; display: flex; gap: 14px; justify-content: center; color: var(--muted); font-size: 13px; }
.footer span { display: inline-flex; align-items: center; gap: 6px; }
/* Timer header — full-width do viewport, rola junto com a página */
.countdown-bar {
    /* Compensa o padding lateral do <body> (24px top, 16px sides, 40px bottom) */
    margin-top: -24px;
    margin-left: -16px;
    margin-right: -16px;
    margin-bottom: 18px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #ff4444 0%, #cc0000 100%);
    color: #fff;
    box-shadow: 0 2px 12px var(--timer-glow-soft, rgba(204, 0, 0, 0.25));
    animation: pulse-timer 2s ease-in-out infinite;
}
.countdown-bar-inner {
    max-width: 520px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
}
.countdown-bar .timer-headline {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.95;
    line-height: 1.2;
}
.countdown-bar .timer-digits {
    font-size: 22px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.04em;
    line-height: 1;
}
.countdown-bar .timer-digits span { display: inline-block; min-width: 26px; text-align: center; }
.countdown-bar .timer-separator { opacity: 0.6; margin: 0 1px; }
.countdown-bar .timer-digits.hide-hours #cd-hours,
.countdown-bar .timer-digits.hide-hours #cd-hours + .timer-separator { display: none; }
.countdown-bar.expired { background: #6b7280; animation: none; box-shadow: none; }
@media (max-width: 540px) {
    .countdown-bar { margin: -24px -16px 14px; padding: 8px 12px; }
    .countdown-bar .timer-digits { font-size: 18px; }
    .countdown-bar .timer-headline { font-size: 11px; }
}
@keyframes pulse-timer { 0%, 100% { box-shadow: 0 0 0 0 var(--timer-glow, rgba(255,68,68,0.4)); } 50% { box-shadow: 0 0 0 8px transparent; } }
.checkout-banner { border-radius: 12px; overflow: hidden; margin-bottom: 16px; }
.checkout-banner img { width: 100%; display: block; border-radius: 12px; }
.checkout-banner a { display: block; }
.tab-content { display: none; }
.tab-content.active { display: block; }
@media (max-width: 560px) {
    .product-header { flex-direction: row !important; align-items: center; }
    .product-header .thumb { width: 64px; height: 64px; flex-shrink: 0; }
    .product-meta { text-align: left; max-width: none; min-width: 0; }
    .product-name { font-size: 15px; }
    .product-desc { font-size: 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
}

@media (min-width: 561px) and (max-width: 900px) {
    .shell { padding: 20px; }
    .card { border-radius: 16px; }
    .funnel-card { max-width: 480px; padding: 36px 28px; }
    .thankyou-card { max-width: 440px; padding: 36px 28px; }
}

/* ------------------------------ */
/* Utilities (shared, reusable)   */
/* ------------------------------ */
.mt-8 { margin-top: 8px !important; }
.mt-12 { margin-top: 12px !important; }
.mt-16 { margin-top: 16px !important; }
.mt-20 { margin-top: 20px !important; }
.mb-8 { margin-bottom: 8px !important; }
.mb-12 { margin-bottom: 12px !important; }
.mb-16 { margin-bottom: 16px !important; }
.ml-auto { margin-left: auto !important; }

.text-muted { color: var(--muted) !important; }
.text-small { font-size: 13px !important; }
.text-xs { font-size: 12px !important; }
.text-left { text-align: left !important; }
.text-center { text-align: center !important; }

.flex { display: flex !important; }
.flex-center { display: flex !important; align-items: center !important; justify-content: center !important; }
.flex-between { display: flex !important; align-items: center !important; justify-content: space-between !important; }
.gap-6 { gap: 6px !important; }
.gap-8 { gap: 8px !important; }
.gap-10 { gap: 10px !important; }
.gap-12 { gap: 12px !important; }

.grid-2 { display: grid !important; grid-template-columns: 1fr 1fr !important; gap: 8px !important; }
.grid-3 { display: grid !important; grid-template-columns: 1fr 1fr 1fr !important; gap: 8px !important; }

.w-full { width: 100% !important; }
.btn-sm { padding: 10px 14px !important; font-size: 14px !important; border-radius: 10px !important; }

.divider-h { height: 1px; background: var(--border); width: 100%; }

.badge { display: inline-block; font-size: 12px; font-weight: 700; padding: 6px 16px; border-radius: 20px; margin-bottom: 16px; text-transform: uppercase; letter-spacing: 0.05em; }
.badge-warning { background: #fef3c7; color: #d97706; }
.badge-danger { background: #fee2e2; color: #dc2626; }

.card-section { padding: 12px; border: 1px solid #e5e7eb; border-radius: 10px; background: #fff; }
.field-label { display:block; margin-bottom: 6px; color: var(--muted); font-size: 13px; }
.field-input { width: 100%; padding: 10px; border: 1px solid #e5e7eb; border-radius: 10px; }

/* ------------------------------ */
/* Funnel (upsell/downsell) pages */
/* ------------------------------ */
.funnel-page {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    margin: 0;
    padding: 24px 16px 40px;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.funnel-page.funnel-upsell { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.funnel-page.funnel-downsell { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }

.funnel-card {
    max-width: 520px;
    width: 100%;
    background: #fff;
    border-radius: 20px;
    padding: 40px 32px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    text-align: center;
}
.funnel-title { font-size: 28px; margin: 0 0 8px; color: #111827; }
.funnel-title--downsell { font-size: 26px; }
.funnel-persuasion { color: #6b7280; font-size: 16px; margin: 0 0 24px; line-height: 1.5; }
.funnel-image { width: 120px; height: 120px; border-radius: 16px; object-fit: cover; margin: 0 auto 20px; display: block; box-shadow: 0 8px 20px rgba(0,0,0,0.1); }
.funnel-image--downsell { width: 100px; height: 100px; }
.funnel-offer-name { font-size: 20px; font-weight: 700; margin: 0 0 8px; color: #111827; }
.funnel-offer-name--downsell { font-size: 18px; }
.funnel-offer-desc { color: #6b7280; font-size: 14px; margin: 0 0 16px; line-height: 1.5; }
.funnel-offer-price { font-size: 32px; font-weight: 800; color: #059669; margin: 0 0 24px; }
.funnel-offer-price--downsell { font-size: 28px; color: #dc2626; }
.funnel-offer-price small { font-size: 16px; font-weight: 500; color: #6b7280; }
.funnel-offer-price--downsell small { font-size: 14px; }

.funnel-btn-accept {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(16,185,129,0.3);
    transition: transform 0.15s, box-shadow 0.15s;
}
.funnel-btn-accept:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(16,185,129,0.4); }
.funnel-btn-accept:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.funnel-btn-accept--downsell {
    padding: 14px;
    font-size: 17px;
    background: linear-gradient(135deg, #f5576c 0%, #ff6b6b 100%);
    box-shadow: 0 8px 20px rgba(245,87,108,0.3);
}

.funnel-btn-decline {
    display: inline-block;
    margin-top: 16px;
    padding: 12px 24px;
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 14px;
    cursor: pointer;
    text-decoration: underline;
}
.funnel-btn-decline:hover { color: #6b7280; }

.funnel-security {
    margin-top: 20px;
    color: #9ca3af;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.funnel-security svg { width: 14px; height: 14px; }

/* Funnel simulation banner */
.funnel-sim-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    margin: 0;
    border-radius: 0;
    border-left: none;
    border-bottom: 4px solid var(--brand, #0a74d7);
    text-align: center;
}
.funnel-page { padding-top: 80px; } /* Make room for fixed banner */

/* Helpers to replace inline style="..." */
.is-hidden { display: none !important; }
.inline-block { display: inline-block !important; }
.no-underline { text-decoration: none !important; }

.input-plain { border: none !important; outline: none !important; font-size: 16px !important; flex: 1 !important; min-width: 0 !important; background: transparent !important; }
.select-plain { width: 100%; border: none !important; outline: none !important; font-size: 16px !important; background: transparent !important; color: var(--text) !important; cursor: pointer !important; }

.row-split { display: grid !important; padding: 0 !important; }
.row-split-2 { grid-template-columns: 1fr 1px 1fr !important; }
.row-split-3-fixed { grid-template-columns: 1fr 1px 100px !important; }
.split-cell { padding: 12px 14px; display: flex; align-items: center; gap: 10px; }
.divider-v { width: 1px; background: var(--border); }
.divider-v-full { width: 1px; background: var(--border); height: 100%; }

.loading-text { color: var(--muted); font-size: 12px; }
.muted-help { color: var(--muted); font-size: 13px; margin-top: 12px; }

.order-summary { margin-top: 16px; padding: 12px 0; border-top: 1px solid var(--border); }
.order-summary-row { display: flex; justify-content: space-between; margin-bottom: 8px; color: #2e7d32; }
.fw-600 { font-weight: 600 !important; }
.fw-700 { font-weight: 700 !important; }
.coupon-chip { font-family: monospace; background: #e8f5e9; padding: 2px 8px; border-radius: 4px; }

.result-title { margin: 0 0 12px; }

.checkline { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; color: var(--text); font-weight: 500; }

/* ------------------------------ */
/* Thank you (obrigado) page      */
/* ------------------------------ */
.thankyou-page {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f4f5f7;
    margin: 0;
    padding: 24px 16px 40px;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.thankyou-card {
    max-width: 480px;
    width: 100%;
    background: #fff;
    border-radius: 16px;
    padding: 40px 32px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    text-align: center;
}
.thankyou-checkmark {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #ecfdf5;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
}
.thankyou-checkmark svg { width: 40px; height: 40px; color: #10b981; }
.thankyou-pending-icon {
    width: 80px; height: 80px; border-radius: 50%;
    background: #fef3c7;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 24px;
}
.thankyou-pending-icon svg { width: 40px; height: 40px; color: #d97706; animation: spin-slow 3s linear infinite; }
@keyframes spin-slow { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.thankyou-failed-icon {
    width: 80px; height: 80px; border-radius: 50%;
    background: #fee2e2;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 24px;
}
.thankyou-failed-icon svg { width: 40px; height: 40px; color: #dc2626; }
.thankyou-title { margin: 0 0 8px; font-size: 28px; color: #111827; }
.thankyou-subtitle { color: #6b7280; font-size: 16px; margin: 0 0 24px; }
.thankyou-details { text-align: left; background: #f9fafb; border-radius: 12px; padding: 20px; margin-bottom: 24px; }
.thankyou-row { display: flex; justify-content: space-between; padding: 8px 0; font-size: 14px; border-bottom: 1px solid #e5e7eb; }
.thankyou-row:last-child { border-bottom: none; }
.thankyou-label { color: #6b7280; font-weight: 500; }
.thankyou-value { color: #111827; font-weight: 600; }
.thankyou-value.amount { color: #059669; font-size: 16px; }
.method-badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 20px; }
.method-card { background: #d1fae5; color: #059669; }
.method-pix { background: #dbeafe; color: #2563eb; }
.method-boleto { background: #fef3c7; color: #d97706; }
.method-internacional { background: #f0e6ff; color: #7c3aed; }

/* Coupon UI */
.checkout-coupon-widget { margin-top: 12px; margin-bottom: 8px; }
.coupon-toggle-area { text-align: left; }
.toggle-coupon-btn { color: var(--brand); font-size: 14px; font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.toggle-coupon-btn:hover { text-decoration: underline; }
.coupon-input-area { margin-top: 10px; }
.coupon-input-area .input-row { display: flex; gap: 8px; padding: 0; background: transparent; border: none; align-items: stretch; }
.coupon-input { width: auto; flex: 1; text-transform: uppercase; padding: 12px 14px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; }
.coupon-input:focus { border-color: var(--brand); outline: none; }
.btn-apply-coupon { width: auto; padding: 0 16px; margin: 0; border-radius: 8px; font-size: 14px; font-weight: 600; }
.coupon-message { font-size: 13px; font-weight: 500; margin-top: 6px; }
.coupon-message.error { color: var(--error); }
.coupon-message.success { color: var(--success); }
.remove-coupon-btn { background: none; border: none; color: var(--error); font-size: 13px; font-weight: 600; cursor: pointer; text-decoration: underline; padding: 0; margin-left: auto; }
.remove-coupon-btn:hover { color: #8e0000; }


/* ============================== PAYMENT FEEDBACK MODAL ============================== */
/* Usa as variáveis de tema do checkout (--brand, --success, --error, --muted, etc) */
.payment-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(43, 43, 43, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    animation: payment-modal-bg-in 0.2s ease-out;
}
.payment-modal.is-open { display: flex; }
@keyframes payment-modal-bg-in {
    from { opacity: 0; }
    to { opacity: 1; }
}
.payment-modal-card {
    width: 100%;
    max-width: 380px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 28px 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.30);
    text-align: center;
    transform: scale(0.96) translateY(8px);
    opacity: 0;
    animation: payment-modal-card-in 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    font-family: "Segoe UI", Arial, sans-serif;
    color: var(--text);
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    position: relative;
}
/* Botão fechar (X) — só aparece nos estados PIX/boleto (cobrança assíncrona, cliente pode sair). */
.payment-modal-x {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    display: none;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 8px;
    background: rgba(0,0,0,0.05);
    color: var(--text-muted, #6b7280);
    cursor: pointer;
    z-index: 2;
}
.payment-modal-x svg { width: 18px; height: 18px; }
.payment-modal-x:hover { background: rgba(0,0,0,0.10); }
.payment-modal-card.is-pix .payment-modal-x,
.payment-modal-card.is-boleto .payment-modal-x { display: flex; }
.payment-modal-card.is-pix { max-width: 420px; }
@keyframes payment-modal-card-in {
    to { transform: scale(1) translateY(0); opacity: 1; }
}
.payment-modal-state { display: none; }
.payment-modal[data-state="loading"] .payment-modal-loading,
.payment-modal[data-state="success"] .payment-modal-success,
.payment-modal[data-state="error"]   .payment-modal-error,
.payment-modal[data-state="info"]    .payment-modal-info,
.payment-modal[data-state="pix"]     .payment-modal-pix,
.payment-modal[data-state="boleto"]  .payment-modal-boleto {
    display: block;
}
.payment-modal-card.is-boleto { max-width: 420px; }
.payment-modal-title {
    margin: 14px 0 6px;
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.3;
}
.payment-modal-text {
    margin: 0 0 14px;
    font-size: 14px;
    color: var(--muted);
    line-height: 1.5;
    word-wrap: break-word;
}

/* Spinner — usa a cor brand do produto */
.payment-modal-spinner {
    width: 52px;
    height: 52px;
    margin: 0 auto;
    border: 3px solid color-mix(in srgb, var(--brand) 18%, transparent);
    border-top-color: var(--brand);
    border-radius: 50%;
    animation: payment-modal-spin 0.7s linear infinite;
}
@keyframes payment-modal-spin {
    to { transform: rotate(360deg); }
}

/* Status icons (success/error/info) — paleta do checkout */
.payment-modal-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto;
}
.payment-modal-icon svg { width: 100%; height: 100%; }
.icon-success { color: var(--success); }
.icon-error   { color: var(--error); }
.icon-info    { color: var(--brand); }

.payment-modal-icon .circle {
    stroke-dasharray: 145;
    stroke-dashoffset: 145;
    animation: payment-modal-circle 0.5s ease-out forwards;
}
.payment-modal-icon .check,
.payment-modal-icon .cross {
    stroke-dasharray: 60;
    stroke-dashoffset: 60;
    animation: payment-modal-stroke 0.4s 0.4s ease-out forwards;
}
@keyframes payment-modal-circle { to { stroke-dashoffset: 0; } }
@keyframes payment-modal-stroke { to { stroke-dashoffset: 0; } }

.payment-modal-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 11px 18px;
    background: #2563eb; /* azul — "Revisar e tentar novamente" converte melhor que vermelho de "erro" */
    color: #fff;
    border: 0;
    border-radius: 10px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: filter 0.15s ease, transform 0.1s ease;
    margin-top: 8px;
}
.payment-modal-btn:hover { filter: brightness(0.92); }
.payment-modal-btn:active { transform: scale(0.98); }
.payment-modal-btn-secondary {
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
}
.payment-modal-btn-secondary:hover { background: #ebecf0; }
.payment-modal-btn-brand {
    background: var(--brand);
    color: #fff;
}
.payment-modal-btn-brand:hover { filter: brightness(0.92); }

/* ===== Estado PIX (QR code + chave + valor + timer) ===== */
.payment-modal-pix-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    gap: 8px;
}
.payment-modal-pix-amount {
    text-align: left;
}
.payment-modal-pix-amount-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 2px;
    line-height: 1;
}
.payment-modal-pix-amount-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.15;
    margin: 0;
    font-variant-numeric: tabular-nums;
}
.payment-modal-pix-timer {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: color-mix(in srgb, var(--brand) 8%, var(--bg));
    border: 1px solid color-mix(in srgb, var(--brand) 25%, var(--border));
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--brand);
    font-variant-numeric: tabular-nums;
}
.payment-modal-pix-timer svg { width: 12px; height: 12px; }
.payment-modal-pix-timer.is-warning {
    background: color-mix(in srgb, var(--error) 8%, var(--bg));
    border-color: color-mix(in srgb, var(--error) 25%, var(--border));
    color: var(--error);
}
.payment-modal-pix-timer.is-expired {
    background: color-mix(in srgb, var(--muted) 10%, var(--bg));
    border-color: var(--border);
    color: var(--muted);
}

.payment-modal-pix-qr {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 14px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 12px;
    margin: 0 auto 14px;
    width: fit-content;
}
.payment-modal-pix-qr img {
    display: block;
    width: 220px;
    height: 220px;
    max-width: 60vw;
    max-height: 60vw;
    border-radius: 6px;
}
.payment-modal-pix-qr.is-loading {
    width: 220px; height: 220px;
    background: var(--bg);
}

.payment-modal-pix-code-label {
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    margin: 0 0 6px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.payment-modal-pix-code {
    display: flex;
    align-items: stretch;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 12px;
}
.payment-modal-pix-code textarea {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    padding: 10px 12px;
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 12px;
    color: var(--text);
    resize: none;
    line-height: 1.45;
    word-break: break-all;
    height: 60px;
}
.payment-modal-pix-copy {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 12px 16px;
    background: var(--brand);
    color: #fff;
    border: 0;
    border-radius: 10px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: filter 0.15s ease, transform 0.1s ease;
}
.payment-modal-pix-copy:hover { filter: brightness(0.92); }
.payment-modal-pix-copy:active { transform: scale(0.98); }
.payment-modal-pix-copy svg { width: 14px; height: 14px; }
.payment-modal-pix-copy.is-copied {
    background: var(--success);
}
.payment-modal-pix-copy.is-copied svg { animation: pix-copy-pop 0.35s ease; }
@keyframes pix-copy-pop {
    0%   { transform: scale(0.5); opacity: 0; }
    60%  { transform: scale(1.15); opacity: 1; }
    100% { transform: scale(1); }
}

.payment-modal-pix-info {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 12px;
    background: color-mix(in srgb, var(--brand) 5%, var(--bg));
    border: 1px solid color-mix(in srgb, var(--brand) 18%, var(--border));
    border-radius: 10px;
    font-size: 12.5px;
    color: var(--text);
    line-height: 1.45;
    text-align: left;
    margin-top: 4px;
}
.payment-modal-pix-info svg {
    color: var(--brand);
    flex-shrink: 0;
    margin-top: 1px;
    width: 14px; height: 14px;
}

/* Pulse de verificação de pagamento (PIX/Boleto) */
.payment-pulse {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding: 6px 12px;
    font-size: 12px;
    color: var(--muted);
    background: color-mix(in srgb, var(--brand) 6%, transparent);
    border: 1px solid color-mix(in srgb, var(--brand) 14%, var(--border));
    border-radius: 999px;
    transition: background 0.2s ease, color 0.2s ease;
    align-self: center;
}
.payment-pulse::before {
    content: '';
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--brand);
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--brand) 45%, transparent);
    animation: paymentPulseDot 1.6s ease-out infinite;
}
.payment-pulse[data-state="checking"]::before {
    animation: paymentPulseDot 0.9s ease-out infinite;
    background: #10b981;
}
.payment-pulse[data-state="checking"] {
    color: #047857;
    background: color-mix(in srgb, #10b981 8%, transparent);
    border-color: color-mix(in srgb, #10b981 25%, transparent);
}
.payment-pulse[data-state="error"]::before {
    background: #f59e0b;
    animation: none;
}
.payment-pulse[data-state="error"] {
    color: #b45309;
    background: color-mix(in srgb, #f59e0b 12%, transparent);
    border-color: color-mix(in srgb, #f59e0b 30%, transparent);
}
@keyframes paymentPulseDot {
    0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--brand) 55%, transparent); }
    70% { box-shadow: 0 0 0 8px transparent; }
    100% { box-shadow: 0 0 0 0 transparent; }
}


/* Footer link (Termos / Privacidade) */
.footer-link {
    color: var(--muted);
    text-decoration: none;
    cursor: pointer;
    border-bottom: 1px dashed transparent;
    transition: color 0.15s ease, border-color 0.15s ease;
}
.footer-link:hover { color: var(--brand); border-bottom-color: var(--brand); }

/* ============================== LEGAL MODAL (Termos / Privacidade) ============================== */
.legal-modal {
    position: fixed;
    inset: 0;
    z-index: 9998;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(43, 43, 43, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.legal-modal.is-open { display: flex; animation: legal-modal-bg-in 0.2s ease-out; }
@keyframes legal-modal-bg-in { from { opacity: 0; } to { opacity: 1; } }
.legal-modal-card {
    width: 100%;
    max-width: 560px;
    max-height: calc(100vh - 40px);
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.30);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.96) translateY(8px);
    opacity: 0;
    animation: legal-modal-card-in 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    font-family: "Segoe UI", Arial, sans-serif;
    color: var(--text);
}
@keyframes legal-modal-card-in { to { transform: scale(1) translateY(0); opacity: 1; } }
.legal-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
    background: var(--card-bg);
    flex-shrink: 0;
}
.legal-modal-head h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.01em;
}
.legal-modal-close {
    background: transparent;
    border: 0;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 24px;
    line-height: 1;
    color: var(--muted);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}
.legal-modal-close:hover { background: var(--bg); color: var(--text); }
.legal-modal-body {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 18px 22px;
    line-height: 1.55;
    font-size: 14px;
    color: var(--text);
}
.legal-modal-body h4 {
    margin: 18px 0 6px;
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.005em;
}
.legal-modal-body h4:first-child { margin-top: 0; }
.legal-modal-body p { margin: 0 0 10px; color: #4a4a4a; }
.legal-modal-body code {
    background: var(--bg);
    padding: 1px 6px;
    border-radius: 4px;
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 12.5px;
}
.legal-modal-body a { color: var(--brand); text-decoration: none; border-bottom: 1px dashed currentColor; }
.legal-modal-body a:hover { filter: brightness(0.85); }
.legal-modal-foot {
    padding: 14px 22px;
    border-top: 1px solid var(--border);
    background: var(--bg);
    font-size: 13px;
    color: var(--muted);
    text-align: center;
    flex-shrink: 0;
}
.legal-modal-foot a {
    color: var(--brand);
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1px dashed currentColor;
}
.legal-modal-foot a:hover { filter: brightness(0.85); }

/* Mensagem custom da página de obrigado (definida no produto) */
.thankyou-custom {
    margin: 14px 0 18px;
    padding: 14px 16px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.55;
    color: var(--text);
    text-align: left;
}
.thankyou-custom h1, .thankyou-custom h2, .thankyou-custom h3 { margin: 8px 0 6px; }
.thankyou-custom p { margin: 0 0 8px; }
.thankyou-custom a { color: var(--brand); text-decoration: none; border-bottom: 1px dashed currentColor; }
.thankyou-custom a:hover { filter: brightness(0.85); }
