/* ========================================
   WAEG CAROUSEL - CARRUSEL DE PRODUCTOS
   ======================================== */

.waeg-carousel-wrapper {
  position: relative;
  width: 100%;
  margin: 40px 0;
  overflow: hidden;
}

.waeg-carousel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 24px 0;
}

.waeg-carousel-title {
  font-size: 28px;
  font-weight: 700;
  margin: 0;
  color: #333;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.waeg-carousel-title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

.waeg-carousel-title a:hover {
  color: #cc0000;
}

.waeg-carousel-view-all {
  font-size: 14px;
  font-weight: 600;
  color: #cc0000;
  text-decoration: none;
  white-space: nowrap;
  transition: opacity 0.2s ease;
}

.waeg-carousel-view-all:hover {
  opacity: 0.75;
}

.waeg-carousel-container {
  position: relative;
  padding: 0 50px;
}

/* Track wrapper con overflow hidden */
.waeg-carousel-track-wrapper {
  overflow: hidden;
  width: 100%;
}

/* Track que contiene los slides */
.waeg-carousel-track {
  display: flex;
  transition: transform 0.5s ease-in-out;
  gap: 20px;
}

/* Slide individual */
.waeg-carousel-slide {
  flex-shrink: 0;
  width: calc(25% - 15px); /* 4 productos por defecto */
  box-sizing: border-box;
}

/* Producto dentro del slide */
.waeg-carousel-product {
  background: var(--waeg-white);
  border: 1px solid var(--waeg-gray-200);
  border-radius: var(--waeg-radius-md);
  overflow: hidden;
  transition: all var(--waeg-transition);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.waeg-carousel-product:hover {
  border-color: var(--waeg-gray-700);
  box-shadow: var(--waeg-shadow-md);
  transform: translateY(-4px);
}

/* Link del producto */
.waeg-carousel-product-link {
  text-decoration: none;
  color: inherit;
  display: block;
  /* Mejorar interacción táctil */
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(0,0,0,0.1);
  cursor: pointer;
}

/* Imagen del producto */
.waeg-carousel-product-image {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  background: #ffffff; /* ✅ Fondo blanco */
}

.waeg-carousel-product-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 15px;
  transition: transform 0.3s ease;
}

.waeg-carousel-product:hover .waeg-carousel-product-image img {
  transform: scale(1.05);
}

/* Badges (deshabilitados) */
.waeg-carousel-badge {
  display: none;
}

/* Título del producto */
.waeg-carousel-product-title {
  font-size: 14px;
  font-weight: 600;
  margin: 12px 16px;
  line-height: 1.4;
  color: #333;
  min-height: 40px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.waeg-carousel-product-link:hover .waeg-carousel-product-title {
  color: #0073aa;
}

/* Precio del producto */
.waeg-carousel-product-price {
  font-size: 18px;
  font-weight: 700;
  color: #333;
  margin: 0 16px 12px 16px;
}

.waeg-carousel-product-price .woocommerce-Price-amount {
  color: #0073aa;
}

.waeg-carousel-product-price del {
  color: #999;
  font-size: 14px;
  margin-right: 8px;
}

.waeg-carousel-product-price ins {
  text-decoration: none;
  color: #e74c3c;
}

/* Botón de compartir WhatsApp (solo móvil) */
.waeg-carousel-share-whatsapp {
  display: none; /* Oculto por defecto en desktop */
  margin: 0 16px 12px 16px;
}

.waeg-whatsapp-share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  background: #25D366; /* Verde WhatsApp oficial */
  color: white;
  text-decoration: none;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(37, 211, 102, 0.3);
  width: 100%;
  max-width: 200px;
}

.waeg-whatsapp-share-btn:hover {
  background: #1DA851; /* Verde más oscuro al hover */
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(37, 211, 102, 0.4);
}

.waeg-whatsapp-share-btn svg {
  flex-shrink: 0;
}

/* Acciones (botón de carrito) */
.waeg-carousel-product-actions {
  margin-top: auto;
  padding: 0 16px 16px 16px;
}

.waeg-carousel-add-to-cart,
.waeg-carousel-view-product {
  width: 100%;
  padding: 12px 20px;
  background: #333;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
}

.waeg-carousel-add-to-cart:hover,
.waeg-carousel-view-product:hover {
  background: #0073aa;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.waeg-carousel-add-to-cart.loading {
  opacity: 0.7;
  cursor: wait;
}

/* Flechas de navegación */
.waeg-carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  background: rgba(255,255,255,0.95);
  border: 1px solid #ddd;
  border-radius: 50%;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 300;
  color: #333;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.waeg-carousel-arrow:hover {
  background: #333;
  color: white;
  border-color: #333;
  transform: translateY(-50%) scale(1.1);
}

