/* Left thumbnail rail. Every photo uses the same stage box as the first image. */
.single-product div.product div.images.woocommerce-product-gallery {
	display: flex;
	flex-direction: row;
	align-items: flex-start;
	gap: 12px;
	width: 100%;
	float: none;
	position: relative;
	box-sizing: border-box;
	margin-bottom: 1em;
	padding-left: 0;
}

.single-product div.product div.images .nm-rail {
	flex: 0 0 76px;
	width: 76px;
	max-height: 540px;
	overflow-x: hidden;
	overflow-y: auto;
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin: 0;
	padding: 0 2px 0 0;
	order: 0;
}

.single-product div.product div.images .nm-rail button {
	display: block;
	width: 72px;
	height: 72px;
	padding: 4px;
	margin: 0;
	border: 1px solid #e4e0d8;
	border-radius: 4px;
	background: #f7f6f3;
	cursor: pointer;
	line-height: 0;
	box-shadow: none;
}

.single-product div.product div.images .nm-rail button.is-active {
	border-color: #14312c;
	box-shadow: inset 0 0 0 1px #14312c;
}

.single-product div.product div.images .nm-rail button img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
	pointer-events: none;
}

.single-product div.product div.images .woocommerce-product-gallery__wrapper {
	position: relative;
	flex: 1 1 auto;
	min-width: 0;
	order: 1;
	display: block !important;
	background: #f3f3f3;
	border-radius: 4px;
	width: 100%;
	aspect-ratio: 1 / 1;
	overflow: hidden;
}

.woocommerce div.product div.images .woocommerce-product-gallery__image,
.woocommerce div.product div.images .woocommerce-product-gallery__image:nth-child(n+2) {
	display: none !important;
	width: 100% !important;
	max-width: 100% !important;
	margin: 0;
	float: none;
}

.single-product div.product div.images .woocommerce-product-gallery__image:first-child,
.single-product div.product div.images.nm-rail-on .woocommerce-product-gallery__image.is-active {
	display: flex !important;
	align-items: center;
	justify-content: center;
	position: absolute;
	inset: 0;
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
}

.single-product div.product div.images.nm-rail-on .woocommerce-product-gallery__image:first-child:not(.is-active) {
	display: none !important;
}

.single-product div.product div.images .woocommerce-product-gallery__image a {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	cursor: zoom-in;
	pointer-events: auto;
}

.single-product div.product div.images .woocommerce-product-gallery__image img,
.single-product div.product div.images.nm-rail-on .woocommerce-product-gallery__image.is-active img {
	display: block;
	width: 100% !important;
	height: 100% !important;
	max-width: 100% !important;
	max-height: 100% !important;
	object-fit: contain;
	margin: 0 auto;
	background: transparent;
}

.single-product div.product div.images .flex-control-thumbs,
.single-product div.product div.images .flex-direction-nav,
.single-product div.product div.images .woocommerce-product-gallery__trigger,
.single-product div.product div.images .zoomImg {
	display: none !important;
}

.single-product div.product div.images .nm-gallery-nav button,
.single-product div.product div.images .nm-gallery-zoom {
	position: absolute;
	z-index: 4;
	border: 0;
	background: #fff;
	box-shadow: 0 1px 6px rgba(20, 49, 44, 0.18);
	cursor: pointer;
	padding: 0;
}

.single-product div.product div.images .nm-gallery-nav button {
	top: 50%;
	width: 36px;
	height: 36px;
	margin-top: -18px;
	border-radius: 50%;
}

.single-product div.product div.images .nm-gallery-nav button:before {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 8px;
	height: 8px;
	border-right: 2px solid #14312c;
	border-bottom: 2px solid #14312c;
}

.single-product div.product div.images .nm-gallery-prev { left: 10px; }
.single-product div.product div.images .nm-gallery-prev:before { transform: translate(-30%, -50%) rotate(135deg); }
.single-product div.product div.images .nm-gallery-next { right: 10px; }
.single-product div.product div.images .nm-gallery-next:before { transform: translate(-70%, -50%) rotate(-45deg); }

.single-product div.product div.images .nm-gallery-zoom {
	top: 10px;
	right: 10px;
	width: 36px;
	height: 36px;
	border-radius: 50%;
}

.single-product div.product div.images .nm-gallery-zoom:before {
	content: "";
	position: absolute;
	left: 9px;
	top: 9px;
	width: 12px;
	height: 12px;
	border: 2px solid #14312c;
	border-radius: 50%;
}

.single-product div.product div.images .nm-gallery-zoom:after {
	content: "";
	position: absolute;
	width: 7px;
	height: 2px;
	background: #14312c;
	right: 8px;
	bottom: 9px;
	transform: rotate(45deg);
}

.nm-zoom {
	position: fixed;
	inset: 0;
	z-index: 100000;
	background: rgba(17, 17, 17, 0.88);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
}

.nm-zoom[hidden] { display: none !important; }

.nm-zoom img {
	max-width: min(1100px, 92vw);
	max-height: 90vh;
	width: auto;
	height: auto;
	object-fit: contain;
	background: #fff;
	box-shadow: 0 8px 40px rgba(0, 0, 0, 0.35);
}

.nm-zoom-x {
	position: absolute;
	top: 16px;
	right: 16px;
	width: 42px;
	height: 42px;
	border: 0;
	border-radius: 50%;
	background: #fff;
	color: #14312c;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
}

html.nm-zoom-open,
html.nm-zoom-open body { overflow: hidden; }

@media (max-width: 767px) {
	.single-product div.product div.images .nm-rail {
		flex-basis: 62px;
		width: 62px;
		max-height: 420px;
	}
	.single-product div.product div.images .nm-rail button {
		width: 58px;
		height: 58px;
	}
}
