/* ========================================
   WAEG CAROUSEL - CARRUSEL DE PRODUCTOS
   ======================================== */

.waeg-carousel-wrapper {
  position: relative;
  width: 100%;
  margin: 40px 0;
  overflow: hidden;
}

.waeg-carousel-title {
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 24px 0;
  color: #333;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.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: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.waeg-carousel-product:hover {
  border-color: #333;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  transform: translateY(-4px);
}

/* Link del producto */
.waeg-carousel-product-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

/* Imagen del producto */
.waeg-carousel-product-image {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  background: #f9f9f9;
}

.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 */
.waeg-carousel-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  border-radius: 4px;
  z-index: 2;
  letter-spacing: 0.5px;
}

.waeg-badge-sale {
  background: #e74c3c;
  color: white;
}

.waeg-badge-featured {
  background: #f39c12;
  color: white;
  top: 40px;
}

/* 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;
}

/* 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;
  }
}

/* Mobile - 2 productos */
@media (max-width: 767px) {
  .waeg-carousel-slide {
    width: calc(50% - 10px);
  }
  
  .waeg-carousel-container {
    padding: 0 35px;
  }
  
  .waeg-carousel-arrow {
    width: 32px;
    height: 32px;
    font-size: 20px;
  }
  
  .waeg-carousel-title {
    font-size: 20px;
    margin-bottom: 20px;
  }
  
  .waeg-carousel-product-title {
    font-size: 13px;
    min-height: 36px;
  }
  
  .waeg-carousel-product-price {
    font-size: 16px;
  }
  
  .waeg-carousel-add-to-cart,
  .waeg-carousel-view-product {
    padding: 10px 16px;
    font-size: 13px;
  }
}

/* Mobile pequeño - 1 producto */
@media (max-width: 480px) {
  .waeg-carousel-slide {
    width: calc(100% - 0px);
  }
  
  .waeg-carousel-track {
    gap: 15px;
  }
  
  .waeg-carousel-container {
    padding: 0 30px;
  }
}

/* ========================================
   ANIMACIONES Y ESTADOS
   ======================================== */

/* Loading state */
.waeg-carousel-wrapper.loading {
  opacity: 0.6;
  pointer-events: none;
}

/* Animación de entrada */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.waeg-carousel-wrapper {
  animation: 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;
}
