/**
 * Product Video Manager — frontend styles.
 *
 * Designed to coexist with Elementor's own video widget CSS. When this
 * shortcode is rendered inside an Elementor section, Elementor's rules
 * for .elementor-wrapper and .elementor-video-iframe apply; everything
 * here is scoped via the .pvm- prefix and only kicks in to provide a
 * baseline for non-Elementor contexts and the facade variant.
 */

/* ─── Wrapper (non-Elementor fallback) ────────────────────────────── */
.pvm-wrapper {
	position: relative;
	width: 100%;
	aspect-ratio: var(--video-aspect-ratio, 1.77777);
	overflow: hidden;
	/* No default background — avoids a visible black line at the bottom of
	   the wrapper when the iframe doesn't fill 100% of the wrapper height
	   (e.g. 9:16 portrait videos on YouTube). A background can be set
	   explicitly via the Background Color setting. */
}

.pvm-wrapper .pvm-iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
	display: block;
}

/* ─── Facade (lazy load + no autoplay) ────────────────────────────── */
.pvm-facade {
	cursor: pointer;
	/* Keep a black background on the facade variant — covers the area
	   while the thumbnail image is still loading. */
	background: #000;
}

.pvm-facade .pvm-facade-thumb {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: filter 0.2s ease;
}

.pvm-facade:hover .pvm-facade-thumb,
.pvm-facade:focus-within .pvm-facade-thumb {
	filter: brightness(0.85);
}

.pvm-play-button {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 68px;
	height: 48px;
	padding: 0;
	border: 0;
	background: transparent;
	cursor: pointer;
	transition: transform 0.15s ease, filter 0.15s ease;
}

.pvm-play-button svg {
	width: 100%;
	height: 100%;
	display: block;
	filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.35));
}

.pvm-facade:hover .pvm-play-button,
.pvm-facade:focus-within .pvm-play-button {
	transform: translate(-50%, -50%) scale(1.05);
}

.pvm-play-button:focus-visible {
	outline: 3px solid #fff;
	outline-offset: 4px;
	border-radius: 14px;
}
