/* PSJB Productgalerij: zelfde look als de vorige galerij (zwart/wit, thumbnails gesluierd). */

.psjb-pg {
	--psjb-pg-h: 400px;
	--psjb-pg-gap: 6px;
	--psjb-pg-btn: #000;
	--psjb-pg-btn-fg: #fff;
	--psjb-pg-veil: rgba(255, 255, 255, 0.54);
	position: relative;
}

@media (max-width: 767px) {
	.psjb-pg {
		--psjb-pg-h: 320px;
	}
}

/* Zelfde breedte als de oude galerij (thema: .woocommerce-product-gallery 50%). */
@media (min-width: 768px) {
	.single-product div.product .psjb-pg.images {
		width: 50%;
	}
}

.psjb-pg ul,
.psjb-pg li {
	margin: 0;
	padding: 0;
	list-style: none;
}

/* ---------- Hoofdafbeelding ---------- */

.psjb-pg__stage {
	position: relative;
}

.psjb-pg__viewport {
	position: relative;
	overflow: hidden;
	touch-action: pan-y pinch-zoom;
	cursor: zoom-in;
}

.psjb-pg--empty .psjb-pg__viewport {
	cursor: default;
}

.psjb-pg__track {
	display: flex;
	will-change: transform;
}

.psjb-pg__slide {
	flex: 0 0 100%;
	min-width: 0;
}

.single-product div.product .psjb-pg .psjb-pg__slide img,
.psjb-pg .psjb-pg__slide img {
	display: block;
	width: 100%;
	height: var(--psjb-pg-h);
	max-width: none;
	margin: 0;
	object-fit: contain;
	object-position: top center;
	user-select: none;
	-webkit-user-drag: none;
}

/* Zoom bij aanwijzen: grote afbeelding over het kader heen. */
.psjb-pg__zoom {
	position: absolute;
	inset: 0;
	z-index: 2;
	background-color: #fff;
	background-repeat: no-repeat;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.15s ease;
}

.psjb-pg__zoom.is-on {
	opacity: 1;
}

/* Vergrootglas (opent de lightbox). */
.psjb-pg__open {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 4;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: var(--psjb-pg-btn);
	color: var(--psjb-pg-btn-fg);
	cursor: pointer;
}

/* Pijlen op de hoofdafbeelding. */
.psjb-pg__arrow {
	position: absolute;
	top: calc(var(--psjb-pg-h) / 2);
	z-index: 3;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	margin: -18px 0 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: var(--psjb-pg-btn);
	color: var(--psjb-pg-btn-fg);
	cursor: pointer;
	transition: opacity 0.2s ease, transform 0.2s ease;
}

.psjb-pg__arrow--prev {
	left: 0;
}

.psjb-pg__arrow--next {
	right: 0;
}

.psjb-pg__arrow:disabled {
	opacity: 0 !important;
	pointer-events: none;
}

/* Desktop: pijlen verschijnen bij aanwijzen (zoals voorheen). */
@media (hover: hover) and (pointer: fine) {
	.psjb-pg__arrow {
		opacity: 0;
	}

	.psjb-pg__arrow--prev {
		transform: translateX(-6px);
	}

	.psjb-pg__arrow--next {
		transform: translateX(6px);
	}

	.psjb-pg__stage:hover .psjb-pg__arrow,
	.psjb-pg__arrow:focus-visible {
		opacity: 1;
		transform: none;
	}
}

.psjb-pg button:focus-visible {
	outline: 2px solid #000;
	outline-offset: 2px;
	box-shadow: 0 0 0 4px #fff;
}

/* ---------- Thumbnails ---------- */

.psjb-pg__thumbs {
	position: relative;
	margin-top: var(--psjb-pg-gap);
}

.psjb-pg__tviewport {
	position: relative;
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
}

.psjb-pg__tviewport::-webkit-scrollbar {
	display: none;
}

.psjb-pg__ttrack {
	display: flex;
	gap: var(--psjb-pg-gap);
}

.psjb-pg .psjb-pg__ttrack > li {
	flex: 0 0 calc((100% - 3 * var(--psjb-pg-gap)) / 4);
	scroll-snap-align: start;
}

.psjb-pg__thumb {
	position: relative;
	display: block;
	width: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: none;
	cursor: pointer;
}

.single-product div.product .psjb-pg .psjb-pg__thumb img,
.psjb-pg .psjb-pg__thumb img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 1 / 1;
	margin: 0;
	object-fit: cover;
}

/* Niet-actieve thumbnails wit gesluierd. */
.psjb-pg__thumb::after {
	position: absolute;
	inset: 0;
	background: var(--psjb-pg-veil);
	content: "";
	transition: opacity 0.2s ease;
}

