/* صنعت‌پرداز | تجربه فروشگاه — all rules are scoped to .spx or spx- classes. */

.spx {
	--spx-primary: #0e4062;
	--spx-primary-hover: #0a2f48;
	--spx-primary-tint: #eef4f8;
	--spx-accent: #ff6f00;
	--spx-accent-strong: #b85000;
	--spx-accent-tint: #fff3e8;
	--spx-text: #1f2933;
	--spx-muted: #5b6672;
	--spx-border: #e3e7eb;
	--spx-bg: #f6f8fa;
	--spx-surface: #ffffff;
	--spx-success: #1e7b45;
	--spx-oos: #6b7280;
	--spx-radius-s: 8px;
	--spx-radius-m: 12px;
	--spx-radius-l: 16px;
	--spx-gap: 16px;
	--spx-shadow: 0 6px 20px rgba(14, 64, 98, 0.08);
	--spx-ease: 180ms ease-out;
	color: var(--spx-text);
	direction: rtl;
	text-align: right;
	line-height: 1.8;
}

.spx *,
.spx *::before,
.spx *::after {
	box-sizing: border-box;
}

.spx a {
	color: inherit;
	text-decoration: none;
}

/* Theme-proof buttons: themes style "button" globally (padding, min-height, background). */
.spx button {
	all: unset;
	box-sizing: border-box;
	cursor: pointer;
	font-family: inherit;
	-webkit-tap-highlight-color: transparent;
}

.spx [hidden] {
	display: none !important;
}

/* Safari-safe square media box (no reliance on aspect-ratio + height:100%). */
.spx .spx-ratio {
	position: relative;
	display: block;
	width: 100%;
	padding-top: 100%;
	overflow: hidden;
}

.spx .spx-ratio > img,
.spx .spx-ratio > picture,
.spx .spx-ratio > svg {
	position: absolute !important;
	inset: 0;
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	margin: 0 !important;
	object-fit: contain;
}

.spx :focus-visible,
.spx button:focus-visible {
	outline: 2px solid var(--spx-accent-strong);
	outline-offset: 2px;
}

.spx ul,
.spx ol {
	margin: 0;
	padding: 0;
	list-style: none;
}

.spx h2,
.spx h3 {
	margin: 0;
	color: var(--spx-text);
	font-weight: 700;
	letter-spacing: 0;
}

.spx-icon {
	width: 1.25em;
	height: 1.25em;
	flex: 0 0 auto;
}

.spx-sr-only {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

.spx-landing {
	margin-block-end: 8px;
}

.spx-section {
	margin-block: 0 32px;
}

/* ---------- Section heads ---------- */

.spx-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	margin-block-end: 14px;
}

.spx-head__title {
	font-size: 18px;
	line-height: 1.5;
}

.spx-head__more {
	display: inline-flex;
	align-items: center;
	gap: 2px;
	font-size: 13px;
	font-weight: 600;
	color: var(--spx-primary) !important;
	white-space: nowrap;
	min-height: 44px;
}

.spx-head__more .spx-icon {
	width: 16px;
	height: 16px;
}

/* ---------- Buttons and chips ---------- */

.spx .spx-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 44px;
	padding: 8px 18px;
	border: 1.5px solid transparent;
	border-radius: var(--spx-radius-s);
	font-size: 14px;
	font-weight: 700;
	line-height: 1.4;
	text-align: center;
	cursor: pointer;
	transition: background-color var(--spx-ease), border-color var(--spx-ease), color var(--spx-ease);
}

.spx .spx-btn--primary {
	background: var(--spx-primary);
	color: #fff !important;
}

.spx .spx-btn--primary:hover {
	background: var(--spx-primary-hover);
}

.spx .spx-btn--accent {
	background: var(--spx-accent-strong);
	color: #fff !important;
}

.spx .spx-btn--accent:hover {
	background: #9a4300;
}

.spx .spx-btn--outline {
	background: var(--spx-surface);
	border-color: var(--spx-primary);
	color: var(--spx-primary) !important;
}

.spx .spx-btn--outline:hover {
	background: var(--spx-primary-tint);
}

.spx .spx-btn--ghost {
	background: var(--spx-bg);
	border-color: var(--spx-border);
	color: var(--spx-text) !important;
}

.spx .spx-btn--ghost:hover {
	border-color: var(--spx-muted);
}

.spx .spx-btn.loading {
	opacity: 0.7;
	pointer-events: none;
}

.spx .spx-btn.added::after {
	content: "✓";
	margin-inline-start: 4px;
}

