/**
 * WooCommerce Product Video Gallery - Frontend Styles
 *
 * Matches the default WooCommerce gallery sizing/spacing so the video slide
 * looks native alongside the product images, in both the default gallery
 * and the Elementor Pro "Product Images" widget.
 */

/* Outer slide: inherits WooCommerce's own gallery image spacing/rounding,
   we only need to control what's inside it. */
.wc-pvg-video-slide {
	position: relative;
}

/* Fixed-ratio box so the slide never causes a layout shift once the video
   metadata loads or playback starts. Adjust the ratio below if your theme's
   product images are not square. */
.wc-pvg-video-wrap {
	position: relative;
	width: 100%;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	background-color: #000;
	border-radius: inherit;
}

.wc-pvg-video {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
	background-color: #000;
}

/* Overlay image + play button layer, shown until the shopper presses play. */
.wc-pvg-overlay {
	position: absolute;
	inset: 0;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	background-color: #000;
	background-size: cover;
	background-position: center center;
	background-repeat: no-repeat;
	cursor: pointer;
	opacity: 1;
	visibility: visible;
	transition: opacity 0.25s ease, visibility 0.25s ease;
}

.wc-pvg-overlay--default {
	background-color: #1a1a1a;
}

/* Once playback starts, fade the overlay out and let native video controls
   take over, without ever unmounting the video element (no layout shift). */
.wc-pvg-video-slide.is-playing .wc-pvg-overlay {
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
}

/* Large centered circular play button. */
.wc-pvg-play-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: clamp( 56px, 12vw, 84px );
	height: clamp( 56px, 12vw, 84px );
	padding: 0;
	margin: 0;
	background: transparent;
	border: 0;
	cursor: pointer;
	transition: transform 0.2s ease;
}

.wc-pvg-play-btn:hover,
.wc-pvg-play-btn:focus-visible {
	transform: scale( 1.08 );
	outline: none;
}

.wc-pvg-play-icon {
	display: block;
	width: 100%;
	height: 100%;
	filter: drop-shadow( 0 2px 8px rgba( 0, 0, 0, 0.35 ) );
}

/* Semi-transparent black circular background. */
.wc-pvg-play-circle {
	fill: rgba( 0, 0, 0, 0.55 );
	transition: fill 0.2s ease;
}

.wc-pvg-play-btn:hover .wc-pvg-play-circle,
.wc-pvg-play-btn:focus-visible .wc-pvg-play-circle {
	fill: rgba( 0, 0, 0, 0.75 );
}

/* White triangle. */
.wc-pvg-play-triangle {
	fill: #ffffff;
}

/* Responsive tweaks for small screens. */
@media ( max-width: 480px ) {
	.wc-pvg-play-btn {
		width: 52px;
		height: 52px;
	}
}

/* Respect visitors who prefer reduced motion. */
@media ( prefers-reduced-motion: reduce ) {
	.wc-pvg-play-btn,
	.wc-pvg-overlay {
		transition: none;
	}
}
