/* ============================================================
   Casa Azarias — estilos customizados (Release 1)
   Tailwind via CDN cobre o grosso; aqui ficam os componentes
   reutilizáveis referenciados no HTML e pequenos ajustes.
   ============================================================ */

:root {
  --choc: #5A3A20;
  --choc-dark: #3E2616;
  --choc-light: #8B5E34;
  --cream: #F4E7D3;
  --cream-dark: #E6C79C;
  --gold: #C79A4B;
}

html { -webkit-text-size-adjust: 100%; }
body { scroll-behavior: smooth; }

/* Respeita o safe-area em iPhones (notch / barra inferior) */
#cart-fab { margin-bottom: env(safe-area-inset-bottom, 0); }
#cart-panel { padding-bottom: env(safe-area-inset-bottom, 0); }

/* ---------- Cartão de produto ---------- */
.product-card {
  background: #fff;
  border: 1px solid rgba(90, 58, 32, 0.12);
  border-radius: 1rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 6px 16px rgba(62, 38, 22, 0.06);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.product-card:hover { transform: translateY(-2px); box-shadow: 0 12px 24px rgba(62, 38, 22, 0.1); }
.product-card img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; }

/* ---------- Stepper de quantidade ---------- */
.qty-btn {
  width: 2rem; height: 2rem;
  border-radius: 9999px;
  background: var(--cream);
  color: var(--choc-dark);
  font-weight: 700;
  font-size: 1.1rem;
  line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 0.15s ease, transform 0.1s ease;
}
.qty-btn:hover { background: var(--cream-dark); }
.qty-btn:active { transform: scale(0.9); }
.qty-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ---------- Campos de formulário ---------- */
.field {
  width: 100%;
  border: 1px solid rgba(90, 58, 32, 0.25);
  border-radius: 0.75rem;
  background: #fff;
  padding: 0.6rem 0.85rem;
  font-size: 0.95rem;
  color: var(--choc-dark);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(199, 154, 75, 0.25); }
.field.invalid { border-color: #dc2626; box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15); }

.error {
  color: #dc2626;
  font-size: 0.78rem;
  margin-top: 0.25rem;
  min-height: 0;
}
.error:empty { display: none; }

/* ---------- Chips de escolha (radio estilizado) ---------- */
.choice { display: block; cursor: pointer; }
.choice-ui {
  display: flex; align-items: center; justify-content: center; gap: 0.35rem;
  text-align: center;
  border: 1px solid rgba(90, 58, 32, 0.25);
  border-radius: 0.75rem;
  padding: 0.6rem 0.5rem;
  font-size: 0.9rem; font-weight: 600;
  background: #fff;
  transition: all 0.15s ease;
}
.choice input:checked + .choice-ui {
  border-color: var(--choc);
  background: var(--choc);
  color: var(--cream);
}
.choice input:focus-visible + .choice-ui { box-shadow: 0 0 0 3px rgba(199, 154, 75, 0.35); }

/* ---------- Acessibilidade ---------- */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
