/**
 * Styles pour le carrousel d'images des produits
 * Organisation : Conteneur → Slides → Images → Navigation → Responsive
 */

/* ============================================
   CONTENEUR PRINCIPAL
   ============================================ */
.product-card-carousel {
  position: relative;
  display: flex;
  width: 100%;
  height: 100%;
  overflow: hidden;

  align-items: center;
  justify-content: center;
  z-index: 1;
}

/* Layout vertical */
.card__layout-vertical .product-card-carousel {
  min-height: 350px;
}

/* ============================================
   SLIDES
   ============================================ */
.carousel__slides {
  display: flex;
  transition: transform 300ms ease-in-out;
  will-change: transform;
  width: 100%;
  height: 100%;
  position: relative;
}

.carousel__slide {
  flex: 0 0 100%;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  box-sizing: border-box;
}

.carousel__slide a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

/* ============================================
   IMAGES
   ============================================ */
/* Image du carrousel - général */
.carousel__slide img {
  width: 100% !important;
  height: 100%;
  min-height: 350px !important;
  max-height: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  transition: all 0.3s ease;
  /* border-radius: var(--sp-radius-image, 6px); */
}

/* Image du carrousel - layout vertical */
.card__layout-vertical .carousel__slide img {
  width: 100% !important;
  height: 100%;
  min-height: 350px;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  transition: transform 0.6s ease;
  /* border-radius: var(--sp-radius-image, 6px); */
}

/* ============================================
   NAVIGATION
   ============================================ */
/* Module de navigation (flèches + indicateurs) */
/* .card__layout-vertical .carousel__navigation {
  bottom: 6rem;
} */

.carousel__navigation {
  position: absolute;
  bottom: 15px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  z-index: 10;
  opacity: 1;
  transition: opacity 0.3s ease;
}

/* Masquer la navigation si une seule image */
.product-card-carousel[data-carousel-enabled="false"] .carousel__navigation,
.product-card-carousel:not([data-carousel-enabled="true"])
  .carousel__navigation {
  display: none;
}

/* Boutons de navigation (flèches) */
.carousel__button {
  position: static;
  background: transparent;
  border: none;
  width: auto;
  height: auto;
  border-radius: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: opacity 0.3s ease;
}

.carousel__button:hover {
  background: transparent;
  opacity: 0.8;
}

.carousel__button:focus {
  outline: 2px solid rgba(255, 255, 255, 0.8);
  outline-offset: 2px;
  border-radius: 2px;
}

.carousel__button-icon {
  line-height: 1;
  color: rgba(255, 255, 255, 0.9);
  font-weight: bold;
  display: block;
}

.carousel__button-icon i {
  display: block;
  height: 100%;
  width: 100%;
  font-size: 30px;
}

/* Indicateurs (petits ronds) */
.carousel__indicators {
  position: static;
  display: flex;
  gap: 8px;
  padding: 0;
  transform: none;
}

.carousel__indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  padding: 0;
  transition: all 0.3s ease;
  opacity: 0.6;
}

.carousel__indicator:hover {
  opacity: 0.8;
  background: rgba(255, 255, 255, 0.7);
}

.carousel__indicator--active {
  background: rgba(255, 255, 255, 1);
  opacity: 1;
  width: 12px;
  height: 12px;
}

.carousel__indicator:focus {
  outline: 2px solid rgba(255, 255, 255, 0.8);
  outline-offset: 2px;
}

/* ============================================
   RESPONSIVE
   ============================================ */
/* Mobile (max-width: 767px) - Toutes les cartes en style vertical */
@media (max-width: 767px) {
  /* Conteneur carrousel - toutes les cartes */
  .product-card-carousel {
    min-height: 300px;
  }

  /* Images du carrousel - toutes les cartes en style vertical */
  .carousel__slide img {
    min-width: 280px !important;
    max-width: 100% !important;
    width: 100% !important;
    max-height: none;
    min-height: 280px;
    height: auto;
    object-fit: contain;
    aspect-ratio: auto;
    border-radius: 0;
  }

  /* Navigation - toutes les cartes */
  .carousel__navigation {
    gap: 10px;
  }

  .carousel__button-icon {
    font-size: 18px;
  }

  .carousel__indicators {
    gap: 6px;
  }

  .carousel__indicator {
    width: 8px;
    height: 8px;
  }

  .carousel__indicator--active {
    width: 10px;
    height: 10px;
  }
}
