/* Carrousel Section */
.tt4-ins-carousel-section {
  position: relative;
  padding: 100px 0;
  overflow: hidden;
  transition: background 1s ease;
  background: linear-gradient(135deg, var(--color-primary), var(--color-border-light));
}

/* Conteneur principal */
.custom-carousel {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  height: 690px;
  /* overflow: hidden; */
}

.carousel-title {
  text-align: center;
  margin-bottom: 50px;
  font-size: 2.2rem;
  color: var(--color-text-dark);
  font-weight: 700;
  position: relative;
}

.carousel-title::after {
  content: '';
  display: block;
  width: 80px;
  height: 4px;
  margin: 15px auto 0;
  border-radius: 2px;
}

/* Piste du carrousel */
.carousel-track {
  position: relative;
  height: 100%;
  width: 100%;
}

/* Slide individuelle - Fond transparent */
.swiper-slide {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 320px;
  height: 448px;
  border-radius: 16px;
  overflow: hidden;
  background: transparent !important;
  display: flex;
  flex-direction: column;
  box-shadow: 0 15px 35px var(--color-shadow-carousel-secondary);
  z-index: 1;
  transition: all 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  opacity: 0;
  visibility: hidden;
}

.tt4-ins-slide-container {
  background: transparent !important;
}

.swiper-slide.active {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) scale(1);
  z-index: 3;
  width: 360px;
  height: 525px;
  overflow: visible;
}

.swiper-slide.next {
  opacity: 1;
  transform: translateX(50%) scale(0.9);
  visibility: visible;
  z-index: 2;
}

.swiper-slide.prev {
  opacity: 1;
  transform: translateX(-150%) scale(0.9);
  visibility: visible;
  z-index: 2;
}


/* On rend la position du lien image relative pour placer le pseudo-élément */
.tt4-ins-slide-image-link {
  display: block;
  height: 100%;
  /* overflow: hidden; */
  position: relative;
  border-radius: 16px;
}

/* Le pseudo-élément ::after pour l'effet de voile sombre */
.tt4-ins-slide-image-link::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  /* Couleur du voile. J'utilise rgba pour une transparence contrôlée. */
  background-color: rgba(0, 0, 0, 0.3);
  /* 50% de noir semi-transparent */
  transition: background-color 0.8s ease;
  z-index: 1;
  /* S'assure que le voile est au-dessus de l'image */
}



/* On cible la slide qui n'est pas active pour appliquer le voile */
.swiper-slide:not(.active) .tt4-ins-slide-image-link::after {
  background-color: rgba(0, 0, 0, 0.3);
  /* Le voile est visible */
}

/* Sur la slide active, le voile est transparent */
.swiper-slide.active .tt4-ins-slide-image-link::after {
  background-color: rgba(0, 0, 0, 0);
  /* Le voile est invisible */
}

/* Optionnel : vous pouvez ajouter un léger effet de transition au survol des slides non actives */
.swiper-slide:not(.active):hover .tt4-ins-slide-image-link::after {
  background-color: rgba(0, 0, 0, 0.1);
  /* Moins de voile au survol */
}


/* Conteneur d'image - Pleine hauteur */
.tt4-ins-slide-image-link {
  display: block;
  height: 100%;
  overflow: hidden;
  position: relative;
  border-radius: 16px;
}

/* Image - Pleine hauteur */
.tt4-ins-slide-image-link img {
  width: 100%;
  /*height: 100%;*/
  object-fit: cover;
  object-position: center;
  transition: transform 0.5s ease;
}

.swiper-slide:hover .tt4-ins-slide-image-link img {
  transform: scale(1.05);
}

