.vsf-product-gallery {
	--photo-gold: #cba768;
	--photo-ink: #0e1012;
	min-width: 0;
}

.vsf-product-gallery :focus-visible {
	outline: 2px solid var(--photo-gold);
	outline-offset: 2px;
}

.vsf-product-gallery .vsf-photo-frame {
	position: relative;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	background: #eeece6;
	border-radius: 3px;
}

.vsf-photo-track {
	position: absolute;
	inset: 0;
	display: flex;
	overflow-x: auto;
	overflow-y: hidden;
	overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	scrollbar-width: none;
	touch-action: pan-x pan-y pinch-zoom;
	-webkit-overflow-scrolling: touch;
}

.vsf-photo-track::-webkit-scrollbar,
.vsf-photo-thumbs::-webkit-scrollbar {
	display: none;
}

.vsf-photo-slide {
	display: block;
	flex: 0 0 100%;
	min-width: 0;
	height: 100%;
	scroll-snap-align: center;
	scroll-snap-stop: always;
	-webkit-user-drag: none;
}

.vsf-photo-slide[data-photo-open] {
	cursor: zoom-in;
}

.vsf-product-gallery .vsf-photo-slide img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
	user-select: none;
	-webkit-user-drag: none;
}

.vsf-photo-arrow,
.vsf-lightbox-toolbar button {
	display: grid;
	place-items: center;
	min-width: 44px;
	min-height: 44px;
	padding: 0;
	border: 1px solid rgba(226, 197, 145, .45);
	border-radius: 3px;
	background: rgba(14, 16, 18, .65);
	color: #fff2d9;
	cursor: pointer;
	touch-action: manipulation;
}

.vsf-photo-arrow {
	position: absolute;
	top: 50%;
	z-index: 1;
	width: 48px;
	height: 48px;
	font: 400 33px/1 Arial, sans-serif;
	transform: translateY(-50%);
	backdrop-filter: blur(5px);
}

.vsf-photo-arrow[hidden] {
	display: none;
}

.vsf-photo-arrow:hover,
.vsf-lightbox-toolbar button:hover,
.vsf-lightbox-toolbar button[aria-pressed=true] {
	background: rgba(14, 16, 18, .94);
	border-color: var(--photo-gold);
}

.vsf-photo-prev {
	left: clamp(6px, 2vw, 16px);
}

.vsf-photo-next {
	right: clamp(6px, 2vw, 16px);
}

.vsf-photo-count {
	position: absolute;
	right: 10px;
	bottom: 10px;
	z-index: 1;
	min-width: 7ch;
	padding: 5px 8px;
	border: 1px solid rgba(226, 197, 145, .45);
	border-radius: 3px;
	background: rgba(14, 16, 18, .78);
	color: #fff2d9;
	font: 400 12px/1.25 ui-monospace, monospace;
	letter-spacing: .02em;
	text-align: center;
	pointer-events: none;
}

.vsf-photo-thumbs {
	display: flex;
	gap: 8px;
	overflow-x: auto;
	padding: 3px;
	margin-top: 9px;
	overscroll-behavior-x: contain;
	scrollbar-width: none;
	touch-action: pan-x pan-y pinch-zoom;
}

.vsf-photo-thumb {
	box-sizing: border-box;
	flex: 0 0 clamp(58px, 10vw, 74px);
	aspect-ratio: 1 / 1;
	overflow: hidden;
	border: 2px solid #d6d0c4;
	border-radius: 3px;
	background: #eeece6;
}

.vsf-photo-thumb[aria-current=true] {
	border-color: #9b7439;
	box-shadow: 0 0 0 1px var(--photo-gold);
}

.vsf-product-gallery .vsf-photo-thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	user-select: none;
	-webkit-user-drag: none;
}

.vsf-photo-lightbox {
	position: fixed;
	inset: 0;
	box-sizing: border-box;
	width: 100%;
	height: 100%;
	max-width: none;
	max-height: none;
	margin: 0;
	padding: 0;
	border: 0;
	background: #08090a;
	color: #fff2d9;
}

.vsf-photo-lightbox::backdrop {
	background: #08090a;
}

html:has(.vsf-photo-lightbox[open]) {
	overflow: hidden;
}

.vsf-lightbox-panel {
	display: grid;
	grid-template-rows: auto minmax(0, 1fr);
	height: 100%;
}

.vsf-lightbox-toolbar {
	display: flex;
	justify-content: flex-end;
	gap: 8px;
	padding: max(8px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 8px 12px;
}

.vsf-lightbox-toolbar .vsf-lightbox-zoom {
	padding: 0 12px;
	font: inherit;
	font-size: 14px;
}

.vsf-lightbox-close {
	font: 400 28px/1 Arial, sans-serif;
}

.vsf-lightbox-frame {
	position: relative;
	margin-bottom: env(safe-area-inset-bottom);
}

.vsf-lightbox-slide.is-zoomed {
	overflow: auto;
	overscroll-behavior: contain;
	touch-action: pan-x pan-y pinch-zoom;
}

.vsf-product-gallery .vsf-lightbox-slide.is-zoomed img {
	width: 200%;
	height: auto;
	max-width: none;
	max-height: none;
	min-height: 100%;
	object-fit: contain;
}

.woocommerce div.product > .vsf-product-gallery {
	float: left;
	width: 48%;
	margin-bottom: 2em;
}

@media (max-width: 781px) {
	.woocommerce div.product > .vsf-product-gallery {
		float: none;
		width: auto;
	}
}

@media (prefers-reduced-motion: reduce) {
	.vsf-photo-track {
		scroll-behavior: auto;
	}
}
