/* ───────────────────────────────────────────────────────────────────────
   Panamar · Checkout (Fase 4c) — stepper de página única
   Mesmo registo visual do carrinho: cards brancos sobre #f5f5f5,
   Spectral (títulos) + Jost (UI), tinta #161616.
   ─────────────────────────────────────────────────────────────────────── */

.checkout { background: #f5f5f5; min-height: 60vh; padding: 0 0 48px; }

.checkout__logged {
  background: #fff; border-bottom: 1px solid #eee;
  padding: 10px 24px; font-family: 'Jost', sans-serif; font-size: 12px; color: #808080;
}
.checkout__logged strong { color: #161616; font-weight: 500; }

.checkout__wrap {
  max-width: 1100px; margin: 0 auto; padding: 40px 16px 0;
  display: flex; flex-direction: column; gap: 32px;
}
@media (min-width: 1024px) {
  .checkout__wrap { flex-direction: row; align-items: flex-start; padding: 40px 32px 0; }
}
.checkout__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 16px; }

/* Cards */
.checkout__card { background: #fff; border-radius: 4px; overflow: hidden; }
.checkout__head { padding: 20px 24px; border-bottom: 1px solid #eee; }
.checkout__head--center { text-align: center; }
.checkout__title { font-family: 'Spectral', serif; font-size: 22px; font-weight: 500; color: #161616; margin: 0 0 4px; }
.checkout__sub { font-family: 'Jost', sans-serif; font-size: 13px; color: #808080; margin: 0; }
.checkout__step-title { font-family: 'Spectral', serif; font-size: 18px; font-weight: 500; color: #161616; margin: 0; }
.checkout__body { padding: 24px; display: flex; flex-direction: column; gap: 14px; }

/* Radios (identidade, envio, método) */
.checkout__radio {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px; border: 1px solid #eee; border-radius: 4px; cursor: pointer;
  transition: border-color .15s ease;
}
.checkout__radio:hover { border-color: #999; }
.checkout__radio input { position: absolute; opacity: 0; pointer-events: none; }
.checkout__radio-dot {
  width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px;
  border: 2px solid #ccc; border-radius: 50%; position: relative; transition: border-color .15s ease;
}
.checkout__radio input:checked ~ .checkout__radio-dot { border-color: #161616; }
.checkout__radio input:checked ~ .checkout__radio-dot::after {
  content: ''; position: absolute; inset: 3px; background: #161616; border-radius: 50%;
}
.checkout__radio-label { display: block; font-family: 'Jost', sans-serif; font-size: 14px; color: #161616; }
.checkout__radio-sub { display: block; font-family: 'Jost', sans-serif; font-size: 12px; color: #808080; margin-top: 2px; }
.checkout__radio-price { margin-left: auto; font-family: 'Jost', sans-serif; font-size: 13px; color: #161616; white-space: nowrap; }

/* Form de morada */
.checkout__form { display: flex; flex-direction: column; gap: 16px; margin-top: 6px; }
.checkout__req { font-family: 'Jost', sans-serif; font-size: 11px; color: #808080; margin: 0; }
.checkout__row { display: flex; gap: 16px; }
.checkout__row .checkout__field { flex: 1; }
/* Em telemóvel as linhas de 2 campos (Nome/Apelido, CP/Localidade) ficavam
   demasiado apertadas (~139px cada); abaixo de 600px passam a empilhar. */
@media (max-width: 600px) {
    .checkout__row { flex-direction: column; gap: 16px; }
}
.checkout__field { display: flex; flex-direction: column; gap: 4px; }
.checkout__label { font-family: 'Jost', sans-serif; font-size: 11px; color: #808080; }
.checkout__field input,
.checkout__field select {
  width: 100%; box-sizing: border-box;
  border: 0; border-bottom: 1px solid #ddd; background: transparent;
  padding: 8px 10px 8px 12px; font-family: 'Jost', sans-serif; font-size: 14px; color: #161616;
  outline: none; transition: border-color .15s ease;
}
.checkout__field input:focus,
.checkout__field select:focus { border-color: #161616; }

.checkout__guest { margin: -2px 0 2px; }
.checkout__signin { display: flex; flex-direction: column; gap: 12px; margin: 2px 0; }
/* O atributo hidden tem de ganhar ao display:flex destes elementos. */
.checkout__signin[hidden], .checkout__cta[hidden], .checkout__alt-link[hidden] { display: none; }
.checkout__err { font-family: 'Jost', sans-serif; font-size: 12px; color: #b3261e; margin: 0; }
.checkout__alt-link { font-family: 'Jost', sans-serif; font-size: 13px; color: #161616; text-decoration: underline; }
.checkout__alt-link:hover { color: #161616; opacity: .7; } /* força cor: há um a:hover{color:#fff} global */

/* CTA */
.checkout__cta {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; box-sizing: border-box; padding: 16px 20px; margin-top: 4px;
  background: #161616; color: #fff; border: 0; border-radius: 4px; cursor: pointer;
  font-family: 'Jost', sans-serif; font-size: 14px; text-decoration: none;
  transition: background .2s ease;
}
.checkout__cta:hover { background: #333; color: #fff; }
.checkout__cta:disabled { opacity: .6; cursor: default; }
.checkout__cta--confirm { justify-content: space-between; gap: 16px; text-align: left; }

/* Aceitação dos Termos e Privacidade (obrigatória) */
.checkout__terms {
  display: flex; align-items: flex-start; gap: 10px; cursor: pointer;
  font-family: 'Jost', sans-serif; font-size: 13px; line-height: 1.5; color: #161616;
}
.checkout__terms input { position: absolute; opacity: 0; pointer-events: none; }
.checkout__terms-box {
  width: 16px; height: 16px; flex-shrink: 0; margin-top: 2px;
  border: 2px solid #ccc; border-radius: 2px; position: relative; transition: border-color .15s ease, background .15s ease;
}
.checkout__terms:hover .checkout__terms-box { border-color: #999; }
.checkout__terms input:checked ~ .checkout__terms-box { border-color: #161616; background: #161616; }
.checkout__terms input:checked ~ .checkout__terms-box::after {
  content: ''; position: absolute; left: 3px; top: 0; width: 5px; height: 9px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.checkout__terms input:focus-visible ~ .checkout__terms-box { outline: 2px solid #161616; outline-offset: 2px; }
.checkout__terms-text a { color: #161616; text-decoration: underline; }
.checkout__terms-text a:hover { color: #161616; opacity: .7; } /* força cor: há um a:hover{color:#fff} global */

/* Passos concluídos (no passo de pagamento) */
.checkout__card--done {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px; opacity: .7;
}
.checkout__edit { background: none; border: 0; cursor: pointer; font-family: 'Jost', sans-serif; font-size: 12px; color: #808080; text-decoration: underline; }
.checkout__edit:hover { color: #161616; }

/* Pagamento offline */
.checkout__pay { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border: 1px solid #eee; border-radius: 4px; }
.checkout__pay-dot { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; border: 2px solid #161616; border-radius: 50%; position: relative; }
.checkout__pay-dot::after { content: ''; position: absolute; inset: 3px; background: #161616; border-radius: 50%; }
.checkout__pay-name { font-family: 'Jost', sans-serif; font-size: 14px; font-weight: 500; color: #161616; margin: 0; }
.checkout__pay-info { font-family: 'Jost', sans-serif; font-size: 12px; color: #808080; margin: 2px 0 0; line-height: 1.5; }

/* Levantamento em boutique (morada + horário, só quando escolhido) */
.checkout__pickup { margin: 2px 0 8px; padding: 14px 16px; border: 1px solid #eee; border-radius: 4px; background: #fafafa; }
.checkout__pickup[hidden] { display: none; }
.checkout__pickup-title { font-family: 'Jost', sans-serif; font-size: 13px; font-weight: 600; color: #161616; margin: 0 0 6px; }
.checkout__pickup-addr { font-family: 'Jost', sans-serif; font-size: 14px; color: #161616; margin: 0; }
.checkout__pickup-ref { font-family: 'Jost', sans-serif; font-size: 12px; color: #808080; margin: 2px 0 0; }
.checkout__pickup-hours { font-family: 'Jost', sans-serif; font-size: 12px; color: #161616; margin: 8px 0 0; }
.checkout__pickup-note { font-family: 'Jost', sans-serif; font-size: 12px; color: #808080; line-height: 1.5; margin: 8px 0 0; }

/* Envio internacional sob consulta (pedido de orçamento — Opção B) */
.checkout__quote { margin: 2px 0 8px; padding: 16px 18px; border: 1px solid #e6e0d8; border-radius: 4px; background: #f7f5f2; }
.checkout__quote[hidden] { display: none; }
.checkout__quote-title { font-family: 'Jost', sans-serif; font-size: 13px; font-weight: 600; letter-spacing: .02em; color: #161616; margin: 0 0 6px; }
.checkout__quote-text { font-family: 'Jost', sans-serif; font-size: 13px; color: #555; line-height: 1.6; margin: 0; }

/* Sucesso */
.checkout__success { padding: 40px 24px; text-align: center; display: flex; flex-direction: column; align-items: center; }
.checkout__success-icon { width: 56px; height: 56px; border-radius: 50%; background: #f0f0f0; display: flex; align-items: center; justify-content: center; margin-bottom: 20px; }
.checkout__order-ref { margin-top: 20px; padding: 12px 24px; background: #f5f5f5; border-radius: 3px; }
.checkout__order-ref-label { display: block; font-family: 'Jost', sans-serif; font-size: 11px; color: #808080; margin-bottom: 2px; }
.checkout__order-ref-val { font-family: 'Jost', sans-serif; font-size: 16px; font-weight: 500; color: #161616; }

/* Dados de pagamento (Multibanco / MB WAY) no ecrã de sucesso */
.checkout__paybox { width: 100%; max-width: 340px; margin: 22px auto 0; padding: 18px 20px; border: 1px solid #e6e6e6; border-radius: 4px; background: #fafafa; text-align: left; }
.checkout__paybox-title { font-family: 'Jost', sans-serif; font-size: 14px; font-weight: 600; color: #161616; margin: 0 0 12px; text-align: center; }
.checkout__paybox-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid #eee; font-family: 'Jost', sans-serif; font-size: 13px; color: #808080; }
.checkout__paybox-row strong { font-size: 16px; font-weight: 600; color: #161616; letter-spacing: .04em; }
.checkout__paybox-note { font-family: 'Jost', sans-serif; font-size: 12px; color: #808080; line-height: 1.5; margin: 12px 0 0; text-align: center; }

/* Ajuda e Serviços (acordeão de confiança na sidebar) */
.checkout__help { margin-top: 16px; background: #fff; border-radius: 3px; padding: 18px 20px; }
.checkout__help-title { font-family: 'Spectral', serif; font-size: 16px; font-weight: 500; color: #161616; margin: 0 0 6px; }
.checkout__acc { border-bottom: 1px solid #eee; }
.checkout__acc:last-child { border-bottom: 0; }
.checkout__acc-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 13px 0; background: none; border: 0; cursor: pointer; text-align: left; font-family: 'Jost', sans-serif; font-size: 13px; color: #161616; }
.checkout__acc-chev { flex-shrink: 0; transition: transform .2s; }
.checkout__acc-head.is-open .checkout__acc-chev { transform: rotate(180deg); }
.checkout__acc-body { font-family: 'Jost', sans-serif; font-size: 12px; color: #808080; line-height: 1.6; padding: 0 2px 14px; }
.checkout__acc-link { color: #161616; text-decoration: underline; text-underline-offset: 2px; }
.checkout__acc-link:hover { color: #161616; opacity: .7; } /* força cor: há um a:hover{color:#fff} global */
.checkout__success-actions { display: flex; flex-direction: column; gap: 12px; }

/* Sidebar */
.checkout__aside { width: 100%; }
@media (min-width: 1024px) { .checkout__aside { width: 340px; flex-shrink: 0; position: sticky; top: 24px; } }
.checkout__summary { background: #fff; border-radius: 4px; padding: 20px; }
.checkout__summary-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.checkout__summary-head h3 { font-family: 'Spectral', serif; font-size: 16px; font-weight: 500; color: #161616; margin: 0; }
.checkout__summary-head span { font-family: 'Jost', sans-serif; font-size: 12px; color: #808080; }
.checkout__summary-list { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.checkout__summary-item { display: flex; gap: 12px; align-items: center; }
.checkout__summary-media { width: 56px; height: 70px; flex-shrink: 0; background: #f0f0f0; border-radius: 3px; overflow: hidden; }
.checkout__summary-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.checkout__summary-name { font-family: 'Jost', sans-serif; font-size: 12px; color: #161616; margin: 0; }
.checkout__summary-variant { font-family: 'Jost', sans-serif; font-size: 11px; color: #808080; margin: 2px 0 0; }
.checkout__summary-qtd { font-family: 'Jost', sans-serif; font-size: 11px; color: #808080; margin: 1px 0 0; }
.checkout__summary-totals { border-top: 1px solid #eee; padding-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.checkout__summary-row { display: flex; justify-content: space-between; font-family: 'Jost', sans-serif; font-size: 13px; color: #161616; }
.checkout__summary-row span:first-child { color: #808080; }
.checkout__summary-row--total { border-top: 1px solid #eee; padding-top: 10px; margin-top: 2px; font-weight: 500; }
.checkout__summary-row--total span:first-child { color: #161616; }

/* ── Página de retorno de pagamento (cartão / Google Pay / Apple Pay) ──────
   /loja/pagamento_retorno — um só cartão centrado, sem sidebar de resumo. */
.checkout__wrap--single { max-width: 560px; }
.checkout__wrap--single .checkout__panel { width: 100%; display: flex; flex-direction: column; gap: 16px; }
.checkout__wrap--single .checkout__sub { max-width: 40em; }
