/* Slider mobile: una sola immagine visibile; tablet/desktop invariati. */
@media (max-width: 767px) {
  .woocommerce-product-gallery.cse-vg-mobile-slider { max-width: 100%; min-width: 0; overflow: hidden; }
  .woocommerce-product-gallery.cse-vg-mobile-slider .flex-viewport { overflow: hidden !important; max-width: 100%; }
  .woocommerce-product-gallery.cse-vg-mobile-slider .woocommerce-product-gallery__wrapper { min-width: 0; }
  /* Forza una sola slide visibile anche se il tema imposta grid/flex/colonne. */
  body .woocommerce-product-gallery.cse-vg-mobile-slider .woocommerce-product-gallery__wrapper {
    display: block !important; width: 100% !important; height: auto !important;
    overflow: hidden !important; transform: none !important;
  }
  body .woocommerce-product-gallery.cse-vg-mobile-slider .woocommerce-product-gallery__wrapper > .woocommerce-product-gallery__image {
    display: none !important; width: 100% !important; max-width: 100% !important;
    float: none !important; margin: 0 !important; transform: none !important;
  }
  body .woocommerce-product-gallery.cse-vg-mobile-slider .woocommerce-product-gallery__wrapper > .woocommerce-product-gallery__image.cse-vg-slide-active {
    display: block !important;
  }
  .woocommerce-product-gallery.cse-vg-mobile-slider .woocommerce-product-gallery__image img { display: block; width: 100%; height: auto; }
  .woocommerce-product-gallery.cse-vg-mobile-slider .flex-control-nav,
  .woocommerce-product-gallery.cse-vg-mobile-slider .flex-direction-nav { display: none !important; }
  .woocommerce-product-gallery.cse-vg-mobile-slider .cse-vg-mobile-controls {
    display: flex; align-items: center; justify-content: center; gap: 18px;
    padding: 10px 0; position: relative; z-index: 2;
  }
  .woocommerce-product-gallery.cse-vg-mobile-slider .cse-vg-mobile-controls button {
    cursor: pointer; border: 0; background: transparent; padding: 4px 12px;
    font-size: 28px; line-height: 1; color: inherit;
  }
  .woocommerce-product-gallery.cse-vg-mobile-slider .cse-vg-mobile-controls button:disabled { opacity: .25; cursor: default; }
  .woocommerce-product-gallery.cse-vg-mobile-slider .cse-vg-mobile-dots {
    display: flex; align-items: center; justify-content: center; gap: 9px; min-width: 0;
  }
  .woocommerce-product-gallery.cse-vg-mobile-slider .cse-vg-mobile-controls .cse-vg-mobile-dot {
    display: block; width: 9px; height: 9px; min-width: 9px; min-height: 9px;
    padding: 0; border: 0; border-radius: 50%; background: currentColor;
    opacity: .3; transition: opacity .2s ease, transform .2s ease;
  }
  .woocommerce-product-gallery.cse-vg-mobile-slider .cse-vg-mobile-controls .cse-vg-mobile-dot.is-active {
    opacity: 1; transform: scale(1.2);
  }
  .woocommerce-product-gallery.cse-vg-mobile-slider .cse-vg-mobile-controls .cse-vg-mobile-dot:focus-visible {
    outline: 2px solid currentColor; outline-offset: 4px;
  }
}

/* Slider autonomo per [shortcode] CSE in Elementor: soltanto mobile. */
@media (max-width: 767px) {
  body .cse-vg-shortcode-mobile > .cse-variation-gallery-shortcode__item,
  body .cse-vg-shortcode-mobile > :not(.cse-vg-shortcode-slider):has(> .cse-variation-gallery-shortcode__item) {
    display: none !important;
  }
  body .cse-vg-shortcode-mobile .cse-vg-shortcode-slider {
    display: block !important; position: relative; width: 100% !important;
    max-width: 100%; min-width: 0; overflow: hidden;
  }
  body .cse-vg-shortcode-mobile .cse-vg-shortcode-track {
    display: block !important; width: 100% !important; overflow: hidden;
  }
  body .cse-vg-shortcode-mobile .cse-vg-shortcode-slide {
    display: none !important; width: 100% !important; max-width: 100% !important;
    margin: 0 !important; float: none !important; position: relative !important;
  }
  body .cse-vg-shortcode-mobile .cse-vg-shortcode-slide.is-active { display: block !important; }
  body .cse-vg-shortcode-mobile .cse-vg-shortcode-slide img {
    display: block !important; width: 100% !important; height: auto !important;
    max-width: 100% !important; object-fit: contain;
  }
  body .cse-vg-shortcode-mobile .cse-vg-shortcode-controls {
    display: flex !important; align-items: center; justify-content: center;
    gap: 18px; padding: 10px 0; position: relative; z-index: 2;
  }
  body .cse-vg-shortcode-mobile .cse-vg-shortcode-controls button {
    cursor: pointer; border: 0; background: transparent; padding: 4px 12px;
    font-size: 28px; line-height: 1; color: inherit;
  }
  body .cse-vg-shortcode-mobile .cse-vg-shortcode-controls button:disabled { opacity: .25; cursor: default; }
  body .cse-vg-shortcode-mobile .cse-vg-shortcode-dots {
    display: flex; align-items: center; justify-content: center; gap: 9px;
  }
  body .cse-vg-shortcode-mobile .cse-vg-shortcode-controls .cse-vg-shortcode-dot {
    display: block; width: 9px; height: 9px; min-width: 9px; min-height: 9px;
    padding: 0; border: 0; border-radius: 50%; background: currentColor; opacity: .3;
  }
  body .cse-vg-shortcode-mobile .cse-vg-shortcode-controls .cse-vg-shortcode-dot.is-active {
    opacity: 1; transform: scale(1.2);
  }
}

/* v1.8.6: carosello mobile orizzontale con anteprima del 10% della foto seguente. */
@media (max-width: 767px) {
  body .cse-vg-shortcode-mobile .cse-vg-shortcode-slider-viewport {
    width: 100%; overflow: hidden; position: relative;
  }
  body .cse-vg-shortcode-mobile .cse-vg-shortcode-track {
    display: flex !important; width: 100% !important; overflow: visible !important;
    align-items: flex-start; flex-wrap: nowrap !important;
    transition: transform .32s cubic-bezier(.22,.61,.36,1);
    will-change: transform;
  }
  body .cse-vg-shortcode-mobile .cse-vg-shortcode-slide,
  body .cse-vg-shortcode-mobile .cse-vg-shortcode-slide.is-active {
    display: block !important; flex: 0 0 90% !important;
    width: 90% !important; max-width: 90% !important;
  }
  body .cse-vg-shortcode-mobile .cse-vg-shortcode-slide img {
    width: 100% !important; height: auto !important;
  }
}
@media (max-width: 767px) and (prefers-reduced-motion: reduce) {
  body .cse-vg-shortcode-mobile .cse-vg-shortcode-track { transition: none; }
}
