/* ============================================================================
   shop.css — "miolo" do fluxo de compra: carrinho, checkout, pedido e login.
   Reaproveita os tokens do tema (base.css) e o vocabulario de form/area do
   cliente (catalog.css). Estilo Astro v6. Regra dura (ADR 0012): fonte >= 16px.
   ============================================================================ */

/* ── Wrapper de pagina (estreito, centralizado) ── */
.shop { padding-block: clamp(1.5rem, 4vw, 3rem); }
.shop--narrow { max-width: 560px; margin-inline: auto; }
.shop__title {
  font-family: var(--font-display);
  font-style: normal;
  font-weight: 800;
  text-transform: uppercase;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  line-height: 1.05;
  margin: 0 0 0.4rem;
}
.shop__sub { color: var(--text-muted); font-size: 1.0625rem; margin: 0 0 1.5rem; }

/* ── Layout 2 colunas (conteudo + resumo sticky) ── */
.shop-grid { display: grid; grid-template-columns: 1fr; gap: 2rem; }
@media (min-width: 900px) {
  .shop-grid { grid-template-columns: 1.7fr 1fr; align-items: start; }
}
.shop-aside { position: sticky; top: 72px; display: grid; gap: 1rem; }

/* ── Campos de formulario ── */
.field { display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: 1rem; }
.field > label { font-size: 1rem; font-weight: 600; }
.field input,
.field textarea,
.field select {
  width: 100%;
  font-size: 1.0625rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card-bg);
  color: var(--text);
}
.field input:focus,
.field textarea:focus,
.field select:focus { outline: 2px solid var(--accent); border-color: var(--accent); }
.field input::placeholder { color: #b3b6bc; }

.form-row { display: flex; gap: 1rem; flex-wrap: wrap; }
.form-row > .field { flex: 1 1 12rem; }
.field--sm { flex: 0 0 7rem; }

/* secao de form com titulo */
.shop-section { margin-top: 1.75rem; }
.shop-section > h2 {
  font-size: 1.0625rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 0.9rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--line);
}

/* aceite de termos */
.terms { display: flex; gap: 0.7rem; align-items: flex-start; margin: 1.25rem 0; font-size: 1.0625rem; }
.terms input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--accent); flex: 0 0 auto; }

