/* =========================================
   CARRITO NEON DARLEXPC V2
========================================= */
.cart-count {
  background: #ef4444;
  color: white;
  border-radius: 50%;
  padding: 2px 6px;
  font-size: 12px;
  margin-left: 5px;
  transition: transform 0.2s ease;
}

.cart-count.bump {
  transform: scale(1.2);
}
/* Contenedor lateral (MECÁNICA ORIGINAL INTACTA) */
.cart-sidebar {
  position: fixed;
  top: 0;
  right: -400px;
  width: 400px;
  height: 100vh;
  background: #ffffff;
  box-shadow: -4px 0 15px rgba(0, 0, 0, 0.1);
  transition: right 0.3s ease;
  z-index: 1000;

  display: flex;
  flex-direction: column;
}

/* Estado activo */
.cart-sidebar.active {
  right: 0;
}

/* Overlay */
.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease;
  z-index: 999;
}

.cart-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Header */
.cart-header {
  padding: 18px;
  font-size: 18px;
  font-weight: 700;
  background: #0f172a;
  color: white;

  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ===============================
   BOTON CERRAR CARRITO
================================ */

#cerrarCarrito {
  width: 34px;
  height: 34px;

  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.3);
  background: transparent;

  color: white;
  font-size: 16px;
  font-weight: bold;

  cursor: pointer;

  display: flex;
  align-items: center;
  justify-content: center;

  transition: all 0.2s ease;
}

/* hover tipo botón físico */

#cerrarCarrito:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: white;
  transform: rotate(90deg);
}

/* efecto click */

#cerrarCarrito:active {
  transform: scale(0.92);
}
.cart-header button {
  background: none;
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
}

/* Lista de productos */
.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

/* Item individual */
.cart-item {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border-radius: 10px;
  background: #ffffff;
  margin-bottom: 14px;
  border: 1px solid #e5e7eb;
  transition:
    border 0.2s ease,
    box-shadow 0.2s ease;
}

/* =====================================
   UX: Highlight producto agregado
   Estado temporal visual del item
===================================== */
/* =====================================
   UX: Highlight producto agregado
   Estado temporal visual del item
===================================== */
.cart-item.highlight-item {
  border: 2px solid #3b82f6;
  box-shadow: 0 0 14px rgba(59, 130, 246, 0.55);

  animation: cartItemPulse 0.5s ease;
}

/* Animación sutil tipo pulse */
@keyframes cartItemPulse {
  0% {
    transform: scale(0.96);
    opacity: 0.7;
  }
  60% {
    transform: scale(1.04);
    opacity: 1;
  }
  100% {
    transform: scale(1);
  }
}
.cart-item:hover {
  border-color: #0b5cff;
  box-shadow: 0 0 0 2px rgba(11, 92, 255, 0.08);
}

/* Imagen miniatura */
.cart-item-img {
  width: 70px;
  height: 70px;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-item-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Información */
.cart-item-info {
  flex: 1;
  font-size: 14px;
}

.cart-item-info strong {
  display: block;
  font-size: 14px;
  margin-bottom: 4px;
  color: #0f172a;
}

.cart-item-info p {
  margin: 2px 0;
  color: #64748b;
}

/* Precio */
.cart-item-price {
  font-weight: 700;
  font-size: 15px;
  color: #0b5cff;
}

/* Footer */
.cart-footer {
  padding: 20px;
  border-top: 1px solid #e5e7eb;
  background: #ffffff;
}

/* Total */
#cartTotal {
  font-size: 22px;
  font-weight: 800;
  color: #16a34a;
}

/* Botón checkout */
.cart-checkout-btn {
  width: 100%;
  padding: 14px;
  margin-top: 12px;
  border-radius: 10px;
  border: none;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  background: linear-gradient(90deg, #0b5cff, #2563eb);
  color: white;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
  box-shadow: 0 6px 20px rgba(11, 92, 255, 0.25);
}

.cart-checkout-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(11, 92, 255, 0.35);
}
.cart-remove {
  background: #ef4444;
  border: none;
  color: white;
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  align-self: flex-start;
  transition: all 0.2s ease;
}

.cart-remove:hover {
  background: #dc2626;
  transform: scale(1.05);
}
.cart-quantity-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 5px 0;
}

.qty-btn {
  background: #111;
  color: #fff;
  border: none;
  width: 26px;
  height: 26px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
}

.qty-btn:hover {
  background: #333;
}

.qty-number {
  min-width: 20px;
  text-align: center;
}
.cart-clear {
  width: 100%;
  padding: 10px;
  background: #dc2626;
  color: white;
  border: none;
  margin-top: 10px;
  cursor: pointer;
  border-radius: 6px;
}

.cart-clear:hover {
  background: #b91c1c;
}
/* ================================
   BOTON WHATSAPP CARRITO
================================ */

.btn-whatsapp {
  width: 100%;
  padding: 14px;

  background-color: #25d366;
  color: white;

  border: none;
  border-radius: 8px;

  font-size: 16px;
  font-weight: 600;

  cursor: pointer;

  margin-top: 10px;

  transition: all 0.2s ease;
}

/* hover */

.btn-whatsapp:hover {
  background-color: #1ebe5d;
  transform: translateY(-1px);
}

/* cuando se presiona */

.btn-whatsapp:active {
  transform: translateY(0px);
}
/* =========================================
   CARRITO RESPONSIVE MOBILE PATCH V2
   (NO ALTERA ESTRUCTURA DESKTOP)
========================================= */

@media (max-width: 768px) {
  .cart-sidebar {
    width: 100%;
    right: -100%;
    border-radius: 0;
  }

  .cart-sidebar.active {
    right: 0;
  }

  .cart-header {
    font-size: 17px;
    padding: 16px;
  }

  .cart-items {
    padding: 14px;
  }

  .cart-item {
    padding: 12px;
  }

  .cart-item-img {
    width: 60px;
    height: 60px;
  }

  .cart-footer {
    padding: 16px;
  }

  #cartTotal {
    font-size: 20px;
  }

  .cart-checkout-btn {
    padding: 12px;
    font-size: 14px;
  }
}
