/* ─────────────────────────────────────────────────────────────────────────
   VDS — Single Product Media
   Inline gallery: thumbs (verticale Swiper, 4 zichtbaar) links + hoofdfoto rechts.
   Popup: lightbox met thumbs-grid links en grote afbeelding/video rechts.
   ───────────────────────────────────────────────────────────────────────── */

/* ─── Inline gallery ──────────────────────────────────────────────────── */

.vds-spm {
	display: flex;
	gap: 12px;
	align-items: flex-start;
	opacity: 0;
	transition: opacity .25s ease-in-out;
}

.vds-spm.vds-spm--ready {
	opacity: 1;
}

/* Thumbs kolom (verticaal). */
.vds-spm__thumbs {
	width: 80px;
	flex: 0 0 80px;
	height: auto;
	max-height: 100%;
	align-self: stretch;
}

.vds-spm__thumbs .swiper-wrapper {
	height: 100%;
}

.vds-spm__thumb {
	position: relative;
	aspect-ratio: 1 / 1;
	height: auto !important; /* override Swiper default voor vertical */
	background: #f7f7f7;
	border: 2px solid transparent;
	cursor: pointer;
	overflow: hidden;
	transition: border-color .15s ease-in-out;
}

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

.vds-spm__thumb.swiper-slide-thumb-active {
	border-color: #222;
}

.vds-spm__thumb:hover {
	border-color: #999;
}

/* Hoofd-swiper. */
.vds-spm__main {
	flex: 1 1 auto;
	min-width: 0;
	position: relative;
}

.vds-spm__main-slide {
	position: relative;
	background: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: zoom-in;
}

.vds-spm__main-slide img {
	width: 100%;
	height: auto;
	display: block;
	max-height: 80vh;
	object-fit: contain;
}

/* Nav-knoppen. */
.vds-spm__nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: rgba(255, 255, 255, .9);
	border: 1px solid rgba(0, 0, 0, .1);
	cursor: pointer;
	z-index: 5;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background .15s ease;
}

.vds-spm__nav:hover {
	background: #fff;
}

.vds-spm__nav.swiper-button-disabled {
	opacity: .35;
	cursor: default;
}

.vds-spm__nav--prev { left: 10px; }
.vds-spm__nav--next { right: 10px; }

.vds-spm__nav::before {
	content: "";
	display: block;
	width: 10px;
	height: 10px;
	border-top: 2px solid #222;
	border-right: 2px solid #222;
}

.vds-spm__nav--prev::before { transform: rotate(-135deg); margin-left: 3px; }
.vds-spm__nav--next::before { transform: rotate(45deg); margin-right: 3px; }

/* Play icon (video slides). */
.vds-spm__play-icon {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: rgba(0, 0, 0, .6);
	pointer-events: none;
}

.vds-spm__play-icon::before {
	content: "";
	position: absolute;
	top: 50%;
	left: 55%;
	transform: translate(-50%, -50%);
	width: 0;
	height: 0;
	border-left: 8px solid #fff;
	border-top: 6px solid transparent;
	border-bottom: 6px solid transparent;
}

.vds-spm__play-icon--main {
	width: 64px;
	height: 64px;
}

.vds-spm__play-icon--main::before {
	border-left-width: 18px;
	border-top-width: 12px;
	border-bottom-width: 12px;
}


/* ─── Mobile: stacked, hoofdfoto boven, thumbs horizontaal eronder ───── */

@media (max-width: 768px) {

	.vds-spm {
		flex-direction: column-reverse;
		gap: 8px;
	}

	.vds-spm__thumbs {
		width: 100%;
		flex: 0 0 auto;
		height: 70px;
	}

	.vds-spm__thumbs .swiper-slide {
		width: 70px !important;
		height: 70px !important;
	}

	.vds-spm__main-slide img {
		max-height: 60vh;
	}
}


/* ─── Popup ───────────────────────────────────────────────────────────── */

