/* =====================================================================
   CHECKOUT — usa as variáveis de :root já definidas em styles.css.
   Mobile-first, largura máxima de cartão único (tipo app de pagamento).
   ===================================================================== */

body.chk-body { background: var(--bg); padding-bottom: 96px; }

.chk-wrap { max-width: 480px; margin: 0 auto; padding: 0 0 32px; }

/* ---------- Header ---------- */
.chk-header {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px var(--gutter);
  background: #fff; border-bottom: 1px solid var(--line);
}
.chk-back {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 10px; color: var(--ink-2);
  background: transparent; border: 0; flex: none;
}
.chk-back:hover { background: var(--soft); }
.chk-back svg { width: 20px; height: 20px; }
.chk-logo img { height: 28px; width: auto; display: block; }
.chk-secure { display: flex; align-items: center; gap: 6px; flex: none; }
.chk-secure svg { width: 16px; height: 16px; color: var(--green); flex: none; }
.chk-secure__text { font-size: 10.5px; font-weight: 800; line-height: 1.25; text-align: right; color: var(--ink); letter-spacing: .01em; }
.chk-secure__text b { display: block; color: var(--green); }

/* ---------- Cartões genéricos ---------- */
.chk-card {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-sm);
  padding: 16px; margin: 14px var(--gutter) 0;
}

/* ---------- Resumo do produto (topo) ---------- */
.chk-product { display: flex; gap: 12px; align-items: center; }
.chk-product__img { width: 88px; height: 88px; border-radius: 12px; object-fit: contain; background: var(--soft); flex: none; padding: 10px; box-sizing: border-box; }
.chk-product__name { font-size: 14px; font-weight: 800; color: var(--ink); }
.chk-product__variant { font-size: 12px; color: var(--muted); margin-top: 2px; }
.chk-product__prices { display: flex; align-items: baseline; gap: 6px; margin-top: 6px; flex-wrap: nowrap; }
.chk-product__price { font-size: 17px; font-weight: 800; color: var(--hot); letter-spacing: -.02em; white-space: nowrap; }
.chk-product__compare { font-size: 11.5px; color: var(--muted); text-decoration: line-through; white-space: nowrap; }
.chk-badge-off { font-size: 10.5px; font-weight: 800; color: var(--hot); background: var(--hot-soft); padding: 2px 6px; border-radius: 999px; white-space: nowrap; flex: none; }
.chk-product__unit { font-size: 12.5px; color: var(--green); font-weight: 700; margin-top: 4px; }

/* ---------- Steps ---------- */
.chk-step__head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.chk-step__num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 999px; background: var(--navy); color: #fff;
  font-size: 12px; font-weight: 800; flex: none;
}
.chk-step__title { font-size: 15.5px; font-weight: 800; color: var(--ink); }
.chk-step__hint { font-size: 12.5px; color: var(--muted); margin: -8px 0 14px 34px; }