.waeg-carousel-arrow:active {
  transform: translateY(-50%) scale(0.95);
}

.waeg-carousel-arrow:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
}

.waeg-carousel-prev {
  left: 0;
}

.waeg-carousel-next {
  right: 0;
}

/* Dots de navegación */
.waeg-carousel-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
}

.waeg-carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ddd;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0;
}

.waeg-carousel-dot:hover {
  background: #999;
  transform: scale(1.2);
}

.waeg-carousel-dot.active {
  background: #333;
  width: 28px;
  border-radius: 5px;
}

/* ========================================
   RESPONSIVE
   ======================================== */

/* Tablet - 3 productos */
@media (max-width: 991px) {
  .waeg-carousel-slide {
    width: calc(33.333% - 14px);
  }
  
  .waeg-carousel-container {
    padding: 0 40px;
  }
  
  .waeg-carousel-arrow {
    width: 36px;
    height: 36px;
    font-size: 24px;
  }
  
  .waeg-carousel-title {
    font-size: 24px;
  }

  .waeg-carousel-header {
    margin-bottom: 16px;
  }
}

/* Mobile - 2 productos */
@media (max-width: 767px) {
  .waeg-carousel-track {
    gap: 16px;
  }

  .waeg-carousel-slide {
    width: calc(50% - 8px);
  }
  
  .waeg-carousel-container {
    padding: 0 30px;
  }
  
  .waeg-carousel-arrow {
    width: 30px;
    height: 30px;
    font-size: 18px;
  }
  
  .waeg-carousel-title {
    font-size: 20px;
  }

  .waeg-carousel-header {
    margin-bottom: 12px;
  }

  .waeg-carousel-view-all {
    font-size: 13px;
  }
  
  .waeg-carousel-product-image {
    aspect-ratio: 4 / 3;
  }

  .waeg-carousel-product-image img {
    padding: 8px;
  }

  .waeg-carousel-product-title {
    font-size: 12px;
    min-height: 34px;
    margin: 8px 10px;
    line-height: 1.3;
  }
  
  .waeg-carousel-product-price {
    font-size: 14px;
    margin: 0 10px 8px 10px;
  }
  
  .waeg-carousel-product-actions {
    padding: 0 10px 10px 10px;
  }

  /* Mostrar botón de WhatsApp en móvil */
  .waeg-carousel-share-whatsapp {
    display: block;
    margin: 0 10px 8px 10px;
  }
  
  .waeg-carousel-add-to-cart,
  .waeg-carousel-view-product {
    padding: 8px 12px;
    font-size: 12px;
  }
}

/* Mobile pequeño - 2 productos compactos */
@media (max-width: 480px) {
  .waeg-carousel-track {
    gap: 12px;
  }

  .waeg-carousel-slide {
    width: calc(50% - 6px);
    flex-shrink: 0;
  }
  
  .waeg-carousel-container {
    padding: 0 24px;
  }

  .waeg-carousel-arrow {
    width: 26px;
    height: 26px;
    font-size: 16px;
  }
  
  .waeg-carousel-product-image {
    aspect-ratio: 4 / 3;
  }

  .waeg-carousel-product-image img {
    padding: 6px;
  }

  .waeg-carousel-product-title {
    font-size: 11px;
    min-height: 30px;
    margin: 6px 8px;
  }

  .waeg-carousel-product-price {
    font-size: 13px;
    margin: 0 8px 6px 8px;
  }

  .waeg-carousel-product-actions {
    padding: 0 8px 8px 8px;
  }

  .waeg-carousel-add-to-cart,
  .waeg-carousel-view-product {
    padding: 7px 10px;
    font-size: 11px;
    gap: 4px;
  }

  .waeg-carousel-share-whatsapp {
    margin: 0 8px 6px 8px;
  }

  .waeg-whatsapp-share-btn {
    font-size: 11px;
    padding: 6px 12px;
  }
}

/* ========================================
   ANIMACIONES Y ESTADOS
   ======================================== */

/* Loading state */
.waeg-carousel-wrapper.loading {
  opacity: 0.6;
  pointer-events: none;
}

/* Animación de entrada */
@keyframes waeg-carousel-slideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.waeg-carousel-wrapper {
  animation: waeg-carousel-slideIn 0.5s ease-out;
}

/* Transición suave del track */
.waeg-carousel-track.transitioning {
  transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Touch/Swipe feedback */
.waeg-carousel-track.grabbing {
  cursor: grabbing;
  transition: none;
}

/* Sin productos */
.waeg-carousel-wrapper .no-products {
  text-align: center;
  padding: 40px 20px;
  color: #999;
  font-size: 16px;
}
