/* === Wrapper e Slider === */
.slider-wrapper {
  position: relative;
  width: 100%;
  overflow: hidden;
  padding: 0 5%; /* mostra parte delle slide adiacenti */
}

.slider {
  display: flex;
  gap: 0;
  transition: transform 0.5s ease-in-out;
  will-change: transform;
}

/* === Slide === */
.slide {
  flex: 0 0 90%;
  padding: 0 10px;
}

.slide img {
  width: 100%;
  height: auto;
  display: block;
}

/* === Controlli === */
.slider-wrapper .controls-container {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%) translateY(-5px);
  background: #f2f2f2;
  border-radius: 30px;
  padding: 15px 25px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* === Play/Pause + Dots container === */
.slider-wrapper .controls-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
}

.slider-wrapper .play-pause {
  background: none;
  border: none;
  cursor: pointer;
  width: 50px;
  height: 50px;
  font-size: 24px;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* === Dotnav === */
.slider-wrapper .dotnav {
  display: flex;
  justify-content: center;
  gap: 14px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.slider-wrapper .dotnav li {
  position: relative;
  width: 14px;
  height: 14px;
  background: #aaa;
  border-radius: 50%;
  overflow: hidden;
  transition: all 0.3s ease;
  cursor: pointer;
}

.slider-wrapper .dotnav li.active {
  width: 44px;
  height: 6px;
  border-radius: 3px;
  background: #aaa;
}

.slider-wrapper .dotnav li.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  background: #000;
  animation: fillBar var(--duration, 4000ms) linear forwards;
  animation-play-state: running;
}

.slider-wrapper .dotnav.paused li.active::before {
  animation-play-state: paused !important;
}

/* === Keyframes === */
@keyframes fillBar {
  from { width: 0%; }
  to { width: 100%; }
}

/* === Mobile Responsive === */
@media (max-width: 768px) {
  .slide {
    flex: 0 0 90%;
    aspect-ratio: 5 / 4; /* proporzione verticale */
  }

  .slider-wrapper .controls-container {
    position: static;
    transform: none;
    margin: 20px 0 0;
    padding: 0px;
    gap: 12px;
    font-size: 14px;
    display: flex;
    justify-content: center;
  }

  .slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
  }
}
