/* Disable horizontal scroll globally when slider is present */
body:has(.horizontal-slider) {
  overflow-x: hidden;
}

/* Horizontal Slider Styles */
.horizontal-slider {
  position: relative;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  overflow: visible;
}

.slider-container {
  position: relative;
  overflow: visible;
  border-radius: 12px;
}

.slider-track {
  display: flex;
  transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: transform;
}

.slide {
  flex: 0 0 100%;
  margin-right: 3.5rem; 
  box-sizing: border-box;
}

.slide-content {
  background: transparent;
  border-radius: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.slide-svg {
  width: 100%;
  height: 250px;
  margin-bottom: 24px;
  flex-shrink: 0;
  background-image: url('../../assets/img/bg-slide.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.slide-svg svg {
  width: 125px;
  height: 125px;
  max-width: 125px;
  max-height: 125px;
}

.slide-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.slide-text h3 {
  font-size: var(--wp--preset--font-size--l);
  font-weight: 600;
  color: var(--wp--preset--color--myrtle);
  margin: 0 0 16px 0;
  line-height: 1.3;
}

.slide-text p {
  font-size: var(--wp--preset--font-size--s);
  line-height: 1.6;
  color: var(--wp--preset--color--myrtle);
  margin: 0;
}

/* Navigation */
.slider-navigation {
  width: auto;
  display: flex;
  gap: 20px;
  pointer-events: none;
  z-index: 10;
  padding-top: 1rem;
}

.slider-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #6AEFB2;
  border: 2px solid #6AEFB2;
  color: #333333;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  pointer-events: all;
  transition: all 0.3s ease;
  z-index: 10;
  position: relative;
}

/* Halo transparent pour les boutons actifs uniquement */
.slider-btn:not(:disabled)::before {
  content: '';
  position: absolute;
  left: 60px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(106, 239, 178, 0.40);
  z-index: -1;
  transition: left 0.3s ease; /* Animation du déplacement */
}

/* Animation au hover : déplacement vers left: 68px */
.slider-btn:not(:disabled):hover::before {
  left: 68px;
}

.slider-btn:disabled {
  background: #ffffff;
  border-color: #ffffff;
  opacity: 1;
  cursor: not-allowed;
  transform: none;
}

.slider-btn svg {
  width: 27px;
  height: 24px;
}

.slider-arrow-next {
  transform: scaleX(-1);
}

.slider-btn-prev,
.slider-btn-next {
  position: static;
}

/* Dots Navigation - Hidden */
.slider-dots {
  display: none;
}

/* Desktop Styles (768px and up) */
@media (min-width: 768px) {
  
  .slide {
    flex: 0 0 45.45%; /* 2.2 slides visible (100% / 2.2) */
    max-width: 45.45%;
  }
  
  .slide-content {
    min-height: 320px;
  }
  
  .slide-svg {
    height: 300px;
    margin-bottom: 32px;
  }
  
  .slide-svg svg {
    width: 150px;
    height: 150px;
    max-width: 150px;
    max-height: 150px;
  }
  
  .slide-text h3 {
    font-size: var(--wp--preset--font-size--l);
    margin-bottom: 0.94rem;
  }
  
  .slide-text p {
    font-size: var(--wp--preset--font-size--s);
  }
  
}

/* Large Desktop Styles */
@media (min-width: 1200px) {
  
  .slide-content {
    min-height: 360px;
  }
  
  .slide-svg {
    height: 350px;
    margin-bottom: 36px;
  }
  
  .slide-svg svg {
    width: 175px;
    height: 175px;
    max-width: 175px;
    max-height: 175px;
  }
  
  .slide-text h3 {
    font-size: 2rem;
    margin-bottom: 24px;
  }
  
  .slide-text p {
    font-size: 1.125rem;
  }
}

/* Mobile Specific Styles */
@media (max-width: 767px) {
  .slider-navigation {
    display: none; /* Hide arrow buttons on mobile, use swipe instead */
  }
  
  .slide-content {
    min-height: 280px;
  }
  
  .slide-svg {
    height: 200px;
    margin-bottom: 20px;
    background-size: 200px 200px;
  }
  
  .slide-svg svg {
    width: 100px;
    height: 100px;
    max-width: 100px;
    max-height: 100px;
  }
  
  .slide-text h3 {
    font-size: 1.25rem;
    margin-bottom: 12px;
  }
  
  .slide-text p {
    font-size: 0.95rem;
  }
}

/* Touch device improvements */
@media (hover: none) and (pointer: coarse) {
  .slider-btn:hover:not(:disabled) {
    transform: none;
    background: #6AEFB2;
    border-color: #6AEFB2;
  }
}

/* Loading state */
.horizontal-slider.loading .slider-track {
  opacity: 0.7;
  pointer-events: none;
}

/* Accessibility */
.slider-btn:focus-visible {
  outline: 2px solid #007cba;
  outline-offset: 2px;
}

.slider-dot:focus-visible {
  outline: 2px solid #007cba;
  outline-offset: 2px;
}

/* Print styles */
@media print {
  .horizontal-slider {
    overflow: visible;
  }
  
  .slider-track {
    transform: none !important;
    display: block;
  }
  
  .slide {
    flex: none;
    max-width: none;
    width: 100%;
    page-break-inside: avoid;
    margin-bottom: 20px;
  }
  
  .slider-navigation,
  .slider-dots {
    display: none;
  }
}