/* Modern Carousel Redesign */
.styles-preview-section {
  background: var(--navy-deep);
  padding: 6rem 1.5rem;
  margin-top: 2rem;
}

.modern-carousel {
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
}

.carousel-viewport {
  overflow-x: auto;
  border-radius: 24px;
  padding: 40px 0;
  position: relative;
  width: 100%;
  scrollbar-width: none;
  scroll-behavior: smooth;
}

.carousel-viewport::-webkit-scrollbar {
  display: none;
}

.carousel-track {
  display: flex;
  width: max-content;
  gap: 2rem;
  transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
  will-change: transform;
}

.carousel-slide {
  flex: 0 0 400px; /* Largeur fixe pour le centrage */
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.style-card {
  display: block;
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  height: 100%;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  display: flex;
  flex-direction: column;
  opacity: 0.4; /* Slide non actif plus sombre */
  transform: scale(0.9);
}

.carousel-slide.active .style-card {
  opacity: 1;
  transform: scale(1.05);
  border-color: var(--teal);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.style-card:hover {
  transform: translateY(-5px) scale(1.07) !important;
}

.card-image {
  height: 200px;
  background-size: cover;
  background-position: center;
  position: relative;
}

.card-essentiel .card-image { background-image: url('https://images.unsplash.com/photo-1497215728101-856f4ea42174?auto=format&fit=crop&q=80&w=800'); }

.card-standard .card-image { background-image: url('https://images.unsplash.com/photo-1460925895917-afdab827c52f?auto=format&fit=crop&q=80&w=800'); }

.card-premium .card-image { background-image: url('https://images.unsplash.com/photo-1551434678-e076c223a692?auto=format&fit=crop&q=80&w=800'); }

.card-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 50%, var(--surface));
}

.card-content {
  padding: 1.5rem 2rem 2rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.card-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--teal);
  font-weight: 700;
  margin-bottom: 0.8rem;
  display: block;
}

.card-content h3 {
  font-size: 1.6rem;
  margin-bottom: 0.8rem;
  color: var(--ink);
}

.card-content p {
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 2rem;
}

.card-features {
  list-style: none;
  padding: 0;
  margin: 0 0 2rem 0;
  display: grid;
  gap: 0.6rem;
}

.card-features li {
  font-size: 0.9rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.card-features li::before {
  content: "•";
  color: var(--teal);
  font-weight: bold;
}

.card-footer {
  margin-top: auto;
}

.btn-demo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.9rem;
  position: relative;
}

.btn-demo::after {
  content: "→";
  transition: transform 0.3s ease;
}

.style-card:hover .btn-demo::after {
  transform: translateX(6px);
}

.btn-demo::before {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--teal);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s ease;
}

.style-card:hover .btn-demo::before {
  transform: scaleX(1);
  transform-origin: left;
}

.carousel-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  margin-top: 3rem;
}

.nav-arrow {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 10;
}

.nav-arrow:hover:not(:disabled) {
  background: var(--teal);
  color: var(--navy-deep);
  border-color: var(--teal);
  transform: scale(1.1);
}

.nav-arrow:disabled {
  opacity: 0.2;
  cursor: not-allowed;
}

.nav-arrow svg {
  width: 24px;
  height: 24px;
}

.carousel-pagination {
  display: flex;
  gap: 10px;
  align-items: center;
}

.page-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--line);
  cursor: pointer;
  transition: all 0.3s ease;
}

.page-dot.active {
  background: var(--teal);
  width: 28px;
  border-radius: 10px;
}

@media (max-width: 1024px) {
.carousel-slide {
    flex: 0 0 350px;
  }
}

@media (max-width: 768px) {
.carousel-slide {
    flex: 0 0 85%;
  }
.carousel-viewport {
    overflow-x: hidden; /* Garder le JS pour le contrôle */
    padding-bottom: 2rem;
  }
.carousel-slide.active .style-card {
    transform: scale(1.02);
  }
.carousel-nav {
    gap: 1rem;
  }
}

.carousel-track {
  padding-inline: max(0px, calc((100% - 400px) / 2));
}

.carousel-slide {
  scroll-snap-align: center;
}

.carousel-viewport {
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 1rem;
  overscroll-behavior-x: contain;
}

@media (max-width: 1024px) {
.carousel-track {
    padding-inline: max(0px, calc((100% - 350px) / 2));
  }
}

@media (max-width: 768px) {
.carousel-track {
    width: 100%;
    padding-inline: 7.5%;
  }
.carousel-viewport {
    overflow-x: auto;
    padding: 2rem 0;
    scroll-padding-inline: 7.5%;
    scroll-snap-type: x mandatory;
    touch-action: pan-x;
  }
.styles-preview-section {
    padding: 4rem 1.2rem;
  }
}

@media (max-width: 480px) {
.carousel-slide {
    flex-basis: 85%;
  }
.card-content {
    padding: 1.25rem 1.25rem 1.5rem;
  }
.card-content h3 {
    font-size: 1.35rem;
  }
.card-features li {
    align-items: flex-start;
  }
.carousel-nav {
    gap: .75rem;
    margin-top: 1.5rem;
  }
.nav-arrow {
    width: 44px;
    height: 44px;
  }
}

/* Readable text and comfortable touch targets */
.card-label {
  font-size: .8rem;
}

.nav-arrow {
  width: 50px;
  height: 50px;
}

.carousel-pagination {
  gap: 0;
}

.page-dot,
.page-dot.active {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 0;
  background: transparent;
}

.page-dot::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--line);
  transition: width 0.3s ease, background 0.3s ease;
}

.page-dot.active::before {
  width: 28px;
  border-radius: 10px;
  background: var(--teal);
}

.page-dot:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: -2px;
}
