/* ───────────────────────────────────────────────────────────────────────
   Panamar · Carrinho (Fase 4b)
   Layout do protótipo Figma (CartPage): duas colunas, resumo sticky.
   Tipos: Spectral (títulos) + Jost (UI). Tinta de marca #161616.
   ─────────────────────────────────────────────────────────────────────── */

/* ─── Canal de funil de checkout (topo focado + rodapé mínimo) ─────── */
/* Sticky footer: body em coluna a 100vh; o conteúdo (.cart/.checkout) cresce
   e empurra o rodapé para o fundo mesmo quando há pouco conteúdo. */
body.checkout-page { background: #f5f5f5; margin: 0; display: flex; flex-direction: column; min-height: 100vh; }
body.checkout-page > .cart,
body.checkout-page > .checkout { flex: 1 0 auto; }
body.checkout-page > .checkout-minifoot { flex-shrink: 0; }

.checkout-topbar {
  position: relative;
  display: flex; align-items: center; justify-content: space-between;
  height: 56px; padding: 0 24px;
  background: #fff; border-bottom: 1px solid #eee;
}
@media (min-width: 1024px) { .checkout-topbar { padding: 0 40px; } }
.checkout-topbar__back {
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: 0; cursor: pointer;
  font-family: 'Jost', sans-serif; font-size: 13px; color: #161616;
  transition: opacity .15s ease;
}
.checkout-topbar__back:hover { opacity: .6; }
.checkout-topbar__logo {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  display: block; color: #161616; transition: opacity .15s ease;
}
/* Manter a tinta escura no hover (um a:hover global punha-os a branco → invisíveis). */
.checkout-topbar__logo:hover { color: #161616; opacity: .6; }
.checkout-topbar__logo-svg { display: block; width: 150px; height: auto; }
.checkout-topbar__cart { position: relative; display: inline-flex; color: #161616; transition: opacity .15s ease; }
.checkout-topbar__cart:hover { color: #161616; opacity: .6; }
.checkout-topbar__cart-badge {
  position: absolute; top: -6px; right: -8px; min-width: 16px; height: 16px;
  padding: 0 4px; box-sizing: border-box; border-radius: 8px;
  background: #161616; color: #fff; font-family: 'Jost', sans-serif; font-size: 10px;
  line-height: 16px; text-align: center;
}
.checkout-topbar__cart-badge[hidden] { display: none; }

.checkout-minifoot {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 24px;
  padding: 16px 24px; margin-top: 32px;
  background: #fff; border-top: 1px solid #eee;
}
.checkout-minifoot a {
  font-family: 'Jost', sans-serif; font-size: 12px; color: #808080;
  text-decoration: none; transition: color .15s ease;
}
.checkout-minifoot a:hover { color: #161616; }

.cart {
  background: #f5f5f5;
  min-height: 60vh;
  padding: 40px 0 64px;
}
.cart__wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}
@media (min-width: 1024px) {
  .cart__wrap { flex-direction: row; align-items: flex-start; padding: 0 32px; }
}

/* ─── Coluna principal ─────────────────────────────────────────────── */
.cart__main { flex: 1; min-width: 0; }
.cart__title {
  font-family: 'Spectral', serif;
  font-size: 24px; font-weight: 500;
  color: #161616; margin: 0 0 4px;
}
.cart__count {
  font-family: 'Jost', sans-serif;
  font-size: 13px; color: #808080; margin: 0 0 24px;
}

.cart__list { list-style: none; margin: 0 0 16px; padding: 0; background: #fff; border-radius: 4px; }
.cart__item {
  display: flex; gap: 16px; padding: 20px;
  border-bottom: 1px solid #eee;
  transition: opacity .2s ease;
}
.cart__item:last-child { border-bottom: 0; }
.cart__item-media {
  width: 120px; height: 150px; flex-shrink: 0;
  background: #f0f0f0; border-radius: 4px; overflow: hidden;
}
.cart__item-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cart__item-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cart__item-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.cart__item-name { font-family: 'Jost', sans-serif; font-size: 14px; color: #161616; margin: 0; }
.cart__item-variant { font-family: 'Jost', sans-serif; font-size: 13px; color: #808080; margin: 2px 0 0; }
.cart__item-price { font-family: 'Jost', sans-serif; font-size: 14px; color: #161616; margin: 0; white-space: nowrap; }

/* Stepper */
.cart__qty { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.cart__qty-btn {
  width: 28px; height: 28px; border: 1px solid #ddd; background: #fff;
  border-radius: 4px; font-size: 16px; line-height: 1; color: #161616;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: border-color .15s ease;
}
.cart__qty-btn:hover:not(:disabled) { border-color: #161616; }
.cart__qty-btn:disabled { opacity: .35; cursor: default; }
.cart__qty-val { font-family: 'Jost', sans-serif; font-size: 14px; color: #161616; min-width: 20px; text-align: center; }
.cart__qty-stockmsg { font-family: 'Jost', sans-serif; font-size: 11px; color: #a07b3a; margin-left: 4px; }

.cart__item-remove {
  align-self: flex-start; margin-top: auto; padding-top: 12px;
  background: none; border: 0; cursor: pointer;
  font-family: 'Jost', sans-serif; font-size: 12px; color: #808080;
  text-decoration: underline; transition: color .15s ease;
}
.cart__item-remove:hover { color: #161616; }

/* Embalagem */
.cart__packaging { background: #fff; border-radius: 4px; padding: 20px; }
.cart__packaging-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.cart__packaging-title { font-family: 'Spectral', serif; font-size: 16px; font-weight: 500; color: #161616; margin: 0; }
.cart__packaging-free { font-family: 'Jost', sans-serif; font-size: 13px; color: #808080; }
.cart__packaging-opt {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px; border: 1px solid #eee; border-radius: 4px; cursor: pointer;
}
.cart__packaging-opt input { position: absolute; opacity: 0; pointer-events: none; }
.cart__packaging-radio {
  width: 16px; height: 16px; flex-shrink: 0; margin-top: 2px;
  border: 2px solid #161616; border-radius: 50%; position: relative;
}
.cart__packaging-opt input:checked + .cart__packaging-radio::after {
  content: ''; position: absolute; inset: 3px;
  background: #161616; border-radius: 50%;
}
.cart__packaging-opt-name { display: block; font-family: 'Jost', sans-serif; font-size: 14px; font-weight: 500; color: #161616; }
.cart__packaging-opt-desc { display: block; font-family: 'Jost', sans-serif; font-size: 12px; color: #808080; margin-top: 2px; line-height: 1.5; }

/* ─── Resumo (direita) ─────────────────────────────────────────────── */
.cart__aside { width: 100%; }
@media (min-width: 1024px) {
  .cart__aside { width: 340px; flex-shrink: 0; position: sticky; top: 24px; }
}
.cart__summary { background: #fff; border-radius: 4px; padding: 24px; margin-bottom: 16px; }
.cart__summary-title { font-family: 'Spectral', serif; font-size: 18px; font-weight: 500; color: #161616; margin: 0 0 16px; }
.cart__summary-row {
  display: flex; justify-content: space-between; align-items: baseline;
  font-family: 'Jost', sans-serif; font-size: 13px; color: #161616; margin-bottom: 8px;
}
.cart__summary-row span:first-child { color: #808080; }
.cart__summary-muted { color: #808080 !important; }
.cart__summary-row--last { margin-bottom: 20px; }

.cart__checkout-btn {
  display: flex; justify-content: space-between; align-items: center;
  width: 100%; box-sizing: border-box; padding: 16px 20px;
  background: #161616; color: #fff; border-radius: 4px; text-decoration: none;
  font-family: 'Jost', sans-serif; font-size: 14px; margin-bottom: 12px;
  transition: background .2s ease;
}
.cart__checkout-btn:hover { background: #333; color: #fff; }
.cart__continue {
  display: block; text-align: center;
  font-family: 'Jost', sans-serif; font-size: 13px; color: #808080;
  text-decoration: underline;
  transition: color .15s ease;
}
.cart__continue:hover { color: #161616; }

/* Ajuda e Serviços */
.cart__help { background: #fff; border-radius: 4px; padding: 24px; }
.cart__help-title { font-family: 'Spectral', serif; font-size: 18px; font-weight: 500; color: #161616; margin: 0 0 8px; }
.cart__help-row { border-bottom: 1px solid #eee; }
.cart__help-row:last-child { border-bottom: 0; }
.cart__help-toggle {
  display: flex; justify-content: space-between; align-items: center;
  width: 100%; padding: 16px 0; background: none; border: 0; cursor: pointer;
  font-family: 'Jost', sans-serif; font-size: 13px; color: #161616; text-align: left;
}
.cart__help-toggle svg { transition: transform .2s ease; }
.cart__help-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.cart__help-body { padding: 0 0 16px; }
.cart__help-body p { font-family: 'Jost', sans-serif; font-size: 12px; color: #808080; line-height: 1.6; margin: 0; }

/* ─── Estado vazio ─────────────────────────────────────────────────── */
.cart__empty { width: 100%; display: flex; flex-direction: column; align-items: center; text-align: center; padding: 64px 16px; }
.cart__empty-icon { margin-bottom: 16px; }
.cart__empty-title { font-family: 'Spectral', serif; font-size: 22px; font-weight: 500; color: #161616; margin: 0 0 8px; }
.cart__empty-text { font-family: 'Jost', sans-serif; font-size: 13px; color: #808080; max-width: 320px; margin: 0 0 28px; line-height: 1.6; }
.cart__empty-cta {
  display: inline-block; padding: 14px 32px; background: #161616; color: #fff;
  border-radius: 4px; text-decoration: none; font-family: 'Jost', sans-serif; font-size: 14px;
  transition: background .2s ease;
}
.cart__empty-cta:hover { background: #333; color: #fff; }

/* Link dentro dos acordeões de "Ajuda e Serviços" (para a página de Contactos).
   O :hover é obrigatório: há um a:hover{color:#fff} global que o punha branco. */
.cart__help-link { color: #161616; text-decoration: underline; text-underline-offset: 2px; }
.cart__help-link:hover { color: #161616; opacity: .7; }
