/* Only native WooCommerce galleries; never affect variation swatches. */
body.single-product .woocommerce-product-gallery.uwg-ready {
  display: grid !important;
  grid-template-columns: 80px minmax(0, 1fr) !important;
  column-gap: 15px !important;
  align-items: start !important;
  min-width: 0 !important;
  position: relative !important;
}
body.single-product .woocommerce-product-gallery.uwg-ready > .flex-viewport,
body.single-product .woocommerce-product-gallery.uwg-ready > .woocommerce-product-gallery__wrapper {
  grid-column: 2 !important;
  grid-row: 1 !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
}
body.single-product .woocommerce-product-gallery.uwg-ready > .flex-viewport { overflow: hidden !important; }
body.single-product .woocommerce-product-gallery.uwg-ready .woocommerce-product-gallery__image img:not(.zoomImg) {
  max-width: 100%; height: auto;
}
body.single-product .woocommerce-product-gallery.uwg-ready > .uwg-thumb-rail {
  grid-column: 1 !important;
  grid-row: 1 !important;
  position: relative !important;
  display: block !important;
  width: 80px !important;
  max-width: 100% !important;
  min-width: 0 !important;
  overflow: hidden !important;
  align-self: start !important;
}
body.single-product .woocommerce-product-gallery.uwg-ready .uwg-thumb-rail > .flex-control-thumbs {
  display: flex !important;
  flex-direction: column !important;
  flex-wrap: nowrap !important;
  gap: 8px !important;
  position: static !important;
  float: none !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  height: auto !important;
  max-height: 370px !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
  box-sizing: border-box !important;
  scrollbar-width: none;
  overscroll-behavior: contain;
  touch-action: pan-y;
}
body.single-product .woocommerce-product-gallery.uwg-ready .uwg-thumb-rail > .flex-control-thumbs::-webkit-scrollbar { display: none; }
body.single-product .woocommerce-product-gallery.uwg-ready .uwg-thumb-rail > .flex-control-thumbs > li {
  display: block !important;
  float: none !important;
  flex: 0 0 auto !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}
