/* Miranda Mobili — mobile product carousel */
body#product .miranda-mobile-gallery {
  display: block !important;
  position: relative;
  left: var(--miranda-gallery-left, 0px) !important;
  width: var(--miranda-gallery-width, 100vw) !important;
  max-width: var(--miranda-gallery-width, 100vw) !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  margin-bottom: 24px !important;
  overflow: hidden;
  background: #f6f6f4;
}

body#product .images-container,
body#product .product-images-container {
    overflow: visible !important;
}

body#product .scroll-box-arrows,
body#product .images-container .arrows,
body#product .images-container .slick-arrow,
body#product .images-container .carousel-control-prev,
body#product .images-container .carousel-control-next,
body#product .product-images-container .arrows,
body#product .product-images-container .slick-arrow,
body#product .product-images-container .carousel-control-prev,
body#product .product-images-container .carousel-control-next {
    display: none !important;
}

/* Sicurezza: anche prima dell'avvio JS la copertina riempie lo schermo. */
body#product .product-cover {
    position: relative !important;
    left: 50% !important;
    display: block !important;
    width: 100vw !important;
    max-width: 100vw !important;
    margin-right: -50vw !important;
    margin-left: -50vw !important;
    overflow: hidden !important;
}

body#product .product-cover .js-qv-product-cover,
body#product .product-cover img {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    height: auto !important;
    aspect-ratio: 2 / 3 !important;
    object-fit: cover !important;
    object-position: center center !important;
}

body#product .miranda-mobile-track {
    display: flex;
    width: 100% !important;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

body#product .miranda-mobile-track::-webkit-scrollbar {
    display: none;
}

body#product .miranda-mobile-slide {
    position: relative;
    flex: 0 0 100% !important;
    width: 100% !important;
    aspect-ratio: 2 / 3 !important;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    overflow: hidden;
    background: #f6f6f4;
}

body#product .miranda-mobile-slide img {
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    object-fit: cover !important;
    object-position: center center !important;
}

body#product .miranda-mobile-dots {
    position: absolute;
    left: 50%;
    bottom: 18px;
    transform: translateX(-50%);
    z-index: 50;
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 9px;
    max-width: calc(100% - 40px);
}

body#product .miranda-mobile-dot {
    width: 8px !important;
    height: 8px !important;
    min-width: 8px !important;
    min-height: 8px !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 50% !important;
    background: rgba(255,255,255,.50) !important;
    box-shadow: none !important;
    appearance: none !important;
}

body#product .miranda-mobile-dot.is-active {
    width: 22px !important;
    min-width: 22px !important;
    border-radius: 999px !important;
    background: rgba(255,255,255,.96) !important;
}

body#product .miranda-carousel-ready > .product-cover,
body#product .miranda-carousel-ready > .js-qv-mask,
body#product .miranda-carousel-ready > .scroll-box-arrows,
body#product .miranda-carousel-ready .product-images {
    display: none !important;
}

/* iPhone/iPad possono usare un viewport da desktop. max-device-width legge
   la larghezza fisica del dispositivo e mostra comunque la galleria mobile. */
@media screen and (max-device-width: 1024px) {
  body#product .images-container,
  body#product .product-images-container {
    overflow: visible !important;
  }

  body#product .scroll-box-arrows,
  body#product .images-container .arrows,
  body#product .images-container .slick-arrow,
  body#product .images-container .carousel-control-prev,
  body#product .images-container .carousel-control-next,
  body#product .product-images-container .arrows,
  body#product .product-images-container .slick-arrow,
  body#product .product-images-container .carousel-control-prev,
  body#product .product-images-container .carousel-control-next {
    display: none !important;
  }

  body#product .miranda-mobile-gallery {
    display: block !important;
  }

  body#product .miranda-carousel-ready > .product-cover,
  body#product .miranda-carousel-ready > .js-qv-mask,
  body#product .miranda-carousel-ready > .scroll-box-arrows,
  body#product .miranda-carousel-ready .product-images {
    display: none !important;
  }
}

/* La posizione orizzontale viene calcolata dal JavaScript rispetto al bordo
   reale dello schermo: il tema Classic non può più lasciare margini laterali. */