.spx .added_to_cart {
	display: block;
	margin-block-start: 6px;
	font-size: 12.5px;
	text-align: center;
	color: var(--spx-primary);
}

.spx-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 36px;
	padding: 4px 14px;
	border: 1px solid var(--spx-border);
	border-radius: 999px;
	background: var(--spx-surface);
	font-size: 13px;
	line-height: 1.4;
	white-space: nowrap;
	transition: border-color var(--spx-ease), background-color var(--spx-ease);
}

.spx-chip:hover {
	border-color: var(--spx-primary);
	background: var(--spx-primary-tint);
}

.spx-chip--strong {
	border-color: var(--spx-primary);
	color: var(--spx-primary) !important;
	font-weight: 700;
}

.spx-chip--brand {
	border-style: dashed;
}

.spx-chip__count {
	color: var(--spx-muted);
	font-size: 12px;
}

.spx-chip .spx-icon {
	width: 14px;
	height: 14px;
}

.spx .spx-link {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	min-height: 44px;
	padding: 0;
	border: 0;
	background: none;
	color: var(--spx-primary);
	font: inherit;
	font-size: 13.5px;
	font-weight: 600;
	cursor: pointer;
}

.spx .spx-link .spx-icon {
	width: 16px;
	height: 16px;
}

/* ---------- Hero search ---------- */

.spx-hero {
	padding: 20px 16px;
	border-radius: var(--spx-radius-l);
	background: var(--spx-primary-tint);
}

.spx-hero__title {
	font-size: 20px;
	line-height: 1.5;
	color: var(--spx-primary);
}

.spx-hero__sub {
	margin: 4px 0 14px;
	font-size: 14px;
	color: var(--spx-muted);
}

.spx-hero__chips {
	display: flex;
	flex-wrap: nowrap;
	align-items: center;
	gap: 8px;
	margin-block-start: 14px;
	overflow-x: auto;
	scrollbar-width: none;
	padding-block-end: 2px;
}

.spx-hero__chips::-webkit-scrollbar {
	display: none;
}

.spx-hero__chips-label {
	font-size: 13px;
	color: var(--spx-muted);
	white-space: nowrap;
}

/* ---------- Search box ---------- */

.spx-search {
	position: relative;
	margin: 0;
}

.spx-search__field {
	display: flex;
	align-items: center;
	gap: 8px;
	min-height: 54px;
	padding-inline: 14px 6px;
	border: 2px solid var(--spx-border);
	border-radius: var(--spx-radius-m);
	background: var(--spx-surface);
	transition: border-color var(--spx-ease), box-shadow var(--spx-ease);
}

.spx-search__field:focus-within {
	border-color: var(--spx-primary);
	box-shadow: 0 0 0 4px rgba(14, 64, 98, 0.12);
}

.spx-search__icon {
	color: var(--spx-muted);
}

.spx .spx-search__input {
	flex: 1 1 auto;
	min-width: 0;
	height: 48px;
	margin: 0;
	padding: 0;
	border: 0 !important;
	outline: 0;
	box-shadow: none !important;
	background: transparent !important;
	font: inherit;
	font-size: 16px;
	color: var(--spx-text);
}

.spx .spx-search__input::-webkit-search-cancel-button {
	display: none;
}

.spx .spx-search__input:focus-visible {
	outline: 0;
}

.spx .spx-search__clear {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: none;
	color: var(--spx-muted);
	cursor: pointer;
}

.spx .spx-search__clear[hidden] {
	display: none;
}

.spx .spx-search__submit {
	min-height: 42px;
	padding: 0 16px;
	border: 0;
	border-radius: var(--spx-radius-s);
	background: var(--spx-primary);
	color: #fff;
	font: inherit;
	font-size: 14px;
	font-weight: 700;
	cursor: pointer;
}

.spx .spx-search__submit:hover {
	background: var(--spx-primary-hover);
}

.spx-search__panel,
.spx-search-host .spx-search__panel--float {
	position: absolute;
	inset-inline: 0;
	top: calc(100% + 6px);
	z-index: 9999;
	max-height: min(70vh, 560px);
	overflow-y: auto;
	padding: 8px;
	border: 1px solid var(--spx-border, #e3e7eb);
	border-radius: 12px;
	background: #fff;
	box-shadow: 0 16px 40px rgba(14, 64, 98, 0.16);
	direction: rtl;
	text-align: right;
	color: #1f2933;
	line-height: 1.6;
}

.spx-search__panel[hidden] {
	display: none;
}

.spx-search-host {
	position: relative;
}

.spx-sr__group {
	padding: 6px 6px 10px;
	border-block-end: 1px solid #e3e7eb;
	margin-block-end: 6px;
}

.spx-sr__label {
	margin: 0 0 8px;
	font-size: 12.5px;
	color: #5b6672;
}

.spx-sr__chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	padding: 4px;
}

