body {
  font-family: 'Montserrat', sans-serif;
  margin: 0;
  background: #fff;
  color: #333;
}
header {
  padding: 1rem;
  color: white;
  text-align: center;
}
main {
  padding: 10px 10px 100px 10px;
  max-width: 600px;   /* Ancho máximo del contenido */
  margin: 0 auto;     /* Centrado horizontal */
}

.catalogo {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.categoria {
  font-size: 1.2rem;
  margin: 1.5rem 0 0.5rem;
  color: var(--color-fondo-contraste);
  border-bottom: 1px solid #eee;
  padding-bottom: 0.25rem;
}
.producto {
  display: flex;
  background: var(--color-fondo-producto);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  height: 132px;           /* TODAS las tarjetas con el mismo alto */
}
.producto img {
  width: 120px;
  height: 132px;           /* la imagen llena exactamente la tarjeta */
  object-fit: cover;
  flex-shrink: 0;
}
/* Descripción: recorte LIMPIO a 2 líneas con "…" (no corta a media línea) */
.descripcion {
  font-size: 12px;
  color: #777;
  margin: 3px 0 1px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.desc-vermas {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-primario);
  cursor: pointer;
  margin: 0 0 2px;
}
.info {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.texto {
  display: flex;
  flex-direction: column;
  min-width: 0;            /* permite que título y descripción recorten con … */
  color: var(--color-fondo-producto-contraste);
}

.info h3 {
  margin: 0;
  font-size: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis; /* título a una línea */
}
.precio {
  color: var(--color-fondo-producto-contraste);
  font-weight: bold;
  margin: 0.25rem 0;
}
button {
  background: var(--color-primario);
  color: white;
  border: none;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
}

footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  color: white;
  text-align: center;
  padding: 15px 0;
  font-weight: bold;
  font-size: 1.1rem;
  cursor: pointer;
}
@media (min-width: 600px) {
  .catalogo {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .producto {
    width: calc(100% - 10px);
    margin: 5px;
  }
}

.btn-mas {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-primario);
  color: var(--color-primario-contraste);
  font-size: 22px;
  font-weight: bold;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s ease;
}

.modal {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background-color: rgba(0,0,0,0.5);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}
.modal-alerta {
  background: #fff;
  padding: 20px 30px;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
  max-width: 90%;
  width: 250px;
  animation: aparecer 0.3s ease;
}

.modal-alerta .icono {
  font-size: 40px;
  margin-bottom: 10px;
}

.modal-alerta h3 {
  margin: 0 0 15px;
}
.modal-alerta button {
  background: var(--color-primario, #ff914d);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
}

@keyframes aparecer {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-content {
  background-color: #fff;
  margin: 10% auto;
  padding: 20px;
  border-radius: 10px;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
  position: relative;
}
.modal-content button {
  background: var(--color-primario-contraste);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
}


.btn-cerrar {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 22px;
  background: #000;
  border: none;
  color: #000;
  cursor: pointer;
}



.vaciar {
  background: var(--color-primario-contraste);
  margin-left: 10px;
}

.modal-carrito {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  justify-content: center;
  align-items: center;
}

.modal-carrito-content {
  background: #fff;
  border-radius: 15px;
  width: calc(100% - 40px);
  max-width: 100%;
  height: calc(100vh - 200px);
  padding: 20px;
  position: relative;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  animation: fadeIn 0.3s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
  margin: 20px;
}

@keyframes fadeIn {
  from {opacity: 0; transform: scale(0.95);}
  to {opacity: 1; transform: scale(1);}
}

.modal-carrito-cerrar {
  position: absolute;
  top: 10px; right: 10px;
  background: transparent;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: #888;
  transition: 0.2s;
}
.modal-carrito-cerrar:hover {
  color: #000;
}

.carrito-lista {
  flex: 1;                  /* Toma el espacio restante */
  overflow-y: auto;
  margin: 10px 0;
}
.carrito-resumen {
  font-size: 14px;
  color: #444;
  border-top: 1px solid #ccc;
  padding-top: 10px;
  margin-bottom: 10px;
}
.carrito-resumen p {
  margin: 5px 0;
  text-align: right;
}

.carrito-lista div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f9f9f9;
  padding: 10px;
  margin-bottom: 10px;
  border-radius: 8px;
}
.carrito-lista div strong {
  display: block;
}
.carrito-lista button {
  background: #ddd;
  border: none;
  padding: 5px 10px;
  font-size: 14px;
  cursor: pointer;
  border-radius: 5px;
}
.carrito-lista button:hover {
  background: #ccc;
}

.carrito-total {
  font-size: 16px;
  font-weight: bold;
  text-align: right;
  margin-bottom: 15px;
}

.carrito-acciones {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.btn-carrito-confirmar {
  flex: 1;
  background: #666;
  color: white;
  border: none;
  padding: 10px 10px;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
}

.btn-carrito-vaciar {
  flex: 1;
  background: #dc3545;
  color: white;
  border: none;
  padding: 10px 10px;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
}
.btn-carrito-vaciar:hover {
  background: #c82333;
}

