/* Product page gallery: arrows + aligned thumbnails (Dec 5 2026).
   Loaded only on single product pages (functions.php fmr_product_gallery_assets). Delete the enqueue to roll back. */

/* Arrows live inside the main photo (moved there by product-gallery.js). */
body.single-product .woocommerce-product-gallery .flex-viewport {
    position: relative;
}

body.single-product .woocommerce-product-gallery .flex-direction-nav {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 20;
}

body.single-product .woocommerce-product-gallery .flex-direction-nav li {
    margin: 0 !important;
    list-style: none !important;
}

body.single-product .woocommerce-product-gallery .flex-direction-nav a {
    /* Look (pink neon, white chevron) comes from style.css; here only placement inside the photo. */
    pointer-events: auto;
    transform: none !important;
    -webkit-tap-highlight-color: transparent;
}

body.single-product .woocommerce-product-gallery .flex-direction-nav a:hover {
    transform: scale(1.08) !important;
}

body.single-product .woocommerce-product-gallery .flex-direction-nav a.flex-disabled {
    opacity: 0.3 !important;
    pointer-events: none;
}

/* Thumbnails: an even grid inside the panel (they were offset to the right and overflowed on phones). */
body.single-product .woocommerce-product-gallery .flex-control-thumbs {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    width: 100% !important;
    box-sizing: border-box;
    margin: 10px 0 0 !important;
    padding: 0 10px 10px !important;
    left: auto !important;
    transform: none !important;
    list-style: none !important;
}

body.single-product .woocommerce-product-gallery .flex-control-thumbs li {
    width: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    float: none !important;
}

body.single-product .woocommerce-product-gallery .flex-control-thumbs li img {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
}

@media (min-width: 769px) {
    body.single-product .woocommerce-product-gallery .flex-control-thumbs {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

/* Phones: less empty space between the header and the photo. */
@media (max-width: 768px) {
    .single-product-container {
        margin-top: 66px !important;
    }

    body.single-product .ast-article-single {
        margin-top: 0 !important;
    }

    body.single-product .woocommerce-product-gallery .flex-direction-nav a {
        width: 42px !important;
        height: 42px !important;
        margin-top: -21px !important;
        box-shadow: 0 0 12px var(--neon-pink) !important;
    }

    body.single-product .woocommerce-product-gallery .flex-direction-nav a.flex-prev { left: 10px !important; }
    body.single-product .woocommerce-product-gallery .flex-direction-nav a.flex-next { right: 10px !important; }
}
