/*
 * STARARTIST Product Card Gallery
 * Version 1.6.4
 */

.starartist-product-gallery,
.starartist-product-gallery * {
	box-sizing: border-box;
}

.starartist-product-gallery {
	position: relative;
	width: 100%;
	aspect-ratio: 4 / 5;
	overflow: hidden;
	background: #f4f4f2;
	isolation: isolate;
}

.starartist-product-gallery__viewport,
.starartist-product-gallery__track,
.starartist-product-gallery__slide {
	width: 100%;
	height: 100%;
}

.starartist-product-gallery__viewport {
	overflow: hidden;
}

.starartist-product-gallery__track {
	display: flex;
	overflow-x: auto;
	overflow-y: hidden;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	scrollbar-width: none;
	overscroll-behavior-inline: contain;
	-webkit-overflow-scrolling: touch;
}

.starartist-product-gallery__track::-webkit-scrollbar {
	display: none;
}

.starartist-product-gallery__slide {
	display: block;
	flex: 0 0 100%;
	min-width: 100%;
	overflow: hidden;
	scroll-snap-align: start;
	scroll-snap-stop: always;
	text-decoration: none;
}

/*
 * v1.6.3 introduced a <picture> wrapper so archive cards can deliberately use
 * 1024px on mobile and 1536px on desktop. The original cover rule targeted an
 * <img> that was a direct child of the slide, so the new <picture> retained the
 * square image's intrinsic height and exposed the lower part of the 4:5 card.
 * Make both the <picture> and its <img> fill the slide, restoring the exact
 * full-bleed 4:5 cover behavior without changing the sharper image sources.
 */
.starartist-product-gallery .starartist-product-gallery__slide > picture.starartist-product-gallery__picture {
	display: block !important;
	width: 100% !important;
	height: 100% !important;
	min-width: 100%;
	min-height: 100%;
	overflow: hidden;
}

.starartist-product-gallery .starartist-product-gallery__slide > picture.starartist-product-gallery__picture > img.starartist-product-gallery__image,
.starartist-product-gallery .starartist-product-gallery__slide > img.starartist-product-gallery__image {
	display: block !important;
	width: 100% !important;
	height: 100% !important;
	min-width: 100%;
	min-height: 100%;
	max-width: none !important;
	max-height: none !important;
	object-fit: cover !important;
	object-position: center center !important;
	user-select: none;
	-webkit-user-drag: none;
	transform: scale(1);
	transition: transform 520ms cubic-bezier(0.22, 1, 0.36, 1);
	will-change: transform;
}

.starartist-product-gallery__arrow {
	position: absolute;
	top: 50%;
	z-index: 5;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 54px;
	padding: 0;
	border: 0;
	border-radius: 0;
	margin: 0;
	background: rgba(255, 255, 255, 0.82);
	box-shadow: none;
	color: #111;
	cursor: pointer;
	transform: translateY(-50%);
	transition: opacity 180ms ease, background-color 180ms ease;
	-webkit-tap-highlight-color: transparent;
}

.starartist-product-gallery__arrow svg {
	width: 21px;
	height: 21px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.4;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.starartist-product-gallery__arrow--previous {
	left: 10px;
}

.starartist-product-gallery__arrow--next {
	right: 10px;
}

.starartist-product-gallery__arrow:hover,
.starartist-product-gallery__arrow:focus-visible {
	background: rgba(255, 255, 255, 0.98);
}

.starartist-product-gallery__arrow:focus-visible {
	outline: 1px solid currentColor;
	outline-offset: 2px;
}

.starartist-product-gallery__arrow:disabled {
	pointer-events: none;
}

.starartist-product-gallery.has-single-image .starartist-product-gallery__track {
	overflow: hidden;
}

@media (min-width: 768px) and (hover: hover) and (pointer: fine) {
	.starartist-product-gallery__arrow {
		opacity: 0;
	}

	.starartist-product-gallery:hover .starartist-product-gallery__arrow,
	.starartist-product-gallery:focus-within .starartist-product-gallery__arrow {
		opacity: 1;
	}

	/* Only the hovered product image zooms; text overlays remain unchanged. */
	.starartist-product-gallery:hover .starartist-product-gallery__image,
	.starartist-product-gallery:focus-within .starartist-product-gallery__image {
		transform: scale(1.04);
	}
}

@media (max-width: 767px) {
	/* Mobile uses native horizontal touch swiping, with no arrow controls. */
	.starartist-product-gallery__arrow {
		display: none !important;
	}

	/* Explicitly disable the desktop hover zoom on mobile. */
	.starartist-product-gallery__image {
		transform: none !important;
		transition: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.starartist-product-gallery__track {
		scroll-behavior: auto;
	}

	.starartist-product-gallery__arrow,
	.starartist-product-gallery__image {
		transition: none;
	}
}
