/* ==========================================================
   Cdra Capas — checkout (usa as variáveis de css/style.css)
   ========================================================== */
.co-page [hidden] { display: none !important; }
.co-page { background: var(--sand); min-height: 100vh; display: flex; flex-direction: column; }

/* ---------- Topo ---------- */
.co-header { background: #fff; border-bottom: 1px solid var(--border); }
.co-header__row { display: flex; align-items: center; justify-content: space-between; padding: 10px 20px; }
.co-header .logo__img { width: 100px; }
.co-secure { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; color: var(--primary-dark); background: var(--primary-light); padding: 8px 14px; border-radius: 999px; }
.co-secure svg { width: 18px; height: 18px; }
.co-timer { background: var(--primary-dark); color: #fff; text-align: center; font-size: 14px; padding: 10px 12px; }
.co-timer strong { display: inline-block; min-width: 46px; background: rgba(255,255,255,.14); border-radius: 6px; padding: 1px 6px; margin-left: 4px; font-variant-numeric: tabular-nums; }
.co-timer.is-over strong { background: var(--accent); }

/* ---------- Layout ---------- */
.co-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 28px; padding-top: 28px; padding-bottom: 48px; align-items: start; flex: 1; }
.co-main { display: grid; gap: 16px; }

/* ---------- Etapas ---------- */
.co-step { background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 22px 24px; }
.co-step__head { display: flex; align-items: flex-start; gap: 12px; }
.co-step__head h2 { margin: 0; font-size: 19px; color: var(--primary-dark); }
.co-step__sub { font-size: 13.5px; color: var(--muted); margin: 3px 0 0; font-weight: normal; }
.co-step__num { width: 30px; height: 30px; border-radius: 50%; background: var(--primary); color: #fff; font-weight: 700; font-size: 14px; display: grid; place-items: center; flex: none; }
.co-step__body { display: none; margin-top: 20px; }
.co-step.is-open .co-step__body { display: block; }
.co-step:not(.is-open):not(.co-review):not(.px-card) { opacity: .65; }
.co-step:not(.is-open) .co-step__num { background: #b9c0b5; }
.co-step.is-done:not(.is-open) { display: none; }

.co-secure-badge { display: flex; align-items: center; gap: 14px; background: #eef7ee; border: 1px solid #cce8ce; border-radius: 12px; padding: 12px 16px; margin-bottom: 18px; }
.co-secure-badge__icon { width: 38px; height: 38px; border-radius: 50%; background: #d7eed9; display: grid; place-items: center; color: #166534; flex: none; }
.co-secure-badge__icon svg { width: 18px; height: 18px; }
.co-secure-badge__copy { display: grid; gap: 2px; }
.co-secure-badge__copy strong { color: #166534; font-size: 14px; font-weight: 700; line-height: 1.2; }
.co-secure-badge__copy span { color: #3e5f44; font-size: 12.5px; line-height: 1.3; }

.field { display: grid; gap: 6px; margin-bottom: 14px; min-width: 0; }
.field label { font-size: 13.5px; font-weight: 500; color: var(--text); }
.field input { height: 48px; border: 1px solid var(--border); border-radius: 10px; padding: 0 14px; font: inherit; font-size: 15px; background: #fff; outline: none; transition: border-color .2s, box-shadow .2s; width: 100%; }
.field input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79, 111, 82, .15); }
.field input.is-invalid { border-color: #c0392b; box-shadow: 0 0 0 3px rgba(192, 57, 43, .12); }
.field .field__err { color: #c0392b; font-size: 12.5px; }
.field--cep { max-width: 260px; }
.field--cep a { font-size: 12.5px; color: var(--primary); text-decoration: underline; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field-row--num { grid-template-columns: 1fr 120px; }
.field-row--city { grid-template-columns: 1fr 1fr 90px; }
.field--loading input { background: var(--sand) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='9' fill='none' stroke='%234f6f52' stroke-width='3' stroke-dasharray='40 20'%3E%3CanimateTransform attributeName='transform' type='rotate' from='0 12 12' to='360 12 12' dur='.8s' repeatCount='indefinite'/%3E%3C/circle%3E%3C/svg%3E") no-repeat right 14px center / 18px; }

.co-next { width: 100%; height: 52px; font-size: 16px; font-weight: 700; margin-top: 6px; }
.co-cta { background: #2e8b57; border-color: #2e8b57; }
.co-cta:hover { background: #23704a; border-color: #23704a; }

/* ---------- Frete ---------- */
.co-ship { margin: 8px 0 16px; }
.co-ship h3 { font-size: 15px; margin: 0 0 10px; color: var(--primary-dark); }
.co-ship__opt { display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1.5px solid var(--border); border-radius: 12px; padding: 14px 16px; cursor: pointer; margin-bottom: 10px; transition: border-color .2s, background .2s; }
.co-ship__opt:has(input:checked) { border-color: var(--primary); background: #f6f9f3; }
.co-ship__opt input { accent-color: var(--primary); width: 18px; height: 18px; flex: none; }
.co-ship__main { display: flex; align-items: center; gap: 12px; }
.co-ship__main svg { width: 26px; height: 26px; color: var(--primary); flex: none; }
.co-ship__main strong { display: block; font-size: 14.5px; }
.co-ship__main small { color: var(--muted); font-size: 13px; }
.co-ship__price { font-weight: 700; font-size: 14.5px; white-space: nowrap; }
.co-ship__price.is-free { color: #2e8b57; }

/* ---------- Revisão ---------- */
.co-review { display: grid; gap: 16px; }
.co-review__block + .co-review__block { border-top: 1px solid var(--border); padding-top: 16px; }
.co-review__head { display: flex; justify-content: space-between; align-items: center; }
.co-review__head h3 { margin: 0; font-size: 15px; color: var(--primary-dark); }
.co-edit { background: none; border: 0; color: var(--primary); font-size: 13.5px; font-weight: 500; text-decoration: underline; padding: 4px; }
.co-review__info { font-size: 14px; color: var(--muted); margin-top: 4px; line-height: 1.55; }
.co-review__info strong { color: var(--text); font-weight: 500; }

/* ---------- Oferta (order bump) ---------- */
.co-offer { border: 1.5px dashed #f59e0b; background: #fffcf2; border-radius: 14px; padding: 16px 18px; margin-bottom: 20px; transition: border-color .2s, background .2s; }
.co-offer__tag { display: inline-flex; align-items: center; gap: 6px; background: #f59e0b; color: #1f2937; font-size: 13px; font-weight: 700; padding: 5px 14px; border-radius: 999px; margin-bottom: 14px; }
.co-offer__product { display: flex; gap: 14px; align-items: center; }
.co-offer__img-box { width: 76px; height: 76px; border-radius: 10px; border: 1px solid #e5e7eb; background: #fff; overflow: hidden; flex: none; display: grid; place-items: center; }
.co-offer__img-box img { width: 100%; height: 100%; object-fit: cover; display: block; }
.co-offer__info { flex: 1; min-width: 0; }
.co-offer__info h4 { margin: 0 0 6px; font-size: 15px; font-weight: 700; color: #1f2a20; line-height: 1.35; }
.co-offer__prices { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.co-offer__old { font-size: 14px; color: #8a968a; text-decoration: line-through; }
.co-offer__now { font-size: 20px; font-weight: 700; color: #166534; }
.co-offer__badge { background: #16a34a; color: #fff; font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 999px; letter-spacing: 0.02em; }
.co-offer__add { width: 100%; height: 48px; margin-top: 14px; background: #1b7a43; border: 1px solid #1b7a43; border-radius: 8px; color: #fff; font-size: 15.5px; font-weight: 700; cursor: pointer; transition: background .2s, border-color .2s; display: flex; align-items: center; justify-content: center; gap: 8px; }
.co-offer__add:hover { background: #156535; border-color: #156535; }
.co-offer__add.is-added { background: #15803d; border-color: #15803d; }
.co-offer__remove { display: block; margin: 10px auto 0; background: none; border: 0; color: var(--muted); font-size: 13px; text-decoration: underline; cursor: pointer; }
.co-offer.is-added { border-style: solid; border-color: #16a34a; background: #f2faf4; }
.co-offer.is-added .co-offer__tag { background: #16a34a; color: #fff; }

/* ---------- Pagamento ---------- */
.co-pay { display: flex; align-items: center; gap: 14px; border: 1.5px solid var(--primary); background: #f6f9f3; border-radius: 12px; padding: 14px 16px; cursor: pointer; }
.co-pay input { accent-color: var(--primary); width: 18px; height: 18px; }
.co-pay__icon { width: 44px; height: 44px; border-radius: 10px; background: #32bcad; color: #fff; font-weight: 700; font-size: 13px; display: grid; place-items: center; flex: none; }
.co-pay__copy { flex: 1; }
.co-pay__copy strong { display: block; font-size: 15px; }
.co-pay__copy small { color: var(--muted); font-size: 13px; }
.co-pay__badge { background: #2e8b57; color: #fff; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.co-paybox { margin-top: 16px; }
.co-paybox > p:first-child { font-size: 14px; color: var(--muted); margin: 0 0 8px; }
.co-status { font-size: 14px; margin: 10px 0 0; min-height: 1em; }
.co-status.is-error { color: #c0392b; }
.co-status.is-ok { color: #2e8b57; font-weight: 500; }

.co-pending { display: flex; align-items: center; justify-content: space-between; gap: 14px; background: #fff8e6; border: 1px solid #f0d58c; border-radius: 14px; padding: 14px 18px; font-size: 14px; }
.co-pending .btn { height: 40px; white-space: nowrap; flex: none; }
@media (max-width: 560px) { .co-pending { flex-direction: column; align-items: stretch; text-align: center; } }

/* PIX gerado */
.co-pix { text-align: center; display: grid; gap: 14px; justify-items: center; }
.co-pix h3 { margin: 0; color: #2e8b57; font-size: 19px; }
.co-pix__qr { width: 220px; height: 220px; border: 1px solid var(--border); border-radius: 12px; padding: 10px; background: #fff; }
.co-pix__code { width: 100%; font: 13px/1.4 monospace; border: 1px solid var(--border); border-radius: 10px; padding: 12px; background: var(--sand); resize: none; height: 84px; color: var(--text); }
.co-pix ol { text-align: left; font-size: 14px; color: var(--muted); margin: 0; padding-left: 20px; }
.co-pix .btn { width: 100%; height: 50px; font-weight: 700; }

/* ---------- Resumo lateral ---------- */
.co-side { position: sticky; top: 20px; }
.co-card { background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 20px 22px; }
.co-card__head { display: flex; align-items: center; gap: 10px; width: 100%; background: none; border: 0; padding: 0; text-align: left; cursor: default; color: inherit; }
.co-card__head h3 { margin: 0; font-size: 17px; color: var(--primary-dark); flex: 1; }
.co-card__count { font-size: 13px; color: var(--muted); background: var(--sand); padding: 3px 10px; border-radius: 999px; }
.co-card__mtotal { display: none; }
.co-items { margin-top: 16px; display: grid; gap: 14px; max-height: 360px; overflow-y: auto; padding-right: 2px; }
.co-item { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: start; }
.co-item--offer { background: #fbfdfb; border: 1px solid #d5ecd8; border-radius: 10px; padding: 8px 10px; }
.co-item--offer .co-item__img img { border-color: #2e8b57; }
.co-item__badge-offer { color: #166534; font-weight: 700; font-size: 12px; background: #e2f4e5; padding: 2px 6px; border-radius: 4px; }
.co-item__img { position: relative; }
.co-item__img img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; background: var(--sand); border: 1px solid var(--border); }
.co-item__name { font-size: 13.5px; line-height: 1.35; margin: 0 0 6px; }
.co-item__price { font-weight: 700; font-size: 14px; white-space: nowrap; }
.co-item .qty { height: 32px; border-radius: 8px; width: max-content; }
.co-item .qty button { width: 30px; font-size: 17px; }
.co-item .qty span { min-width: 24px; text-align: center; font-size: 14px; }
.co-item__rm { background: none; border: 0; color: var(--muted); font-size: 12.5px; text-decoration: underline; padding: 0; margin-left: 10px; }
.co-item__tools { display: flex; align-items: center; }
.co-items.is-locked .co-item__tools { display: none; }
.co-empty { text-align: center; color: var(--muted); font-size: 14px; padding: 12px 0; }
.co-empty a { color: var(--primary); text-decoration: underline; }

.co-totals { border-top: 1px solid var(--border); margin-top: 18px; padding-top: 14px; display: grid; gap: 8px; font-size: 14.5px; }
.co-totals > div { display: flex; justify-content: space-between; gap: 10px; }
.co-totals span { color: var(--muted); }
.co-totals__disc strong { color: #2e8b57; }
.co-totals .is-free { color: #2e8b57; }
.co-totals__total { border-top: 1px solid var(--border); padding-top: 12px; margin-top: 4px; font-size: 18px; }
.co-totals__total span { color: var(--text); font-weight: 700; }
.co-totals__total strong { color: var(--primary-dark); font-size: 21px; }

.co-trust { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); display: grid; gap: 10px; font-size: 13.5px; color: var(--muted); }
.co-trust li { display: flex; align-items: center; gap: 10px; }
.co-trust svg { width: 20px; height: 20px; color: var(--primary); flex: none; }

.co-footer { background: #fff; border-top: 1px solid var(--border); text-align: center; font-size: 13px; color: var(--muted); padding: 20px 16px; }
.co-footer p { margin: 2px 0; }

/* ---------- Responsivo ---------- */
@media (max-width: 900px) {
  .co-layout { grid-template-columns: 1fr; padding-top: 16px; gap: 16px; }
  .co-side { position: static; order: -1; }
  .co-card { padding: 16px; }
  .co-card__head { cursor: pointer; }
  .co-card__head::after { content: '▾'; color: var(--muted); transition: transform .2s; }
  .co-card__head[aria-expanded="true"]::after { transform: rotate(180deg); }
  .co-card__mtotal { display: block; font-size: 16px; color: var(--primary-dark); }
  .co-card__body[hidden] { display: none; }
  .co-trust { display: none; }
}
@media (max-width: 560px) {
  .co-header__row { padding: 8px 14px; }
  .co-header .logo__img { width: 84px; }
  .co-secure { font-size: 12.5px; padding: 6px 11px; }
  .co-step { padding: 18px 16px; }
  .field-row, .field-row--city { grid-template-columns: 1fr; gap: 0; }
  .field-row--num { grid-template-columns: 1fr 96px; gap: 10px; }
  .field--cep { max-width: none; }
  .co-card__count { display: none; }
}

/* ---------- Página do PIX (pix.html) ---------- */
.px-wrap { padding-top: 28px; padding-bottom: 48px; flex: 1; }
.px-card { max-width: 560px; margin: 0 auto; text-align: center; padding: 28px 26px; }
.px-status { display: inline-flex; align-items: center; gap: 8px; background: #fff8e6; color: #8a6414; border: 1px solid #f0d58c; font-size: 13.5px; font-weight: 500; padding: 6px 14px; border-radius: 999px; }
.px-spinner { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: px-spin .8s linear infinite; }
@keyframes px-spin { to { transform: rotate(360deg); } }
.px-title { font-size: 22px; line-height: 1.3; color: var(--primary-dark); margin: 14px 0 6px; }
.px-sub { color: var(--muted); font-size: 14.5px; margin: 0 0 20px; }
.px-card .co-pix__qr img, .px-card .co-pix__qr canvas { width: 100%; height: 100%; }
.px-info { margin: 24px 0 0; border-top: 1px solid var(--border); padding-top: 16px; display: grid; gap: 8px; font-size: 14px; text-align: left; }
.px-info div { display: flex; justify-content: space-between; gap: 16px; }
.px-info dt { color: var(--muted); }
.px-info dd { margin: 0; text-align: right; }
.px-done svg { width: 64px; height: 64px; color: #2e8b57; margin: 0 auto; }
.px-done--fail svg { color: var(--accent); }
.px-back { width: 100%; height: 50px; margin-top: 22px; font-weight: 700; }
@media (max-width: 560px) { .px-card { padding: 22px 16px; } .px-title { font-size: 19px; } }
