/**
 * Theme Name: Blocksy Child
 * Description: Blocksy Child theme
 * Author: Creative Themes
 * Template: blocksy
 * Text Domain: blocksy
 */

/* =========================================
   TCG SWAP – BLOCKSY PRODUCT IMAGES
   ========================================= */

/* SHOP / CATEGORY / PRODUCT ARCHIVES */
[data-products] .product figure,
[data-products] .product .ct-media-container,
.woocommerce ul.products li.product figure,
.woocommerce ul.products li.product .ct-media-container {
    aspect-ratio: 1 / 1 !important;
    overflow: hidden !important;
    background: #fff;
}

/* Archive product images */
[data-products] .product figure img,
[data-products] .product .ct-media-container img,
.woocommerce ul.products li.product figure img,
.woocommerce ul.products li.product .ct-media-container img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    object-position: center center !important;
}


/* =========================================
   SINGLE PRODUCT GALLERY
   ========================================= */

.single-product .woocommerce-product-gallery img,
.single-product .flexy-item img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    object-position: center center !important;
}

/* Keep main gallery square */
.single-product .flexy-item {
    aspect-ratio: 1 / 1 !important;
    overflow: hidden !important;
    background: #fff;
}

/* Gallery image container */
.single-product .flexy-item > * {
    width: 100%;
    height: 100%;
}


/* =========================================
   GALLERY THUMBNAILS
   ========================================= */

.single-product .flexy-pills img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    object-position: center center !important;
}


/* =========================================
   RELATED / UPSELL / CROSS SELL
   ========================================= */

.related.products li.product figure,
.upsells.products li.product figure,
.cross-sells li.product figure {
    aspect-ratio: 1 / 1 !important;
    overflow: hidden !important;
    background: #fff;
}

.related.products li.product figure img,
.upsells.products li.product figure img,
.cross-sells li.product figure img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    object-position: center center !important;
}

@media screen and (max-width: 767px) {

    .single .ct-stacked-gallery-container {
        display: flex !important;
        flex-wrap: nowrap !important;
        gap: 10px !important;

        margin-left: -4vw !important;
        margin-right: -4vw !important;

        overflow-x: auto !important;
        overflow-y: hidden !important;

        background-color: #fff;

        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
    }

    .single .ct-stacked-gallery-container::-webkit-scrollbar {
        display: none;
    }

    .single .ct-stacked-gallery-container > * {
        flex: 0 0 90%;
        scroll-snap-align: center;
    }
}