.domotex-product-rail {
	--domotex-rail-gap: clamp(0.75rem, 1.6vw, 1.25rem);
	--domotex-rail-columns: 4;
	min-width: 0;
}

.domotex-product-rail__collection {
	min-width: 0;
	overflow-x: auto;
	overflow-y: hidden;
	scroll-behavior: smooth;
	scroll-padding-inline: 1px;
	scroll-snap-type: x mandatory;
	overscroll-behavior-inline: contain;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
}

.domotex-product-rail__collection::-webkit-scrollbar {
	display: none;
}

.domotex-product-rail__collection .wp-block-woocommerce-product-template,
.domotex-product-rail__collection .wc-block-product-template {
	display: flex !important;
	width: 100%;
	flex-wrap: nowrap !important;
	align-items: stretch;
	gap: var(--domotex-rail-gap);
	margin: 0;
	padding: 0 1px 0.25rem;
	list-style: none;
}

.domotex-product-rail__collection .wc-block-product {
	min-width: 0;
	flex: 0 0 calc((100% - (var(--domotex-rail-gap) * (var(--domotex-rail-columns) - 1))) / var(--domotex-rail-columns));
	margin: 0 !important;
	scroll-snap-align: start;
	scroll-snap-stop: always;
}

.domotex-product-rail__collection .wc-block-product > .domotex-product-card {
	width: 100%;
}

.domotex-product-rail--compact {
	--domotex-rail-columns: 2;
}

.domotex-product-rail__controls {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	align-items: center;
	width: 100%;
	gap: 0.75rem;
	margin-top: clamp(1rem, 2vw, 1.5rem);
}

.domotex-product-rail__controls[hidden] {
	display: none !important;
}

.domotex-product-rail__arrow {
	display: inline-grid;
	width: 2.5rem;
	height: 2.5rem;
	place-items: center;
	padding: 0;
	border: 1px solid var(--domotex-color-warm-border);
	border-radius: 50%;
	background: var(--domotex-color-white);
	color: var(--domotex-color-charcoal);
	font: inherit;
	cursor: pointer;
	transition: background-color 160ms ease, border-color 160ms ease, opacity 160ms ease;
}

.domotex-product-rail__arrow:hover:not(:disabled) {
	border-color: var(--domotex-color-charcoal);
	background: var(--domotex-color-category-background);
}

.domotex-product-rail__arrow:disabled {
	cursor: default;
	opacity: 0.42;
}

.domotex-product-rail__arrow span {
	font-size: 1.25rem;
	line-height: 1;
}

.domotex-product-rail__progress {
	width: 100%;
	padding-block: 0.5rem;
	cursor: default;
}

.domotex-product-rail__progress-track {
	position: relative;
	display: block;
	width: 100%;
	height: 2px;
	border-radius: var(--domotex-radius-pill);
	background: var(--domotex-color-warm-border);
}

.domotex-product-rail__progress-thumb {
	position: absolute;
	top: 0;
	left: 0;
	display: block;
	width: 20%;
	height: 100%;
	border-radius: inherit;
	background: var(--domotex-color-charcoal);
	transform: translateX(0);
	transition: transform 120ms linear, width 120ms linear;
}

.domotex-product-rail__progress[aria-valuenow="0"] .domotex-product-rail__progress-thumb {
	transform: translateX(0) !important;
}

@media (max-width: 767px) {
	.domotex-product-rail:not(.domotex-product-rail--compact) {
		--domotex-rail-columns: 2;
		--domotex-rail-gap: 0.75rem;
	}

	.domotex-product-rail__controls {
		grid-template-columns: auto minmax(0, 1fr) auto;
		gap: 0.5rem;
		margin-top: 0.875rem;
	}

	.domotex-product-rail__arrow {
		width: 2.25rem;
		height: 2.25rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.domotex-product-rail__collection {
		scroll-behavior: auto;
	}

	.domotex-product-rail__progress-thumb,
	.domotex-product-rail__arrow {
		transition: none;
	}
}
