/* ==========================================================================
   VivaManta — Checkout (estilo 3 etapas + resumo do pedido)
   Usa as variáveis de css/styles.css
   ========================================================================== */

.co-body { background: var(--cream); }

/* Topo */
.co-top { background: var(--white); border-bottom: 1px solid var(--line); padding: 18px 0; }
.co-top__inner { display: flex; align-items: center; justify-content: center; gap: 10px; }
.co-top img { height: 34px; }
.co-secure-mini { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--muted); margin-left: 12px; }
.co-secure-mini svg { width: 16px; height: 16px; color: var(--green); }

.co-promo { background: var(--navy); color: #f0ead9; text-align: center; font-size: .9rem; padding: 11px 16px; font-weight: 600; }
.co-promo b { color: var(--gold-soft); }

/* Layout */
.co-wrap { max-width: 1060px; margin: 0 auto; padding: 32px 20px 80px; display: grid; grid-template-columns: 1fr 360px; gap: 28px; align-items: start; }

/* Stepper */
.co-steps { display: flex; align-items: center; gap: 8px; margin-bottom: 24px; }
.co-step { display: flex; align-items: center; gap: 10px; flex: 1; }
.co-step__num { width: 30px; height: 30px; border-radius: 50%; background: var(--cream-200); color: var(--muted); display: grid; place-items: center; font-weight: 700; font-size: .9rem; flex: none; transition: background .2s, color .2s; }
.co-step__label { font-weight: 700; color: var(--muted); font-size: .95rem; transition: color .2s; }
.co-step__line { height: 2px; background: var(--line); flex: 1; }
.co-step.is-active .co-step__num { background: var(--navy); color: #fff; }
.co-step.is-active .co-step__label { color: var(--navy); }
.co-step.is-done .co-step__num { background: var(--green); color: #fff; }
.co-step.is-done .co-step__label { color: var(--navy); }

/* Cartão do formulário */
.co-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow-sm); }
.co-panel { display: none; }
.co-panel.is-active { display: block; animation: coFade .35s var(--ease); }
@keyframes coFade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.co-panel h2 { font-size: 1.3rem; margin-bottom: 4px; }
.co-panel .co-sub { color: var(--muted); font-size: .92rem; margin-bottom: 20px; }

/* Campos */
.co-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.co-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 4px; }
.co-field.col-2 { grid-column: 1 / -1; }
.co-field label { font-size: .82rem; font-weight: 700; color: var(--navy); }
.co-field label .req { color: #c0392b; }
.co-field input, .co-field select {
  font-family: inherit; font-size: 1rem; color: var(--ink); padding: 13px 14px;
  border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: var(--white);
  transition: border-color .2s, box-shadow .2s; width: 100%;
}
.co-field input:focus, .co-field select:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(193,154,78,.15); }
.co-field input::placeholder { color: #aab1bd; }
.co-field input.is-error, .co-field select.is-error { border-color: #c0392b; box-shadow: 0 0 0 3px rgba(192,57,43,.12); }
.co-field .co-error { color: #c0392b; font-size: .78rem; display: none; }
.co-field.has-error .co-error { display: block; }

/* Bloco de confiança nos dados */
.co-trustlist { border: 1px dashed var(--line); border-radius: var(--radius-sm); padding: 16px 18px; margin: 18px 0 4px; }
.co-trustlist b { display: block; color: var(--navy); font-size: .9rem; margin-bottom: 10px; }
.co-trustlist li { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: .9rem; margin-bottom: 7px; }
.co-trustlist li:last-child { margin-bottom: 0; }
.co-trustlist svg { width: 17px; height: 17px; color: var(--green); flex: none; }

/* Ações */
.co-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 22px; }
.co-back { background: none; color: var(--muted); font-weight: 600; font-size: .92rem; display: inline-flex; align-items: center; gap: 6px; }
.co-back:hover { color: var(--navy); }
.co-actions .btn { min-width: 200px; }
.co-actions.end { justify-content: flex-end; }

/* Opções de envio */
.co-ship__hint { display: flex; align-items: center; gap: 10px; background: var(--cream); border: 1px dashed var(--line); border-radius: var(--radius-sm); padding: 14px 16px; color: var(--muted); font-size: .9rem; margin: 4px 0 8px; }
.co-ship__hint svg { width: 18px; height: 18px; color: var(--gold); flex: none; }
.co-ship[hidden] { display: none; }
.co-ship { margin: 4px 0 8px; }
.co-ship__title { font-size: .82rem; font-weight: 700; color: var(--navy); margin-bottom: 10px; display: block; }
.co-ship__opt { display: flex; align-items: center; gap: 14px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 13px 15px; cursor: pointer; margin-bottom: 10px; transition: border-color .2s, background .2s; }
.co-ship__opt:last-child { margin-bottom: 0; }
.co-ship__opt:hover { border-color: var(--gold-soft); }
.co-ship__opt.is-active { border-color: var(--gold); background: var(--cream-200); }
.co-ship__opt input { position: absolute; opacity: 0; pointer-events: none; }
.co-ship__radio { flex: none; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line); position: relative; transition: border-color .2s; }
.co-ship__opt.is-active .co-ship__radio { border-color: var(--gold); }
.co-ship__opt.is-active .co-ship__radio::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--gold); }
.co-ship__logo { flex: none; width: 64px; height: 30px; display: grid; place-items: center; }
.co-ship__logo img { max-height: 26px; max-width: 64px; width: auto; object-fit: contain; }
.co-ship__info { flex: 1; min-width: 0; }
.co-ship__info b { display: block; color: var(--navy); font-size: .95rem; }
.co-ship__info small { color: var(--muted); font-size: .82rem; }
.co-ship__price { flex: none; font-weight: 800; color: var(--green); font-size: .9rem; }

