/**
 * Template Builder — Frontend gallery fix.
 *
 * WooCommerce's flexslider creates an <ol class="flex-control-thumbs"> for the
 * thumbnail strip. The list items need list-style: none and float: left to render
 * as a horizontal row. Some themes override those rules with higher-specificity
 * selectors (e.g. .product ol li { list-style: decimal }), causing the thumbnails
 * to appear as a numbered vertical column.
 *
 * These rules use .woocommerce-product-gallery as the scoping ancestor (always
 * present on the WooCommerce gallery wrapper) so they apply everywhere regardless
 * of the outer template wrapper, and !important ensures they win over theme resets.
 */

/* Thumbnail strip container */
.woocommerce-product-gallery .flex-control-nav.flex-control-thumbs {
    list-style: none !important;
    padding: 0 !important;
    margin: 6px 0 0 !important;
    overflow: hidden !important;
    zoom: 1;
    display: block !important;
}

/* Individual thumbnail items — width is overridden by JS to match exact count */
.woocommerce-product-gallery .flex-control-nav.flex-control-thumbs li {
    list-style: none !important;
    float: left !important;
    width: 25% !important;     /* fallback; JS recalculates to 100%/n */
    margin: 0 !important;
    padding: 2px !important;
    box-sizing: border-box !important;
    cursor: pointer !important;
}

/* Thumbnail images */
.woocommerce-product-gallery .flex-control-nav.flex-control-thumbs li img {
    width: 100% !important;
    display: block !important;
    opacity: 0.5;
    transition: opacity 0.2s ease;
}

.woocommerce-product-gallery .flex-control-nav.flex-control-thumbs li img.flex-active,
.woocommerce-product-gallery .flex-control-nav.flex-control-thumbs li:hover img {
    opacity: 1;
}
