.topfast-product-gallery {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: clamp(12px, 2vw, 20px);
	width: 100%;
}

.topfast-product-gallery__track {
	display: contents;
}

.topfast-product-gallery__item {
	width: 100%;
	min-width: 0;
}

.topfast-product-gallery__trigger {
	display: block;
	width: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	outline: 0;
	background: none;
	box-shadow: none;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}

.topfast-product-gallery__trigger:focus,
.topfast-product-gallery__trigger:focus-visible,
.topfast-product-gallery__trigger:active {
	outline: 0;
	border: 0;
	box-shadow: none;
}

.topfast-product-gallery__image {
	display: block;
	width: 100%;
	height: auto;
	max-width: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	outline: 0;
	box-shadow: none;
}

.topfast-product-lightbox {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 12px;
}

.topfast-product-lightbox[hidden] {
	display: none;
}

.topfast-product-lightbox__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.9);
	opacity: 0;
	transition: opacity 0.35s ease;
}

.topfast-product-lightbox.is-visible .topfast-product-lightbox__backdrop {
	opacity: 1;
}

.topfast-product-lightbox__dialog {
	position: relative;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
}

.topfast-product-lightbox__stage {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
}

.topfast-product-lightbox__image {
	display: block;
	width: auto;
	height: auto;
	max-width: 96vw;
	max-height: 92vh;
	object-fit: contain;
	opacity: 0;
	transform: scale(0.88);
	transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.topfast-product-lightbox.is-visible .topfast-product-lightbox__image {
	opacity: 1;
	transform: scale(1);
}

.topfast-product-lightbox__image.is-switching {
	opacity: 0;
	transform: scale(0.94);
	transition-duration: 0.2s;
}

.topfast-product-lightbox__close,
.topfast-product-lightbox__nav {
	position: absolute;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	outline: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
	box-shadow: none;
	opacity: 0;
	transition: opacity 0.35s ease 0.1s, background 0.2s ease;
	appearance: none;
	-webkit-appearance: none;
}

.topfast-product-lightbox.is-visible .topfast-product-lightbox__close,
.topfast-product-lightbox.is-visible .topfast-product-lightbox__nav {
	opacity: 1;
}

.topfast-product-lightbox__close:hover,
.topfast-product-lightbox__nav:hover {
	background: rgba(255, 255, 255, 0.22);
}

.topfast-product-lightbox__close {
	top: 12px;
	right: 12px;
}

.topfast-product-lightbox__nav {
	top: 50%;
	transform: translateY(-50%);
}

.topfast-product-lightbox__nav--prev {
	left: 12px;
}

.topfast-product-lightbox__nav--next {
	right: 12px;
}

.topfast-product-lightbox__counter {
	position: absolute;
	left: 50%;
	bottom: 16px;
	transform: translateX(-50%);
	padding: 6px 12px;
	border-radius: 999px;
	background: rgba(0, 0, 0, 0.45);
	color: #fff;
	font-size: 14px;
	line-height: 1;
	opacity: 0;
	transition: opacity 0.35s ease 0.15s;
}

.topfast-product-lightbox.is-visible .topfast-product-lightbox__counter {
	opacity: 1;
}

html.topfast-product-lightbox-open {
	overflow: hidden;
}

@media (max-width: 767px) {
	.topfast-product-gallery {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.topfast-product-gallery.is-slider {
		display: block;
		overflow: hidden;
		width: 100%;
		max-width: 100%;
		touch-action: pan-y;
		user-select: none;
		-webkit-user-select: none;
	}

	.topfast-product-gallery.is-slider .topfast-product-gallery__track {
		display: flex;
		gap: 12px;
		will-change: transform;
		cursor: grab;
	}

	.topfast-product-gallery.is-slider .topfast-product-gallery__track.is-animating {
		transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
	}

	.topfast-product-gallery.is-slider .topfast-product-gallery__track:active {
		cursor: grabbing;
	}

	.topfast-product-gallery.is-slider .topfast-product-gallery__item {
		flex: 0 0 78%;
		max-width: 78%;
	}

	.topfast-product-lightbox__image {
		max-width: 100vw;
		max-height: 88vh;
	}

	.topfast-product-lightbox__nav--prev {
		left: 4px;
	}

	.topfast-product-lightbox__nav--next {
		right: 4px;
	}
}
