/**
 * Frontend styles for Product Video.
 */

.spv-video-slide,
.spv-video-slide .spv-video-link {
	display: block;
	width: 100%;
	max-width: 100%;
	position: relative;
}

.spv-video-slide > a.spv-video-link {
	pointer-events: none;
}

.spv-video-slide > a.spv-video-link .spv-video-player {
	pointer-events: auto;
}

.spv-video-player {
	position: relative;
	width: 100%;
	max-width: 100%;
	margin: 0 auto;
	overflow: hidden;
	background: #000;
	aspect-ratio: 16 / 9;
	box-sizing: border-box;
}

.spv-video-player[style*="height"] {
	aspect-ratio: auto;
}

.spv-video-player iframe.spv-iframe,
.spv-video-player video.spv-html5-video {
	position: absolute !important;
	top: 0 !important;
	left: 0 !important;
	right: 0 !important;
	bottom: 0 !important;
	width: 100% !important;
	height: 100% !important;
	max-width: 100% !important;
	max-height: 100% !important;
	min-width: 0 !important;
	min-height: 0 !important;
	border: 0 !important;
	display: block;
	object-fit: contain;
}

/* Hidden placeholder for WooCommerce PhotoSwipe indexing */
.spv-pswp-placeholder,
.visually-hidden.spv-pswp-placeholder {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
	opacity: 0 !important;
	pointer-events: none !important;
}

.spv-play-badge {
	position: absolute;
	left: 50%;
	top: 50%;
	width: 40px;
	height: 40px;
	margin: -20px 0 0 -20px;
	border-radius: 50%;
	background: #e11d2e;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
	z-index: 2;
	pointer-events: none;
}

.spv-play-badge::before {
	content: "";
	position: absolute;
	left: 15px;
	top: 11px;
	border-style: solid;
	border-width: 9px 0 9px 14px;
	border-color: transparent transparent transparent #fff;
}

.product-thumbnails .col.first.spv-thumb-video,
.product-thumbnails .first.spv-thumb-video {
	position: relative;
}

.product-thumbnails .spv-thumb-video a {
	position: relative;
	display: block;
}

.product-thumbnails .spv-thumb-video .spv-play-badge {
	width: 28px;
	height: 28px;
	margin: -14px 0 0 -14px;
}

.product-thumbnails .spv-thumb-video .spv-play-badge::before {
	left: 10px;
	top: 7px;
	border-width: 7px 0 7px 11px;
}

.spv-shop-video-thumb {
    display: block;
    overflow: hidden;
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100% !important;
    object-fit: cover;
}

.spv-shop-video-thumb img {
	display: block;
	width: 100%;
	height: auto;
}

.spv-shop-video {
	position: relative;
	display: block;
	width: 100%;
	max-width: 100%;
	background: #000;
	aspect-ratio: 16 / 9;
	overflow: hidden;
}

.spv-shop-video iframe,
.spv-shop-video video {
	position: absolute;
	inset: 0;
	width: 100% !important;
	height: 100% !important;
	display: block;
	border: 0;
}

/* PhotoSwipe HTML video slide — center in viewport */
.pswp__item .pswp__zoom-wrap:has(.spv-pswp-video-wrap),
.pswp__item.spv-pswp-item--video .pswp__zoom-wrap {
	position: absolute !important;
	top: 0 !important;
	left: 0 !important;
	width: 100% !important;
	height: 100% !important;
	transform: none !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
}

.pswp__zoom-wrap .spv-pswp-video-wrap,
.pswp .spv-pswp-video-wrap,
.spv-pswp-video-wrap {
	position: relative !important;
	top: auto !important;
	left: auto !important;
	transform: none !important;
	width: min(900px, 92vw);
	max-width: 92vw;
	max-height: 85vh;
	margin: 0 auto;
	background: #000;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	flex-shrink: 0;
}

.spv-pswp-video-wrap iframe,
.spv-pswp-video-wrap video {
	position: absolute;
	inset: 0;
	width: 100% !important;
	height: 100% !important;
	border: 0;
	display: block;
	background: #000;
}

.mfp-content .spv-inline-lightbox,
.spv-mfp-video-wrap {
	max-width: 900px;
	margin: 0 auto;
	background: #000;
}

.mfp-content .spv-inline-lightbox video,
.spv-mfp-video-wrap iframe,
.spv-mfp-video-wrap video {
	width: 100%;
	height: auto;
	min-height: 50vh;
	display: block;
	border: 0;
}

.mfp-iframe-holder .mfp-content {
	max-width: 900px;
	line-height: 0;
}

.spv-inline-lightbox {
	max-width: 900px;
	margin: 20px auto;
}