body.single-product .woocommerce-product-gallery.uwg-ready .uwg-thumb-rail > .flex-control-thumbs > li > img {
  display: block !important;
  position: static !important;
  float: none !important;
  width: 100% !important;
  max-width: 100% !important;
  height: 82px !important;
  min-height: 0 !important;
  max-height: 82px !important;
  object-fit: contain !important;
  object-position: center !important;
  box-sizing: border-box !important;
  opacity: 1 !important;
  visibility: visible !important;
  border: 2px solid transparent !important;
  border-radius: 3px !important;
  cursor: pointer !important;
  transform: none !important;
  transition: border-color .2s ease !important;
}
body.single-product .woocommerce-product-gallery.uwg-ready .uwg-thumb-rail img.flex-active { border-color: #333 !important; }
body.single-product .woocommerce-product-gallery.uwg-ready > .woocommerce-product-gallery__trigger {
  grid-column: 2 !important;
  grid-row: 1 !important;
  justify-self: end !important;
  align-self: start !important;
  z-index: 20 !important;
}
body.single-product .woocommerce-product-gallery.uwg-ready .uwg-nav {
  position: absolute !important;
  left: 0 !important;
  width: 100% !important;
  height: 26px !important;
  z-index: 25 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: rgba(0,0,0,.65) !important;
  color: white !important;
  font-size: 16px !important;
  line-height: 1 !important;
  cursor: pointer !important;
  opacity: 0 !important;
  visibility: hidden !important;
  transition: opacity .15s ease !important;
}
body.single-product .woocommerce-product-gallery.uwg-ready .uwg-nav--up { top: 0 !important; }
body.single-product .woocommerce-product-gallery.uwg-ready .uwg-nav--down { bottom: 0 !important; }
body.single-product .woocommerce-product-gallery.uwg-ready .uwg-thumb-rail.uwg-scrollable:hover .uwg-nav:not(:disabled),
body.single-product .woocommerce-product-gallery.uwg-ready .uwg-thumb-rail.uwg-scrollable:focus-within .uwg-nav:not(:disabled) {
  opacity: 1 !important; visibility: visible !important;
}
body.single-product .woocommerce-product-gallery.uwg-ready .uwg-nav:disabled { pointer-events: none !important; }
@media (hover: none) {
  body.single-product .woocommerce-product-gallery.uwg-ready .uwg-thumb-rail.uwg-scrollable .uwg-nav:not(:disabled) {
    opacity: 1 !important; visibility: visible !important;
  }
}
@media (max-width: 767px) {
  body.single-product .woocommerce-product-gallery.uwg-ready { grid-template-columns: 55px minmax(0,1fr) !important; column-gap: 10px !important; }
  body.single-product .woocommerce-product-gallery.uwg-ready > .uwg-thumb-rail { width: 55px !important; }
  body.single-product .woocommerce-product-gallery.uwg-ready .uwg-thumb-rail > .flex-control-thumbs { max-height: 300px !important; gap: 6px !important; }
  body.single-product .woocommerce-product-gallery.uwg-ready .uwg-thumb-rail > .flex-control-thumbs > li > img { height: 64px !important; max-height: 64px !important; }
}

/* v1.4: prevent clipped first thumbnail and preserve full product images. */
body.single-product .woocommerce-product-gallery.uwg-ready .uwg-thumb-rail > .flex-control-thumbs {
  overflow-anchor: none !important;
  scroll-padding-top: 0 !important;
}
body.single-product .woocommerce-product-gallery.uwg-ready .uwg-thumb-rail > .flex-control-thumbs > li > img {
  object-fit: contain !important;
  object-position: center center !important;
}
/* Zoom fallback is enabled only if native WooCommerce zoom did not attach. */
body.single-product .woocommerce-product-gallery.uwg-ready .woocommerce-product-gallery__image.uwg-fallback-zoom {
  overflow: hidden !important;
}
body.single-product .woocommerce-product-gallery.uwg-ready .woocommerce-product-gallery__image.uwg-fallback-zoom > a {
  display: block !important;
  overflow: hidden !important;
}
body.single-product .woocommerce-product-gallery.uwg-ready .woocommerce-product-gallery__image.uwg-fallback-zoom img:not(.zoomImg) {
  transition: transform .12s ease-out !important;
  transform-origin: var(--uwg-zoom-x, 50%) var(--uwg-zoom-y, 50%) !important;
}
@media (hover: hover) and (pointer: fine) {
  body.single-product .woocommerce-product-gallery.uwg-ready .woocommerce-product-gallery__image.uwg-fallback-zoom:hover img:not(.zoomImg) {
    transform: scale(1.6) !important;
  }
}
@media (prefers-reduced-motion: reduce) {
  body.single-product .woocommerce-product-gallery.uwg-ready .woocommerce-product-gallery__image.uwg-fallback-zoom img:not(.zoomImg) {
    transition: none !important;
  }
}

/* v1.5: Exact whole-thumbnail scrolling; 4 complete thumbnails in the rail. */
body.single-product .woocommerce-product-gallery.uwg-ready .uwg-thumb-rail > .flex-control-thumbs {
  max-height: none !important;
  scroll-snap-type: y proximity;
  scroll-behavior: smooth;
  overscroll-behavior: contain;
}
body.single-product .woocommerce-product-gallery.uwg-ready .uwg-thumb-rail > .flex-control-thumbs > li {
  scroll-snap-align: start;
  scroll-snap-stop: always;
}
/* Zoom hint appears only over the main product image, not the thumbnail rail. */
@media (hover: hover) and (pointer: fine) {
  body.single-product .woocommerce-product-gallery.uwg-ready .woocommerce-product-gallery__image {
    position: relative !important;
  }
  body.single-product .woocommerce-product-gallery.uwg-ready .woocommerce-product-gallery__image::after {
    content: '';
    position: absolute;
    right: 16px;
    bottom: 16px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0,0,0,.66);
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s ease;
    z-index: 12;
  }
  body.single-product .woocommerce-product-gallery.uwg-ready .woocommerce-product-gallery__image::before {
    content: '';
    position: absolute;
    right: 27px;
    bottom: 28px;
    width: 11px;
    height: 11px;
    border: 2px solid white;
    border-radius: 50%;
    box-sizing: border-box;
    box-shadow: 0 0 0 0 transparent;
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s ease;
    z-index: 13;
  }
  body.single-product .woocommerce-product-gallery.uwg-ready .woocommerce-product-gallery__image:hover::before,
  body.single-product .woocommerce-product-gallery.uwg-ready .woocommerce-product-gallery__image:hover::after {
    opacity: 1;
  }
  body.single-product .woocommerce-product-gallery.uwg-ready .woocommerce-product-gallery__image img.zoomImg {
    /* Native WooCommerce zoom animation is theme-controlled. */
  }
  body.single-product .woocommerce-product-gallery.uwg-ready .woocommerce-product-gallery__image.uwg-fallback-zoom img:not(.zoomImg) {
    transition: transform .55s ease-out, transform-origin .3s ease-out !important;
  }
  body.single-product .woocommerce-product-gallery.uwg-ready .woocommerce-product-gallery__image.uwg-fallback-zoom:hover img:not(.zoomImg) {
    transform: scale(1.35) !important;
  }
}

