/* FUENTES */
@import url('/taggi/assets/fonts.css');
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700&display=swap');

/* === GENERAL === */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Montserrat', sans-serif;
  background: #f9f9f9;
  color: #333;
  margin: 0;
  padding: 0;
}

/* ESTILOS PARA SCROLL */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #e0e0e0;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background-color: #3c7f78;
  border-radius: 10px;
  border: 2px solid #e0e0e0;
}

::-webkit-scrollbar-thumb:hover {
  background-color: #2b6058;
}

.carrito-container {
  max-width: 1200px;
  margin: 2rem auto 4rem;
  padding: 0 1.5rem;
}

/* === HEADER DEL CARRITO === */
.carrito-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #eaeaea;
}

.carrito-header h1 {
  font-size: 2rem;
  color: #333;
  font-weight: 600;
}

.carrito-estadisticas {
  display: flex;
  align-items: center;
}

.carrito-contador {
  display: flex;
  flex-direction: column;
  align-items: center;
  background-color: #28ce93;
  color: white;
  padding: 0.6rem 1rem;
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(40, 206, 147, 0.2);
}

.contador-numero {
  font-size: 1.2rem;
  font-weight: 700;
}

.contador-texto {
  font-size: 0.8rem;
  opacity: 0.9;
}

/* === CONTENIDO DEL CARRITO === */
.carrito-content {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* === PRODUCTOS === */
.carrito-productos {
  background: #fff;
  padding: 1.5rem;
  border-radius: 16px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.producto-carrito {
  display: flex;
  gap: 1.5rem;
  padding: 1.5rem;
  margin-bottom: 1rem;
  background-color: #fbfbfb;
  border-radius: 12px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.producto-carrito:hover {
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  transform: translateY(-3px);
}

.producto-carrito.removing {
  opacity: 0;
  transform: translateX(50px);
  transition: all 0.3s ease;
}

.producto-carrito:last-child {
  margin-bottom: 0;
}

.producto-imagen {
  width: 100px;
  height: 100px;
  min-width: 100px;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.producto-imagen img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.producto-detalle {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.producto-info {
  margin-bottom: 1rem;
}

.producto-nombre {
  text-decoration: none;
  display: block;
  margin-bottom: 0.5rem;
}

.producto-nombre h3 {
  font-size: 1.1rem;
  color: #333;
  font-weight: 600;
  margin: 0;
  transition: color 0.2s ease;
}

.producto-nombre:hover h3 {
  color: #28ce93;
}

.producto-color {
  display: flex;
  align-items: center;
  margin: 0.5rem 0;
}

.color-indicator {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  margin-right: 8px;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.color-name {
  font-size: 0.9rem;
  color: #666;
}

.producto-precio {
  font-size: 1rem;
  color: #333;
  font-weight: 500;
}

.producto-acciones {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

/* === SELECTOR DE CANTIDAD === */
.cantidad-selector {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  background-color: #f0f0f0;
  padding: 0.4rem 0.8rem;
  border-radius: 25px;
}

.cantidad-selector button {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #3c7f78;
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cantidad-selector button:hover {
  background-color: #28ce93;
  transform: scale(1.1);
}

.cantidad {
  font-size: 0.95rem;
  font-weight: 600;
  color: #333;
  min-width: 20px;
  text-align: center;
}

.producto-subtotal {
  font-size: 0.95rem;
  color: #333;
}

.subtotal-label {
  font-weight: 500;
  margin-right: 5px;
}

.subtotal {
  font-weight: 600;
  color: #28ce93;
}

/* === BOTÓN ELIMINAR === */
.btn-eliminar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background-color: #fff0f0;
  color: #ff5252;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 25px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-eliminar:hover {
  background-color: #ffe0e0;
  transform: translateY(-2px);
}

.btn-eliminar i {
  font-size: 0.9rem;
}

/* === CARRITO VACÍO === */
.carrito-vacio {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
  text-align: center;
}

.carrito-vacio-icono {
  width: 80px;
  height: 80px;
  background-color: #f0f8f4;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.carrito-vacio-icono i {
  font-size: 2.5rem;
  color: #28ce93;
}

.carrito-vacio h2 {
  font-size: 1.5rem;
  color: #333;
  margin-bottom: 1rem;
}

.carrito-vacio p {
  color: #666;
  margin-bottom: 1.5rem;
  max-width: 400px;
}

/* === RESUMEN DE PEDIDO === */
.resumen-pedido {
  background: #ffffff;
  padding: 1.5rem;
  border-radius: 16px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.resumen-pedido h2 {
  font-size: 1.3rem;
  color: #333;
  margin-bottom: 1.5rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid #eaeaea;
}

.resumen-detalles {
  margin-bottom: 1.5rem;
}

.resumen-fila {
  display: flex;
  justify-content: space-between;
  padding: 0.8rem 0;
  font-size: 0.95rem;
  color: #555;
}

.resumen-total {
  border-top: 1px solid #eaeaea;
  margin-top: 0.5rem;
  padding-top: 1rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: #333;
}

/* === BOTONES DE ACCIÓN === */
.opciones-finalizacion {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.btn-finalizar,
.btn-seguir-comprando {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  width: 100%;
  padding: 1rem;
  border-radius: 8px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  transition: all 0.3s ease;
}

.btn-finalizar {
  background: linear-gradient(135deg, #28ce93, #23b885);
  color: white;
  box-shadow: 0 4px 15px rgba(40, 206, 147, 0.3);
}

.btn-finalizar:hover {
  background: linear-gradient(135deg, #23b885, #1ca377);
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(40, 206, 147, 0.4);
}

.btn-seguir-comprando {
  background-color: #f0f0f0;
  color: #555;
}

.btn-seguir-comprando:hover {
  background-color: #e5e5e5;
  color: #333;
}

/* === RESPONSIVE (DESKTOP) === */
@media (min-width: 768px) {
  .carrito-content {
    flex-direction: row;
    align-items: flex-start;
  }

  .carrito-productos {
    flex: 2;
  }

  .resumen-pedido {
    flex: 1;
    position: sticky;
    top: 2rem;
    margin-left: 2rem;
  }

  .producto-acciones {
    flex-wrap: nowrap;
  }
}

/* === RESPONSIVE (MOBILE) === */
@media (max-width: 767px) {
  .carrito-container {
    padding: 0 1rem;
    margin-top: 1rem;
  }

  .carrito-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .carrito-estadisticas {
    align-self: flex-end;
  }

  .producto-carrito {
    flex-direction: column;
    padding: 1rem;
  }

  .producto-imagen {
    width: 80px;
    height: 80px;
    align-self: center;
  }

  .producto-acciones {
    flex-direction: column;
    align-items: flex-start;
  }

  .producto-subtotal {
    align-self: flex-end;
  }

  .btn-eliminar {
    align-self: stretch;
    justify-content: center;
  }

  .resumen-pedido {
    margin-top: 1rem;
  }
}

/* --- ANIMACIONES --- */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Popover carrito (estilo mejorado) */
.popover-carrito {
  position: fixed;
  background-color: #ffffff !important;
  color: #333;
  padding: 15px;
  border-radius: 10px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  font-size: 14px;
  animation: fadeIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  align-items: center;
  border-left: 4px solid #3ecb85;
  max-width: 320px;
  transition: all 0.3s ease;
}

.popover-carrito.popover-hide {
  opacity: 0;
  transform: translateY(-20px);
}

.popover-carrito img {
  width: 60px;
  height: 60px;
  margin-right: 15px;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
}

.popover-info {
  display: flex;
  flex-direction: column;
}

.popover-title {
  font-weight: 600;
  margin: 0 0 5px 0;
  font-size: 0.95rem;
}

.popover-qty {
  font-size: 0.85rem;
  color: #777;
  margin: 0 0 5px 0;
}

.popover-success {
  display: flex;
  align-items: center;
  color: #28a76d;
  font-size: 0.85rem;
  margin: 0;
}

.success-icon {
  width: 16px;
  height: 16px;
  fill: #28a76d;
  margin-right: 5px;
}

@media (max-width: 576px) {
  .popover-carrito {
    max-width: calc(100% - 40px);
    right: 20px !important;
    left: 20px !important;
  }
}

.toast-stock {
  position: fixed;
  top: 20px;
  /* sitio visible */
  right: 20px;
  z-index: 10000;
  /* sobre todo lo demás */
  background: #e74c3c;
  /* rojo avisos */
  color: #fff;
  padding: 12px 16px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
  font-size: 14px;
  animation: fadein .3s ease-out;
}

@keyframes fadein {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}
