/* Hover-Bild in der Produktübersicht: nur mit Maus, Touchgeräte laden das Bild nicht */
.woocommerce ul.products li.product .custom-product-card a img.res-hover-image,
.custom-product-card img.res-hover-image {
	display: none;
}

@media (hover: hover) and (pointer: fine) {
	/* Theme blendet Links beim Hover auf 60% ab - hier würde das zweite Bild blass wirken */
	.custom-product-card a.res-has-hover-image:hover {
		opacity: 1;
	}
	.res-hover-media {
		display: block;
		position: relative;
	}
	.woocommerce .products > li.grid-page .custom-grid-item .custom-product-card a .res-hover-media {
		height: 100%;
	}
	.woocommerce ul.products li.product .custom-product-card a img.res-hover-image,
	.custom-product-card img.res-hover-image {
		display: block;
		position: absolute;
		top: 0;
		left: 0;
		width: 100%;
		height: 100%;
		object-fit: cover;
		opacity: 0;
		transition: opacity .4s ease;
	}
	.woocommerce ul.products li.product .custom-product-card a:hover img.res-hover-image,
	.woocommerce ul.products li.product .custom-product-card a:focus-visible img.res-hover-image,
	.custom-product-card a:hover img.res-hover-image,
	.custom-product-card a:focus-visible img.res-hover-image {
		opacity: 1;
	}
	/* Titel und Preis bleiben auch auf dunklen Fotos lesbar */
	.woocommerce .products > li.grid-page .custom-grid-item .custom-product-card a.res-has-hover-image .product-overlay {
		transition: background-color .4s ease;
	}
	.woocommerce .products > li.grid-page .custom-grid-item .custom-product-card a.res-has-hover-image:hover .product-overlay,
	.woocommerce .products > li.grid-page .custom-grid-item .custom-product-card a.res-has-hover-image:focus-visible .product-overlay {
		background-color: rgba(254, 255, 249, 0.7);
	}
}

/* Video in der Produktgalerie */
.woocommerce div.product div.images .woocommerce-product-gallery__video a {
	display: block;
	position: relative;
}
.woocommerce div.product div.images .woocommerce-product-gallery__video a::after {
	content: "";
	position: absolute;
	right: 10px;
	bottom: 10px;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	background: rgba(255, 255, 255, .85) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M2.5 1.2v7.6L9 5z'/%3E%3C/svg%3E") center / 12px no-repeat;
	pointer-events: none;
}

/* Vorschau quadratisch wie die Bilder daneben, das ganze Video zeigt die Lightbox */
.woocommerce div.product div.images .woocommerce-product-gallery__video:nth-child(n+2) .wp-post-video {
	aspect-ratio: 1;
	object-fit: cover;
}
@media only screen and (max-width: 768px) {
	.woocommerce div.product div.images .woocommerce-product-gallery__video a::after {
		right: 6px;
		bottom: 6px;
		width: 22px;
		height: 22px;
		background-size: 9px;
	}
}