.spx-search__panel .spx-chip {
	display: inline-flex;
	align-items: center;
	min-height: 36px;
	padding: 4px 12px;
	border: 1px solid #e3e7eb;
	border-radius: 999px;
	background: #fff;
	font-size: 13px;
	color: #1f2933;
	text-decoration: none;
}

.spx-search__panel .spx-chip.is-active,
.spx-search__panel .spx-chip:hover {
	border-color: #0e4062;
	background: #eef4f8;
}

.spx-sr__list {
	display: flex;
	flex-direction: column;
}

.spx-sr__item {
	display: flex;
	align-items: center;
	gap: 12px;
	min-height: 64px;
	padding: 8px;
	border-radius: 8px;
	color: #1f2933 !important;
	text-decoration: none !important;
}

.spx-sr__item:hover,
.spx-sr__item.is-active {
	background: #eef4f8;
}

.spx-sr__img {
	width: 48px;
	height: 48px;
	flex: 0 0 48px;
	object-fit: contain;
	border-radius: 6px;
	background: #fff;
	border: 1px solid #e3e7eb;
}

.spx-sr__body {
	display: flex;
	flex-direction: column;
	min-width: 0;
	flex: 1 1 auto;
}

.spx-sr__title {
	display: -webkit-box;
	overflow: hidden;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.6;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

.spx-sr__meta {
	display: flex;
	gap: 10px;
	overflow: hidden;
	font-size: 12px;
	color: #5b6672;
	white-space: nowrap;
}

.spx-sr__price {
	flex: 0 0 auto;
	font-size: 13px;
	font-weight: 700;
	color: #0e4062;
	white-space: nowrap;
}

.spx-sr__price .is-oos {
	display: block;
	font-weight: 500;
	color: #6b7280;
}

.spx-sr__all {
	display: block;
	margin-block-start: 6px;
	padding: 12px 8px;
	border-block-start: 1px solid #e3e7eb;
	font-size: 13.5px;
	font-weight: 700;
	color: #0e4062 !important;
	text-align: center;
	text-decoration: none !important;
}

.spx-sr__all.is-active,
.spx-sr__all:hover {
	background: #eef4f8;
	border-radius: 8px;
}

.spx-sr__msg {
	margin: 0;
	padding: 12px 8px;
	font-size: 13.5px;
	color: #5b6672;
}

/* ---------- Category circles ---------- */

.spx-cats__list {
	display: flex;
	gap: 12px;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	padding-block-end: 4px;
}

.spx-cats__list::-webkit-scrollbar {
	display: none;
}

.spx-cats__list > li {
	flex: 0 0 88px;
	scroll-snap-align: start;
}

.spx-cat {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	text-align: center;
}

.spx-cat__media {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 80px;
	height: 80px;
	overflow: hidden;
	border: 1px solid var(--spx-border);
	border-radius: 50%;
	background: var(--spx-bg);
	color: var(--spx-primary);
	transition: border-color var(--spx-ease);
}

.spx-cat:hover .spx-cat__media {
	border-color: var(--spx-primary);
}

.spx .spx-cat__img {
	display: block;
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	object-fit: cover;
}

.spx-cat__icon {
	width: 34px;
	height: 34px;
}

.spx-cat__name {
	display: -webkit-box;
	overflow: hidden;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.5;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

.spx-cat__count {
	font-size: 11.5px;
	color: var(--spx-muted);
}

/* ---------- Finder ---------- */

.spx-finder {
	padding: 18px 16px;
	border: 1px solid var(--spx-border);
	border-inline-start: 4px solid var(--spx-accent-strong);
	border-radius: var(--spx-radius-l);
	background: var(--spx-surface);
}

.spx-finder__intro {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.spx-finder__title {
	font-size: 18px;
	line-height: 1.5;
}

.spx-finder__sub {
	margin: 4px 0 0;
	font-size: 14px;
	color: var(--spx-muted);
}

.spx-finder__start {
	align-self: flex-start;
}

.spx-finder.is-enhanced:not(.is-open) .spx-finder__body {
	display: none;
}

.spx-finder.is-open .spx-finder__start {
	display: none;
}

.spx-finder__body {
	margin-block-start: 16px;
	scroll-margin-top: 90px;
}

.spx-steps {
	display: flex;
	gap: 6px;
	margin-block-end: 16px;
	counter-reset: spx-step;
}

.spx-steps li {
	flex: 1 1 0;
	padding-block-start: 8px;
	border-block-start: 3px solid var(--spx-border);
	font-size: 12.5px;
	color: var(--spx-muted);
	counter-increment: spx-step;
}

.spx-steps li::before {
	content: counter(spx-step, persian) ". ";
}

.spx-steps li[aria-current="step"] {
	border-color: var(--spx-accent-strong);
	color: var(--spx-text);
	font-weight: 700;
}

.spx-steps li.is-done {
	border-color: var(--spx-primary);
}

.spx-finder__q {
	margin-block-end: 12px;
	font-size: 16px;
	outline: none;
}

.spx-finder__picked {
	margin: -6px 0 12px;
	font-size: 13px;
	color: var(--spx-muted);
}

.spx-finder__step .spx-head .spx-finder__q {
	margin: 0;
}

.spx-options {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 10px;
}

.spx .spx-option {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	width: 100%;
	min-height: 64px;
	padding: 12px;
	border: 1px solid var(--spx-border);
	border-radius: var(--spx-radius-m);
	background: var(--spx-surface);
	font: inherit;
	color: var(--spx-text);
	text-align: right;
	cursor: pointer;
	transition: border-color var(--spx-ease), background-color var(--spx-ease);
}

.spx .spx-option:hover {
	border-color: var(--spx-primary);
	background: var(--spx-primary-tint);
}

.spx-option__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	flex: 0 0 38px;
	border-radius: 10px;
	background: var(--spx-accent-tint);
	color: var(--spx-accent-strong);
}

.spx-option__text {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.spx-option__title {
	font-size: 13.5px;
	font-weight: 700;
	line-height: 1.6;
}

.spx-option__desc {
	font-size: 12px;
	line-height: 1.6;
	color: var(--spx-muted);
}

.spx-finder__cats {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-block-end: 12px;
}

.spx-finder__actions {
	display: flex;
	gap: 20px;
	margin-block-start: 6px;
}

.spx-finder__empty {
	padding: 16px 0;
	font-size: 14px;
	color: var(--spx-muted);
}

/* ---------- Use cases ---------- */

.spx-uses__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 10px;
}

.spx-use {
	display: flex;
	flex-direction: column;
	gap: 8px;
	height: 100%;
	min-height: 120px;
	padding: 14px;
	border: 1px solid var(--spx-border);
	border-radius: var(--spx-radius-m);
	background: var(--spx-surface);
	transition: border-color var(--spx-ease);
}

.spx-use:hover {
	border-color: var(--spx-primary);
}

.spx-use__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 10px;
	background: var(--spx-primary-tint);
	color: var(--spx-primary);
}

.spx-use__title {
	font-size: 14px;
	font-weight: 700;
	line-height: 1.6;
}

.spx-use__meta {
	margin-block-start: auto;
	font-size: 12px;
	color: var(--spx-muted);
}

/* ---------- Product rails ---------- */

.spx-rail-wrap {
	position: relative;
}

.spx-rail {
	display: flex;
	gap: 12px;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-padding-inline: 2px;
	scrollbar-width: thin;
	padding: 2px 2px 10px;
	overscroll-behavior-x: contain;
}

.spx-rail__item {
	flex: 0 0 168px;
	scroll-snap-align: start;
	display: flex;
}

.spx .spx-rail__nav {
	display: none;
}

.spx-row--accent {
	padding: 18px 14px 12px;
	border-radius: var(--spx-radius-l);
	background: var(--spx-primary);
}

.spx-row--accent .spx-head__title {
	color: #fff;
}

.spx-row--accent .spx-head__more {
	color: #fff !important;
}

.spx-row--accent .spx-head__title::before {
	content: "";
	display: inline-block;
	width: 10px;
	height: 10px;
	margin-inline-end: 10px;
	border-radius: 2px;
	background: var(--spx-accent);
	transform: rotate(45deg) translateY(-2px);
}

/* ---------- Product card ---------- */

.spx-card {
	display: flex;
	flex-direction: column;
	width: 100%;
	overflow: hidden;
	border: 1px solid var(--spx-border);
	border-radius: var(--spx-radius-m);
	background: var(--spx-surface);
	transition: box-shadow var(--spx-ease), border-color var(--spx-ease);
}

.spx-card__media {
	display: block;
	padding: 10px;
	background: #fff;
}

.spx-card.is-oos .spx-card__img {
	opacity: 0.55;
}

.spx-card__body {
	display: flex;
	flex-direction: column;
	gap: 4px;
	flex: 1 1 auto;
	padding: 4px 12px 12px;
}

.spx-card__brand {
	font-size: 12px;
	color: var(--spx-muted);
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.spx-card__title {
	display: -webkit-box;
	min-height: 3.2em;
	overflow: hidden;
	font-size: 13.5px !important;
	font-weight: 600;
	line-height: 1.6 !important;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

.spx-card__title a:hover {
	color: var(--spx-primary);
}

.spx-card__sku {
	font-size: 11.5px;
	color: var(--spx-muted);
}

.spx-card__foot {
	display: flex;
	flex-direction: column;
	gap: 2px;
	margin-block-start: auto;
	padding-block-start: 6px;
}

.spx-card__price {
	font-size: 15px;
	font-weight: 800;
	color: var(--spx-primary);
	line-height: 1.6;
}

.spx-card__price del {
	display: block;
	font-size: 12px;
	font-weight: 400;
	color: var(--spx-muted);
}

.spx-card__price ins {
	text-decoration: none;
}

.spx-price-date {
	display: block;
	margin-block-start: 3px;
	color: var(--spx-muted);
	font-size: 11.5px;
	font-weight: 500;
	line-height: 1.6;
}

.spx-price-date time {
	white-space: nowrap;
}

.spx-stock {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-size: 12px;
	font-weight: 600;
}

.spx-stock .spx-icon {
	width: 14px;
	height: 14px;
}

.spx-stock--in {
	color: var(--spx-success);
}

.spx-stock--out {
	color: var(--spx-oos);
}

.spx-card__btn {
	width: 100%;
	margin-block-start: 8px;
	min-height: 40px;
	padding: 6px 10px;
	font-size: 13px;
}

/* Skeleton */

.spx-card--skel {
	pointer-events: none;
}

.spx-skel {
	border-radius: 6px;
	background: linear-gradient(90deg, #eef1f4 25%, #f6f8fa 50%, #eef1f4 75%);
	background-size: 200% 100%;
	animation: spx-shimmer 1.2s linear infinite;
}

.spx-skel--media {
	height: 0;
	padding-top: calc(100% - 20px);
	margin: 10px;
}

.spx-skel--line {
	height: 12px;
	margin-block: 6px;
}

.spx-skel--short {
	width: 60%;
}

@keyframes spx-shimmer {
	from { background-position: 200% 0; }
	to { background-position: -200% 0; }
}

/* ---------- Brands ---------- */

.spx-brands__list {
	display: flex;
	gap: 10px;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	padding-block-end: 4px;
}

.spx-brands__list::-webkit-scrollbar {
	display: none;
}

.spx-brands__list > li {
	flex: 0 0 128px;
	scroll-snap-align: start;
}

.spx-brand {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 6px;
	height: 96px;
	padding: 10px;
	border: 1px solid var(--spx-border);
	border-radius: var(--spx-radius-m);
	background: var(--spx-surface);
	text-align: center;
	transition: border-color var(--spx-ease);
}

.spx-brand:hover {
	border-color: var(--spx-primary);
}

.spx .spx-brand__img {
	width: auto;
	max-width: 100%;
	height: 44px;
	object-fit: contain;
}

.spx-brand__name {
	display: -webkit-box;
	overflow: hidden;
	font-size: 13px;
	font-weight: 700;
	line-height: 1.5;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

.spx-brand__count {
	font-size: 11.5px;
	color: var(--spx-muted);
}

/* ---------- All categories (cards) ---------- */

.spx-allcats__grid {
	display: grid;
	gap: 12px;
}

.spx-catcard {
	padding: 12px;
	border: 1px solid var(--spx-border);
	border-radius: var(--spx-radius-m);
	background: var(--spx-surface);
}

.spx-catcard__head {
	display: flex;
	align-items: center;
	gap: 12px;
	min-height: 56px;
}

.spx-catcard__media {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 56px;
	width: 56px;
	height: 56px;
	overflow: hidden;
	border-radius: 12px;
	background: var(--spx-bg);
	color: var(--spx-primary);
}

.spx .spx-catcard__media img {
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	object-fit: cover;
}

.spx-catcard__text {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	min-width: 0;
}

.spx-catcard__name {
	font-size: 15px;
	font-weight: 700;
	line-height: 1.5;
}

.spx-catcard__count {
	font-size: 12px;
	color: var(--spx-muted);
}

.spx-catcard__go {
	color: var(--spx-muted);
}

.spx-catcard__head:hover .spx-catcard__name {
	color: var(--spx-primary);
}

.spx-catcard__children {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-block-start: 10px;
	padding-block-start: 10px;
	border-block-start: 1px dashed var(--spx-border);
}

.spx-catcard__children .spx-chip {
	min-height: 32px;
	font-size: 12.5px;
}

/* ---------- Trust & help ---------- */

.spx-trust__list {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 10px;
}

.spx-trust__item {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	padding: 12px;
	border-radius: var(--spx-radius-m);
	background: var(--spx-bg);
	font-size: 12.5px;
	line-height: 1.6;
	color: var(--spx-muted);
}

.spx-trust__item strong {
	display: block;
	font-size: 13.5px;
	color: var(--spx-text);
}

.spx-trust__icon {
	width: 26px;
	height: 26px;
	color: var(--spx-primary);
}

.spx-help {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 12px;
	padding: 18px 16px;
	border-radius: var(--spx-radius-l);
	background: var(--spx-primary-tint);
}

.spx-help__icon {
	display: flex;
	color: var(--spx-primary);
}

.spx-help__icon .spx-icon {
	width: 32px;
	height: 32px;
}

.spx-help__title {
	font-size: 16px;
}

.spx-help__text p {
	margin: 4px 0 0;
	font-size: 13.5px;
	color: var(--spx-muted);
}

/* ---------- Archive helpers ---------- */

.spx-all-heading {
	margin: 8px 0 16px !important;
	font-size: 20px !important;
}

.spx-active {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin-block-end: 16px;
	padding: 10px 14px;
	border-radius: var(--spx-radius-m);
	background: var(--spx-primary-tint);
	font-size: 14px;
}

.spx-active strong {
	color: var(--spx-primary);
}

.spx-oos-cta {
	background: #f6f8fa !important;
	border: 1px solid #e3e7eb !important;
	color: #1f2933 !important;
}

.spx-standalone .spx-section {
	margin-block-end: 0;
}

/* ---------- Archive header: description, subcategories, filters ---------- */

.spx-arch {
	margin-block-end: 20px;
}

.spx-arch--bottom {
	margin-block: 32px 0;
}

.spx-desc {
	position: relative;
	margin-block-end: 16px;
	font-size: 14px;
	line-height: 1.9;
	color: var(--spx-muted);
}

.spx-desc p {
	margin: 0 0 10px;
}

.spx-js .spx-desc__body {
	max-height: 5.7em;
	overflow: hidden;
	-webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent);
	mask-image: linear-gradient(to bottom, #000 55%, transparent);
}

.spx-js .spx-desc.is-open .spx-desc__body,
.spx-js .spx-desc.is-short .spx-desc__body {
	max-height: none;
	-webkit-mask-image: none;
	mask-image: none;
}

.spx .spx-desc__toggle {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	min-height: 40px;
	font-size: 13px;
	font-weight: 700;
	color: var(--spx-primary);
}

.spx-desc__toggle .spx-icon {
	width: 16px;
	height: 16px;
	transition: transform var(--spx-ease);
}

.spx-desc.is-open .spx-desc__toggle .spx-icon {
	transform: rotate(180deg);
}

.spx-subcats {
	margin-block-end: 16px;
}

.spx-subcats__list {
	display: flex;
	gap: 8px;
	overflow-x: auto;
	scroll-snap-type: x proximity;
	scrollbar-width: none;
	padding-block-end: 2px;
}

.spx-subcats__list::-webkit-scrollbar {
	display: none;
}

.spx-subcats__list > li {
	flex: 0 0 auto;
	scroll-snap-align: start;
}

.spx-subcat {
	display: flex;
	align-items: center;
	gap: 10px;
	min-height: 56px;
	padding: 6px 6px 6px 14px;
	border: 1px solid var(--spx-border);
	border-radius: var(--spx-radius-m);
	background: var(--spx-surface);
	transition: border-color var(--spx-ease);
}

.spx-subcat:hover,
.spx-subcat.is-current {
	border-color: var(--spx-primary);
}

.spx-subcat.is-current {
	background: var(--spx-primary-tint);
}

.spx-subcat__media {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 44px;
	width: 44px;
	height: 44px;
	overflow: hidden;
	border-radius: 10px;
	background: var(--spx-bg);
	color: var(--spx-primary);
}

.spx .spx-subcat__media img {
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	object-fit: cover;
}

.spx-subcat__text {
	display: flex;
	flex-direction: column;
	line-height: 1.5;
	white-space: nowrap;
}

.spx-subcat__name {
	font-size: 13.5px;
	font-weight: 700;
}

.spx-subcat__count {
	font-size: 11.5px;
	color: var(--spx-muted);
}

/* Filter bar */

.spx-fbar__row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
}

.spx .spx-fbar__open {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 44px;
	padding: 0 14px;
	border: 1px solid var(--spx-border);
	border-radius: 999px;
	background: var(--spx-surface);
	font-size: 14px;
	font-weight: 700;
	color: var(--spx-text);
}

.spx .spx-fbar__open:hover {
	border-color: var(--spx-primary);
}

.spx-fbar__badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 20px;
	height: 20px;
	padding: 0 6px;
	border-radius: 999px;
	background: var(--spx-primary);
	color: #fff;
	font-size: 12px;
}

.spx-switch {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 44px;
	padding: 0 12px;
	border: 1px solid var(--spx-border);
	border-radius: 999px;
	background: var(--spx-surface);
	font-size: 13.5px;
	cursor: pointer;
	user-select: none;
}

.spx-switch input {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
}

.spx-switch__track {
	position: relative;
	flex: 0 0 34px;
	width: 34px;
	height: 20px;
	border-radius: 999px;
	background: #c9d1d9;
	transition: background-color var(--spx-ease);
}

.spx-switch__track::after {
	content: "";
	position: absolute;
	top: 2px;
	right: 2px;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
	transition: transform var(--spx-ease);
}

.spx-switch input:checked + .spx-switch__track {
	background: var(--spx-success);
}

.spx-switch input:checked + .spx-switch__track::after {
	transform: translateX(-14px);
}

.spx-switch input:focus-visible + .spx-switch__track {
	outline: 2px solid var(--spx-accent-strong);
	outline-offset: 2px;
}

.spx-fbar__chips {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
}

.spx-chip--active {
	border-color: var(--spx-primary);
	background: var(--spx-primary-tint);
	color: var(--spx-primary) !important;
	font-weight: 600;
}

/* Filter panel: inline without JavaScript, drawer/bottom sheet with it */

.spx-fpanel {
	margin-block-start: 12px;
	border: 1px solid var(--spx-border);
	border-radius: var(--spx-radius-m);
	background: var(--spx-surface);
}

.spx-js .spx-fpanel {
	position: fixed;
	z-index: 100000;
	inset: auto 0 0 0;
	display: flex;
	flex-direction: column;
	max-height: 88vh;
	margin: 0;
	border: 0;
	border-radius: 18px 18px 0 0;
	box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.18);
	transform: translateY(105%);
	visibility: hidden;
	transition: transform 220ms ease-out, visibility 0s linear 220ms;
}

.spx-js .spx-fpanel.is-open {
	transform: none;
	visibility: visible;
	transition: transform 220ms ease-out, visibility 0s;
}

.spx-fbackdrop {
	position: fixed;
	z-index: 99999;
	inset: 0;
	background: rgba(15, 23, 32, 0.45);
}

.spx-fpanel__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 16px 10px;
	border-block-end: 1px solid var(--spx-border);
}

.spx .spx-fpanel__title {
	font-size: 16px;
}

.spx .spx-fpanel__close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	color: var(--spx-muted);
}

