/**
 * Ritika PDP Zoom — fullscreen image-zoom overlay.
 */

/* Custom magnifier cursors (matches Jimmy Choo's icon-zoom-pdp-in/out), hotspot
   at the lens centre. SVG data-URI with a native keyword fallback for browsers
   that don't render SVG cursors (desktop Safari). */
:root {
	--rz-cur-in: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgdmlld0JveD0iMCAwIDQwIDQwIj48ZyBmaWxsPSJub25lIiBzdHJva2U9IiNmZmYiIHN0cm9rZS13aWR0aD0iNCIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIj48Y2lyY2xlIGN4PSIxNiIgY3k9IjE2IiByPSIxMSIvPjxsaW5lIHgxPSIyNCIgeTE9IjI0IiB4Mj0iMzUiIHkyPSIzNSIvPjxsaW5lIHgxPSIxNiIgeTE9IjExIiB4Mj0iMTYiIHkyPSIyMSIvPjxsaW5lIHgxPSIxMSIgeTE9IjE2IiB4Mj0iMjEiIHkyPSIxNiIvPjwvZz48ZyBmaWxsPSJub25lIiBzdHJva2U9IiMxMTEiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIj48Y2lyY2xlIGN4PSIxNiIgY3k9IjE2IiByPSIxMSIvPjxsaW5lIHgxPSIyNCIgeTE9IjI0IiB4Mj0iMzUiIHkyPSIzNSIgc3Ryb2tlLXdpZHRoPSIzIi8+PGxpbmUgeDE9IjE2IiB5MT0iMTEiIHgyPSIxNiIgeTI9IjIxIi8+PGxpbmUgeDE9IjExIiB5MT0iMTYiIHgyPSIyMSIgeTI9IjE2Ii8+PC9nPjwvc3ZnPgo=") 16 16;
	--rz-cur-out: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgdmlld0JveD0iMCAwIDQwIDQwIj48ZyBmaWxsPSJub25lIiBzdHJva2U9IiNmZmYiIHN0cm9rZS13aWR0aD0iNCIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIj48Y2lyY2xlIGN4PSIxNiIgY3k9IjE2IiByPSIxMSIvPjxsaW5lIHgxPSIyNCIgeTE9IjI0IiB4Mj0iMzUiIHkyPSIzNSIvPjxsaW5lIHgxPSIxMSIgeTE9IjE2IiB4Mj0iMjEiIHkyPSIxNiIvPjwvZz48ZyBmaWxsPSJub25lIiBzdHJva2U9IiMxMTEiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIj48Y2lyY2xlIGN4PSIxNiIgY3k9IjE2IiByPSIxMSIvPjxsaW5lIHgxPSIyNCIgeTE9IjI0IiB4Mj0iMzUiIHkyPSIzNSIgc3Ryb2tlLXdpZHRoPSIzIi8+PGxpbmUgeDE9IjExIiB5MT0iMTYiIHgyPSIyMSIgeTI9IjE2Ii8+PC9nPjwvc3ZnPgo=") 16 16;
}

/* Lock page scroll while the overlay is open. */
html.rz-open,
html.rz-open body {
	overflow: hidden;
}

/* Neutralise the legacy Porto/elevateZoom hover magnifier and the PhotoSwipe
   `.zoom` popup button — the overlay replaces both. The magnifier flag is also
   turned off server-side, but these guard against any residual DOM (e.g. after
   a color-images gallery swap). */
.zoomContainer,
.zoomWindowContainer,
.zoomWindow,
.zoomLens {
	display: none !important;
}
.product-images .zoom,
.woocommerce-product-gallery .product-images .zoom {
	display: none !important;
}

/* The main product image is now the zoom trigger. */
.woocommerce-product-gallery .product-images .img-thumbnail img {
	cursor: var(--rz-cur-in), zoom-in;
}

/* ── Overlay ─────────────────────────────────────────────────────── */

.rz-overlay {
	position: fixed;
	inset: 0;
	z-index: 100000;
	background: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	overscroll-behavior: contain;
	animation: rz-fade .18s ease;
}
.rz-overlay[hidden] {
	display: none;
}

@keyframes rz-fade {
	from { opacity: 0; }
	to   { opacity: 1; }
}

.rz-stage {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	box-sizing: border-box;
}

/* Fill the viewport at base scale — like Jimmy Choo (height:100vh) — so every
   zoom step magnifies from a full-screen image rather than an inset one. */
.rz-img {
	max-width: 100vw;
	max-height: 100vh;
	will-change: transform;
	transform-origin: center center;
	cursor: var(--rz-cur-in), zoom-in;
	user-select: none;
	-webkit-user-drag: none;
	touch-action: none;
}
/* At max zoom the next click resets — show the zoom-out magnifier. */
.rz-overlay.rz-zoomout .rz-img {
	cursor: var(--rz-cur-out), zoom-out;
}
.rz-overlay.rz-loading .rz-img {
	opacity: .6;
}

/* ── Controls ────────────────────────────────────────────────────── */

.rz-close,
.rz-nav {
	position: absolute;
	z-index: 2;
	border: none;
	background: rgba(255, 255, 255, .85);
	color: #111;
	cursor: pointer;
	line-height: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background .15s ease, opacity .15s ease;
	-webkit-tap-highlight-color: transparent;
}
.rz-close:hover,
.rz-nav:hover {
	background: rgba(0, 0, 0, .06);
}

.rz-close {
	top: 18px;
	right: 18px;
	width: 46px;
	height: 46px;
	border-radius: 50%;
	font-size: 20px;
}

.rz-nav {
	top: 50%;
	transform: translateY(-50%);
	width: 52px;
	height: 52px;
	border-radius: 50%;
	font-size: 34px;
	padding-bottom: 4px;
}
.rz-prev { left: 18px; }
.rz-next { right: 18px; }

.rz-counter {
	position: absolute;
	bottom: 22px;
	left: 50%;
	transform: translateX(-50%);
	z-index: 2;
	font-size: 13px;
	letter-spacing: .04em;
	color: #111;
	background: rgba(255, 255, 255, .85);
	padding: 5px 12px;
	border-radius: 20px;
	pointer-events: none;
}

@media (max-width: 600px) {
	.rz-nav { width: 44px; height: 44px; font-size: 28px; }
	.rz-prev { left: 8px; }
	.rz-next { right: 8px; }
	.rz-close { top: 10px; right: 10px; width: 42px; height: 42px; }
}