.psjb-pg__thumb.is-active::after,
.psjb-pg__thumb:hover::after {
	opacity: 0;
}

.psjb-pg__tarrow {
	position: absolute;
	top: 0;
	bottom: 0;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: var(--psjb-pg-btn);
	color: var(--psjb-pg-btn-fg);
	cursor: pointer;
}

.psjb-pg__tarrow[hidden] {
	display: none;
}

.psjb-pg__tarrow--prev {
	left: 0;
}

.psjb-pg__tarrow--next {
	right: 0;
}

/* ---------- Lightbox ---------- */

.psjb-pg-lock,
.psjb-pg-lock body {
	overflow: hidden;
}

.psjb-pg-lb {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: grid;
	grid-template-rows: auto 1fr auto auto;
	background: rgba(10, 0, 0, 0.82);
	color: #fff;
	opacity: 0;
	transition: opacity 0.2s ease;
}

.psjb-pg-lb[hidden] {
	display: none;
}

.psjb-pg-lb.is-open {
	opacity: 1;
}

.psjb-pg-lb__bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 8px 8px 8px 16px;
	font-size: 14px;
	font-variant-numeric: tabular-nums;
	letter-spacing: 0.02em;
}

.psjb-pg-lb__tools {
	display: flex;
	gap: 4px;
}

.psjb-pg-lb__btn,
.psjb-pg-lb__nav {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: rgba(30, 30, 30, 0.6);
	color: #fff;
	cursor: pointer;
}

.psjb-pg-lb__btn:hover,
.psjb-pg-lb__nav:hover {
	background: rgba(30, 30, 30, 0.9);
}

.psjb-pg-lb__btn[aria-pressed="true"] {
	background: #fff;
	color: #000;
}

.psjb-pg-lb button:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

.psjb-pg-lb__stage {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 0;
	padding: 0 0 16px;
	overflow: hidden;
	touch-action: none;
}

.psjb-pg-lb__img {
	display: block;
	max-width: calc(100vw - 120px);
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
	transform-origin: center center;
	cursor: zoom-in;
	user-select: none;
	-webkit-user-drag: none;
	transition: opacity 0.15s ease;
}

.psjb-pg-lb.is-zoomed .psjb-pg-lb__img {
	cursor: grab;
}

.psjb-pg-lb__img.is-hidden {
	opacity: 0;
}

.psjb-pg-lb__nav {
	position: absolute;
	top: 50%;
	margin-top: -22px;
}

.psjb-pg-lb__nav--prev {
	left: 8px;
}

.psjb-pg-lb__nav--next {
	right: 8px;
}

.psjb-pg-lb__nav:disabled,
.psjb-pg-lb.is-single .psjb-pg-lb__nav,
.psjb-pg-lb.is-single [data-lb="thumbs"],
.psjb-pg-lb.is-single .psjb-pg-lb__count {
	visibility: hidden;
}

.psjb-pg-lb__caption {
	margin: 0;
	padding: 8px 16px 12px;
	font-size: 14px;
	line-height: 1.4;
	text-align: center;
}

.psjb-pg-lb__caption[hidden] {
	display: none;
}

.psjb-pg-lb__thumbs {
	padding: 0 8px 10px;
	overflow-x: auto;
	scrollbar-width: thin;
}

.psjb-pg-lb__thumbs[hidden] {
	display: none;
}

.psjb-pg-lb__thumbs ul {
	display: flex;
	justify-content: center;
	gap: 6px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.psjb-pg-lb__thumbs li {
	flex: 0 0 64px;
	margin: 0;
	list-style: none;
}

.psjb-pg-lb__thumbs button {
	display: block;
	width: 64px;
	margin: 0;
	padding: 0;
	border: 2px solid transparent;
	border-radius: 0;
	background: none;
	opacity: 0.55;
	cursor: pointer;
}

.psjb-pg-lb__thumbs button.is-active,
.psjb-pg-lb__thumbs button:hover {
	border-color: #fff;
	opacity: 1;
}

.psjb-pg-lb__thumbs img {
	display: block;
	width: 100%;
	aspect-ratio: 1 / 1;
	object-fit: cover;
}

@media (max-width: 767px) {
	.psjb-pg-lb__img {
		max-width: 100vw;
	}

	.psjb-pg-lb__nav {
		width: 38px;
		height: 38px;
		margin-top: -19px;
		background: rgba(30, 30, 30, 0.45);
	}

	.psjb-pg-lb__thumbs ul {
		justify-content: flex-start;
	}
}

@media (prefers-reduced-motion: reduce) {
	.psjb-pg__arrow,
	.psjb-pg__zoom,
	.psjb-pg__thumb::after,
	.psjb-pg-lb,
	.psjb-pg-lb__img {
		transition: none;
	}
}
