* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif;
  color: #0f172a;
  background: #f6f7fb;
  line-height: 1.5;
}

/* Limites de conteúdo */
main, section, header, footer { max-width: 1100px; margin: 0 auto; }
main { padding: 24px 16px 48px; }

/* ======= Header com “hero” ======= */
header, .topo {
  /* gradiente semelhante ao do screenshot */
  background: linear-gradient(135deg, #0ea5e9 0%, #7c3aed 60%, #9333ea 100%);
  color: #fff;
  padding: 28px 16px 56px;
  margin-bottom: 56px;
  border-bottom-left-radius: 24px;
  border-bottom-right-radius: 24px;
  box-shadow: 0 20px 40px rgba(124, 58, 237, 0.25);
}
header h1, .topo h1 {
  max-width: 1100px;
  margin: 0 auto;
  font-size: clamp(24px, 3vw, 36px);
  font-weight: 800;
}

/* ======= Barra de filtros ======= */
#filtros {
  position: relative;
  margin: -36px auto 24px;     /* “flutua” sobre o hero */
  max-width: 1100px;
  background: rgba(255,255,255,0.95);
  border: 1px solid #e5e7eb;   /* gray-200 */
  border-radius: 16px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08); /* slate-900 a 8% */
}

#filtros label {
  font-weight: 600;
  color: #334155;              /* slate-600 */
}

#filtros select,
#filtros input[type="search"],
#filtros button {
  appearance: none;
  border: 1px solid #e5e7eb;
  background: #fff;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  color: #0f172a;
}
#filtros select:focus,
#filtros input[type="search"]:focus {
  outline: none;
  border-color: #7c3aed;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.2);
}

/* ======= Grelha de produtos ======= */
#lista-produtos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}

/* Card do produto */
#lista-produtos article {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 10px 24px rgba(2, 6, 23, 0.06);  /* slate-950 a 6% */
  transition: transform .12s ease, box-shadow .12s ease;
}
#lista-produtos article:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 32px rgba(2, 6, 23, 0.10);
}

/* Títulos */
#lista-produtos h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  color: #0f172a;
}

/* Imagens – cortadas e consistentes */
#lista-produtos img {
  width: 100%;
  aspect-ratio: 16 / 9;    /* altura consistente, sem esticar */
  object-fit: cover;
  border-radius: 12px;
  background: #f1f5f9;     /* slate-100 (placeholder) */
}

/* Texto / descrição curto */
#lista-produtos p {
  margin: 0;
  color: #334155;          /* slate-600 */
  font-size: 14px;
}
#lista-produtos p + p { margin-top: 4px; }

/* Preço destacado */
#lista-produtos p:nth-of-type(2) { /* o <p> com preço se seguires a ordem do JS */
  font-weight: 700;
  color: #111827;          /* gray-900 */
}

/* Rating */
#lista-produtos p:has(> span.star) { color: #475569; } /* opcional se usares <span class="star"> */

/* Botão */
#lista-produtos button {
  margin-top: 6px;
  align-self: start;
  background: #7c3aed;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px 12px;
  font-weight: 600;
  cursor: pointer;
  transition: filter .12s ease, transform .06s ease;
}
#lista-produtos button:hover { filter: brightness(1.05); }
#lista-produtos button:active { transform: translateY(1px); }

/* ======= Cesto ======= */
#cesto {
  margin-top: 32px;
  padding: 20px;
  border-radius: 16px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 10px 24px rgba(2, 6, 23, 0.06);
}

#cesto h2 {
  margin: 0 0 10px;
  font-size: 20px;
  font-weight: 800;
  color: #0f172a;
}

#cesto h3 {
  margin: 16px 0 8px;
  font-size: 18px;
  font-weight: 800;
  color: #111827;
}

#cesto hr {
  border: none;
  height: 1px;
  background: #eef2f7;
  margin: 14px 0 12px;
}

/* Linhas de itens do cesto (já tinhas algo; fica mais consistente) */
#lista-cesto {
  list-style: none;
  padding: 0; margin: 0 0 10px 0;
  display: flex; flex-direction: column; gap: 8px;
}
#lista-cesto li {
  display: flex; justify-content: space-between; align-items: center;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  color: #334155;
}
#lista-cesto button {
  background: #ef4444;      /* vermelho */
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 10px;
  font-weight: 600;
  cursor: pointer;
}
#lista-cesto button:hover { filter: brightness(1.05); }

/* Total do cesto */
#total {
  font-weight: 800;
  color: #0f172a;
}

/* ---------- Formulário do checkout ---------- */
#form-checkout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 8px;
}

#form-checkout .linha {
  display: grid;
  gap: 6px;
}

#form-checkout label {
  font-size: 14px;
  color: #334155;           /* slate-600 */
  font-weight: 600;
}

#form-checkout input[type="text"],
#form-checkout input[type="search"],
#form-checkout input[type="email"] {
  width: 100%;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  color: #0f172a;
  background: #fff;
}
#form-checkout input[type="text"]:focus,
#form-checkout input[type="search"]:focus,
#form-checkout input[type="email"]:focus {
  outline: none;
  border-color: #7c3aed;                        /* roxo */
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.2); /* focus ring */
}

/* Checkbox numa linha bonita */
#form-checkout .linha:has(#chk-student) {
  grid-template-columns: 1fr auto;
  align-items: center;
}
#chk-student {
  width: 18px; height: 18px;
  accent-color: #7c3aed; /* cor do visto */
}

/* Botão Comprar */
#btn-comprar {
  justify-self: start;
  background: linear-gradient(135deg, #7c3aed, #0ea5e9);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px 16px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  box-shadow: 0 10px 18px rgba(124, 58, 237, 0.25);
  transition: transform .08s ease, filter .12s ease, box-shadow .12s ease;
}
#btn-comprar:hover {
  filter: brightness(1.05);
  box-shadow: 0 14px 26px rgba(124, 58, 237, 0.3);
}
#btn-comprar:active {
  transform: translateY(1px);
}

/* Resultado da compra (mensagens) */
#resultado-compra {
  margin-top: 12px;
  font-size: 14px;
  color: #334155;
}

/* Sucesso */
#resultado-compra .compra-ok {
  background: #f0fdf4;                  /* green-50 */
  border: 1px solid #86efac;            /* green-300 */
  color: #065f46;                       /* green-800 */
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: 0 6px 14px rgba(5, 150, 105, 0.12);
}

/* Versão mobile */
@media (max-width: 640px) {
  #cesto { padding: 16px; }
  #form-checkout { gap: 10px; }
  #lista-cesto li { font-size: 13px; padding: 8px 10px; }
  #btn-comprar { width: 100%; justify-self: stretch; text-align: center; }
}

/* Thumbnails no cesto */
.cesto-item {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  align-items: center;
  gap: 12px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 8px 10px;
}

.cesto-thumb {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 10px;
  background: #eef2f7;
}

.cesto-info {
  font-size: 14px;
  color: #334155;
}

#lista-cesto button {
  background: #ef4444;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 10px;
  font-weight: 600;
  cursor: pointer;
}
#lista-cesto button:hover { filter: brightness(1.05); }