/* ---------- Product cards / gallery: video laid exactly over the product image ---------- */
.ajexpress-pva-video {
	position: absolute;
	z-index: 1;
	object-fit: cover;
	max-width: none !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	opacity: 0;
	pointer-events: none !important; /* clicks reach the product link underneath */
	transition: opacity .25s ease;
	background: transparent;
}
.ajexpress-pva-video.ajexpress-pva-on {
	opacity: 1;
}
img.ajexpress-pva-hidden {
	opacity: 0 !important;
}

/* Badges must always sit above the video, in the same place as on products without a video. */
li.product .woocommerce-badges,
.products .product .woocommerce-badges,
.product-inner .woocommerce-badges,
li.product .onsale,
li.product .product-badges {
	z-index: 9 !important;
}

/* ---------- Video as the background of ANY element (class ajv-video-ID / data-ajv-video) ---------- */
.ajv-has-video {
	isolation: isolate;
}
.ajv-bgvideo {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	z-index: -1;
	pointer-events: none;
	border-radius: inherit;
	max-width: none !important;
}

/* ---------- [ajexpress_video] shortcode (banners, pages) ---------- */
.ajexpress-vid {
	position: relative;
	display: block;
	width: 100%;
	overflow: hidden;
	border-radius: var(--ajv-radius, 16px);
	background: #f2f2f2;
	aspect-ratio: var(--ajv-ratio, 16/9);
	isolation: isolate;
}
.ajexpress-vid--h {
	aspect-ratio: auto;
	height: var(--ajv-height);
}
.ajexpress-vid__media {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: var(--ajv-fit, cover);
	display: block;
	border-radius: inherit;
	z-index: 0;
}
.ajexpress-vid__link {
	position: absolute;
	inset: 0;
	z-index: 2;
}
.ajexpress-vid__content {
	position: relative;
	z-index: 1;
	height: 100%;
	box-sizing: border-box;
	padding: 24px;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: flex-start;
}
.ajexpress-vid__content > * {
	pointer-events: auto;
}
.ajexpress-vid__content a,
.ajexpress-vid__content button {
	position: relative;
	z-index: 3;
}

/* Background mode: fills the parent container; put your own widgets above it. */
.ajexpress-vid--bg {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	aspect-ratio: auto;
	border-radius: inherit;
	z-index: -1; /* behind the parent's own widgets */
	pointer-events: none;
}
