.custom-product-gallery-f092fe17 {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
}

/* ------------------------------------------------------------------ */
/* LAYOUT PAGINA PRODOTTO — galleria a sinistra, riepilogo a destra.   */
/* Su questo sito manca il wrapper #content e la variabile             */
/* --theme-var-single-product-gallery-width non e' definita, quindi il */
/* layout a due colonne del tema non si applica: lo forziamo qui.      */
/* ------------------------------------------------------------------ */
@media (min-width: 992px) {
    .woocommerce div.product .custom-product-gallery-wrap-f092fe17 {
        width: 50%;
        float: left;
        clear: left;
        box-sizing: border-box;
        padding-right: 40px;
        margin-bottom: 40px;
    }
    .woocommerce div.product .summary.entry-summary {
        width: 50% !important;
        float: right !important;
        box-sizing: border-box;
    }
    /* i blocchi sotto (tab, correlati) scendono sotto le due colonne */
    .woocommerce div.product::after {
        content: "";
        display: block;
        clear: both;
    }
}

@media (max-width: 991px) {
    .woocommerce div.product .custom-product-gallery-wrap-f092fe17 {
        width: 100%;
        float: none;
    }
    .woocommerce div.product .summary.entry-summary {
        width: 100% !important;
        float: none !important;
    }
}

.custom-product-gallery-f092fe17.thumb-pos-left {
    flex-direction: row-reverse;
}

.custom-product-gallery-f092fe17.thumb-pos-left .gallery-main-swiper-container {
    flex: 1;
    min-width: 0;
}

.custom-product-gallery-f092fe17.thumb-pos-left .gallery-thumbs-swiper-container {
    width: 80px;
    flex: 0 0 auto;
}

.gallery-main-swiper {
    position: relative;
    overflow: hidden;
    width: 100%;
    /* Nessuna altezza fissa: il box si adatta all'immagine (come online),
       cosi' le immagini piu' alte NON vengono tagliate. Vedi autoHeight nel JS. */
}

.gallery-main-swiper .swiper-slide {
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    overflow: hidden;
}

/* Immagine ad aspetto NATURALE (niente crop). */
.gallery-main-swiper .swiper-slide img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
}

.gallery-main-swiper .swiper-zoom-container {
    width: 100%;
    height: auto;
    display: block;
}

/* Force browser native styled custom scrollbar to avoid vanishing and remain stable */
.gallery-thumbs-swiper {
    overflow-x: auto !important;
    overflow-y: hidden !important;
    width: 100%;
    padding-bottom: 8px !important;
}

/* Le miniature scorrono nativamente (niente Swiper): impostiamo noi il flex.
   Neutralizziamo l'eventuale transform residuo lasciato da Swiper. */
.gallery-thumbs-swiper .swiper-wrapper {
    display: flex;
    flex-direction: row;
    transform: none !important;
    gap: 10px;
}

.custom-product-gallery-f092fe17.thumb-pos-left .gallery-thumbs-swiper .swiper-wrapper {
    flex-direction: column;
}

.gallery-thumbs-swiper::-webkit-scrollbar,
.custom-product-gallery-f092fe17.thumb-pos-left .gallery-thumbs-swiper::-webkit-scrollbar {
    height: 8px !important;
    width: 8px !important;
    display: block !important;
}

.gallery-thumbs-swiper::-webkit-scrollbar-track,
.custom-product-gallery-f092fe17.thumb-pos-left .gallery-thumbs-swiper::-webkit-scrollbar-track {
    background: #f1f1f1 !important;
    border-radius: 4px !important;
}

.gallery-thumbs-swiper::-webkit-scrollbar-thumb,
.custom-product-gallery-f092fe17.thumb-pos-left .gallery-thumbs-swiper::-webkit-scrollbar-thumb {
    background: #071852 !important;
    border-radius: 4px !important;
}

.gallery-thumbs-swiper::-webkit-scrollbar-thumb:hover,
.custom-product-gallery-f092fe17.thumb-pos-left .gallery-thumbs-swiper::-webkit-scrollbar-thumb:hover {
    background: #0d2a7a !important;
}

.custom-product-gallery-f092fe17.thumb-pos-left .gallery-thumbs-swiper {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding-right: 8px !important;
    padding-bottom: 0 !important;
}

.gallery-thumbs-swiper .swiper-slide {
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.3s;
    flex-shrink: 0 !important;
    /* Dimensioni di default delle miniature (prima dai controlli Elementor,
       che ora non esistono piu' perche' la galleria e' renderizzata via hook). */
    width: 80px;
    height: 80px;
    flex: 0 0 80px;
}

/* La miniatura SELEZIONATA (e quella sotto il mouse) a opacita' piena;
   le altre restano leggermente scurite. NB: l'opacita' va sulla SLIDE,
   non sull'img, altrimenti lo 0.6 del genitore la scurisce comunque. */
.gallery-thumbs-swiper .swiper-slide-thumb-active,
.gallery-thumbs-swiper .swiper-slide:hover {
    opacity: 1;
}

.gallery-thumbs-swiper .swiper-slide-thumb-active img {
    border-color: #071852 !important; /* vince sulla regola 'border: transparent' che segue */
    opacity: 1;
}

.custom-product-gallery-f092fe17.thumb-pos-left .gallery-thumbs-swiper-container {
    width: 80px;
}

.gallery-thumbs-swiper .swiper-slide img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    border: 2px solid transparent;
}

.gallery-thumbs-swiper .swiper-slide-thumb-active img {
    opacity: 1;
}

/* Swiper navigation buttons - fixed for proper centering without breaking escaping */
.custom-product-gallery-f092fe17 .swiper-button-next,
.custom-product-gallery-f092fe17 .swiper-button-prev {
    color: #ffffff;
    background-color: #071852;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.custom-product-gallery-f092fe17 .swiper-button-next:hover,
.custom-product-gallery-f092fe17 .swiper-button-prev:hover {
    background-color: #0d2a7a;
}

.custom-product-gallery-f092fe17 .swiper-button-next::after,
.custom-product-gallery-f092fe17 .swiper-button-prev::after {
    font-size: 16px;
    font-weight: bold;
}

/* Vertical slider custom style for Left position */
.custom-product-gallery-f092fe17.thumb-pos-left .gallery-thumbs-swiper {
    height: 400px;
}

@media (max-width: 767px) {
    .custom-product-gallery-f092fe17.thumb-pos-left {
        flex-direction: column;
    }
    .custom-product-gallery-f092fe17.thumb-pos-left .gallery-thumbs-swiper-container {
        width: 100% !important;
        height: auto;
    }
    .custom-product-gallery-f092fe17.thumb-pos-left .gallery-thumbs-swiper {
        height: auto;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        padding-bottom: 8px !important;
        padding-right: 0 !important;
    }
    /* Su mobile lasciamo l'altezza automatica: l'immagine non viene tagliata. */
}