.spx .spx-fpanel__close:hover {
	background: var(--spx-bg);
}

.spx-fpanel__body {
	flex: 1 1 auto;
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 8px 16px;
}

.spx-fpanel__foot {
	display: flex;
	gap: 10px;
	padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
	border-block-start: 1px solid var(--spx-border);
}

.spx-fpanel__foot .spx-btn--primary {
	flex: 1 1 auto;
}

.spx .spx-fgroup {
	min-width: 0;
	margin: 0 !important;
	padding: 14px 0 !important;
	border: 0 !important;
	border-block-end: 1px solid var(--spx-border) !important;
	border-radius: 0 !important;
	background: none !important;
	box-shadow: none !important;
}

.spx .spx-fgroup:last-child {
	border-block-end: 0 !important;
}

.spx .spx-fgroup__title {
	display: block;
	float: none;
	width: 100%;
	margin: 0 0 8px !important;
	padding: 0 !important;
	border: 0;
	background: none;
	font-size: 14.5px;
	font-weight: 700;
	color: var(--spx-text);
}

.spx .spx-fgroup__search {
	width: 100%;
	min-height: 42px;
	margin: 0 0 8px;
	padding: 0 12px;
	border: 1px solid var(--spx-border);
	border-radius: var(--spx-radius-s);
	background: var(--spx-bg);
	font: inherit;
	font-size: 16px;
}

