/* Surname-only storefront adjustments. */
body.gys-lastname-product .woocommerce-product-gallery .swiper-wrapper.flex-control-nav,
body.gys-lastname-product .swiper-wrapper.flex-control-nav {
    visibility: visible !important;
    opacity: 1 !important;
}

body.gys-lastname-product .woocommerce-product-gallery .swiper-wrapper.flex-control-nav > .swiper-slide,
body.gys-lastname-product .swiper-wrapper.flex-control-nav > .swiper-slide {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}


/* Preserve the real artwork aspect ratio after Shoptimizer/Swiper refreshes.
 * Scoped to surname products only. */
body.gys-lastname-product ul.swiper-wrapper.cg-psp-gallery {
    height: auto !important;
}

body.gys-lastname-product ul.swiper-wrapper.cg-psp-gallery > li.woocommerce-product-gallery__image.swiper-slide,
body.gys-lastname-product ul.swiper-wrapper.cg-psp-gallery > li.woocommerce-product-gallery__image.swiper-slide > a.swiper-slide-imglink {
    height: auto !important;
}

body.gys-lastname-product ul.swiper-wrapper.cg-psp-gallery img.pdp-img {
    display: block;
    width: 100% !important;
    height: auto !important;
    max-width: 100%;
    object-fit: contain !important;
}


/* Make the three surname gallery thumbnails use the available width.
 * Scoped to surname products only so first-name galleries are unchanged. */
body.gys-lastname-product ul.swiper-wrapper.flex-control-nav {
    width: 100% !important;
    transform: translate3d(0, 0, 0) !important;
    gap: 12px !important;
}

body.gys-lastname-product ul.swiper-wrapper.flex-control-nav > li.swiper-slide {
    flex: 0 0 calc((100% - 24px) / 3) !important;
    width: calc((100% - 24px) / 3) !important;
    max-width: none !important;
    margin-right: 0 !important;
}

body.gys-lastname-product ul.swiper-wrapper.flex-control-nav > li.swiper-slide img {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    max-width: none !important;
    object-fit: contain !important;
}
