/* XGATE product gallery — matches design: bordered main panel,
   5-per-row thumbnail strip below, active thumb outlined in green. */

.xg-gallery {
	   --xg-border: #D4D4D4;
	   --xg-active: #43A977;
	   --xg-gap: 16px;
	   float: none;
	   width: 100%;
	   opacity: 1 !important; /* neutralise WC's fade-in inline style if it appears */
   }

/* Main image panel */
.xg-gallery__main {
	border: 1px solid var(--xg-border);
	background: #fff;
	padding: 24px;
}

.xg-gallery__main .woocommerce-product-gallery__image,
.xg-gallery__main .woocommerce-product-gallery__image a {
	display: block;
}

.xg-gallery__main img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 1 / 1;
	object-fit: contain;
	transition: opacity 0.15s ease;
}

.xg-gallery__main.is-swapping img {
	opacity: 0;
}

/* Thumbnail strip — flex, 5 per line */
.xg-gallery__thumbs {
	display: flex;
	flex-wrap: wrap;
	gap: var(--xg-gap);
	margin: var(--xg-gap) 0 0;
	padding: 0;
	list-style: none;
}

.xg-gallery__thumb {
	flex: 0 0 calc((100% - 4 * var(--xg-gap)) / 5);
	margin: 0;
}

.xg-gallery__thumb button {
	display: block;
	width: 100%;
	margin: 0;
	padding: 10px;
	border: 1px solid var(--xg-border);
	border-radius: 0;
	background: #fff;
	cursor: pointer;
	transition: border-color 0.15s ease;
}

.xg-gallery__thumb img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 1 / 1;
	object-fit: contain;
}

.xg-gallery__thumb button:hover,
.xg-gallery__thumb button:focus-visible {
	border-color: #b8b8b8;
	outline: none;
}

.xg-gallery__thumb.is-active button {
	border-color: var(--xg-active);
	box-shadow: inset 0 0 0 1px var(--xg-active);
}

@media (max-width:991px) {
	.xg-gallery {
		--xg-gap: 12px;
	}

	.xg-gallery__main {
		padding: 12px;
	}

	.xg-gallery__thumb {
		flex: 0 0 calc((100% - 4 * var(--xg-gap)) / 5);
	}

	.xg-gallery__thumb button {
		padding: 6px;
	}
}