.chk-field { margin-bottom: 12px; }
.chk-field:last-child { margin-bottom: 0; }
.chk-field label { display: block; font-size: 12.5px; font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.chk-input {
  width: 100%; min-height: 48px; padding: 0 14px; border-radius: 12px;
  border: 1.5px solid var(--line); background: #fff; color: var(--ink);
  font: inherit; font-size: 14.5px;
}
.chk-input::placeholder { color: #9AA6BC; }
.chk-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.chk-input.is-ok { border-color: var(--green); background-image: none; }
.chk-input.is-err { border-color: var(--hot); }
.chk-input[readonly] { background: var(--soft); color: var(--ink-2); }
.chk-input-wrap { position: relative; }
.chk-input-wrap .chk-check { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--green); pointer-events: none; display: none; }
.chk-input-wrap.is-ok .chk-check { display: block; }
.chk-error { font-size: 11.5px; color: var(--hot); margin-top: 5px; display: none; }
.chk-field.is-invalid .chk-error { display: block; }
.chk-field.is-invalid .chk-input { border-color: var(--hot); }

.chk-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.chk-row2--cep { grid-template-columns: 2fr 1fr; }

.chk-link { font-size: 12.5px; font-weight: 700; margin-top: 6px; display: inline-block; }

.chk-addr-rest { display: none; }
.chk-addr-rest.is-open { display: block; }

/* ---------- Frete ---------- */
.chk-shipping-empty {
  display: flex; align-items: center; gap: 10px; padding: 14px; border-radius: 12px;
  background: var(--soft); color: var(--muted); font-size: 13px;
}
.chk-shipping-empty svg { width: 20px; height: 20px; color: var(--primary); flex: none; }

.chk-radio {
  display: flex; align-items: flex-start; gap: 12px; padding: 14px; border-radius: 14px;
  border: 1.5px solid var(--line); margin-bottom: 10px; cursor: pointer; transition: border-color .15s, background-color .15s;
}
.chk-radio:last-child { margin-bottom: 0; }
.chk-radio.is-active { border-color: var(--primary); background: var(--primary-soft); }
.chk-radio__dot {
  width: 20px; height: 20px; border-radius: 999px; border: 2px solid var(--line); flex: none; margin-top: 1px;
  display: flex; align-items: center; justify-content: center; background: #fff;
}
.chk-radio.is-active .chk-radio__dot { border-color: var(--primary); }
.chk-radio.is-active .chk-radio__dot::after { content: ""; width: 10px; height: 10px; border-radius: 999px; background: var(--primary); }
.chk-radio__body { flex: 1; min-width: 0; }
.chk-radio__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.chk-radio__name { font-size: 14px; font-weight: 800; color: var(--ink); }
.chk-radio__price { font-size: 14px; font-weight: 800; color: var(--ink); flex: none; }
.chk-radio__price--free { color: var(--green); }
.chk-radio__tag { font-size: 10px; font-weight: 800; color: #B8750E; background: #FFF4E0; padding: 2px 7px; border-radius: 999px; margin-left: 6px; text-transform: uppercase; }
.chk-radio__eta { font-size: 12.5px; color: var(--muted); margin-top: 3px; }

/* ---------- Pagamento ---------- */
.chk-pay-option {
  display: flex; align-items: flex-start; gap: 12px; padding: 14px; border-radius: 14px;
  border: 1.5px solid var(--green); background: var(--green-soft);
}
.chk-pay-option__icon {
  width: 34px; height: 34px; border-radius: 10px; background: #fff; flex: none;
  display: flex; align-items: center; justify-content: center; color: var(--green);
}
.chk-pay-option__icon svg, .chk-pay-option__icon img { width: 20px; height: 20px; object-fit: contain; }
.chk-pay-option__top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chk-pay-option__name { font-size: 14.5px; font-weight: 800; color: var(--ink); }
.chk-pill {
  font-size: 10.5px; font-weight: 800; color: var(--green); background: #fff;
  padding: 3px 9px; border-radius: 999px; letter-spacing: .01em;
}
.chk-pay-option__list { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.chk-pay-option__list span { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-2); }
.chk-pay-option__list svg { width: 15px; height: 15px; color: var(--green); flex: none; }

/* ---------- Resumo do pedido ---------- */
.chk-summary__row { display: flex; align-items: center; justify-content: space-between; padding: 6px 0; font-size: 13.5px; color: var(--ink-2); }
.chk-summary__row--discount { color: var(--green); font-weight: 700; }
.chk-summary__row--total { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 12px; font-size: 16px; font-weight: 800; color: var(--ink); }
.chk-summary__save {
  margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: var(--green-soft); color: var(--green);
  font-size: 12.5px; font-weight: 700; display: flex; align-items: center; gap: 7px;
}
.chk-summary__save svg { width: 16px; height: 16px; flex: none; }

.chk-trust { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; margin: 18px var(--gutter) 0; }
.chk-trust span { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); font-weight: 700; }
.chk-trust svg { width: 15px; height: 15px; color: var(--primary); }

.chk-form-error {
  margin: 14px var(--gutter) 0; padding: 12px 14px; border-radius: 12px;
  background: var(--hot-soft); color: #B3184F; font-size: 13px; font-weight: 700; text-align: center;
}

/* ---------- Rodapé navy ---------- */
.chk-footer { background: var(--navy); color: #fff; margin-top: 24px; padding: 26px var(--gutter) 90px; text-align: center; }
.chk-footer__label { font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: #D9B8C8; margin-bottom: 12px; }
.chk-footer__pix { display: inline-flex; align-items: center; gap: 8px; background: #fff; color: var(--ink); padding: 8px 16px; border-radius: 10px; font-weight: 800; font-size: 13px; }
.chk-footer__pix svg { width: 18px; height: 18px; color: var(--green); }
.chk-footer__pix img { width: 18px; height: 18px; object-fit: contain; }
.chk-footer__info { margin-top: 18px; font-size: 12px; color: #E5C7D2; line-height: 1.7; }
.chk-footer__info b { color: #fff; display: block; font-size: 13px; }
.chk-footer__info a { color: #E5C7D2; text-decoration: underline; }

/* ---------- Barra fixa de pagamento ---------- */
.chk-stickybar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 12px var(--gutter); background: #fff; border-top: 1px solid var(--line);
  box-shadow: 0 -8px 24px rgba(11,31,68,.08);
}
.chk-stickybar__total-label { font-size: 11px; color: var(--muted); font-weight: 700; }
.chk-stickybar__total { font-size: 19px; font-weight: 800; color: var(--ink); letter-spacing: -.02em; }
.chk-pay-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 22px; border: 0; border-radius: 14px;
  background: var(--green); color: #fff; font-size: 15px; font-weight: 800;
  box-shadow: 0 8px 20px rgba(6,122,75,.3); flex: none;
}
.chk-pay-btn svg, .chk-pay-btn img { width: 18px; height: 18px; object-fit: contain; }
.chk-pay-btn:disabled { opacity: .55; }
.chk-pay-btn[data-loading="1"] { opacity: .85; }

/* ---------- Tela "aguardando pagamento" ---------- */
.chk-pay-badge {
  display: inline-flex; align-items: center; gap: 7px; background: #FFF4E0; color: #B8750E;
  font-size: 11.5px; font-weight: 800; padding: 6px 12px; border-radius: 999px; letter-spacing: .04em; text-transform: uppercase;
}
.chk-pay-badge svg { width: 14px; height: 14px; }
.chk-pay-title { font-size: 21px; font-weight: 800; color: var(--ink); margin: 14px 0 4px; text-align: center; }
.chk-pay-sub { font-size: 14px; color: var(--ink-2); text-align: center; }
.chk-pay-sub b { color: var(--ink); }
.chk-countdown {
  margin: 14px auto 0; display: inline-flex; align-items: center; gap: 7px;
  background: var(--soft); padding: 7px 14px; border-radius: 999px; font-size: 13px; color: var(--ink-2); font-weight: 700;
}
.chk-countdown b { color: var(--hot); font-variant-numeric: tabular-nums; }
.chk-copy-btn {
  width: 100%; margin-top: 18px; display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 52px; border: 0; border-radius: 14px; background: var(--green); color: #fff;
  font-size: 15px; font-weight: 800; box-shadow: 0 8px 20px rgba(6,122,75,.3);
}
.chk-copy-btn svg { width: 18px; height: 18px; }
.chk-copy-btn[data-copied="1"] { background: var(--navy); }
.chk-pix-code {
  margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: var(--soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11.5px; line-height: 1.5; color: var(--ink-2); word-break: break-all;
  max-height: 68px; overflow: hidden;
}
.chk-pay-steps { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.chk-pay-steps li { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; color: var(--ink-2); }
.chk-pay-steps b {
  flex: none; width: 20px; height: 20px; border-radius: 999px; background: var(--primary-soft); color: var(--primary);
  display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800;
}
.chk-qr-toggle {
  margin-top: 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: none; border: 0; width: 100%; padding: 0; cursor: pointer;
}
.chk-qr-toggle__label { font-size: 13.5px; font-weight: 700; color: var(--primary); }
.chk-switch { width: 38px; height: 22px; border-radius: 999px; background: var(--line); position: relative; flex: none; transition: background .15s; }
.chk-switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 999px; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .15s; }
.chk-qr-toggle.is-on .chk-switch { background: var(--green); }
.chk-qr-toggle.is-on .chk-switch::after { transform: translateX(16px); }
.chk-qr-box { display: none; margin-top: 14px; text-align: center; }
.chk-qr-box.is-open { display: block; }
.chk-qr-box img { width: 180px; height: 180px; margin: 0 auto; border-radius: 12px; border: 1px solid var(--line); background: #fff; }
.chk-pay-note { margin-top: 16px; display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); justify-content: center; text-align: center; }
.chk-pay-note svg { width: 15px; height: 15px; color: var(--green); flex: none; }

.chk-order-card__row { display: flex; align-items: center; justify-content: space-between; padding: 5px 0; font-size: 13px; color: var(--ink-2); }
.chk-order-card__row b { color: var(--ink); font-weight: 800; }

/* ---------- Confirmado ---------- */
.chk-paid-icon {
  width: 64px; height: 64px; border-radius: 999px; background: var(--green-soft); color: var(--green);
  display: flex; align-items: center; justify-content: center; margin: 0 auto;
}
.chk-paid-icon svg { width: 32px; height: 32px; }

@media (min-width: 540px) {
  .chk-header { padding-inline: 24px; }
  .chk-card { margin-inline: 24px; }
  .chk-trust, .chk-footer { padding-inline: 24px; }
  .chk-stickybar { padding-inline: 24px; }
}
