/* Featured Collection — horizontal scroller.
 *
 * The section still renders WooCommerce's own `[products]` markup, so cards keep
 * the theme's styling, image ratios and add-to-cart behaviour. Only the layout
 * changes: the grid becomes a single scrolling row with snap points, plus the
 * arrows added by assets/js/featured-carousel.js.
 *
 * Kadence's grid classes (grid-cols / grid-lg-col-4 …) set display:grid with a
 * fixed column count, so those must be overridden here rather than fought at a
 * lower specificity. */

.po-featured {
	position: relative;
}

.home .po-featured ul.products,
.home .po-featured ul.products.grid-cols {
	display: flex;
	flex-wrap: nowrap;
	gap: 1.5rem;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	/* Room for the cards' own hover lift and shadow, and so the first/last card
	 * isn't flush against the section padding. */
	padding: 0.5rem 0.25rem 1.5rem;
	margin: 0;
	/* Firefox / IE-era scrollbar hiding; WebKit handled below. */
	scrollbar-width: none;
	-ms-overflow-style: none;
}
.home .po-featured ul.products::-webkit-scrollbar {
	display: none;
}

.home .po-featured ul.products li.product {
	flex: 0 0 auto;
	width: clamp(200px, 24vw, 280px);
	margin: 0;
	scroll-snap-align: start;
}

/* Arrows — deliberately minimal: a thin circle that sits over the section
 * background rather than a heavy control. `display`/`padding` declared because
 * Kadence gives every <button> filled-chip padding. */
.po-featured__arrow {
	position: absolute;
	top: 42%;
	transform: translateY(-50%);
	z-index: 3;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 1px solid var(--global-palette5, #bcbc94);
	border-radius: 50%;
	background: var(--global-palette9, #ffffff);
	color: var(--global-palette2, #54543c);
	cursor: pointer;
	box-shadow: 0 2px 10px rgba(60, 52, 35, 0.1);
	transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}
.po-featured__arrow:hover {
	background: var(--global-palette1, #747c34);
	border-color: var(--global-palette1, #747c34);
	color: #ffffff;
	box-shadow: 0 6px 18px rgba(60, 52, 35, 0.18);
}
/* Hidden rather than removed at the ends of the track, so the row doesn't
 * shift as the arrows appear and disappear. */
.po-featured__arrow[disabled] {
	opacity: 0;
	pointer-events: none;
}
.po-featured__arrow--prev {
	left: -22px;
}
.po-featured__arrow--next {
	right: -22px;
}

/* On narrow screens there's no room to hang the arrows outside the track, and
 * touch scrolling is the natural interaction, so drop them. */
@media (max-width: 900px) {
	.po-featured__arrow {
		display: none;
	}
	.home .po-featured ul.products li.product {
		width: 62vw;
	}
}

@media (prefers-reduced-motion: reduce) {
	.home .po-featured ul.products {
		scroll-behavior: auto;
	}
	.po-featured__arrow {
		transition: none;
	}
}
