/**
 * Productgalerij-lightbox in huisstijl (zwart met oranje accenten).
 * Vervangt de PhotoSwipe-overlay van WooCommerce, die achter de
 * pagina-inhoud terechtkwam.
 */

.ml-lightbox {
	position: fixed;
	inset: 0;
	z-index: 2147483000;
	display: flex;
	flex-direction: column;
	background: rgba(0, 0, 0, 0.45);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.22s ease, visibility 0.22s ease;
}

.ml-lightbox.is-open {
	opacity: 1;
	visibility: visible;
}

.ml-lightbox__stage {
	position: relative;
	flex: 1 1 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 0;
	padding: 72px 88px 16px;
}

.ml-lightbox__figure {
	margin: 0;
	max-width: 100%;
	max-height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
}

.ml-lightbox__img {
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
	border-radius: 6px;
	background: #fff;
	opacity: 0;
	transform: scale(0.985);
	transition: opacity 0.2s ease, transform 0.2s ease;
}

.ml-lightbox__img.is-ready {
	opacity: 1;
	transform: none;
}

/* Bovenbalk: teller links, sluiten rechts */
.ml-lightbox__bar {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 18px 22px;
}

/* Het kruisje staat altijd rechtsboven, ook als de teller ontbreekt
   (bij een product met maar een foto). */
.ml-lightbox__close {
	margin-left: auto;
}

.ml-lightbox__counter {
	margin: 0;
	padding: 7px 14px;
	border-radius: 999px;
	background: rgba(0, 0, 0, 0.45);
	font-size: 14px;
	font-weight: 600;
	color: rgba(255, 255, 255, 0.85);
	letter-spacing: 0.02em;
}

.ml-lightbox__counter:empty {
	display: none;
}

.ml-lightbox__counter em {
	font-style: normal;
	color: var(--ml-orange, #ff6600);
}

/* Knoppen */
.ml-lightbox__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 46px;
	height: 46px;
	padding: 0;
	border: 1px solid rgba(255, 255, 255, 0.22);
	border-radius: 50%;
	/* Donkere vulling: de knoppen liggen op smallere schermen deels over de
	   foto, dus ze moeten ook op een lichte afbeelding leesbaar blijven. */
	background: rgba(0, 0, 0, 0.5);
	color: #fff;
	cursor: pointer;
	transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.12s ease;
}

.ml-lightbox__btn svg {
	width: 20px;
	height: 20px;
	display: block;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.ml-lightbox__btn:hover,
.ml-lightbox__btn:focus-visible {
	background: var(--ml-orange, #ff6600);
	border-color: var(--ml-orange, #ff6600);
	color: #fff;
	outline: none;
}

.ml-lightbox__btn:active {
	transform: scale(0.95);
}

.ml-lightbox__btn[hidden] {
	display: none;
}

.ml-lightbox__nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 52px;
	height: 52px;
}

.ml-lightbox__nav:active {
	transform: translateY(-50%) scale(0.95);
}

.ml-lightbox__nav--prev {
	left: 20px;
}

.ml-lightbox__nav--next {
	right: 20px;
}

/* Onderrand: bijschrift en thumbnails */
.ml-lightbox__foot {
	flex: 0 0 auto;
	padding: 0 22px 22px;
	text-align: center;
}

.ml-lightbox__caption {
	margin: 0 auto 14px;
	max-width: 640px;
	font-size: 14px;
	line-height: 1.5;
	color: #fff;
	text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

.ml-lightbox__caption:empty {
	display: none;
}

.ml-lightbox__thumbs {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	gap: 10px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.ml-lightbox__thumbs[hidden] {
	display: none;
}

.ml-lightbox__thumb {
	width: 62px;
	height: 62px;
	padding: 0;
	border: 2px solid transparent;
	border-radius: 6px;
	background: rgba(255, 255, 255, 0.08);
	overflow: hidden;
	cursor: pointer;
	opacity: 0.6;
	transition: opacity 0.18s ease, border-color 0.18s ease;
}

.ml-lightbox__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.ml-lightbox__thumb:hover,
.ml-lightbox__thumb:focus-visible {
	opacity: 1;
	outline: none;
}

.ml-lightbox__thumb.is-active {
	opacity: 1;
	border-color: var(--ml-orange, #ff6600);
}

/* Scrollen achter de overlay blokkeren */
html.ml-lightbox-open,
body.ml-lightbox-open {
	overflow: hidden !important;
}

@media (max-width: 782px) {
	.ml-lightbox__stage {
		padding: 66px 14px 10px;
	}
	.ml-lightbox__nav {
		width: 44px;
		height: 44px;
	}
	.ml-lightbox__nav--prev {
		left: 8px;
	}
	.ml-lightbox__nav--next {
		right: 8px;
	}
	.ml-lightbox__nav {
		background: rgba(0, 0, 0, 0.62);
	}
	.ml-lightbox__thumb {
		width: 50px;
		height: 50px;
	}
}
