/* ==========================================================
   🛒 ESTILOS DEL CARRITO — Las Glorias de la Cocina
   Archivo: carrito.css
   ========================================================== */

/* === Controles de cantidad === */
.qty-controls {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.qty-controls button {
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 4px 8px;
  background: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
}

.qty-controls button:hover {
  background: #f4f4f4;
  transform: scale(1.05);
}

/* === Botón del footer del carrito === */
#carrito-footer .button {
  min-width: 160px;
  justify-content: center;
  display: inline-flex;
  align-items: center;
  font-weight: 600;
  border-radius: 10px;
  padding: 10px 16px;
  transition: all 0.25s ease;
}

/* Estados visuales */
#carrito-footer .button:hover {
  filter: brightness(1.1);
  transform: scale(1.03);
}

/* === Aparición suave del footer del carrito === */
#carrito-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.08);
  border-top: 2px solid #f59e0b;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px 16px;
  transition: transform 0.3s ease, opacity 0.3s ease;
  z-index: 900;
}

#carrito-footer.hidden {
  transform: translateY(100%);
  opacity: 0;
  pointer-events: none;
}

#carrito-footer:not(.hidden) {
  transform: translateY(0);
  opacity: 1;
}

/* === Animación al agregar platillo (efecto rebote) === */
@keyframes carrito-pop {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.08);
  }
  100% {
    transform: scale(1);
  }
}

/* Clase que se activa temporalmente al agregar un producto */
#carrito-footer.pop {
  animation: carrito-pop 0.4s ease;
}

/* === Total del carrito === */
#carrito-total {
  font-size: 16px;
  font-weight: 600;
  color: #111;
  margin-right: 12px;
}

/* === Mejora general de legibilidad === */
#carrito-footer * {
  font-family: 'Poppins', system-ui, sans-serif;
}

/* === Adaptación móvil === */
@media (max-width: 480px) {
  #carrito-footer {
    flex-direction: column;
    gap: 10px;
    padding: 14px;
  }

  #carrito-footer .button {
    width: 100%;
    justify-content: center;
  }

  #carrito-total {
    margin-right: 0;
  }
}


/* === 🧩 Evitar que el carrito tape el footer de redes === */
body {
  padding-bottom: 90px; /* espacio libre igual al alto del carrito */
}

/* Animación elegante: oculta el carrito cuando el footer entra en pantalla */
@media (max-width: 1024px) {
  #carrito-footer {
    transition: transform 0.3s ease, opacity 0.3s ease;
  }
}

/* === 🧾 Modal resumen del carrito === */
.resumen-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 950;
}

.resumen-modal.hidden { display: none; }

.resumen-content {
  background: #fff;
  border-radius: 16px;
  padding: 20px;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.25);
  animation: fadeIn 0.25s ease;
}

.resumen-content header {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 14px;
  text-align: center;
  color: #3a2a0a;
}

#resumen-lista {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 240px;
  overflow-y: auto;
}

#resumen-lista li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #eee;
  padding: 6px 0;
}

#resumen-lista li .nombre {
  flex: 1;
  color: #333;
  font-size: 14px;
}

#resumen-lista li .precio {
  font-weight: 600;
  color: #3a2a0a;
  margin-left: 6px;
}

#resumen-lista li .eliminar {
  background: none;
  border: none;
  color: #b91c1c;
  font-size: 18px;
  cursor: pointer;
  margin-left: 6px;
  transition: transform 0.2s ease;
}

#resumen-lista li .eliminar:hover {
  transform: scale(1.2);
}

.resumen-total {
  text-align: right;
  font-weight: 600;
  font-size: 15px;
  color: #111;
  margin-top: 12px;
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* === ✨ Indicador interactivo del total del carrito === */
#carrito-total {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: transform 0.2s ease;
}

#carrito-total:hover {
  transform: scale(1.05);
}

/* Icono visual de carrito */
#carrito-total::after {
  content: "🧾";
  font-size: 17px;
  opacity: 0.75;
  transform: translateY(1px);
  animation: bounce 2.5s infinite ease-in-out;
  transition: opacity 0.3s;
}

#carrito-total:hover::after {
  opacity: 1;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