/* Pagamento: métodos */
.co-methods { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 20px; }
.co-method { border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 16px; cursor: pointer; display: flex; align-items: center; gap: 12px; transition: border-color .2s, background .2s; }
.co-method:hover { border-color: var(--gold-soft); }
.co-method.is-active { border-color: var(--gold); background: var(--cream-200); }
.co-method input { position: absolute; opacity: 0; pointer-events: none; }
.co-method .co-method__ico { width: 38px; height: 38px; border-radius: 9px; background: var(--white); border: 1px solid var(--line); display: grid; place-items: center; color: var(--navy); flex: none; font-size: 1.1rem; }
.co-method b { display: block; color: var(--navy); font-size: .96rem; }
.co-method small { color: var(--muted); font-size: .8rem; }
.co-method .tag-pix { background: var(--green); color: #fff; font-size: .68rem; font-weight: 700; padding: 2px 7px; border-radius: 99px; margin-left: auto; }

.co-pay-panel { display: none; }
.co-pay-panel.is-active { display: block; }

/* Order bump (2ª unidade 50% OFF) */
.co-bump { display: flex; align-items: center; gap: 14px; border: 2px dashed var(--gold); background: linear-gradient(0deg, var(--cream-200), var(--cream-200)); border-radius: var(--radius-sm); padding: 14px 16px; margin-bottom: 18px; cursor: pointer; position: relative; transition: box-shadow .2s; }
.co-bump:hover { box-shadow: var(--shadow-sm); }
.co-bump.is-active { border-style: solid; box-shadow: 0 0 0 3px rgba(193,154,78,.18); }
.co-bump__check { flex: none; width: 24px; height: 24px; border-radius: 6px; border: 2px solid var(--gold); display: grid; place-items: center; color: #fff; background: #fff; }
.co-bump.is-active .co-bump__check { background: var(--gold); }
.co-bump__check svg { width: 15px; height: 15px; opacity: 0; }
.co-bump.is-active .co-bump__check svg { opacity: 1; }
.co-bump input { position: absolute; opacity: 0; pointer-events: none; }
.co-bump__img { flex: none; width: 48px; height: 48px; border-radius: 8px; object-fit: cover; border: 1px solid var(--line); }
.co-bump__txt { flex: 1; min-width: 0; }
.co-bump__txt b { color: var(--navy); font-size: .95rem; display: block; }
.co-bump__txt small { color: var(--muted); font-size: .82rem; }
.co-bump__tag { background: var(--gold); color: #fff; font-size: .64rem; font-weight: 800; letter-spacing: .08em; padding: 2px 7px; border-radius: 99px; text-transform: uppercase; }
.co-bump__price { flex: none; text-align: right; }
.co-bump__price .now { color: var(--green); font-weight: 800; font-size: .98rem; }
.co-bump__price .old { color: var(--muted); text-decoration: line-through; font-size: .76rem; display: block; }

/* Contador de expiração do PIX */
.co-pix__timer { display: inline-flex; align-items: center; gap: 8px; background: #fff4e6; border: 1px solid #f0d9a8; color: #8a6418; font-weight: 700; font-size: .9rem; padding: 8px 14px; border-radius: 999px; margin: 0 auto 14px; }
.co-pix__timer.is-urgent { background: #fdecea; border-color: #f5c6c0; color: #a33028; }
.co-pix__timer b { font-variant-numeric: tabular-nums; }

/* PIX status / spinner / erro */
.co-pix__status { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 16px; font-weight: 700; color: var(--navy); font-size: .95rem; }
.co-pix__status.is-paid { color: var(--green); }
.co-spinner { width: 18px; height: 18px; border-radius: 50%; border: 3px solid var(--cream-200); border-top-color: var(--gold); animation: coSpin .8s linear infinite; flex: none; }
@keyframes coSpin { to { transform: rotate(360deg); } }
.co-pixerror { background: #fdecea; border: 1px solid #f5c6c0; color: #a33028; border-radius: var(--radius-sm); padding: 14px 16px; font-size: .9rem; margin-top: 14px; }
.co-loading { opacity: .7; pointer-events: none; }

/* PIX box */
.co-pix { text-align: center; background: var(--cream); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 22px; }
.co-pix__qr { width: 150px; height: 150px; margin: 0 auto 14px; border-radius: 12px; background: #fff; border: 1px solid var(--line); display: grid; place-items: center; }
.co-pix__qr svg { width: 120px; height: 120px; }
.co-pix p { color: var(--muted); font-size: .9rem; margin-bottom: 12px; }
.co-pix__code { display: flex; gap: 8px; max-width: 360px; margin: 0 auto; }
.co-pix__code input { flex: 1; font-size: .82rem; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--muted); }
.co-pix__code button { background: var(--navy); color: #fff; padding: 0 16px; border-radius: 8px; font-weight: 700; font-size: .85rem; }

/* Resumo do pedido */
.co-summary { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm); position: sticky; top: 20px; }
.co-summary h3 { font-family: var(--sans); font-size: .82rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 16px; display: flex; align-items: center; justify-content: space-between; }
.co-summary h3 .count { background: var(--navy); color: #fff; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: .78rem; }
.co-item { display: flex; gap: 12px; align-items: center; padding-bottom: 16px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.co-item img { width: 60px; height: 60px; border-radius: 10px; object-fit: cover; flex: none; border: 1px solid var(--line); }
.co-item__info { flex: 1; min-width: 0; }
.co-item__info b { display: block; color: var(--navy); font-size: .95rem; }
.co-item__info small { color: var(--muted); font-size: .82rem; }
.co-qty { display: inline-flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 99px; padding: 3px; }
.co-qty button { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; color: var(--navy); font-weight: 700; background: var(--cream-200); }
.co-qty span { min-width: 16px; text-align: center; font-weight: 700; color: var(--navy); font-size: .9rem; }
.co-totals { font-size: .92rem; }
.co-totals .row { display: flex; justify-content: space-between; margin-bottom: 8px; color: var(--muted); }
.co-totals .row b { color: var(--navy); }
.co-totals .row .free { color: var(--green); font-weight: 700; }
.co-totals .discount { color: var(--green); }
.co-totals .total { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px solid var(--line); padding-top: 14px; margin-top: 6px; }
.co-totals .total span { color: var(--navy); font-weight: 700; }
.co-totals .total b { font-family: var(--serif); font-size: 1.6rem; color: var(--navy); }
.co-secure { text-align: center; margin-top: 16px; display: inline-flex; width: 100%; justify-content: center; align-items: center; gap: 8px; color: var(--green); font-weight: 700; font-size: .85rem; }
.co-secure svg { width: 18px; height: 18px; }

/* Sucesso */
.co-success { text-align: center; padding: 30px 10px; }
.co-success .ico { width: 70px; height: 70px; margin: 0 auto 18px; border-radius: 50%; background: var(--green-soft); color: var(--green); display: grid; place-items: center; }
.co-success .ico svg { width: 36px; height: 36px; }
.co-success h2 { font-size: 1.5rem; margin-bottom: 8px; }
.co-success p { color: var(--muted); max-width: 380px; margin: 0 auto 8px; }

.co-devnote { max-width: 1060px; margin: 0 auto 30px; padding: 14px 18px; background: #fff8e6; border: 1px solid #f0e0a8; border-radius: var(--radius-sm); color: #7a6418; font-size: .85rem; }
.co-devnote b { color: #5c4b10; }

@media (max-width: 880px) {
  .co-wrap { grid-template-columns: 1fr; }
  .co-summary { position: static; order: -1; }
  .co-grid, .co-methods { grid-template-columns: 1fr; }
  .co-step__label { display: none; }
  .co-step { flex: none; }
  .co-step__line { flex: 1; }
}
