/**
 * Single-product gallery: full uncropped photos + a usable PhotoSwipe lightbox.
 */

.single-product .woocommerce-product-gallery .flexy-item .ct-media-container,
.single-product .woocommerce-product-gallery .ct-product-gallery-container > figure.ct-media-container {
	--theme-object-fit: contain;
	background-color: #fff;
}

.single-product .woocommerce-product-gallery .flexy-item .ct-media-container img:not(.zoomImg),
.single-product .woocommerce-product-gallery .ct-product-gallery-container > figure.ct-media-container img:not(.zoomImg) {
	aspect-ratio: 1 / 1 !important;
	object-fit: contain !important;
	width: 100%;
	height: auto;
	max-width: 100%;
}

/* In-place hover-zoom is desktop-only; on touch it fights the slider. */
@media (hover: none), (max-width: 999px) {
	.single-product .woocommerce-product-gallery .zoomImg {
		visibility: hidden !important;
		opacity: 0 !important;
		pointer-events: none !important;
	}
}

.single-product .woocommerce-product-gallery .woocommerce-product-gallery__trigger {
	z-index: 5;
}

/* Only PhotoSwipe should handle gestures while open (blocks iOS page pinch
   from fighting the lightbox zoom, and Flexy from seeing the same touches). */
html.ictech-pswp-open,
html.ictech-pswp-open body {
	overflow: hidden;
	overscroll-behavior: none;
	touch-action: none;
}

.pswp,
.pswp--open,
.pswp__scroll-wrap,
.pswp__container,
.pswp__item,
.pswp__zoom-wrap {
	touch-action: none !important;
}

/* Always-visible close control. ui.css used to zero .pswp button backgrounds,
   which hid the default-skin sprite; this button does not rely on that sprite. */
.ictech-pswp-close {
	position: fixed !important;
	top: max(12px, env(safe-area-inset-top, 0px)) !important;
	right: max(12px, env(safe-area-inset-right, 0px)) !important;
	left: auto !important;
	z-index: 2147483000 !important;
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	width: 44px !important;
	height: 44px !important;
	min-width: 44px !important;
	min-height: 44px !important;
	padding: 0 !important;
	margin: 0 !important;
	border: 2px solid rgba(255, 255, 255, 0.95) !important;
	border-radius: 999px !important;
	background: rgba(15, 15, 15, 0.82) !important;
	background-image: none !important;
	color: #fff !important;
	font-size: 28px !important;
	font-weight: 500 !important;
	line-height: 1 !important;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35) !important;
	transform: none !important;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}

.ictech-pswp-close span {
	display: block;
	margin-top: -2px;
}

.ictech-pswp-close:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 3px;
}

.ictech-pswp-close[hidden] {
	display: none !important;
}
