/* SUPO Product Video Gallery - frontend styles */

/*
 * Thumb strip items are injected by the PHP filter into Flatsome's
 * own `.product-thumbnails.slider` container (we use the class
 * `.supo-pvg-thumb-video` to mark them). The styling below works
 * alongside Flatsome's existing Flickity thumb styles.
 */
.supo-pvg-thumb-video {
	position: relative;
}
.supo-pvg-thumb-video a {
	display: block;
	position: relative;
}
.supo-pvg-thumb-play {
	position: absolute;
	left: 50%;
	top: 50%;
	width: 28px;
	height: 28px;
	margin: -14px 0 0 -14px;
	background: rgba(0, 0, 0, 0.55);
	border-radius: 50%;
	display: block;
	pointer-events: none;
}
.supo-pvg-thumb-play::after {
	content: '';
	position: absolute;
	left: 50%;
	top: 50%;
	width: 0;
	height: 0;
	margin: -6px 0 0 -3px;
	border-left: 9px solid #fff;
	border-top: 6px solid transparent;
	border-bottom: 6px solid transparent;
}

/*
 * Main slider video slide.
 * - Frame is 16:9 by default and absolutely positioned so Flickity can
 *   place it inside the slider.
 * - Poster overlay is visible by default and shows the play button.
 * - Video and iframe are hidden until the user clicks play. JS toggles
 *   a `.supo-pvg-playing` class on the slide to reveal them; we don't
 *   rely on `[src]` attribute selectors because <iframe src="about:blank">
 *   is set from the start, which would re-trigger display prematurely.
 */
.supo-pvg-slide {
	width: 100%;
}
.supo-pvg-slide .supo-pvg-frame {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	background: #000;
	overflow: hidden;
	border-radius: 6px;
}

.supo-pvg-slide .supo-pvg-poster {
	position: absolute;
	inset: 0;
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	background-color: #111;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
}

.supo-pvg-slide .supo-pvg-play {
	width: 72px;
	height: 72px;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.55);
	border: 2px solid rgba(255, 255, 255, 0.85);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: transform .2s ease, background .2s ease;
	padding: 0;
}
.supo-pvg-slide .supo-pvg-play:hover {
	background: rgba(196, 36, 36, 0.85);
	transform: scale(1.05);
}

.supo-pvg-slide .supo-pvg-play-triangle {
	width: 0;
	height: 0;
	margin-left: 5px;
	border-left: 18px solid #fff;
	border-top: 12px solid transparent;
	border-bottom: 12px solid transparent;
}

/* Video / iframe: hidden by default, shown once slide has the
   `.supo-pvg-playing` class (added by JS after user clicks play). */
.supo-pvg-slide video.supo-pvg-video,
.supo-pvg-slide iframe.supo-pvg-iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
	display: none;
	background: #000;
}

.supo-pvg-slide.supo-pvg-playing video.supo-pvg-video,
.supo-pvg-slide.supo-pvg-playing iframe.supo-pvg-iframe {
	display: block;
}

.supo-pvg-slide.supo-pvg-playing .supo-pvg-poster {
	display: none;
}

/*
 * While a video is the active gallery cell, hide Flatsome's image-only
 * zoom / lightbox button (`.zoom-button`, icon-expand) and hover-zoom.
 * They make no sense on a video and otherwise overlap the player
 * controls. The marker class is toggled from frontend.js on slide change.
 */
.product-images.supo-pvg-video-active .zoom-button,
.product-images.supo-pvg-video-active .image-zoom {
	display: none !important;
}