/* Category-page banner slider — mobile-only strip above filters/products.
 * Height comes from --yps-cs-h (admin-configurable, default 120px), set
 * inline per instance in class-yps-category-slider.php::render(). Hidden on
 * desktop at the same 768px breakpoint the header slider (slider.css) and
 * the rest of the theme already use for the mobile/desktop split. */

.yps-cat-slider {
	position: relative;
	overflow: hidden;
	margin: 0 12px 12px;
	border-radius: 14px;
}

@media (min-width: 768px) and (max-width: 767px) {
	.yps-cat-slider { display: none; }
}

.yps-cat-slider__track {
	display: flex;
	align-items: stretch;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
	scroll-behavior: smooth;
	height: var(--yps-cs-h, 120px);
}
.yps-cat-slider__track::-webkit-scrollbar { display: none; }

.yps-cat-slider__slide {
	flex: 0 0 100%;
	scroll-snap-align: center;
	scroll-snap-stop: always;
	position: relative;
	display: block;
	height: 100%;
}

.yps-cat-slider__slide img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* A single banner needs no swipe affordance. */
.yps-cat-slider[data-count="1"] .yps-cat-slider__track { overflow-x: hidden; }

.yps-cat-slider__dots {
	position: absolute;
	inset-inline: 0;
	bottom: 8px;
	display: flex;
	justify-content: center;
	gap: 6px;
	z-index: 2;
	pointer-events: none;
}
.yps-cat-slider__dot {
	pointer-events: auto;
	width: 6px;
	height: 6px;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: rgba(255, 255, 255, .6);
	cursor: pointer;
	transition: width .2s, background .2s;
}
.yps-cat-slider__dot.is-active {
	width: 18px;
	background: #fff;
}
.yps-cat-slider__dot:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.yps-cat-slider[data-count]:not([data-count="1"])::after {
	content: "";
	position: absolute;
	inset-inline: 0;
	bottom: 0;
	height: 28px;
	background: linear-gradient(to top, rgba(0, 0, 0, .28), rgba(0, 0, 0, 0));
	pointer-events: none;
	z-index: 1;
}

@media (prefers-reduced-motion: reduce) {
	.yps-cat-slider__track { scroll-behavior: auto; }
}
