/*
 * su-product-zoom package
 * Click the element marked data-su-product-zoom-main to open a fullscreen
 * popup gallery built from data-su-product-zoom-gallery a[href] links.
 * There is no prev/next stepping by design: every image is already
 * reachable directly from the product detail page, so the popup only
 * needs a close button and a thumbnail strip to jump between images.
 * See: su-product-zoom-guide.md for integration steps.
 */
[data-su-product-zoom-main] {
	cursor: pointer;
}

.su-product-zoom-overlay {
	display: flex;
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	/* CUSTOMIZE: overlay background color/opacity. rgba(0, 0, 0, 0.85) = black at 85% opacity */
	background: rgba(0, 0, 0, 0.85);
	z-index: 9999;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 16px;
	box-sizing: border-box;
	visibility: hidden;
	opacity: 0;
	pointer-events: none;
	/* CUSTOMIZE: fade duration. Set both to 0s to remove the fade entirely */
	transition: opacity 0.2s ease, visibility 0s linear 0.2s;
}
.su-product-zoom-overlay.is-open {
	visibility: visible;
	opacity: 1;
	pointer-events: auto;
	transition: opacity 0.2s ease, visibility 0s linear 0s;
}

/* the image lives in a "stage" that flexes to fill whatever space is left
   after the thumbnail strip, so the image always fits on screen no matter
   how large the source file is */
.su-product-zoom-stage {
	flex: 1 1 auto;
	min-height: 0;
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
}
.su-product-zoom-img {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
}
.su-product-zoom-close {
	position: absolute;
	top: 16px;
	right: 16px;
	background: none;
	border: none;
	cursor: pointer;
	color: #fff;
	font-size: 32px;
	line-height: 1;
	padding: 12px;
	opacity: 0.75;
	transition: opacity 0.2s ease;
	/* dark halo so the white glyph stays visible over light/white product photos */
	text-shadow:
		0 0 6px rgba(0, 0, 0, 0.85),
		0 0 14px rgba(0, 0, 0, 0.6);
}
.su-product-zoom-close:hover {
	opacity: 1;
}
.su-product-zoom-overlay.is-single .su-product-zoom-thumbs {
	display: none;
}

/* a real flex sibling of the stage (not an overlay pinned to the viewport
   edge), so there is always a guaranteed gap between it and the image
   regardless of image size or viewport height */
.su-product-zoom-thumbs {
	flex: 0 0 auto;
	margin-top: 20px;
	max-width: 100%;
	display: flex;
	justify-content: center;
	gap: 8px;
	overflow-x: auto;
}
/* many images: centering + overflow-x can trap the scroll start in some
   browsers, so switch to a plain left-to-right scrolling row instead */
.su-product-zoom-thumbs.is-overflowing {
	justify-content: flex-start;
}
.su-product-zoom-thumb {
	flex: 0 0 auto;
	width: 48px;
	height: 48px;
	padding: 0;
	border: 2px solid transparent;
	background: rgba(255, 255, 255, 0.15);
	cursor: pointer;
	opacity: 0.7;
	transition: opacity 0.2s ease, border-color 0.2s ease;
}
.su-product-zoom-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
.su-product-zoom-thumb:hover {
	opacity: 1;
}
.su-product-zoom-thumb.is-active {
	opacity: 1;
	border-color: #fff;
}

@media (max-width: 767px) {
	.su-product-zoom-close {
		font-size: 26px;
		padding: 10px;
	}
	.su-product-zoom-thumb {
		width: 40px;
		height: 40px;
	}
	.su-product-zoom-thumbs {
		margin-top: 12px;
	}
}
