/* Product-card media behaviour owned by TA FluentCart Variation Gallery.
 * The alternate is explicit product media; no gallery-position fallback exists. */
.ta-fc-card-media,
.ta-fc-card-image-link {
	display: block;
	position: relative;
}

.ta-fc-card-image-link {
	overflow: hidden;
}

.ta-fc-card-primary-image,
.ta-fc-card-hover-image {
	display: block;
	inline-size: 100%;
	block-size: 100%;
	object-fit: cover;
}

.ta-fc-card-hover-image {
	position: absolute;
	inset: 0;
	opacity: 0;
	pointer-events: none;
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
	.ta-fc-card-primary-image,
	.ta-fc-card-hover-image {
		transition: opacity 500ms ease-in-out;
	}

	.ta-fc-card-media:hover .ta-fc-card-primary-image,
	.ta-fc-card-media:focus-within .ta-fc-card-primary-image {
		opacity: 0;
	}

	.ta-fc-card-media:hover .ta-fc-card-hover-image,
	.ta-fc-card-media:focus-within .ta-fc-card-hover-image {
		opacity: 1;
	}
}

@media (hover: none), (pointer: coarse), (prefers-reduced-motion: reduce) {
	.ta-fc-card-hover-image {
		display: none;
		opacity: 0;
	}

	.ta-fc-card-media:hover .ta-fc-card-primary-image,
	.ta-fc-card-media:focus-within .ta-fc-card-primary-image,
	.ta-fc-card-primary-image {
		opacity: 1;
		transition: none;
	}
}