/* Contenu - Superposition transparente - CACHÉ PAR DÉFAUT */
.tt4-ins-product-slide-content {
  position: absolute;
  bottom: -150px;
  left: 0;
  right: 0;
  padding: 27px 15px 10px 27px;
  display: flex;
  flex-direction: column;
  background: rgba(0, 0, 0, 0.7);
  color: var(--color-text-medium-light);
  border-radius: 0 0 16px 16px;
  z-index: 2;
  min-height: 150px;

  /* Centrer le contenu */
  text-align: center;
  align-items: center;
  justify-content: center;

  /* Initial state - caché en bas */
  transform: translateY(100%);
  opacity: 0;
  transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275),
    opacity 0.7s ease;
}
.tt4-ins-product-slide-content p {
  margin: 0;
  padding: 0;
  margin-bottom: 5px;
}

/* ANIMATION: Quand le slide est actif, le contenu monte */
.swiper-slide.active .tt4-ins-product-slide-content {
  transform: translateY(0);
  opacity: 1;
}

.tt4-ins-product-slide-content h3 {
  margin: 2px;
  font-size: 1.3rem;
  line-height: 1.2;
  color: var(--color-text-medium-light);
  font-weight: 700;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  /* overflow: hidden; */
  width: 100%;
  text-decoration: none;
}

.product-carousel-subtitle {
  margin: 0 0 2px;
  font-size: 0.9rem;
  color: var(--color-background-light-overlay);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  /* overflow: hidden; */
  flex-grow: 1;
  width: 100%;
  text-decoration: none;
}

.tt4-ins-slide-info-link {
  text-decoration: none;
}

.tt4-ins-product-slide-content h3:hover,
.product-carousel-subtitle:hover {
  color: var(--color-accent);
}

.tt4-ins-product-slide-content .price {
  margin-top: auto;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--color-accent-price);
  width: 100%;
}

.button.add_to_cart_button {
  margin: 12px 0;
  padding: 12px 20px;
  font-size: 1rem;
  background: var(--color-accent);
  color: var(--color-background-light-overlay);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  text-align: center;
  transition: all 0.3s ease;
  font-weight: 600;
  width: 100%;
  max-width: 200px;
  opacity: 0.95;
}

.button.add_to_cart_button:hover {
  background: var(--color-accent-blue-darkest);
  transform: translateY(-2px);
  opacity: 1;
}

/* Badge de promotion - Position ajustée */
.promo-badge {
  position: absolute;
  top: 15px;
  right: 15px;
  background: #ff9aa2;
  color: var(--color-text-medium-light);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 700;
  z-index: 3;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Boutons de navigation */
.carousel-button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  font-size: 28px;
  cursor: pointer;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0;
  color: var(--color-accent);
}

.carousel-button:hover {
  background: var(--color-accent-blue-darkest);
  color: var(--color-text-medium-light);
  transform: translateY(-50%) scale(1.1);
}

.carousel-button.prev {
  left: 20px;
}

.carousel-button.next {
  right: 20px;
}

/* Pagination */
.carousel-pagination {
  position: absolute;
  top: -30px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 10px;
  z-index: 10;
}

.pagination-bullet {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: all 0.3s ease;
}

.pagination-bullet.active {
  background: #4a6fa5;
  transform: scale(1.4);
}

/* Responsive */
@media (max-width: 1024px) {
  .swiper-slide {
    width: 280px;
    height: 420px;
  }
}

@media (max-width: 768px) {
  .custom-carousel {
    height: 495px;
  }

  .swiper-slide.active {
    height: 475px;
  }

  .swiper-slide {
    width: 260px;
    height: 400px;
  }

  .carousel-button {
    width: 50px;
    height: 50px;
    font-size: 24px;
  }

  .tt4-ins-product-slide-content {
    padding: 15px 15px 35px 15px;
  }

}

@media (max-width: 480px) {

  .custom-carousel {
    height: 510px;
  }

  .swiper-slide {
    width: 240px;
    height: 370px;
  }

  .carousel-button {
    width: 45px;
    height: 45px;
    font-size: 22px;
  }

  .tt4-ins-product-slide-content {
    padding: 12px;
  }

  .button.add_to_cart_button {
    padding: 10px 15px;
    font-size: 0.9rem;
  }
}