/**
 * Carrusel principal del inicio — fade + respaldo CSS antes de que cargue JS.
 */
.banner-carousel {
  position: relative;
  width: 100%;
  max-width: 900px;
  margin: 20px auto;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.banner-carousel__viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 1366 / 768;
  height: auto;
  min-height: 168px;
  max-height: min(400px, 56vw);
  overflow: hidden;
  background: #0a0612;
}

.banner-carousel__slides {
  list-style: none;
  margin: 0;
  padding: 0;
  position: absolute;
  inset: 0;
}

.banner-carousel__slide {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.7s ease-in-out, visibility 0.7s ease-in-out;
  z-index: 0;
  pointer-events: none;
}

.banner-carousel__slide.is-active {
  opacity: 1;
  visibility: visible;
  z-index: 1;
  pointer-events: auto;
}

/* Respaldo: rota aunque JS tarde o falle */
@keyframes banner-carousel-fade-step {
  0%, 28% {
    opacity: 1;
    visibility: visible;
    z-index: 1;
  }
  33%, 100% {
    opacity: 0;
    visibility: hidden;
    z-index: 0;
  }
}

.banner-carousel:not([data-banner-carousel-init]) .banner-carousel__slide {
  animation: banner-carousel-fade-step 15s infinite ease-in-out;
}

.banner-carousel:not([data-banner-carousel-init]) .banner-carousel__slide:nth-child(1) {
  animation-delay: 0s;
}

.banner-carousel:not([data-banner-carousel-init]) .banner-carousel__slide:nth-child(2) {
  animation-delay: 5s;
}

.banner-carousel:not([data-banner-carousel-init]) .banner-carousel__slide:nth-child(3) {
  animation-delay: 10s;
}

.banner-carousel__slide picture {
  display: block;
  width: 100%;
  height: 100%;
}

.banner-carousel__slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.banner-carousel__btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.banner-carousel__btn:hover {
  background: rgba(0, 0, 0, 0.78);
  box-shadow: 0 0 12px rgba(255, 135, 226, 0.35);
}

.banner-carousel__btn--prev {
  left: 10px;
}

.banner-carousel__btn--next {
  right: 10px;
}

.banner-carousel__dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 12px;
  z-index: 3;
  display: flex;
  justify-content: center;
  gap: 8px;
  pointer-events: none;
}

.banner-carousel__dot {
  pointer-events: auto;
  width: 9px;
  height: 9px;
  padding: 0;
  margin: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.banner-carousel__dot.is-active {
  background: #ff87e2;
  transform: scale(1.15);
  box-shadow: 0 0 8px rgba(255, 135, 226, 0.65);
}

@media (max-width: 900px) {
  .banner-carousel {
    margin: 12px auto;
    border-radius: 12px;
  }

  .banner-carousel__viewport {
    min-height: 168px;
    max-height: 52vw;
  }

  .banner-carousel__btn {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
  }
}
