/* Only the two approved pilots; no change to source images or other galleries. */
body.single-product:is(.postid-18205,.postid-18249,.postid-18271,.postid-18284,.postid-18363,.postid-20529) .woocommerce-product-gallery .flexy-items figure.ct-media-container {
  aspect-ratio: 1;
  height: auto;
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  background: #fff;
}
body.single-product:is(.postid-18205,.postid-18249,.postid-18271,.postid-18284,.postid-18363,.postid-20529) .woocommerce-product-gallery .flexy-items figure.ct-media-container > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
body.single-product:is(.postid-18205,.postid-18249,.postid-18271,.postid-18284,.postid-18363,.postid-20529) .woocommerce-product-gallery .epsivol-image-caption {
  min-height: var(--tandt-gallery-caption-height, 0px);
}
body.single-product:is(.postid-18205,.postid-18249,.postid-18271,.postid-18284,.postid-18363,.postid-20529) .woocommerce-product-gallery .epsivol-image-caption[hidden] {
  display: block;
  visibility: hidden;
}
.pswp.tandt-gallery-viewer .pswp__caption {
  height: var(--tandt-viewer-caption-height);
  overflow: auto;
}
.pswp.tandt-gallery-viewer .pswp__caption__center {
  box-sizing: border-box;
  overflow-wrap: anywhere;
}
.pswp.tandt-gallery-viewer .pswp__button:focus-visible,
body.single-product:is(.postid-18205,.postid-18249,.postid-18271,.postid-18284,.postid-18363,.postid-20529) .woocommerce-product-gallery__trigger:focus-visible {
  outline: 3px solid #0067B1;
  outline-offset: 3px;
}

/* Fullscreen canvas belongs to the viewport, never to the current image.
   PhotoSwipe keeps the source aspect ratio and its existing fit/zoom bounds. */
.pswp.tandt-gallery-viewer .pswp__scroll-wrap::before {
  content: "";
  position: absolute;
  inset: 44px 0 var(--tandt-viewer-caption-height, 0px);
  background: #FFFFFF;
  pointer-events: none;
}

/* M148: preserve the measuring container even when the current caption is empty. */
body.postid-20529 .pswp.tandt-gallery-viewer .pswp__caption--empty {
  display: block;
}
