/* Single product gallery slider (markup: woocommerce/single-product/product-image.php) */

.thp-gallery {
	position: relative;
}

.thp-gallery__stage {
	position: relative;
	border: 1px solid #e6e6e6;
	border-radius: 6px;
	background: #fff;
	overflow: hidden;
}

/* The track is a native scroll-snap carousel, so it swipes without JavaScript. */
.thp-gallery__track {
	display: flex;
	overflow-x: auto;
	overflow-y: hidden;
	scroll-snap-type: x mandatory;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
	-ms-overflow-style: none;
}
.thp-gallery__track::-webkit-scrollbar {
	display: none;
}

.thp-gallery__slide {
	flex: 0 0 100%;
	display: block;
	position: relative;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	scroll-snap-align: start;
	scroll-snap-stop: always;
	cursor: zoom-in;
}

.woocommerce div.product div.images.thp-gallery .thp-gallery__slide img,
.woocommerce-page div.product div.images.thp-gallery .thp-gallery__slide img {
	display: block;
	width: 100%;
	height: 100%;
	max-height: none;
	padding: 12px;
	box-sizing: border-box;
	object-fit: contain;
	transition: transform .25s ease;
	will-change: transform;
}

/* Hover zoom (the transform-origin follows the cursor, set from JS) */
.thp-gallery__slide.is-zoomed img {
	transform: scale(1.8);
	transition-duration: .12s;
}

/* Prev / next */
.thp-gallery__nav {
	position: absolute;
	top: 50%;
	z-index: 2;
	width: 38px;
	height: 38px;
	margin-top: -19px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, .92);
	box-shadow: 0 1px 6px rgba(0, 0, 0, .22);
	cursor: pointer;
	opacity: 0;
	transition: opacity .2s ease, background-color .2s ease;
}
.thp-gallery__nav--prev { left: 10px; }
.thp-gallery__nav--next { right: 10px; }
.thp-gallery__nav::before {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 9px;
	height: 9px;
	border: solid #2952a4;
	border-width: 2px 2px 0 0;
}
.thp-gallery__nav--prev::before { transform: translate(-30%, -50%) rotate(-135deg); }
.thp-gallery__nav--next::before { transform: translate(-70%, -50%) rotate(45deg); }
.thp-gallery__nav:hover,
.thp-gallery__nav:focus {
	background: #2952a4;
	outline: none;
}
.thp-gallery__nav:hover::before,
.thp-gallery__nav:focus::before {
	border-color: #fff;
}
.thp-gallery.is-ready .thp-gallery__stage:hover .thp-gallery__nav,
.thp-gallery.is-ready .thp-gallery__nav:focus {
	opacity: 1;
}

.thp-gallery__count {
	position: absolute;
	right: 10px;
	bottom: 10px;
	z-index: 2;
	padding: 2px 9px;
	border-radius: 11px;
	background: rgba(0, 0, 0, .55);
	color: #fff;
	font-size: 12px;
	line-height: 18px;
	pointer-events: none;
}
.thp-gallery__count b {
	font-weight: 600;
}

/* Thumbnails */
.thp-gallery__thumbs {
	display: flex;
	gap: 8px;
	margin-top: 10px;
	padding-bottom: 2px;
	overflow-x: auto;
	scroll-behavior: smooth;
	scrollbar-width: none;
	-ms-overflow-style: none;
}
.thp-gallery__thumbs::-webkit-scrollbar {
	display: none;
}

.thp-gallery__thumb {
	flex: 0 0 auto;
	width: 68px;
	height: 68px;
	padding: 3px;
	border: 2px solid #e6e6e6;
	border-radius: 5px;
	background: #fff;
	cursor: pointer;
	opacity: .65;
	transition: opacity .2s ease, border-color .2s ease;
}
.thp-gallery__thumb:hover,
.thp-gallery__thumb:focus {
	opacity: 1;
	outline: none;
}
.thp-gallery__thumb.is-active {
	border-color: #2952a4;
	opacity: 1;
}
.woocommerce div.product div.images.thp-gallery .thp-gallery__thumb img,
.woocommerce-page div.product div.images.thp-gallery .thp-gallery__thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
}

/* Touch screens have no hover: keep the arrows visible. */
@media (hover: none) {
	.thp-gallery.is-ready .thp-gallery__nav {
		opacity: .9;
	}
}

@media screen and (max-width: 767px) {
	.thp-gallery__nav {
		width: 32px;
		height: 32px;
		margin-top: -16px;
	}
	.thp-gallery__thumb {
		width: 56px;
		height: 56px;
	}
}

/* Lightbox */
.thp-lightbox {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, .9);
	opacity: 0;
	visibility: hidden;
	transition: opacity .2s ease, visibility .2s ease;
	-webkit-user-select: none;
	user-select: none;
}
.thp-lightbox.is-open {
	opacity: 1;
	visibility: visible;
}
.thp-lightbox__img {
	max-width: 92vw;
	max-height: 86vh;
	background: #fff;
	border-radius: 4px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, .5);
	transition: opacity .15s ease;
}
.thp-lightbox.is-loading .thp-lightbox__img {
	opacity: .35;
}
.thp-lightbox__btn {
	position: absolute;
	width: 46px;
	height: 46px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, .14);
	color: #fff;
	cursor: pointer;
	transition: background-color .2s ease;
}
.thp-lightbox__btn:hover,
.thp-lightbox__btn:focus {
	background: rgba(255, 255, 255, .3);
	outline: none;
}
.thp-lightbox__btn--prev { left: 14px; top: 50%; margin-top: -23px; }
.thp-lightbox__btn--next { right: 14px; top: 50%; margin-top: -23px; }
.thp-lightbox__btn--close { right: 14px; top: 14px; }
.thp-lightbox__btn--prev::before,
.thp-lightbox__btn--next::before {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 11px;
	height: 11px;
	border: solid #fff;
	border-width: 2px 2px 0 0;
}
.thp-lightbox__btn--prev::before { transform: translate(-30%, -50%) rotate(-135deg); }
.thp-lightbox__btn--next::before { transform: translate(-70%, -50%) rotate(45deg); }
.thp-lightbox__btn--close::before,
.thp-lightbox__btn--close::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 20px;
	height: 2px;
	margin: -1px 0 0 -10px;
	background: #fff;
}
.thp-lightbox__btn--close::before { transform: rotate(45deg); }
.thp-lightbox__btn--close::after { transform: rotate(-45deg); }
.thp-lightbox__count {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 14px;
	color: #fff;
	font-size: 14px;
	text-align: center;
	pointer-events: none;
}
.thp-lightbox--single .thp-lightbox__btn--prev,
.thp-lightbox--single .thp-lightbox__btn--next,
.thp-lightbox--single .thp-lightbox__count {
	display: none;
}
