:root {
  --amarelo: #f2b705;
  --preto: #1a1a1a;
  --cinza: #777;
  --verde: #25D366;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Poppins', Arial, sans-serif;
  background: #f8f8f8;
  color: var(--preto);
}

header {
  text-align: center;
  background: var(--preto);
  color: white;
  padding: 20px;
}

header img {
  width: 90px;
  border-radius: 12px;
}

main {
  display: grid;
  grid-template-columns: 3fr 1fr;
  gap: 20px;
  padding: 20px;
}

.produtos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}

.card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  padding: 12px;
  text-align: center;
  transition: transform 0.2s ease-in-out;
  min-height: 360px; /* Estabiliza altura */
}

.card:hover {
  transform: scale(1.03);
}

.card img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  display: block;
  border-radius: 10px;
  background-color: #eee; /* Evita "piscar" */
  opacity: 0;
  transition: opacity 0.3s ease-in;
}

.card img.loaded {
  opacity: 1;
}

.card h3 {
  margin: 10px 0 5px;
}

.card p {
  color: var(--cinza);
  font-size: 14px;
}

.card .preco {
  font-weight: 700;
  margin: 8px 0;
}

.card button {
  background: var(--amarelo);
  border: none;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
}

.card button:hover {
  background: #e0a500;
}

.carrinho {
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  padding: 15px;
  position: sticky;
  top: 20px;
  height: fit-content;
}

.carrinho ul {
  list-style: none;
  padding: 0;
  max-height: 300px;
  overflow-y: auto;
}

.carrinho li {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  border-bottom: 1px dashed #ddd;
  padding-bottom: 5px;
}

button#enviarPedido {
  background: var(--verde);
  color: white;
  width: 100%;
  border: none;
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 15px;
  margin-top: 10px;
}

button.limpar {
  background: transparent;
  border: 1px solid #ccc;
  width: 100%;
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  margin-top: 6px;
}

.admin {
  margin-top: 10px;
}

.painel-admin {
  display: none;
  margin-top: 10px;
  font-size: 14px;
}

footer {
  text-align: center;
  background: var(--preto);
  color: white;
  padding: 15px;
  margin-top: 20px;
}

@media (max-width: 900px) {
  main {
    grid-template-columns: 1fr;
  }
}