/*
  CSS comum aos 3 templates do checkout.
  As variaveis --color-primary, --color-primary-hover, --color-dark
  vem do credentials.php via style inline.
*/

.checkout-page { min-height: 100vh; background: var(--bg); padding-bottom: 40px; }
.hide-mobile { display: inline; }
@media (max-width: 540px) { .hide-mobile { display: none; } }

.checkout-top-logo { width: 28px; height: 28px; border-radius: 6px; background: #fff; padding: 2px; object-fit: contain; vertical-align: middle; margin-right: 6px; }
.checkout-top-brand img { display: inline-block; }
.checkout-top-brand { color: var(--ink); display: inline-flex; align-items: center; gap: 6px; }

.checkout-banner-wrap { max-width: 1200px; margin: 16px auto 0; padding: 0 20px; }
.checkout-banner-img { width: 100%; height: auto; max-height: 240px; object-fit: cover; border-radius: 14px; box-shadow: var(--shadow-sm); display: block; }
.checkout-banner-gaucho { max-width: 720px; margin: 16px auto 0; padding: 0 16px; }
.checkout-banner-gaucho .banner-gaucho-img { width: 100%; height: auto; max-height: 200px; object-fit: cover; border-radius: 14px; box-shadow: 0 6px 18px rgba(0,0,0,.10); display: block; }

.section-block { background: #fff; border-radius: 14px; padding: 20px 22px; margin-bottom: 14px; box-shadow: var(--shadow-sm); border: 1px solid var(--line); }
.section-block-title { display: flex; align-items: center; gap: 10px; font-size: 1rem; font-weight: 800; margin-bottom: 14px; color: var(--ink); }
.section-icon { width: 28px; height: 28px; border-radius: 50%; background: var(--color-primary); color: #fff; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

.mode-1 .checkout-shell { max-width: 580px; }
.mode-3 .checkout-shell { max-width: 540px; }

.onepage-pix { background: #fff; border-radius: 18px; padding: 24px 22px; box-shadow: var(--shadow); text-align: center; }
.onepage-pix .pix-amount { margin-top: 8px; }
.onepage-pix .pix-howto { text-align: left; }

.checkout-top { background: #fff; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.checkout-top-inner { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.checkout-top-back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: .85rem; font-weight: 600; }
.checkout-top-back:hover { color: var(--color-primary); }
.checkout-top-brand { font-weight: 800; font-size: 1rem; }
.checkout-top-secure { display: flex; align-items: center; gap: 6px; font-size: .78rem; color: var(--green); font-weight: 600; }

/* PROGRESS BAR */
.steps-bar { max-width: 540px; margin: 24px auto 8px; padding: 0 20px; position: relative; }
.steps-track { position: absolute; top: 18px; left: 14%; right: 14%; height: 3px; background: var(--line); border-radius: 2px; z-index: 0; }
.steps-fill { height: 100%; background: var(--color-primary); border-radius: 2px; transition: width .5s cubic-bezier(.4,0,.2,1); width: 0%; }
.steps-list { position: relative; z-index: 1; display: flex; justify-content: space-between; list-style: none; }
.steps-list li { display: flex; flex-direction: column; align-items: center; gap: 6px; flex: 1; }
.step-circle { width: 36px; height: 36px; border-radius: 50%; background: #fff; border: 2px solid var(--line); display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--muted); font-size: .92rem; transition: all .3s; }
.step-label { font-size: .72rem; color: var(--muted); font-weight: 600; text-align: center; }
.steps-list li.active .step-circle { background: var(--color-primary); border-color: var(--color-primary); color: #fff; box-shadow: 0 4px 10px rgba(0,0,0,.15); }
.steps-list li.active .step-label { color: var(--ink); font-weight: 700; }
.steps-list li.done .step-circle { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }
.steps-list li.done .step-circle::after { content: '✓'; }
.steps-list li.done .step-circle span { display: none; }

/* STEP */
.checkout-shell { max-width: 540px; margin: 14px auto; padding: 0 20px; }
.step-panel { background: #fff; border-radius: 16px; padding: 22px; box-shadow: var(--shadow-sm); display: none; animation: slideIn .35s cubic-bezier(.4,0,.2,1); }
.step-panel.active { display: block; }
@keyframes slideIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
.step-title { font-size: 1.15rem; font-weight: 800; margin-bottom: 4px; display: flex; align-items: center; gap: 10px; }
.step-title-icon { width: 32px; height: 32px; border-radius: 50%; background: var(--color-primary); color: #fff; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.step-sub { color: var(--muted); font-size: .88rem; margin-bottom: 18px; }

/* FORM */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: .82rem; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.field .hint { font-size: .72rem; color: var(--muted); margin-top: 4px; }
.input, .select { width: 100%; padding: 13px 14px; font-size: .96rem; font-family: inherit; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); outline: none; transition: border-color .2s, box-shadow .2s; }
.input:focus, .select:focus { border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(220,38,38,.12); }
.input:disabled { background: var(--bg); color: var(--muted); cursor: not-allowed; }
.input.error { border-color: var(--color-primary); background: var(--red-soft); }
.input::placeholder, .select::placeholder, .tc-popup-input::placeholder {
  color: #cbd5e1;
  opacity: 1;
  font-weight: 400;
}
.input::-webkit-input-placeholder, .tc-popup-input::-webkit-input-placeholder { color: #cbd5e1; }
.input::-moz-placeholder, .tc-popup-input::-moz-placeholder { color: #cbd5e1; opacity: 1; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-row.tres { grid-template-columns: 2fr 1fr 1fr; }
.cep-status { font-size: .78rem; margin-top: 6px; min-height: 18px; }
.cep-status.loading { color: var(--muted); }
.cep-status.erro { color: var(--color-primary); }
.cep-status.sucesso { color: var(--green); }
.cep-status.aviso { color: var(--gold); }

/* RESUMO PRODUTO */
.resumo-card { background: var(--bg); border: 1.5px solid var(--line); border-radius: 12px; padding: 14px; display: flex; gap: 12px; margin-bottom: 16px; }
.resumo-card-img { width: 70px; height: 70px; border-radius: 8px; overflow: hidden; flex-shrink: 0; background: #fff; }
.resumo-card-img img { width: 100%; height: 100%; object-fit: cover; }
.resumo-card-info { flex: 1; min-width: 0; }
.resumo-card-name { font-size: .92rem; font-weight: 700; line-height: 1.3; margin-bottom: 4px; }
.resumo-card-sub { font-size: .76rem; color: var(--muted); margin-bottom: 6px; }
.resumo-card-bottom { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.resumo-card-price { font-size: 1rem; font-weight: 800; color: var(--color-primary); }
.qty-stepper { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.qty-step { width: 32px; height: 32px; background: transparent; color: var(--color-primary); font-weight: 800; font-size: 1.1rem; border: 0; cursor: pointer; transition: background .12s; }
.qty-step:hover:not(:disabled) { background: var(--red-soft); }
.qty-step:disabled { color: #cbd5e1; cursor: not-allowed; }
.qty-num { min-width: 32px; text-align: center; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--ink); padding: 0 4px; }

/* TOTAL */
.totais { background: var(--bg); border-radius: 10px; padding: 14px 16px; margin-bottom: 16px; }
.totais-row { display: flex; justify-content: space-between; padding: 4px 0; font-size: .9rem; color: var(--ink-soft); }
.totais-row.total { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 10px; font-size: 1.08rem; font-weight: 800; color: var(--ink); }
.totais-row .v { font-weight: 600; }
.totais-row.total .v { color: var(--color-primary); }

/* BUMPS - estilo Cloudfy clássico */
.bumps-block { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.bump-card { background: #fff; border: 1.5px dashed #d1d5db; border-radius: 12px; padding: 14px; position: relative; transition: border-color .2s, box-shadow .2s; user-select: none; }
.bump-card:hover { border-color: var(--color-primary); box-shadow: 0 6px 18px rgba(255,0,4,.10); }
.bump-card.selected { border: 1.5px solid var(--color-primary); background: var(--red-soft); box-shadow: 0 6px 20px rgba(255,0,4,.18); }
.bump-card-badge { position: absolute; top: -10px; left: 14px; display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; color: var(--ink-soft); background: transparent; padding: 0; }
.bump-badge-pill { background: var(--color-primary); color: #fff; padding: 4px 12px; border-radius: 50px; font-weight: 800; font-size: .76rem; letter-spacing: .02em; box-shadow: 0 4px 10px rgba(255,0,4,.25); }
.bump-badge-text { color: var(--ink); font-weight: 600; font-size: .82rem; background: #fff; padding: 0 4px; }
.bump-card-body { display: flex; align-items: center; gap: 12px; margin-top: 6px; }
.bump-card-img { width: 60px; height: 60px; border-radius: 8px; overflow: hidden; flex-shrink: 0; background: #fafafa; border: 1px solid #f1f5f9; }
.bump-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bump-card-info { flex: 1; min-width: 0; }
.bump-card-name { font-size: .92rem; font-weight: 700; color: var(--ink); line-height: 1.25; margin-bottom: 2px; }
.bump-card-desc { font-size: .76rem; color: var(--muted); margin-bottom: 4px; }
.bump-card-price-old { font-size: .74rem; color: var(--muted); text-decoration: line-through; margin-bottom: 2px; }
.bump-card-price { font-size: 1rem; font-weight: 800; color: var(--color-primary); }
.bump-card-cta { background: var(--color-primary); color: #fff; border: 0; padding: 10px 16px; border-radius: 50px; font-weight: 700; font-size: .82rem; cursor: pointer; transition: background .15s, transform .12s; flex-shrink: 0; }
.bump-card-cta:hover { background: var(--color-primary-hover); }
.bump-card-cta:active { transform: scale(.96); }
.bump-card.selected .bump-card-cta { background: #16a34a; }
@media (max-width: 540px) {
  .bump-card-body { gap: 10px; }
  .bump-card-img { width: 50px; height: 50px; }
  .bump-card-cta { padding: 8px 12px; font-size: .76rem; }
  .bump-card-name { font-size: .85rem; }
}

/* BOTAO */
.btn-primary { width: 100%; background: var(--color-primary); color: #fff; padding: 16px 20px; border-radius: 12px; font-size: 1rem; font-weight: 800; transition: background .2s, transform .15s; display: flex; align-items: center; justify-content: center; gap: 8px; box-shadow: 0 6px 16px rgba(0,0,0,.12); }
.btn-primary:hover { background: var(--color-primary-hover); }
.btn-primary:active { transform: scale(.98); }
.btn-primary:disabled { opacity: .6; cursor: progress; }

.btn-back { background: transparent; color: var(--muted); padding: 12px; font-weight: 600; font-size: .88rem; }
.btn-back:hover { color: var(--ink); }

.foot-info { margin-top: 14px; text-align: center; font-size: .74rem; color: var(--muted); display: flex; align-items: center; justify-content: center; gap: 6px; }
.foot-info svg { color: var(--green); }

/* PIX SCREEN */
.pix-screen { max-width: 480px; margin: 24px auto; padding: 0 20px; }
.pix-card { background: #fff; border-radius: 18px; padding: 22px 20px; box-shadow: var(--shadow); text-align: center; }
.pix-amount { font-size: 1.7rem; font-weight: 800; color: var(--color-primary); margin-bottom: 4px; }
.pix-amount-label { font-size: .8rem; color: var(--muted); margin-bottom: 18px; }
.pix-qr { width: 220px; max-width: 60vw; aspect-ratio: 1; margin: 0 auto 16px; border: 3px solid var(--bg); border-radius: 14px; padding: 8px; background: #fff; }
.pix-qr img { width: 100%; height: 100%; object-fit: contain; display: block; }
.pix-step-label { font-size: .82rem; font-weight: 700; margin-bottom: 8px; color: var(--ink); }
.pix-code-box { display: flex; align-items: stretch; border: 2px solid var(--line); border-radius: 10px; overflow: hidden; margin-bottom: 14px; }
.pix-code-text { flex: 1; padding: 10px 12px; font-family: monospace; font-size: .72rem; color: var(--muted); word-break: break-all; text-align: left; max-height: 64px; overflow-y: auto; overflow-x: hidden; user-select: all; line-height: 1.4; min-width: 0; }
.pix-code-box { gap: 0; }
.pix-amount { font-size: 1.6rem; line-height: 1.2; word-break: keep-all; }
.pix-screen { padding: 0 16px; }
.pix-card { padding: 20px 18px; }
.pix-timer { font-size: .82rem; }
.pix-status { flex-wrap: wrap; gap: 8px; font-size: .82rem; }
.pix-status .pix-spin { flex-shrink: 0; }
.pix-status > span:not(.pix-timer) { flex: 1; min-width: 0; }
@media (max-width: 540px) {
  .pix-amount { font-size: 1.4rem; }
  .pix-code-text { font-size: .68rem; padding: 8px 10px; }
  .pix-copy-btn { padding: 0 12px; font-size: .76rem; }
}
.pix-copy-btn { background: var(--color-primary); color: #fff; padding: 0 16px; font-weight: 700; font-size: .82rem; display: flex; align-items: center; gap: 5px; }
.pix-copy-btn.success { background: var(--green); }

.pix-status { background: #fffbeb; border: 1.5px solid #fde68a; border-radius: 10px; padding: 12px 14px; display: flex; align-items: center; gap: 10px; margin-bottom: 14px; font-size: .88rem; font-weight: 600; color: var(--ink); }
.pix-spin { width: 18px; height: 18px; border: 2.5px solid var(--line); border-top-color: var(--color-primary); border-radius: 50%; animation: spin .7s linear infinite; flex-shrink: 0; }
@keyframes spin { to { transform: rotate(360deg); } }
.pix-timer { font-weight: 800; color: var(--color-primary); font-variant-numeric: tabular-nums; margin-left: auto; }

.pix-howto { background: var(--bg); border-radius: 10px; padding: 12px 14px; font-size: .82rem; color: var(--ink-soft); line-height: 1.55; text-align: left; margin-top: 14px; }
.pix-howto ol { padding-left: 18px; margin-top: 6px; }
.pix-howto ol li { margin-bottom: 4px; }

/* THANK YOU POPUP */
.ty-overlay { position: fixed; inset: 0; background: rgba(31,41,55,.8); backdrop-filter: blur(6px); z-index: 300; display: none; align-items: center; justify-content: center; padding: 20px; }
.ty-overlay.open { display: flex; }
.ty-card { background: #fff; max-width: 440px; width: 100%; border-radius: 22px; padding: 32px 26px; text-align: center; box-shadow: var(--shadow-lg); animation: tyIn .45s cubic-bezier(.34,1.4,.64,1); }
@keyframes tyIn { from { transform: scale(.9) translateY(20px); opacity: 0; } to { transform: scale(1) translateY(0); opacity: 1; } }
.ty-icon { width: 80px; height: 80px; border-radius: 50%; background: var(--green-soft); color: var(--green); display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; border: 3px solid var(--green); }
.ty-title { font-size: 1.5rem; font-weight: 800; margin-bottom: 8px; color: var(--ink); }
.ty-body { color: var(--ink-soft); font-size: .96rem; line-height: 1.55; margin-bottom: 22px; }
.ty-actions { display: flex; flex-direction: column; gap: 10px; }
.ty-btn-primary { background: var(--color-primary); color: #fff; padding: 13px 20px; border-radius: 10px; font-weight: 700; font-size: .92rem; }
.ty-btn-secondary { background: var(--bg); color: var(--ink-soft); padding: 12px 20px; border-radius: 10px; font-weight: 600; font-size: .88rem; border: 1px solid var(--line); }

@media (max-width: 540px) {
  .field-row, .field-row.tres { grid-template-columns: 1fr; }
}

/* FRETE */
.frete-list { display: flex; flex-direction: column; gap: 10px; }
.frete-item { display: flex; align-items: center; gap: 14px; padding: 14px; border: 2px solid var(--line); border-radius: 12px; cursor: pointer; background: #fff; transition: border-color .15s, background .15s; user-select: none; }
.frete-item:hover { border-color: var(--color-primary); }
.frete-item.selected { border-color: var(--color-primary); background: var(--red-soft); }
.frete-radio { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); flex-shrink: 0; position: relative; }
.frete-item.selected .frete-radio { border-color: var(--color-primary); }
.frete-item.selected .frete-radio::after { content: ''; position: absolute; inset: 3px; border-radius: 50%; background: var(--color-primary); }
.frete-info { flex: 1; min-width: 0; }
.frete-name { font-size: .94rem; font-weight: 700; color: var(--ink); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.frete-badge { background: var(--green); color: #fff; font-size: .62rem; font-weight: 800; padding: 3px 8px; border-radius: 4px; text-transform: uppercase; letter-spacing: .04em; }
.frete-eta { font-size: .78rem; color: var(--muted); margin-top: 3px; font-weight: 500; }
.frete-price { font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; font-size: .96rem; flex-shrink: 0; }
.frete-price.free { color: var(--green); }

/* BUTTON AMOUNT */
.btn-primary .btn-amount { margin-left: auto; padding-left: 12px; opacity: .92; font-variant-numeric: tabular-nums; }
.btn-primary .btn-label { font-weight: 800; }