.spx-fgroup__list {
	display: flex;
	flex-direction: column;
	max-height: 320px;
	overflow-y: auto;
}

.spx-check {
	position: relative;
	display: flex;
	align-items: center;
	gap: 10px;
	min-height: 44px;
	padding-inline-end: 6px;
	cursor: pointer;
}

.spx-check input {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
}

.spx-check__box {
	flex: 0 0 20px;
	width: 20px;
	height: 20px;
	border: 1.5px solid #9aa5b1;
	border-radius: 5px;
	background: #fff;
}

.spx-check input:checked + .spx-check__box {
	border-color: var(--spx-primary);
	background: var(--spx-primary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7'/%3E%3C/svg%3E") center / 14px no-repeat;
}

.spx-check input:focus-visible + .spx-check__box {
	outline: 2px solid var(--spx-accent-strong);
	outline-offset: 2px;
}

.spx-check__label {
	flex: 1 1 auto;
	font-size: 14px;
}

.spx-check__count {
	font-size: 12px;
	color: var(--spx-muted);
}

.spx-price {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
}

.spx-price label {
	display: flex;
	flex-direction: column;
	gap: 4px;
	font-size: 12.5px;
	color: var(--spx-muted);
}

.spx .spx-price input {
	width: 100%;
	min-height: 44px;
	margin: 0;
	padding: 0 12px;
	border: 1px solid var(--spx-border);
	border-radius: var(--spx-radius-s);
	background: #fff;
	font: inherit;
	font-size: 16px;
	direction: ltr;
	text-align: right;
}

html.spx-lock,
html.spx-lock body {
	overflow: hidden !important;
}

/* ---------- Tablet ---------- */

@media (min-width: 600px) {
	.spx-section {
		margin-block-end: 40px;
	}

	.spx-hero {
		padding: 28px;
	}

	.spx-hero__title {
		font-size: 24px;
	}

	.spx-head__title {
		font-size: 20px;
	}

	.spx-options {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.spx-uses__grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.spx-finder {
		padding: 24px;
	}

	.spx-finder__intro {
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
	}

	.spx-finder__start {
		align-self: center;
		flex: 0 0 auto;
	}

	.spx-rail__item {
		flex-basis: 190px;
	}

	.spx-trust__list {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}

	.spx-help {
		flex-direction: row;
		align-items: center;
	}

	.spx-help__text {
		flex: 1 1 auto;
	}

	.spx-allcats__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		align-items: start;
	}
}

/* ---------- Desktop ---------- */

@media (min-width: 1024px) {
	.spx-hero {
		padding: 36px 40px;
	}

	.spx-hero .spx-search {
		max-width: 760px;
	}

	.spx-hero__chips {
		flex-wrap: wrap;
		overflow: visible;
	}

	.spx-cats__list {
		display: grid;
		grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
		gap: 20px 12px;
		overflow: visible;
	}

	.spx-cats__list > li {
		flex: none;
	}

	.spx-cat__media {
		width: 104px;
		height: 104px;
	}

	.spx-options {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}

	.spx-options--three {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		max-width: 760px;
	}

	.spx-uses__grid {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}

	.spx-rail__item {
		flex-basis: 210px;
	}

	.spx-row--accent {
		padding: 22px 20px 14px;
	}

	.spx-allcats__grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.spx-subcats__list {
		flex-wrap: wrap;
		overflow: visible;
	}

	.spx-js .spx-fpanel {
		inset: 0 0 0 auto;
		width: 380px;
		max-height: none;
		border-radius: 0;
		box-shadow: 0 0 40px rgba(0, 0, 0, 0.18);
		transform: translateX(105%);
	}
}

/* Arrow buttons only where a mouse can use them. */
@media (hover: hover) and (pointer: fine) {
	.spx .spx-rail__nav {
		position: absolute;
		top: 38%;
		z-index: 2;
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 40px;
		height: 40px;
		padding: 0;
		border: 1px solid var(--spx-border);
		border-radius: 50%;
		background: var(--spx-surface);
		color: var(--spx-text);
		box-shadow: var(--spx-shadow);
		cursor: pointer;
	}

	.spx .spx-rail__nav:hover {
		border-color: var(--spx-primary);
		color: var(--spx-primary);
	}

	.spx .spx-rail__nav--prev {
		right: 4px;
	}

	.spx .spx-rail__nav--next {
		left: 4px;
	}

	.spx-card:hover {
		border-color: #cfd6dd;
		box-shadow: var(--spx-shadow);
	}
}

@media (prefers-reduced-motion: reduce) {
	.spx *,
	.spx-js .spx-fpanel,
	.spx-search__panel * {
		transition: none !important;
		animation: none !important;
		scroll-behavior: auto !important;
	}
}
