/**
 * Horizontal product carousel — native CSS scroll-snap (no JS animation library).
 */

.mst-carousel-wrap {
	position: relative;
}

.mst-carousel {
	display: flex;
	gap: var(--space-3);
	overflow-x: auto;
	scroll-snap-type: x proximity;
	scroll-padding-inline: var(--space-3);
	padding-bottom: var(--space-2);
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
}

.mst-carousel::-webkit-scrollbar {
	display: none;
}

.mst-carousel > * {
	scroll-snap-align: start;
	flex: 0 0 auto;
	width: 240px;
}

@media (min-width: 640px) {
	.mst-carousel > * {
		width: 260px;
	}
}

.mst-carousel-nav {
	display: none;
}

@media (min-width: 900px) {
	.mst-carousel-nav {
		display: flex;
		gap: var(--space-2);
	}

	.mst-carousel-btn {
		width: 40px;
		height: 40px;
		border-radius: var(--radius-full);
		border: 1px solid var(--border);
		background: var(--bg-elevated);
		display: inline-flex;
		align-items: center;
		justify-content: center;
		transition: background-color var(--dur-fast) var(--ease-out), opacity var(--dur-fast);
	}

	.mst-carousel-btn:hover {
		background: var(--bg-subtle);
	}

	.mst-carousel-btn:disabled {
		opacity: 0.35;
		cursor: default;
	}

	.mst-carousel-btn svg {
		width: 16px;
		height: 16px;
	}
}

/* Infinite-scroll grid */
.mst-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: var(--space-3);
}

@media (min-width: 640px) {
	.mst-grid {
		grid-template-columns: repeat(3, 1fr);
		gap: var(--space-4);
	}
}

@media (min-width: 1024px) {
	.mst-grid {
		grid-template-columns: repeat(4, 1fr);
	}
}

.mst-load-sentinel {
	grid-column: 1 / -1;
	display: flex;
	justify-content: center;
	padding: var(--space-5) 0;
}

.mst-spinner {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	border: 3px solid var(--border);
	border-top-color: var(--mst-accent);
	animation: mst-spin 0.7s linear infinite;
}

@keyframes mst-spin {
	to {
		transform: rotate(360deg);
	}
}
