/* ==========================================================================
   Shop / category listing hover video
   ========================================================================== */

/**
 * Listing containers: support both default WC (ul.products li.product)
 * and Flatsome (div.product-small .box-image) markup.
 */

ul.products li.product,
.product,
.product-small,
.product-small .col-inner,
.product-small .box {
	position: relative;
}

/* Flatsome image container: ensure overflow is hidden so videos can cover and be cropped cleanly */
.product .box-image,
.product-small .box-image {
	position: relative;
	overflow: hidden;
}

ul.products li.product a img,
.product .box-image img,
.product-small .box-image img {
	position: relative;
	z-index: 1;
}

.qpv-video-wrap.qpv-listing-video {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 5;
	opacity: 0;
	pointer-events: none; /* leave pointer handling to image container */
	transition: opacity 0.25s ease;
	overflow: hidden;
	background: #000;
	/* Ensure it sits above the image but below overlay controls */
	inset: 0;
}

.qpv-video-wrap.qpv-listing-video.qpv-active {
	opacity: 1;
}

.qpv-video-wrap video,
.qpv-video-wrap iframe {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border: 0;
	display: block;
	pointer-events: none; /* avoid blocking product controls; container handles hover */
}

/* ==========================================================================
   Single product gallery video slide
   ========================================================================== */

.woocommerce-product-gallery__image.qpv-gallery-slide {
	position: relative;
}

.qpv-play-icon {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 56px;
	height: 56px;
	margin: -28px 0 0 -28px;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.55);
	z-index: 3;
	pointer-events: none;
	transition: opacity 0.2s ease;
}

.qpv-play-icon::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 54%;
	width: 0;
	height: 0;
	transform: translate(-50%, -50%);
	border-style: solid;
	border-width: 10px 0 10px 16px;
	border-color: transparent transparent transparent #fff;
}

.qpv-gallery-slide.qpv-active .qpv-play-icon {
	opacity: 0;
}

.qpv-gallery-slide .qpv-video-wrap {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 2;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.25s ease;
	background: #000;
}

.qpv-gallery-slide.qpv-active .qpv-video-wrap {
	opacity: 1;
	pointer-events: auto;
}

/* Small play icon badge on the flexslider thumbnail nav item */
.flex-control-thumbs li.qpv-nav-video {
	position: relative;
}

.flex-control-thumbs li.qpv-nav-video::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 0;
	height: 0;
	transform: translate(-50%, -50%);
	border-style: solid;
	border-width: 6px 0 6px 10px;
	border-color: transparent transparent transparent #fff;
	pointer-events: none;
}

/* ==========================================================================
   Controls: unmute button
   ========================================================================== */

.qpv-unmute-btn {
	position: absolute;
	bottom: 8px;
	right: 8px;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: rgba(0,0,0,0.6);
	border: 0;
	z-index: 10;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	cursor: pointer;
	pointer-events: auto;
}

.qpv-unmute-btn:focus {
	outline: 2px solid rgba(255,255,255,0.9);
}

.qpv-unmute-icon {
	width: 14px;
	height: 14px;
	background-repeat: no-repeat;
	background-size: contain;
	background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23fff"><path d="M3 9v6h4l5 5V4L7 9H3z"/></svg>');
}

/* ==========================================================================
   Admin meta box
   ========================================================================== */

.qpv-meta-box .qpv-video-filename {
	word-break: break-all;
}
