/* Container for the main image and zoom lens */
.img-zoom-container {
	position: relative;
	cursor: crosshair;
	/* Indicate interactivity */
	width: 400px;
	/* Example fixed width for the main image */
	height: 400px;
	/* Example fixed height for the main image */
	overflow: hidden;
	/* Crucial to hide parts of the lens that go outside */
	border-radius: 0.5rem;
	/* rounded-lg */
	box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
	/* shadow-xl */
}

/* The main product image */
.img-zoom-container img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	/* Ensures image covers the container */
	border-radius: 0.5rem;
	/* rounded-lg */
	transition: opacity 0.2s ease-in-out;
	/* Smooth transition for hover effects */
	cursor: pointer;
	/* Indicate it's clickable */
}

.img-zoom-container:hover img {
	opacity: 0.8;
	/* Slight dimming on hover */
}

/* The zoom lens (the movable square) */
#img-zoom-lens {
	position: absolute;
	border: 2px solid #6366f1;
	/* Indigo-500 equivalent */
	background-color: rgba(255, 255, 255, 0.3);
	/* Semi-transparent white */
	width: 200px;
	/* Increased size of the lens */
	height: 200px;
	/* Increased size of the lens */
	z-index: 10;
	/* Above the image */
	pointer-events: none;
	/* Allows mouse events to pass through to the underlying image container */
	display: none;
	/* Hidden by default; controlled by JS visibility */
	border-radius: 0.25rem;
	/* rounded-md */
}

/* The magnified image display area */
#img-zoom-result {
	width: 500px;
	/* Fixed size for the magnified view */
	height: 500px;
	/* Fixed size for the magnified view */
	border: 1px solid #e5e7eb;
	/* Gray-200 equivalent */
	background-repeat: no-repeat;

	/* Key change: Use visibility and opacity instead of display */
	visibility: hidden;
	/* Keeps element in document flow, preventing shift */
	opacity: 0;
	/* Makes it transparent */
	transition: opacity 0.2s ease-in-out;
	/* Smooth fade-in/out */
	pointer-events: none;
	/* Prevent interaction when hidden */

	border-radius: 0.5rem;
	/* rounded-lg */
	box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
	/* shadow-xl */
}

/* Make visible when shown by JS */
#img-zoom-result.show {
	visibility: visible;
	opacity: 1;
	pointer-events: auto;
	/* Allow interaction when visible */
}

/* Thumbnail styling */
.thumbnail-img {
	width: 80px;
	/* Fixed width for thumbnails */
	height: 80px;
	/* Fixed height for thumbnails */
	object-fit: cover;
	border-radius: 0.375rem;
	/* rounded-md */
	border: 2px solid transparent;
	/* Default transparent border */
	cursor: pointer;
	transition: border-color 0.2s ease-in-out, transform 0.1s ease-in-out;
}

.thumbnail-img:hover {
	border-color: #6366f1;
	/* Indigo-500 on hover */
	transform: scale(1.05);
}

.thumbnail-img.active {
	border-color: #4f46e5;
	/* Deeper indigo for active thumbnail */
	box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Lightbox modal for full image view */
#full-image-lightbox {
	position: fixed;
	inset: 0;
	background-color: rgba(0, 0, 0, 0.9);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 100;
	/* Higher than other elements */
	transition: opacity 0.3s ease-in-out;
	opacity: 0;
	visibility: hidden;
	/* Start hidden */
	padding: 1rem;
}

#full-image-lightbox.active {
	opacity: 1;
	visibility: visible;
}

#full-image-lightbox-img {
	max-width: 90vw;
	/* Max width 90% of viewport width */
	max-height: 90vh;
	/* Max height 90% of viewport height */
	object-fit: contain;
	border-radius: 0.5rem;
	box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
	/* shadow-2xl */
	transition: transform 0.2s ease-out;
	/* Smooth scale and translate transitions */
	transform-origin: center center;
	/* Set transform origin to center for natural zoom/pan */
}

/* Styles for zoomed/fitted state in full-screen lightbox */
#full-image-lightbox-img.fitted {
	max-width: 90vw;
	max-height: 90vh;
	object-fit: contain;
	width: auto;
	height: auto;
	/* cursor is set by JS now */
}

#full-image-lightbox-img.zoomed {
	max-width: unset;
	max-height: unset;
	width: auto;
	height: auto;
	object-fit: initial;
	cursor: move;
	/* Four-directional arrow for panning */
}

#full-image-lightbox-img.zoomed.dragging {
	cursor: grabbing;
}

.lightbox-nav-btn {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	background-color: rgba(0, 0, 0, 0.5);
	color: white;
	padding: 0.5rem 1rem;
	border-radius: 9999px;
	/* rounded-full */
	font-size: 2.5rem;
	line-height: 1;
	cursor: pointer;
	z-index: 101;
	/* Above the image */
	transition: background-color 0.2s ease;
}

.lightbox-nav-btn:hover {
	background-color: rgba(0, 0, 0, 0.7);
}

.lightbox-nav-btn.left {
	left: 1rem;
}

.lightbox-nav-btn.right {
	right: 1rem;
}

.lightbox-control-btn {
	/* New class for zoom/download/close buttons */
	position: absolute;
	background-color: rgba(0, 0, 0, 0.5);
	color: white;
	padding: 0.75rem;
	border-radius: 9999px;
	/* rounded-full */
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
	z-index: 101;
	transition: background-color 0.2s ease;
}

.lightbox-control-btn:hover {
	background-color: rgba(0, 0, 0, 0.7);
}

/* Positioning for new buttons */
#lightbox-zoom-in {
	top: 1rem;
	left: 1rem;
}

#lightbox-zoom-out {
	top: 1rem;
	left: 5rem;
	/* Adjusted position */
}

#lightbox-download {
	top: 1rem;
	left: 9rem;
	/* Adjusted position */
}

#lightbox-close {
	top: 1rem;
	right: 1rem;
}