body.single-product .woocommerce-product-gallery { pointer-events: auto !important; background: transparent; }
body.single-product .ic-gallery-1218 .flex-viewport { background: transparent; }
body.single-product .woocommerce-product-gallery .flex-control-thumbs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 20px 0 0 !important; padding: 0 !important; overflow: visible; list-style: none; }
body.single-product .woocommerce-product-gallery .flex-control-thumbs::before,
body.single-product .woocommerce-product-gallery .flex-control-thumbs::after { display: none; }
body.single-product .woocommerce-product-gallery .flex-control-thumbs li { float: none !important; width: auto !important; margin: 0 !important; min-width: 0; }
body.single-product .ic-gallery-1218 .ic-gallery-choice-1218 { display: block; width: 100%; padding: 6px; border: 1px solid #cfc7d4; border-radius: 10px; background: transparent; box-shadow: none; line-height: 0; cursor: pointer; transition: border-color 120ms ease, box-shadow 120ms ease; }
body.single-product .ic-gallery-1218 .ic-gallery-choice-1218 img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: contain; opacity: 1 !important; pointer-events: auto; border: 0; border-radius: 4px; background: transparent; margin: 0; }
body.single-product .ic-gallery-1218 .ic-gallery-choice-1218:hover { border-color: #897394; }
body.single-product .ic-gallery-1218 .ic-gallery-choice-1218[aria-pressed="true"] { border-color: #4b3f56; box-shadow: 0 0 0 1px #4b3f56; }
body.single-product .ic-gallery-1218 .ic-gallery-choice-1218:focus-visible { outline: 3px solid #4b3f56; outline-offset: 3px; }
body.single-product .ic-gallery-1218 .ic-gallery-status-1218 { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 480px) {
 body.single-product .woocommerce-product-gallery .flex-control-thumbs { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 14px !important; }
 body.single-product .ic-gallery-1218 .ic-gallery-choice-1218 { padding: 3px; border-radius: 7px; }
}
@media (prefers-reduced-motion: reduce) {
 body.single-product .ic-gallery-1218 .ic-gallery-choice-1218 { transition: none; }
}

body.single-product .ic-gallery-widget-1218 { filter: none !important; }
body.single-product .ic-gallery-1218 .woocommerce-product-gallery__trigger { display: flex !important; align-items: center; justify-content: center; position: absolute; top: 10px; right: 10px; width: 44px; height: 44px; border-radius: 50%; background: rgba(246,244,241,.92); color: #4b3f56; z-index: 5; cursor: zoom-in; }
body.single-product .ic-gallery-1218 .woocommerce-product-gallery__trigger:focus-visible { outline: 3px solid #4b3f56; outline-offset: 3px; }

/* Fill the product image column while keeping desktop thumbnails compact. */
body.single-product .ic-gallery-widget-1218 { width: 100% !important; max-width: 100% !important; }
@media (min-width: 1025px) {
 body.single-product .woocommerce-product-gallery .flex-control-thumbs { grid-template-columns: repeat(auto-fit, minmax(0, 80px)); justify-content: center; }
}

/* Keep the native hover magnifier transparent like the source WebPs. */
.ic-gallery-1218 img.zoomImg { background: transparent !important; }

/* Reserve the pre-slider image stack and stabilise product columns on load. */
body.single-product .elementor-widget-woocommerce-product-images{width:100%!important;max-width:100%!important;filter:none!important}
body.single-product .woocommerce-product-gallery > .woocommerce-product-gallery__wrapper{display:grid;grid-template-columns:minmax(0,1fr)}
body.single-product .woocommerce-product-gallery > .woocommerce-product-gallery__wrapper > .woocommerce-product-gallery__image{grid-area:1/1}
body.single-product .elementor-594 .elementor-element-b6bac6a{align-items:flex-start}

/* Keep the square native viewport stable while FlexSlider sets inline dimensions. */
body.single-product .woocommerce-product-gallery .flex-viewport{
 aspect-ratio:1; height:auto!important; contain:size;
}
/* Reserve the native thumbnail rows before JavaScript creates their list. */
@media(max-width:1024px){
 body.single-product .woocommerce-product-gallery:not(:has(.flex-control-thumbs))::after{
  content:"";display:block;height:0;padding-bottom:calc((100% - 36px)/4 + 20px);
 }
 body.single-product .woocommerce-product-gallery:not(:has(.flex-control-thumbs)):has(.woocommerce-product-gallery__wrapper > .woocommerce-product-gallery__image:nth-child(5))::after{
  padding-bottom:calc((100% - 36px)/4*2 + 32px);
 }
}
@media(max-width:480px){
 body.single-product .woocommerce-product-gallery:not(:has(.flex-control-thumbs))::after,
 body.single-product .woocommerce-product-gallery:not(:has(.flex-control-thumbs)):has(.woocommerce-product-gallery__wrapper > .woocommerce-product-gallery__image:nth-child(5))::after{
  padding-bottom:calc((100% - 16px)/3*2 + 22px);
 }
}

/* Use WordPress's existing responsive derivative for the decorative mobile background. */
@media(max-width:767px){
 body.single-product .elementor-594 .elementor-element.elementor-element-b6bac6a{
  background-image:url("https://intracellsupplements.com/wp-content/uploads/2026/03/504419b4-192b-4508-bed1-96967158a7fa-768x512.png")!important;
 }
}

/* Reuse the existing large derivative for the decorative tablet/desktop background. */
@media(min-width:768px){
 body.single-product .elementor-594 .elementor-element.elementor-element-b6bac6a{
  background-image:url("https://intracellsupplements.com/wp-content/uploads/2026/03/504419b4-192b-4508-bed1-96967158a7fa-1024x683.png")!important;
 }
}
