/* === SLIDER ================================================== */
.ams-slider {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.ams-slider .reviews {
  display: flex;
  gap: 0;                 /* nessun gap tra slide */
  will-change: transform; /* performance */
  transition: transform 500ms ease;
  animation: none !important; /* spegne eventuale marquee esistente */
  width: 100%;
}

.ams-slider .row-block.linked {
  flex: 0 0 100%;         /* 1 slide per viewport */
  user-select: none;
  -webkit-user-drag: none;
}

/* autoplay “lento”: cambia solo ogni X secondi via JS */

/* Controlli */
.ams-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: rgba(0,0,0,.35);
  color: #fff;
  width: 2.2em; height: 2.2em;
  border-radius: 50%;
  line-height: 2.2em;
  text-align: center;
  cursor: pointer;
  z-index: 5;
}
.ams-prev { left: .5em; }
.ams-next { right: .5em; }
.ams-nav:hover { background: rgba(0,0,0,.55); }

/* Dots */
.ams-dots {
  position: absolute;
  left: 50%; transform: translateX(-50%);
  bottom: .6em;
  display: flex; gap: .4em;
  z-index: 5;
}
.ams-dots button {
  width: .55em; height: .55em; border-radius: 50%;
  border: 0; background: rgba(255,255,255,.4);
  cursor: pointer;
}
.ams-dots button[aria-current="true"] { background: rgba(255,255,255,.95); }

/* Swipe cursori (facoltativi) */
.ams-slider.grabbing { cursor: grabbing; }

/* === LIGHTBOX ================================================= */
#amsLightbox {
  position: fixed; inset: 0; z-index: 10000;
  background: rgba(0,0,0,.9);
  display: none; /* mostrata via JS */
}

#amsLightbox.open { display: block; }

#amsLightbox .lb-stage {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}

#amsLightbox img {
  max-width: 92vw; max-height: 90vh; object-fit: contain;
  user-select: none; -webkit-user-drag: none;
  transition: transform 250ms ease;
}

#amsLightbox .lb-close,
#amsLightbox .lb-prev,
#amsLightbox .lb-next {
  position: absolute; top: 50%; transform: translateY(-50%);
  border: 0; color: #fff; background: rgba(255,255,255,.15);
  width: 2.4em; height: 2.4em; border-radius: 50%;
  cursor: pointer;
}
#amsLightbox .lb-close {
  top: .8em; right: .8em; transform: none;
}
#amsLightbox .lb-prev { left: 1em; }
#amsLightbox .lb-next { right: 1em; }
#amsLightbox .lb-prev:hover, #amsLightbox .lb-next:hover, #amsLightbox .lb-close:hover {
  background: rgba(255,255,255,.3);
}

/* su schermi larghi: 2 o 3 slide visibili se vuoi */
@media (min-width: 1100px) {
  /* per restare a 1 slide, lascia così. 
     Se vuoi 2 per viewport: usa 50% qui sotto. */
  /* .ams-slider .row-block.linked { flex-basis: 50%; } */
}


/* --- FIX PACK SLIDER --- */
.ams-slider { overflow: hidden; }

.ams-slider .ams-track {
  display: flex !important;
  gap: 0 !important;
  width: 100% !important;
  animation: none !important;
  white-space: normal !important;
  transform: translateX(0);
}

.ams-slider .ams-track > .row-block.linked {
  flex: 0 0 100% !important;
  max-width: 100% !important;
}

.ams-slider .ams-track img.mainimage {
  width: 90%;
  height: auto;
  flex: none;
  aspect-ratio: auto;
}

/* Desktop: 2 per viewport */
@media (min-width: 900px) {
  .ams-slider .ams-track > .row-block.linked {
    flex: 0 0 50% !important;
    max-width: 50% !important;
  }
}

