/* ==========================================================================
   Product carousel

   A native scroll container with snap points. Works with touch, trackpad,
   keyboard and assistive tech before any JS loads; the arrows only enhance it.
   ========================================================================== */

.products-head__actions {
	display: flex;
	align-items: center;
	gap: var(--space-s);
}

.carousel-nav {
	display: flex;
	gap: 6px;
}

.carousel-nav[hidden] {
	display: none;
}

.carousel-btn {
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	flex: none;
	border: 1px solid var(--border-strong);
	border-radius: var(--radius-full);
	background: var(--surface);
	color: var(--text);
	cursor: pointer;
	transition: background-color 0.18s ease, border-color 0.18s ease, opacity 0.18s ease;
}

.carousel-btn svg {
	width: 18px;
	height: 18px;
}

.carousel-btn:hover:not(:disabled) {
	background: var(--gold-500);
	border-color: var(--gold-500);
	color: var(--on-accent);
}

.carousel-btn:disabled {
	opacity: 0.35;
	cursor: not-allowed;
}

/* --------------------------------------------------------------------------
   Track
   -------------------------------------------------------------------------- */

ul.products.products--carousel {
	display: flex !important;
	grid-template-columns: none !important;
	gap: var(--space-m);
	overflow-x: auto;
	overscroll-behavior-inline: contain;
	scroll-snap-type: x proximity;
	scroll-padding-inline-start: 0;
	/* room for the card hover lift and focus ring */
	margin-block-start: var(--space-2xl);
	/* Scrollbar hidden: the arrows and the peeking next card carry the
	   affordance, and the track stays fully scrollable by touch and keyboard. */
	scrollbar-width: none;
	-ms-overflow-style: none;
}

ul.products.products--carousel:focus-visible {
	outline: 2px solid var(--focus);
	outline-offset: 4px;
}

ul.products.products--carousel > li.product {
	/* five across on desktop, accounting for the four gaps between them */
	flex: 0 0 calc((100% - 4 * var(--space-m)) / 5);
	scroll-snap-align: start;
}

ul.products.products--carousel::-webkit-scrollbar {
	display: none;
}

/* --------------------------------------------------------------------------
   Responsive counts — the next card peeks so the track reads as scrollable
   -------------------------------------------------------------------------- */

@media (max-width: 1200px) {
	ul.products.products--carousel > li.product {
		flex-basis: calc((100% - 3 * var(--space-m)) / 4);
	}
}

@media (max-width: 1000px) {
	ul.products.products--carousel > li.product {
		flex-basis: calc((100% - 2 * var(--space-m)) / 3);
	}
}

@media (max-width: 760px) {
	ul.products.products--carousel {
		gap: var(--space-s);
		margin-block-start: var(--space-xl);
	}

	ul.products.products--carousel > li.product {
		flex-basis: calc((100% - var(--space-s)) / 2 - 12px);
	}
}

@media (max-width: 460px) {
	ul.products.products--carousel > li.product {
		flex-basis: 74%;
	}
}

/* Stack the header actions on narrow screens. */
@media (max-width: 860px) {
	.products-head__actions {
		justify-content: space-between;
		width: 100%;
	}
}


