/* =========================================
   ESTILOS MODERNIZADOS - TACOS EL GÜERO
========================================= */

* { 
  box-sizing: border-box; 
  -webkit-tap-highlight-color: transparent; /* Quita el cuadro azul en celulares al tocar */
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, sans-serif;
  background: #F3F4F6; /* Gris súper clarito moderno */
  color: #1C1917; 
}

/* --- APPBAR (Ahora es sticky y tiene sombra) --- */
.appbar {
  background: #DC2626; 
  color: white;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 15px rgba(220, 38, 38, 0.3);
}

.marca {
  display: flex;
  align-items: center;
  gap: 12px; 
}

.marca h1 {
  margin: 0;
  font-size: 1.3rem; 
  font-weight: 700;
  letter-spacing: -0.5px;
}

.logo-encabezado {
  height: 42px; 
  width: auto;
  border-radius: 50%; 
  background: white; 
  padding: 2px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.pill {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(4px); /* Efecto cristal */
  border-radius: 999px;
  padding: 0.3rem 0.8rem;
  font-size: 0.8rem;
  font-weight: 600;
}
.pill.sin-conexion { 
  background: #1C1917; 
  color: #FACC15;
} 

/* --- LAYOUT PRINCIPAL --- */
main {
  max-width: 760px;
  margin: 2rem auto;
  padding: 0 1rem;
}

/* Secciones sin bordes duros, con sombras suaves */
section {
  background: white;
  border: none;
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

section h2 {
  margin-top: 0;
  color: #1C1917;
  font-weight: 700;
}

/* --- CATÁLOGO Y TARJETAS --- */
.grid {
  display: grid;
  gap: 1.2rem;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.producto {
  background: white;
  border: none;
  border-radius: 12px;
  padding: 0.8rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}

/* Efecto hover: la tarjeta flota un poco */
.producto:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.producto__foto {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 0.8rem;
  background: #f1f5f4;
}

.producto strong { 
  display: block; 
  margin-bottom: 0.3rem; 
  font-size: 1.05rem;
}

.producto .precio { 
  color: #DC2626; 
  font-weight: 800; 
  font-size: 1.1rem;
  margin-bottom: 0.8rem;
}

/* Empuja el botón siempre hacia abajo para que se alineen solos */
.producto button {
  margin-top: auto; 
}

/* Tarjetas esqueleto (cargando) */
.producto--cargando strong,
.producto--cargando .precio,
.producto--cargando p {
  background: #E5E7EB;
  border-radius: 4px;
  color: transparent;
  animation: pulso 1.5s infinite ease-in-out;
}
@keyframes pulso {
  0% { opacity: 0.6; }
  50% { opacity: 1; }
  100% { opacity: 0.6; }
}
.producto--cargando strong { width: 80%; height: 1.2rem; display: block; margin-bottom: 0.5rem;}
.producto--cargando .precio { width: 40%; height: 1.2rem; display: block; margin-bottom: 1rem;}
.producto--cargando button { visibility: hidden; }

/* --- BOTONES MODERNOS --- */
button {
  background: #FACC15; 
  color: #1C1917;
  font-weight: 700; 
  border: none;
  border-radius: 10px;
  padding: 0.6rem 1rem;
  cursor: pointer;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  box-shadow: 0 2px 5px rgba(250, 204, 21, 0.3);
}

button:hover { 
  background: #EAB308; 
  box-shadow: 0 4px 10px rgba(234, 179, 8, 0.4);
}

/* Efecto al dar clic */
button:active {
  transform: scale(0.95);
}

/* --- CARRITO --- */
#zona-carrito {
  background: white;
  border: none !important; /* Quita el borde rojo duro del HTML */
  box-shadow: 0 8px 30px rgba(220, 38, 38, 0.1) !important;
  border-radius: 16px !important;
}

#carrito-lista { list-style: none; padding: 0; }
#carrito-lista li {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  align-items: center;
  gap: 0.8rem;
  border-bottom: 1px solid #F3F4F6;
  padding: 1rem 0;
}
#carrito-lista li:last-child { border-bottom: none; }

.carrito-nombre { font-weight: 600; font-size: 1.05rem; }

.carrito-cantidad {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #F3F4F6;
  padding: 0.2rem;
  border-radius: 8px;
}
.carrito-cantidad button {
  padding: 0.3rem 0.6rem;
  font-size: 1rem;
  background: white;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.carrito-precio { font-weight: 800; color: #DC2626; white-space: nowrap; }

.carrito-quitar {
  background: #FEE2E2;
  color: #DC2626;
  border: none;
  border-radius: 8px;
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
  box-shadow: none;
}
.carrito-quitar:hover { background: #FECACA; color: #B91C1C; }

/* --- MAPA Y MENSAJES --- */
.mensaje { color: #6B7280; font-size: 0.95rem; min-height: 1.2em; }
.sucursal-info { color: #4B5563; font-size: 0.95rem; margin: 0 0 1rem; }

.mapa {
  height: 260px;
  border-radius: 12px;
  margin-top: 1rem;
  border: none;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

/* --- RESPONSIVE PARA CELULARES --- */
@media (max-width: 480px) {
  #carrito-lista li { 
    grid-template-columns: 1fr auto; 
    grid-template-areas: "nombre nombre" "cantidad precio" "quitar quitar"; 
    gap: 0.5rem;
  }
  .carrito-nombre { grid-area: nombre; margin-bottom: 0.2rem; }
  .carrito-cantidad { grid-area: cantidad; }
  .carrito-precio { grid-area: precio; justify-self: end; font-size: 1.1rem; }
  .carrito-quitar { grid-area: quitar; justify-self: start; width: 100%; margin-top: 0.5rem;}
}