/* SWC product gallery: large slider + vertical thumbnails */

/* Apply immediately, before JS adds swc-gallery-ready */
.woocommerce div.product div.images.woocommerce-product-gallery,
body.single-product .woocommerce-product-gallery {
    display: grid !important;
    grid-template-columns: 88px minmax(0, 1fr) !important;
    gap: 16px !important;
    align-items: stretch !important;

}

/* Main image area */
.woocommerce div.product div.images.woocommerce-product-gallery .swc-gallery-main-frame,
body.single-product .woocommerce-product-gallery .swc-gallery-main-frame,
.woocommerce div.product div.images.woocommerce-product-gallery .flex-viewport,
body.single-product .woocommerce-product-gallery .flex-viewport {
    grid-column: 2 !important;
    grid-row: 1 !important;
    position: relative !important;
    min-width: 0 !important;
    width: 100% !important;
    background: #f6f6f6 !important;
    border-radius: 10px !important;
    overflow: hidden !important;
}

.woocommerce div.product div.images.woocommerce-product-gallery .swc-gallery-main-frame {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.woocommerce div.product div.images.woocommerce-product-gallery .woocommerce-product-gallery__wrapper,
body.single-product .woocommerce-product-gallery .woocommerce-product-gallery__wrapper {
   /* width: 100% !important;*/
    margin: 0 !important;
}

.woocommerce div.product div.images.woocommerce-product-gallery .woocommerce-product-gallery__image,
body.single-product .woocommerce-product-gallery .woocommerce-product-gallery__image {
    margin: 0 !important;
    text-align: center !important;
    background: #f6f6f6 !important;
}

.woocommerce div.product div.images.woocommerce-product-gallery .woocommerce-product-gallery__image img,
body.single-product .woocommerce-product-gallery .woocommerce-product-gallery__image img {
    width: 100% !important;
    height: auto !important;
    object-fit: contain !important;
    display: block !important;
}

/* Thumbnails column */
.woocommerce div.product div.images.woocommerce-product-gallery .flex-control-nav.flex-control-thumbs,
body.single-product .woocommerce-product-gallery .flex-control-nav.flex-control-thumbs {
    grid-column: 1 !important;
    grid-row: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    gap: 10px !important;
    width: 88px !important;
    height: 690px !important;
    max-height: 690px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    margin: 0 !important;
    padding: 0 8px 0 0 !important;
    list-style: none !important;
}

.woocommerce div.product div.images.woocommerce-product-gallery .flex-control-nav.flex-control-thumbs li,
body.single-product .woocommerce-product-gallery .flex-control-nav.flex-control-thumbs li {
    float: none !important;
    width: 72px !important;
    height: 72px !important;
    margin: 0 !important;
    padding: 0 !important;
    flex: 0 0 72px !important;
}

.woocommerce div.product div.images.woocommerce-product-gallery .flex-control-nav.flex-control-thumbs img,
body.single-product .woocommerce-product-gallery .flex-control-nav.flex-control-thumbs img {
    width: 72px !important;
    height: 72px !important;
    object-fit: cover !important;
    border-radius: 7px !important;
    border: 2px solid transparent !important;
    background: #fff !important;
    opacity: 1 !important;
    cursor: pointer !important;
    display: block !important;
}

.woocommerce div.product div.images.woocommerce-product-gallery .flex-control-nav.flex-control-thumbs img.flex-active,
body.single-product .woocommerce-product-gallery .flex-control-nav.flex-control-thumbs img.flex-active {
    border-color: #111 !important;
}

/* Arrows */
.swc-gallery-arrow {
    position: absolute !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    z-index: 50 !important;
    width: 38px !important;
    height: 38px !important;
    border: 0 !important;
    border-radius: 999px !important;
    background: #fff !important;
    box-shadow: 0 2px 10px rgba(0,0,0,.18) !important;
    cursor: pointer !important;
    font-size: 28px !important;
    line-height: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #333 !important;
    padding: 0 !important;
}

.swc-gallery-arrow.swc-prev {
    left: 12px !important;
}

.swc-gallery-arrow.swc-next {
    right: 12px !important;
}

/* Mobile */
@media (max-width: 768px) {
    .woocommerce div.product div.images.woocommerce-product-gallery,
    body.single-product .woocommerce-product-gallery {
        grid-template-columns: 1fr !important;
    }

    .woocommerce div.product div.images.woocommerce-product-gallery .swc-gallery-main-frame,
    body.single-product .woocommerce-product-gallery .swc-gallery-main-frame,
    .woocommerce div.product div.images.woocommerce-product-gallery .flex-viewport,
    body.single-product .woocommerce-product-gallery .flex-viewport {
        grid-column: 1 !important;
        grid-row: 1 !important;
    }

    .woocommerce div.product div.images.woocommerce-product-gallery .flex-control-nav.flex-control-thumbs,
    body.single-product .woocommerce-product-gallery .flex-control-nav.flex-control-thumbs {
        grid-column: 1 !important;
        grid-row: 2 !important;
        flex-direction: row !important;
        width: 100% !important;
        height: auto !important;
        max-height: none !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        padding: 10px 0 0 0 !important;
    }
}