/**
 * LegendAir product gallery
 * Minimal replacement for the active styles.
 */

.woocommerce div.product div.images.la-product-gallery,
.woocommerce-page div.product div.images.la-product-gallery {
	display: grid;
	grid-template-columns: 15% minmax(0, calc(78% + 2px));
	justify-content: space-between;
	align-items: start;
}

.la-product-gallery .la-gallery__stage {
	position: relative;
	grid-column: 2;
	grid-row: 1;
	box-sizing: border-box;
	width: 100%;
	float: none;
	overflow: hidden;
	border: 1px solid #000;
	/* A finger drag on the image moves the magnifier, not the page. */
	touch-action: none;
	-webkit-touch-callout: none;
	-webkit-user-select: none;
	user-select: none;
}

.la-product-gallery .la-gallery__main,
.la-product-gallery .la-gallery__image {
	display: block;
	width: 100%;
	height: auto;
	margin: 0;
}

.la-product-gallery .la-gallery__main {
	position: relative;
	cursor: zoom-in;
}

.la-product-gallery .la-gallery__thumbs {
	position: static;
	grid-column: 1;
	grid-row: 1;
	display: flex;
	width: 100%;
	margin: 0;
	padding: 0;
	float: none;
	flex-direction: column;
}

/* Keep the HTML hidden state authoritative if a thumbnail strip is hidden. */
.la-product-gallery .la-gallery__thumbs[hidden] {
	display: none;
}

.la-product-gallery .la-gallery__thumb {
	display: block;
	box-sizing: content-box;
	width: 100%;
	padding: 0;
	aspect-ratio: 1;
	border: 1px solid #000;
	border-radius: 0;
	background: #fff;
	cursor: pointer;
	overflow: hidden;
    transition: 0.5s ease-out;
}

.la-product-gallery .la-gallery__thumb:not(:last-child) {
	/* Preserves the current 5.9%-of-gallery vertical rhythm. */
	margin-bottom: 36.55%;
}

.la-product-gallery .la-gallery__thumb img {
	display: block;
	width: 100%;
	height: 100%;
	margin: 0;
	object-fit: cover;
}

.la-product-gallery .la-gallery__thumb:focus-visible {
	outline: 2px solid #000;
	outline-offset: 2px;
}

.la-product-gallery .la-gallery__thumb[aria-pressed="false"] {
    opacity: 0.6;
}


.la-product-gallery .la-gallery__magnifier {
	position: absolute;
	z-index: 2;
	inset: 0;
	display: block;
	pointer-events: none;
	background-repeat: no-repeat;
	opacity: 0;
	transition: opacity 160ms ease;
}

.la-product-gallery .la-gallery__magnifier.is-active {
	opacity: 1;
}

/* Keep mobile long presses on the gallery rather than on the image link. */
@media (hover: none) and (pointer: coarse) {
	.la-product-gallery .la-gallery__magnifier {
		pointer-events: auto;
	}
}

.woocommerce div.product div.images.la-product-gallery--single,
.woocommerce-page div.product div.images.la-product-gallery--single {
	display: block;
}

.la-product-gallery--single .la-gallery__stage {
	width: 100%;
}

@media (prefers-reduced-motion: reduce) {
	.la-product-gallery .la-gallery__magnifier {
		transition: none;
	}
}
