/**
 * Fullscreen gallery lightbox for variable products (konte-child).
 *
 * Layout: vertical thumbnail column on the left, active image in the main
 * stage, thin close button top-right, position counter bottom-centre.
 * Matches the supplied Ralph Lauren-style reference.
 */

/* Lock background scroll while the lightbox is open. */
body.kvl-open {
	overflow: hidden;
}

.kvl-overlay {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	background: #ffffff;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.25s ease, visibility 0s linear 0.25s;
}

.kvl-overlay.is-active {
	opacity: 1;
	visibility: visible;
	transition: opacity 0.25s ease;
}

/* Left thumbnail rail ---------------------------------------------------- */
.kvl-thumbs {
	flex: 0 0 96px;
	width: 96px;
	max-height: 100%;
	overflow-y: auto;
	overflow-x: hidden;
	padding: 24px 8px 24px 16px;
	box-sizing: border-box;
	scrollbar-width: thin;
	scrollbar-color: rgba(0, 0, 0, 0.35) transparent;
}

.kvl-thumb {
	display: block;
	width: 64px;
	margin: 0 0 12px;
	padding: 0;
	border: 1px solid transparent;
	background: none;
	cursor: pointer;
	border-radius: 2px;
	overflow: hidden;
	transition: border-color 0.2s ease, opacity 0.2s ease;
	opacity: 0.7;
}

.kvl-thumb:last-child {
	margin-bottom: 0;
}

.kvl-thumb img {
	display: block;
	width: 100%;
	height: auto;
}

.kvl-thumb:hover,
.kvl-thumb:focus-visible {
	opacity: 1;
	outline: none;
}

.kvl-thumb.is-active {
	opacity: 1;
	border-color: #161619;
}

/* Main stage ------------------------------------------------------------- */
.kvl-stage {
	position: relative;
	flex: 1 1 auto;
	min-width: 0;
	overflow-y: auto;
	overflow-x: hidden;
	scroll-behavior: smooth;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior: contain;
	scrollbar-width: thin;
	scrollbar-color: rgba(0, 0, 0, 0.35) transparent;
}

.kvl-stage::-webkit-scrollbar {
	width: 6px;
}

.kvl-stage::-webkit-scrollbar-thumb {
	background: rgba(0, 0, 0, 0.3);
	border-radius: 4px;
}

.kvl-stage::-webkit-scrollbar-track {
	background: transparent;
}

.kvl-stage-inner {
	display: flex;
	justify-content: center;
	align-items: flex-start;
	min-height: 100%;
	padding: 24px 24px 64px;
	box-sizing: border-box;
}

.kvl-main-img {
	display: block;
	max-width: min(820px, 92%);
	width: auto;
	height: auto;
	margin: 0 auto;
	opacity: 1;
	transition: opacity 0.3s ease, transform 0.35s ease;
	transform-origin: center center;
	/* Zoom-in magnifier cursor (matches existing inline-grid zoom cursor). */
	cursor: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2724%27 height=%2724%27 viewBox=%270%200%2024%2024%27%3E%3Ccircle cx=%2710%27 cy=%2710%27 r=%276.5%27 fill=%27white%27 fill-opacity=%270.9%27 stroke=%27%23161619%27 stroke-width=%271.5%27/%3E%3Cpath d=%27M10%207v6M7%2010h6%27 stroke=%27%23161619%27 stroke-width=%271.5%27 stroke-linecap=%27round%27/%3E%3Cpath d=%27M15.2%2015.2L20%2020%27 stroke=%27%23161619%27 stroke-width=%271.5%27 stroke-linecap=%27round%27/%3E%3C/svg%3E") 12 12, zoom-in;
	-webkit-user-drag: none;
	user-select: none;
}

.kvl-main-img.is-fading {
	opacity: 0;
}

.kvl-main-img.is-zoomed {
	max-width: none;
	transform: scale(1.6);
	cursor: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2724%27 height=%2724%27 viewBox=%270%200%2024%2024%27%3E%3Ccircle cx=%2710%27 cy=%2710%27 r=%276.5%27 fill=%27white%27 fill-opacity=%270.9%27 stroke=%27%23161619%27 stroke-width=%271.5%27/%3E%3Cpath d=%27M7%2010h6%27 stroke=%27%23161619%27 stroke-width=%271.5%27 stroke-linecap=%27round%27/%3E%3Cpath d=%27M15.2%2015.2L20%2020%27 stroke=%27%23161619%27 stroke-width=%271.5%27 stroke-linecap=%27round%27/%3E%3C/svg%3E") 12 12, zoom-out;
}

/* Close button (thin X, top-right) -------------------------------------- */
.kvl-close {
	position: absolute;
	top: 18px;
	right: 22px;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	background: none;
	color: #161619;
	font-size: 26px;
	line-height: 40px;
	text-align: center;
	cursor: pointer;
	z-index: 3;
	transition: opacity 0.2s ease;
	opacity: 0.85;
}

.kvl-close:hover,
.kvl-close:focus-visible {
	opacity: 1;
	outline: none;
}

/* Position counter (bottom-centre) -------------------------------------- */
.kvl-counter {
	position: absolute;
	left: 50%;
	bottom: 22px;
	transform: translateX(-50%);
	z-index: 3;
	font-size: 13px;
	letter-spacing: 0.04em;
	color: #161619;
	background: rgba(255, 255, 255, 0.85);
	padding: 6px 14px;
	border-radius: 999px;
	pointer-events: none;
}

/* Responsive ------------------------------------------------------------- */
@media (max-width: 767px) {
	.kvl-thumbs {
		flex-basis: 64px;
		width: 64px;
		padding: 16px 6px;
	}

	.kvl-thumb {
		width: 48px;
	}

	.kvl-stage-inner {
		padding: 16px 12px 56px;
	}

	.kvl-main-img {
		max-width: 96%;
	}

	.kvl-close {
		top: 10px;
		right: 12px;
	}
}

/* Respect reduced-motion preferences. */
@media (prefers-reduced-motion: reduce) {
	.kvl-overlay,
	.kvl-main-img,
	.kvl-stage {
		transition: none;
		scroll-behavior: auto;
	}
}
