/* Estilos básicos del Día 1. El diseño final lo hacemos el Día 3. */
* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, sans-serif;
  background: #faf7f2;
  color: #222;
}

.cabecera { padding: 1.5rem 1rem; background: #b3261e; color: #fff; text-align: center; }
.cabecera h1 { margin: 0 0 .25rem; font-size: 1.6rem; }
.cabecera p { margin: 0; opacity: .9; }

.contenedor { max-width: 960px; margin: 0 auto; padding: 1rem; }

#buscador {
  width: 100%;
  padding: .75rem 1rem;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 8px;
}

.categorias { display: flex; gap: .5rem; overflow-x: auto; padding: 1rem 0; }
.categorias button {
  flex: none;
  padding: .5rem 1rem;
  border: 1px solid #b3261e;
  border-radius: 999px;
  background: #fff;
  color: #b3261e;
  font-size: .95rem;
  cursor: pointer;
}
.categorias button.activa { background: #b3261e; color: #fff; }

.grilla { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 600px) { .grilla { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .grilla { grid-template-columns: repeat(3, 1fr); } }

.tarjeta { background: #fff; border-radius: 10px; padding: 1rem; box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.tarjeta h3 { margin: 0 0 .25rem; }
.tarjeta p { margin: 0 0 .5rem; color: #555; font-size: .9rem; }
.tarjeta .precio { font-weight: 700; color: #b3261e; }

/* ===== Carrito (Día 2) ===== */
.btn-agregar {
  margin-top: .5rem;
  padding: .5rem 1rem;
  border: none;
  border-radius: 8px;
  background: #b3261e;
  color: #fff;
  font-size: .95rem;
  cursor: pointer;
}

.carrito { margin-top: 2rem; padding: 1rem; background: #fff; border-radius: 10px; box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.carrito h2 { margin-top: 0; }
.carrito-fila { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .5rem 0; border-bottom: 1px solid #eee; }
.carrito-controles button { width: 2rem; height: 2rem; border: 1px solid #b3261e; border-radius: 50%; background: #fff; color: #b3261e; font-size: 1.1rem; cursor: pointer; }
.carrito-total { font-size: 1.2rem; text-align: right; }

#btn-enviar {
  width: 100%;
  padding: .9rem;
  border: none;
  border-radius: 8px;
  background: #25d366;
  color: #fff;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
}

/* ===== Barra flotante del pedido (Día 3) ===== */
html { scroll-behavior: smooth; }
body { padding-bottom: 5rem; } /* para que la barra no tape el final de la página */

.barra-pedido {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .9rem 1rem calc(.9rem + env(safe-area-inset-bottom));
  background: #b3261e;
  color: #fff;
  font-size: 1.05rem;
  text-decoration: none;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, .25);
}
.barra-pedido[hidden] { display: none; }

/* ===== Imágenes de productos (Día 3) ===== */
.tarjeta img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: .75rem;
}