/* ── Alertas ── */
.alert {
  font-size: 1.0625rem;
  border-radius: var(--radius-sm);
  padding: 0.85rem 1.1rem;
  margin: 0 0 1.25rem;
  border: 1px solid transparent;
}
.alert--error { background: #fdecec; border-color: #f3b4b4; color: #b42318; }
.alert--success { background: #e3f4e8; border-color: #abefc6; color: #1f7a3d; }
.alert--info { background: #fff7e6; border-color: #f0d488; color: #8a5a12; }

/* utilitario: botao full-width + variante clara (secundario) + pequeno */
.btn--block { width: 100%; }
.btn--ghost { background: var(--muted-bg); color: var(--ink); }
.btn--ghost:hover { background: #e7e7e7; }
.btn--sm { padding: 0.6rem 1.1rem; font-size: 1rem; }

/* link de acao destrutiva discreta (remover item) */
.link-danger {
  border: 0; background: none; color: var(--accent); font-weight: 600;
  cursor: pointer; padding: 0; font-size: 1rem;
}
.link-danger:hover { color: var(--accent-dark); text-decoration: underline; }

/* ============================================================================
   RESUMO DO PEDIDO (carrinho/checkout/pedido)
   ============================================================================ */
.summary { border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem 1.4rem; background: var(--card-bg); }
.summary h2 {
  font-size: 1.0625rem; text-transform: uppercase; letter-spacing: 0.04em; margin: 0 0 1rem;
}
.summary__items { list-style: none; margin: 0 0 0.5rem; padding: 0; }
.summary__items li {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: 0.55rem 0; border-bottom: 1px solid var(--line); font-size: 1rem;
}
.summary__row { display: flex; justify-content: space-between; gap: 1rem; padding: 0.35rem 0; font-size: 1.0625rem; }
.summary__row .muted { color: var(--text-muted); }
.summary__total {
  display: flex; justify-content: space-between; gap: 1rem;
  border-top: 2px solid var(--ink); margin-top: 0.6rem; padding-top: 0.85rem;
  font-weight: 800; font-size: 1.35rem;
}

/* ============================================================================
   CARRINHO
   ============================================================================ */
.cart-items { list-style: none; margin: 0; padding: 0; }
.cart-item { display: flex; gap: 1.1rem; padding: 1.25rem 0; border-bottom: 1px solid var(--line); }
.cart-item:first-child { padding-top: 0; }
.cart-item__media,
.cart-item__noimg {
  flex: 0 0 auto; width: 88px; height: 88px;
  border-radius: var(--radius-sm); background: var(--muted-bg); object-fit: cover;
}
.cart-item__noimg {
  display: flex; align-items: center; justify-content: center;
  color: #b3b6bc; font-size: 1rem; text-align: center; line-height: 1.2;
}
.cart-item__info { flex: 1; min-width: 0; }
.cart-item__name { font-size: 1.0625rem; font-weight: 600; }
.cart-item__name:hover { color: var(--accent); }
.cart-item__variation { color: var(--text-muted); font-size: 1rem; margin: 0.15rem 0 0; }
/* Personalizacao (ADR 0026 onda 2): inputs do cliente no item do carrinho. */
.cart-item__personal { list-style: none; margin: 0.2rem 0 0; padding: 0; color: var(--text); font-size: 1rem; }
.cart-item__personal li { margin: 0.1rem 0; }
.cart-item__personal-label { color: var(--text-muted); }
.cart-item__unit { color: var(--text-muted); font-size: 1rem; margin: 0.25rem 0 0.7rem; }
.cart-item__row { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.cart-qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.cart-qty input { width: 56px; text-align: center; border: 0; padding: 0.55rem 0.25rem; background: transparent; font-size: 1rem; }
.cart-qty input:focus { outline: none; }
.cart-qty button {
  border: 0; background: none; cursor: pointer; font-size: 1.0625rem; font-weight: 700;
  color: var(--accent); padding: 0.25rem 0.5rem;
}
.cart-item__line { margin-left: auto; font-weight: 700; font-size: 1.0625rem; white-space: nowrap; }
.cart-empty { text-align: center; padding: clamp(2.5rem, 8vw, 4.5rem) 0; }
.cart-empty p { font-size: 1.0625rem; color: var(--text-muted); margin: 0 0 1.5rem; }

/* ============================================================================
   FRETE (ilha Alpine no checkout)
   ============================================================================ */
.ship-opts { margin: 0.5rem 0; display: flex; flex-direction: column; }
.ship-opt {
  display: flex; align-items: center; gap: 0.75rem; padding: 0.8rem 0.2rem;
  border-bottom: 1px solid var(--line); cursor: pointer; font-size: 1.0625rem;
}
.ship-opt input { width: 18px; height: 18px; accent-color: var(--accent); }
.ship-opt__svc { flex: 1; }
.ship-msg { font-size: 1rem; color: var(--text-muted); margin: 0.5rem 0; }
.ship-msg.is-err { color: #b42318; }

/* ============================================================================
   IDENTIDADE (email-first) + ENDERECOS SALVOS no checkout
   ============================================================================ */
.id-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 0.75rem; }

.addr-list { display: flex; flex-direction: column; gap: 0.6rem; margin-bottom: 1rem; }
.addr-opt {
  display: flex; align-items: flex-start; gap: 0.75rem; padding: 0.9rem 1rem;
  border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer;
  font-size: 1.0625rem; transition: border-color 0.15s ease, background 0.15s ease;
}
.addr-opt:hover { border-color: var(--accent); }
.addr-opt:has(input:checked) { border-color: var(--accent); background: #f6faf7; }
.addr-opt input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--accent); flex: 0 0 auto; }
.addr-opt__text { flex: 1; line-height: 1.4; }

/* ── Stepper (5 etapas) ── */
.steps {
  display: flex; list-style: none; margin: 0 0 1.75rem; padding: 0;
  gap: 0.5rem; flex-wrap: wrap;
}
.step {
  display: flex; align-items: center; gap: 0.5rem; flex: 1 1 auto;
  padding: 0.6rem 0.75rem; border: 1px solid var(--line); border-radius: var(--radius);
  font-size: 1rem; color: var(--text-muted); white-space: nowrap;
}
.step__n {
  width: 28px; height: 28px; flex: 0 0 auto; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: #eceff3; color: var(--text-muted); font-weight: 700; font-size: 0.95rem;
}
.step.is-active { border-color: var(--accent); color: var(--text); font-weight: 600; }
.step.is-active .step__n { background: var(--accent); color: #fff; }
.step.is-done { cursor: pointer; }
.step.is-done .step__n { background: #16a34a; color: #fff; }
.step.is-done .step__n::after { content: "✓"; }
.step.is-done .step__l { color: var(--text); }
@media (max-width: 640px) {
  .step__l { display: none; }
  .step { flex: 1 1 0; justify-content: center; }
}

/* etapa: so a ativa fica visivel (hidden nativo) */
.wstep { animation: wfade 0.18s ease; }
@keyframes wfade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* navegacao da etapa */
.wnav { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; margin-top: 1.5rem; }

/* revisao (etapa 5) */
.review { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 1rem; }
.review__row { display: flex; gap: 1rem; padding: 0.85rem 1rem; border-bottom: 1px solid var(--line); font-size: 1.0625rem; }
.review__row:last-child { border-bottom: 0; }
.review__k { flex: 0 0 7rem; color: var(--text-muted); }
.review__v { flex: 1; }

/* ============================================================================
   PEDIDO (confirmacao)
   ============================================================================ */
.order-confirm {
  background: #e3f4e8; border: 1px solid #abefc6; border-radius: var(--radius);
  padding: 1.25rem 1.5rem; margin-bottom: 1.5rem;
}
.order-confirm h1 {
  font-family: var(--font-display); font-style: normal; text-transform: uppercase;
  font-size: clamp(1.6rem, 4vw, 2.2rem); line-height: 1.05; margin: 0 0 0.35rem; color: #1f7a3d;
}
.order-confirm p { margin: 0; font-size: 1.0625rem; }
.order-meta { font-size: 1.0625rem; line-height: 1.9; margin: 0 0 1.5rem; }
.order-meta strong { font-weight: 700; }

.pix-box {
  margin-top: 1.5rem; background: #fff7e6; border: 1px solid #f0d488;
  border-radius: var(--radius); padding: 1.25rem 1.5rem;
}
.pix-box.is-paid { background: #e3f4e8; border-color: #abefc6; }
.pix-box h2 { margin-top: 0; font-size: 1.25rem; }
.pix-code {
  display: block; word-break: break-all; background: var(--card-bg); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 0.8rem 0.9rem; font-size: 1rem; margin: 0.75rem 0;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}
.pix-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: center; margin-top: 0.5rem; }
.order-actions { margin-top: 1.75rem; display: flex; gap: 0.75rem; flex-wrap: wrap; }

/* ============================================================================
   LOGIN (entrar / confirmar codigo) — card centrado
   ============================================================================ */
.auth-card {
  max-width: 460px; margin: clamp(2rem, 6vw, 4rem) auto;
  background: var(--card-bg); border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(1.5rem, 4vw, 2.5rem); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}
.auth-card__title {
  font-family: var(--font-display); font-style: normal; font-weight: 800;
  text-transform: uppercase; font-size: 1.9rem; line-height: 1.05; margin: 0 0 0.4rem;
}
.auth-card__sub { color: var(--text-muted); font-size: 1.0625rem; margin: 0 0 1.5rem; }
.auth-card__email { color: var(--ink); font-weight: 700; }
.auth-code-input { letter-spacing: 0.4em; text-align: center; font-size: 1.4rem !important; font-weight: 700; }
.auth-back { display: inline-block; margin-top: 1.25rem; font-size: 1rem; }
