/*
 * Lekka galeria produktu (zamiennik woo-product-gallery-slider).
 * Slider = CSS scroll-snap (natywny swipe + natywny lazy). Ładowany tylko na produkcie.
 */

.soly-gallery {
	position: relative;
	width: 100%;
	margin: 0 0 1em;
}

/* ---- Główny slider ---- */
.soly-gallery__stage {
	position: relative;
}

.soly-gallery__track {
	display: flex;
	margin: 0;
	padding: 0;
	list-style: none;
	overflow-x: auto;
	overflow-y: hidden;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none; /* Firefox */
}

.soly-gallery__track::-webkit-scrollbar {
	display: none; /* WebKit */
}

.soly-gallery__slide {
	flex: 0 0 100%;
	max-width: 100%;
	margin: 0;
	padding: 0;
	list-style: none;
	scroll-snap-align: start;
}

.soly-gallery .soly-gallery__img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 30px; /* parzyste z prod; scope .soly-gallery bije regułę Astry div.product img */
}

/* ---- Strzałki (styl przejęty z wpgs_form.custom_css) ---- */
.soly-gallery__arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 10;
	width: 32px;
	height: 32px;
	padding: 0;
	border: 0;
	background: transparent;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}

.soly-gallery__arrow--prev {
	left: 24px;
}

.soly-gallery__arrow--next {
	right: 24px;
}

.soly-gallery__arrow::before {
	content: "";
	display: block;
	width: 10px;
	height: 10px;
	border-top: 2px solid #fff; /* parzyste z prod (slider_nav_color:#ffffff) */
	border-left: 2px solid #fff;
	position: absolute;
	top: 50%;
	left: 50%;
}

.soly-gallery__arrow--prev::before {
	transform: translate(-30%, -50%) rotate(-45deg);
}

.soly-gallery__arrow--next::before {
	transform: translate(-70%, -50%) rotate(135deg);
}

.soly-gallery__arrow:hover::before {
	opacity: 0.7;
}

/* ---- Miniatury (desktop; ukryte ≤1024px, parzyste z wtyczką) ---- */
.soly-gallery__thumbs-wrap {
	position: relative;
	margin: 10px 0 0;
}

/*
 * Jeden rząd, 4 widoczne, reszta przewijana — parzyste z wtyczką
 * (thumb_to_show=4, thumb_scroll_by=1). Wcześniej flex-wrap: wrap łamał
 * miniatury na kolejne wiersze przy 5+ zdjęciach.
 */
.soly-gallery__thumbs {
	position: relative; /* baza dla offsetLeft w soly-gallery.js */
	display: flex;
	flex-wrap: nowrap;
	gap: 10px;
	margin: 0;
	padding: 0;
	list-style: none;
	overflow-x: auto;
	overflow-y: hidden;
	scroll-snap-type: x proximity;
	scroll-behavior: smooth;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none; /* Firefox */
}

.soly-gallery__thumbs::-webkit-scrollbar {
	display: none; /* WebKit */
}

.soly-gallery__thumb {
	flex: 0 0 calc(25% - 7.5px);
	max-width: calc(25% - 7.5px);
	margin: 0;
	list-style: none;
	scroll-snap-align: start;
}

.soly-gallery__thumb-btn {
	display: block;
	width: 100%;
	padding: 0;
	border: 1px solid transparent; /* prod: aktywna 1px solid #000 */
	border-radius: 6px; /* parzyste z prod */
	overflow: hidden;
	background: none;
	cursor: pointer;
	line-height: 0;
}

.soly-gallery__thumb.is-active .soly-gallery__thumb-btn {
	border-color: #000;
}

.soly-gallery .soly-gallery__thumb-img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 2 / 3;    /* wszystkie miniatury tej samej wysokości (jak prod) */
	object-fit: cover;      /* kadruj zamiast zniekształcać (poziome zdjęcia też 2:3) */
	border-radius: 6px;     /* parzyste z prod */
}

/* ---- Strzałki paska miniatur (JS zdejmuje [hidden] tylko przy przewijalnym pasku) ---- */
.soly-gallery__thumb-arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 5;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.9);
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}

.soly-gallery__thumb-arrow[hidden] {
	display: none; /* bije display: flex powyżej */
}

.soly-gallery__thumb-arrow--prev {
	left: 0;
}

.soly-gallery__thumb-arrow--next {
	right: 0;
}

.soly-gallery__thumb-arrow::before {
	content: "";
	display: block;
	width: 8px;
	height: 8px;
	border-top: 2px solid #000; /* pasek jest na białym tle, nie na zdjęciu */
	border-left: 2px solid #000;
	position: absolute;
	top: 50%;
	left: 50%;
}

.soly-gallery__thumb-arrow--prev::before {
	transform: translate(-30%, -50%) rotate(-45deg);
}

.soly-gallery__thumb-arrow--next::before {
	transform: translate(-70%, -50%) rotate(135deg);
}

.soly-gallery__thumb-arrow:hover::before {
	opacity: 0.7;
}

.soly-gallery__thumb-arrow.is-disabled {
	opacity: 0.35;
	pointer-events: none;
}

@media (max-width: 1024px) {
	.soly-gallery__thumbs-wrap {
		display: none;
	}
}
