/* Product Image Slideshow — scoped under .pis */

.pis {
	--pis-tw: 80px;
	--pis-th: 80px;
	--pis-tgap: 10px;
	--pis-dot: 8px;
	--pis-speed: 600ms;
	--pis-dir: column;
	--pis-tdir: row;
	--pis-wrap-w: 100%;
	--pis-inner-pos: relative;
	--pis-stage-flex: 0 0 auto;
	--pis-ov: auto hidden;

	position: relative;
	display: flex;
	flex-direction: var(--pis-dir);
	gap: 12px;
	width: 100%;
	max-width: 100%;
	margin-left: auto;
	margin-right: auto;
	box-sizing: border-box;
}

.pis *,
.pis *::before,
.pis *::after {
	box-sizing: border-box;
}

/* ── Stage ─────────────────────────────────────── */
.pis .pis__stage {
	position: relative;
	flex: var(--pis-stage-flex);
	min-width: 0;
	height: 500px;
	overflow: hidden;
	border-radius: 12px;
	isolation: isolate;
	transform: translateZ(0);
	touch-action: pan-y;
	-webkit-user-select: none;
	user-select: none;
}

.pis--multi .pis__stage { cursor: grab; }
.pis--multi .pis__stage.is-dragging { cursor: grabbing; }
.pis .pis__stage:focus-visible { outline: 2px solid #111; outline-offset: 3px; }

.pis .pis__track {
	display: flex;
	width: 100%;
	height: 100%;
	transition: transform var(--pis-speed) cubic-bezier(.65, 0, .35, 1);
	will-change: transform;
}

.pis .pis__slide {
	position: relative;
	flex: 0 0 100%;
	min-width: 0;
	height: 100%;
	margin: 0;
	padding: 0;
}

.pis .pis__img {
	display: block;
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	margin: 0;
	object-fit: cover;
	object-position: center center;
	-webkit-user-drag: none;
	user-select: none;
	pointer-events: none;
}

/* Fade */
.pis--fade .pis__track {
	position: relative;
	display: block;
	transform: none !important;
	transition: none;
}

.pis--fade .pis__slide {
	position: absolute;
	inset: 0;
	opacity: 0;
	visibility: hidden;
	transition: opacity var(--pis-speed) ease, visibility 0s linear var(--pis-speed);
}

.pis--fade .pis__slide.is-active {
	z-index: 1;
	opacity: 1;
	visibility: visible;
	transition-delay: 0s;
}

/* ── Arrows ────────────────────────────────────── */
.pis button.pis__arrow {
	position: absolute;
	top: 50%;
	z-index: 3;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	min-width: 0;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background-color: #fff;
	color: #111;
	line-height: 1;
	box-shadow: 0 2px 12px rgba(0, 0, 0, .14);
	cursor: pointer;
	opacity: 0;
	transform: translateY(-50%) scale(.92);
	transition: opacity .25s ease, transform .25s ease, background-color .2s ease, color .2s ease;
	-webkit-appearance: none;
	appearance: none;
}

.pis .pis__arrow--prev { left: 12px; }
.pis .pis__arrow--next { right: 12px; }

.pis .pis__arrow svg {
	display: block;
	width: 18px;
	height: 18px;
	pointer-events: none;
}

.pis .pis__stage:hover button.pis__arrow,
.pis button.pis__arrow:focus-visible,
.pis-arrows-always .pis button.pis__arrow {
	opacity: 1;
	transform: translateY(-50%) scale(1);
}

.pis button.pis__arrow:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }

@media (hover: none) {
	.pis .pis__stage button.pis__arrow {
		opacity: 1;
		transform: translateY(-50%);
	}
}

.pis .pis__stage button.pis__arrow:disabled {
	opacity: .3;
	cursor: default;
	pointer-events: none;
}

/* ── Dots ──────────────────────────────────────── */
.pis .pis__dots {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 14px;
	z-index: 3;
	display: flex;
	justify-content: center;
	gap: 8px;
	pointer-events: none;
}

.pis button.pis__dot {
	position: relative;
	width: var(--pis-dot);
	height: var(--pis-dot);
	min-width: 0;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background-color: #111;
	opacity: .3;
	cursor: pointer;
	pointer-events: auto;
	transition: width .3s ease, opacity .3s ease;
	-webkit-appearance: none;
	appearance: none;
}

.pis button.pis__dot::before {
	content: "";
	position: absolute;
	inset: -8px -4px;
}

.pis button.pis__dot.is-active {
	width: calc(var(--pis-dot) * 2.75);
	opacity: 1;
}

.pis button.pis__dot:focus-visible { outline: 2px solid #111; outline-offset: 3px; }

/* ── Counter ───────────────────────────────────── */
.pis .pis__counter {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 3;
	padding: 4px 12px;
	border-radius: 999px;
	background-color: rgba(17, 17, 17, .65);
	color: #fff;
	font-size: 12px;
	font-weight: 500;
	line-height: 1.6;
	letter-spacing: .04em;
	font-variant-numeric: tabular-nums;
	pointer-events: none;
}

/* ── Thumbnails ────────────────────────────────── */
.pis .pis__thumbs-wrap {
	position: relative;
	flex: 0 0 auto;
	width: var(--pis-wrap-w);
	min-width: 0;
}

.pis .pis__thumbs {
	position: var(--pis-inner-pos);
	inset: 0;
	display: flex;
	flex-direction: var(--pis-tdir);
	gap: var(--pis-tgap);
	padding: 4px;
	overflow: var(--pis-ov);
	overscroll-behavior: contain;
	scrollbar-width: none;
}

.pis .pis__thumbs::-webkit-scrollbar { display: none; }

.pis button.pis__thumb {
	flex: 0 0 auto;
	width: var(--pis-tw);
	height: var(--pis-th);
	min-width: 0;
	min-height: 0;
	margin: 0;
	padding: 0;
	overflow: hidden;
	border: 2px solid transparent;
	border-radius: 8px;
	background: none;
	opacity: .6;
	cursor: pointer;
	transition: opacity .25s ease, border-color .25s ease;
	-webkit-appearance: none;
	appearance: none;
}

.pis button.pis__thumb:hover { opacity: 1; background: none; }

.pis button.pis__thumb.is-active {
	opacity: 1;
	border-color: #111;
}

.pis button.pis__thumb:focus-visible { outline: 2px solid #111; outline-offset: 2px; }

.pis .pis__thumb img {
	display: block;
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	margin: 0;
	object-fit: cover;
	pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
	.pis *,
	.pis *::before,
	.pis *::after {
		transition-duration: .01ms !important;
	}
}
