/**
 * Widget Especiales - Carousel CSS
 * Minimalista y responsivo
 */

.we-carousel-wrapper {
  position: relative;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  background-color: #effdff;
  border-radius: 8px;
}

.we-carousel-container {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 4px;
}

.we-carousel-track {
  display: flex;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

.we-slide {
  flex: 0 0 calc(25% - 15px);
  margin-right: 20px;
}

.we-slide-link {
  display: block;
  height: 100%;
  text-decoration: none;
  color: inherit;
  transition: transform 0.3s ease;
}

.we-slide-link:hover {
  transform: translateY(-4px);
}

.we-slide-image {
  position: relative;
  width: 100%;
  aspect-ratio: 315 / 403;
  overflow: hidden;
  border-radius: 8px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

.we-slide-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition:
    filter 0.3s ease,
    transform 0.3s ease;
}

.we-slide-link:hover .we-slide-image img {
  filter: saturate(1.2) brightness(1.1);
  transform: scale(1.05);
}

.we-slide-content {
  padding: 12px 8px;
}

.we-slide-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.3;
  color: #000;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.we-slide-link:hover .we-slide-title {
  color: #0099ff;
}

/* Botones de navegación */
.we-carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  background-color: rgba(0, 153, 255, 0.85);
  border: none;
  color: white;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  padding: 0;
}

.we-carousel-btn:hover {
  background-color: rgba(0, 99, 153, 0.95);
  box-shadow: 0 4px 12px rgba(0, 153, 255, 0.4);
  transform: translateY(-50%) scale(1.1);
}

.we-carousel-btn:focus {
  outline: 2px solid #0099ff;
  outline-offset: 2px;
}

.we-carousel-prev {
  left: 10px;
}

.we-carousel-next {
  right: 10px;
}

.we-carousel-btn svg {
  width: 24px;
  height: 24px;
  stroke: white;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Puntos de navegación */
.we-carousel-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
}

.we-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: none;
  background-color: #ccc;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0;
}

.we-dot:hover {
  background-color: #999;
}

.we-dot.active {
  background-color: #0099ff;
  box-shadow: 0 0 8px rgba(0, 153, 255, 0.5);
}

.we-dot:focus {
  outline: 2px solid #0099ff;
  outline-offset: 2px;
}

/* Estado de error */
.we-error {
  padding: 40px 20px;
  text-align: center;
  color: #666;
  background-color: #f5f5f5;
  border-radius: 8px;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.we-error p {
  margin: 0;
  font-size: 1.1rem;
}

/* Animación de carga */
@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Responsive */
@media (max-width: 1024px) {
  .we-slide {
    flex: 0 0 calc(33.333% - 14px);
  }

  .we-carousel-btn {
    width: 40px;
    height: 40px;
  }

  .we-carousel-btn svg {
    width: 20px;
    height: 20px;
  }
}

@media (max-width: 768px) {
  .we-carousel-wrapper {
    padding: 16px;
  }

  .we-slide {
    flex: 0 0 calc(50% - 10px);
  }

  .we-carousel-btn {
    width: 36px;
    height: 36px;
  }

  .we-carousel-btn svg {
    width: 18px;
    height: 18px;
  }

  .we-slide-title {
    font-size: 0.95rem;
  }

  .we-carousel-prev {
    left: 5px;
  }

  .we-carousel-next {
    right: 5px;
  }
}

@media (max-width: 576px) {
  .we-carousel-wrapper {
    padding: 12px;
    background-color: transparent;
  }

  .we-slide {
    flex: 0 0 100%;
  }

  .we-carousel-btn {
    width: 32px;
    height: 32px;
    background-color: rgba(0, 153, 255, 0.9);
  }

  .we-carousel-btn svg {
    width: 16px;
    height: 16px;
  }

  .we-carousel-prev {
    left: 4px;
  }

  .we-carousel-next {
    right: 4px;
  }

  .we-carousel-dots {
    margin-top: 16px;
    gap: 6px;
  }

  .we-dot {
    width: 8px;
    height: 8px;
  }

  .we-slide-title {
    font-size: 0.9rem;
    -webkit-line-clamp: 2;
  }
}

/* Accesibilidad */
@media (prefers-reduced-motion: reduce) {
  .we-carousel-track,
  .we-slide-link,
  .we-carousel-btn,
  .we-dot {
    transition: none;
  }
}