.vds-spm-popup {
	position: fixed;
	inset: 0;
	z-index: 99999;
	background: rgba(0, 0, 0, .55);
	display: none;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.vds-spm-popup--open {
	display: flex;
}

.vds-spm-popup__inner {
	background: #fff;
	border-radius: 10px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, .25);
	width: 100%;
	max-width: 1200px;
	max-height: 95vh;
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.vds-spm-popup__header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 16px;
	padding: 18px 22px;
	border-bottom: 1px solid #eee;
}

.vds-spm-popup__title {
	margin: 0;
	font-size: 18px;
	font-weight: 600;
	line-height: 1.35;
	flex: 1 1 auto;
}

.vds-spm-popup__close {
	background: none;
	border: 0;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
	color: #444;
	padding: 0 4px;
	flex: 0 0 auto;
}

.vds-spm-popup__close:hover {
	color: #000;
}

.vds-spm-popup__body {
	display: flex;
	flex: 1 1 auto;
	min-height: 0;
	overflow: hidden;
}

/* Thumbs: 2-koloms grid, scrollbaar verticaal. */
.vds-spm-popup__thumbs {
	flex: 0 0 220px;
	padding: 18px;
	overflow-y: auto;
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 8px;
	align-content: start;
	border-right: 1px solid #f0f0f0;
}

.vds-spm-popup__thumb {
	position: relative;
	aspect-ratio: 1 / 1;
	background: #f7f7f7;
	border: 2px solid transparent;
	cursor: pointer;
	padding: 0;
	overflow: hidden;
	transition: border-color .15s ease-in-out;
}

.vds-spm-popup__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.vds-spm-popup__thumb--active {
	border-color: #222;
}

.vds-spm-popup__thumb:hover {
	border-color: #999;
}

/* Hoofd-media area. */
.vds-spm-popup__main {
	flex: 1 1 auto;
	padding: 24px;
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 0;
	overflow: hidden;
}

.vds-spm-popup__media {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
}

.vds-spm-popup__media-img,
.vds-spm-popup__media video,
.vds-spm-popup__media iframe {
	max-width: 80%;
	max-height: 70vh;
	width: auto;
	height: auto;
	display: block;
	object-fit: contain;
}

.vds-spm-popup__media video,
.vds-spm-popup__media iframe {
	width: 80%;
	aspect-ratio: 16 / 9;
	max-height: 70vh;
}

.vds-spm-popup__footer {
	padding: 16px 22px;
	border-top: 1px solid #eee;
	display: flex;
	justify-content: flex-end;
}

.vds-spm-popup__add-to-cart {
	background: #5cb85c;
	color: #fff;
	border: 0;
	padding: 12px 24px;
	border-radius: 6px;
	font-weight: 600;
	cursor: pointer;
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	gap: 8px;
}

.vds-spm-popup__add-to-cart:hover {
	background: #4cae4c;
	color: #fff;
}


/* ─── Popup mobile: stack — hoofdfoto boven, thumbs eronder, knop helemaal onder ─── */

@media (max-width: 768px) {

	.vds-spm-popup {
		padding: 0;
	}

	.vds-spm-popup__inner {
		max-width: 100%;
		max-height: 100vh;
		border-radius: 0;
	}

	.vds-spm-popup__body {
		flex-direction: column;
	}

	.vds-spm-popup__main {
		order: 1;
		padding: 16px;
		flex: 1 1 auto;
	}

	.vds-spm-popup__thumbs {
		order: 2;
		flex: 0 0 auto;
		display: flex;
		flex-direction: row;
		overflow-x: auto;
		overflow-y: hidden;
		padding: 12px 16px;
		gap: 8px;
		border-right: 0;
		border-top: 1px solid #f0f0f0;
	}

	.vds-spm-popup__thumb {
		flex: 0 0 70px;
		aspect-ratio: 1 / 1;
	}

	.vds-spm-popup__media-img,
	.vds-spm-popup__media video,
	.vds-spm-popup__media iframe {
		max-width: 100%;
		max-height: 50vh;
		width: 100%;
	}

	.vds-spm-popup__footer {
		padding: 12px 16px;
	}

	.vds-spm-popup__add-to-cart {
		width: 100%;
		justify-content: center;
	}
}


/* Lock body scroll wanneer popup open is. */
body.vds-spm-popup-open {
	overflow: hidden;
}