/* v1.7: dynamic number of full thumbnails and a half-visible last thumbnail.
   JS sets the exact viewport height based on rendered thumbnail sizes. */
body.single-product .woocommerce-product-gallery.uwg-ready .uwg-thumb-rail > .flex-control-thumbs {
  scroll-snap-type: none !important;
  scroll-padding-top: 0 !important;
  overflow-anchor: none !important;
  align-content: flex-start !important;
  justify-content: flex-start !important;
}

/* v1.8: Disable hover zoom visuals; keep gallery and lightbox intact. */
body.single-product .woocommerce-product-gallery.uwg-ready .woocommerce-product-gallery__image::before,
body.single-product .woocommerce-product-gallery.uwg-ready .woocommerce-product-gallery__image::after { display: none !important; }


/* v2.3.0: Consistent native WooCommerce lightbox trigger icon.
   Visual-only: no zoom, gallery, scrolling, or click behavior changes. */
body.single-product .woocommerce-product-gallery.uwg-ready > .woocommerce-product-gallery__trigger {
  position: absolute !important;
  top: 14px !important;
  right: 14px !important;
  left: auto !important;
  bottom: auto !important;
  width: 38px !important;
  height: 38px !important;
  min-width: 38px !important;
  min-height: 38px !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 50% !important;
  background: #fff !important;
  box-shadow: 0 2px 8px rgba(0,0,0,.12) !important;
  color: transparent !important;
  font-size: 0 !important;
  line-height: 0 !important;
  text-indent: -9999px !important;
  overflow: hidden !important;
  transform: none !important;
  z-index: 30 !important;
}
body.single-product .woocommerce-product-gallery.uwg-ready > .woocommerce-product-gallery__trigger::before {
  content: '' !important;
  display: block !important;
  position: absolute !important;
  width: 12px !important;
  height: 12px !important;
  top: 10px !important;
  left: 10px !important;
  border: 2px solid #111 !important;
  border-radius: 50% !important;
  background: transparent !important;
  box-shadow: none !important;
  transform: none !important;
  opacity: 1 !important;
}
body.single-product .woocommerce-product-gallery.uwg-ready > .woocommerce-product-gallery__trigger::after {
  content: '' !important;
  display: block !important;
  position: absolute !important;
  width: 9px !important;
  height: 2px !important;
  top: 24px !important;
  left: 22px !important;
  border: 0 !important;
  border-radius: 1px !important;
  background: #111 !important;
  box-shadow: none !important;
  transform: rotate(45deg) !important;
  transform-origin: left center !important;
  opacity: 1 !important;
}
