/**
 * فیلتر پیشرفته — فرانت فروشگاه
 */

.nextshop-filter-form--advanced {
	--filter-surface: #ffffff;
	--filter-surface-muted: #f9fafb;
	--filter-surface-subtle: #fafafa;
	--filter-surface-hover: #ffffff;
	--filter-border: #e5e7eb;
	--filter-border-light: #f3f4f6;
	--filter-text: #374151;
	--filter-text-heading: #333333;
	--filter-text-secondary: #4b5563;
	--filter-text-muted: #6b7280;
	--filter-text-placeholder: #9ca3af;
	--filter-icon: #9ca3af;
	--filter-toggle-bg: #f9fafb;
	--filter-toggle-border: #f3f4f6;
	--filter-toggle-track: #d1d5db;
	--filter-toggle-thumb: #ffffff;
	--filter-check-bg: #ffffff;
	--filter-check-border: #d1d5db;
	--filter-cat-count-bg: #e5e7eb;
	--filter-cat-count-text: #6b7280;
	--filter-rail: #e5e7eb;
	--filter-slider-fill-start: color-mix(in srgb, var(--ns-primary) 45%, #ffffff);
	--filter-slider-fill-end: var(--ns-primary);
	--filter-slider-thumb: #ffffff;
	--filter-slider-thumb-ring: color-mix(in srgb, var(--ns-primary) 22%, transparent);
	--filter-price-value: var(--filter-text-heading);
	--filter-price-value-max: var(--ns-primary);
	--filter-price-sep: var(--filter-text-muted);
	--filter-price-unit: var(--filter-text-muted);
	--filter-focus-ring: var(--ns-primary-soft, rgba(239, 57, 78, 0.12));
	--filter-clear-border: #d1d5db;
	--filter-select2-choice-bg: #fef2f2;
	--filter-select2-choice-border: #fecaca;
	--filter-select2-choice-text: #b91c1c;
	--filter-drawer-bg: #f9fafb;
	--filter-drawer-close-bg: #f3f4f6;
	--filter-drawer-close-hover-bg: #fee2e2;
	--filter-status: #6b7280;
	--filter-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

/* کارت هم‌سبک ویجت‌های سایدبار */
.nextshop-shop-sidebar .nextshop-filter-form--advanced,
.nextshop-filter-form--advanced {
	background: var(--filter-surface);
	border: 1px solid var(--filter-border);
	border-radius: 12px;
	padding: 0;
	box-shadow: var(--filter-shadow);
	overflow: hidden;
	color: var(--filter-text);
}

.nextshop-filter-form--advanced .nextshop-filter-head {
	padding: 1.25rem 1.25rem 0;
	margin: 0;
}

.nextshop-filter-form--advanced .nextshop-filter-head__title {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin: 0 0 1rem;
	padding: 0 0 0.65rem;
	border-bottom: 2px solid var(--ns-primary);
	font-size: 1.1rem;
	font-weight: 700;
	color: var(--filter-text-heading);
	line-height: 1.4;
}

.nextshop-filter-form--advanced .nextshop-filter-head__title i {
	color: var(--ns-primary);
	font-size: 0.95rem;
}

/* ——— جستجو ——— */
.nextshop-filter-section--search {
	padding: 0 1.25rem 0.25rem;
}

.nextshop-filter-search {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.55rem 0.75rem;
	border: 1px solid var(--filter-border);
	border-radius: 10px;
	background: var(--filter-surface-muted);
	transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.nextshop-filter-search:focus-within {
	border-color: var(--ns-primary);
	background: var(--filter-surface-hover);
	box-shadow: 0 0 0 3px var(--filter-focus-ring);
}

.nextshop-filter-search__icon {
	color: var(--filter-icon);
	font-size: 0.85rem;
	flex-shrink: 0;
}

.nextshop-filter-search:focus-within .nextshop-filter-search__icon {
	color: var(--ns-primary);
}

.nextshop-filter-search__input {
	flex: 1;
	min-width: 0;
	border: 0;
	background: transparent;
	font: inherit;
	font-size: 0.875rem;
	color: var(--filter-text);
	outline: none;
}

.nextshop-filter-search__input::placeholder {
	color: var(--filter-text-placeholder);
}

.nextshop-filter-search__input::-webkit-search-cancel-button {
	-webkit-appearance: none;
}

/* ——— دسته‌بندی (ناو هوشمند) ——— */
.nextshop-filter-section--categories {
	padding-top: 0.25rem;
}

.nextshop-filter-cats {
	display: flex;
	flex-wrap: wrap;
	gap: 0.45rem;
}

.nextshop-filter-cat {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	padding: 0.45rem 0.75rem;
	border: 1px solid var(--filter-border);
	border-radius: 999px;
	background: var(--filter-surface-muted);
	color: var(--filter-text-secondary);
	font: inherit;
	font-size: 0.8rem;
	cursor: pointer;
	transition: background 0.2s, border-color 0.2s, color 0.2s;
	line-height: 1.3;
}

.nextshop-filter-cat:hover {
	border-color: var(--ns-primary);
	color: var(--ns-primary);
	background: var(--filter-surface-hover);
}

.nextshop-filter-cat--back {
	border-style: dashed;
	background: var(--filter-surface);
}

.nextshop-filter-cat--back i {
	font-size: 0.7rem;
	opacity: 0.85;
}

.nextshop-filter-cat.is-active {
	background: var(--ns-primary);
	border-color: var(--ns-primary);
	color: #fff;
}

.nextshop-filter-cat.is-active .nextshop-filter-cat__count {
	background: rgba(255, 255, 255, 0.25);
	color: #fff;
}

.nextshop-filter-cat__count {
	display: inline-block;
	min-width: 1.25rem;
	padding: 0 0.35rem;
	border-radius: 999px;
	background: var(--filter-cat-count-bg);
	font-size: 0.7rem;
	font-weight: 600;
	color: var(--filter-cat-count-text);
	text-align: center;
}

.nextshop-filter-dynamic.is-loading,
[data-nextshop-filter-price].is-loading {
	opacity: 0.5;
	pointer-events: none;
	min-height: 2rem;
}

/* بخش‌ها */
.nextshop-filter-form--advanced .nextshop-filter-section {
	padding: 0 1.25rem 1.15rem;
	margin: 0;
	border-bottom: 1px solid var(--filter-border-light);
}

.nextshop-filter-form--advanced .nextshop-filter-section:last-of-type {
	border-bottom: none;
}

.nextshop-filter-form--advanced .nextshop-filter-section__title {
	margin: 0 0 0.75rem;
	font-size: 0.9rem;
	font-weight: 600;
	color: var(--filter-text-secondary);
}

/* ——— اسلایدر محدوده قیمت ——— */
.nextshop-filter-section--price,
.nextshop-filter-form--advanced [data-nextshop-filter-price] {
	overflow: visible;
}

.nextshop-price-slider {
	--ns-slider-thumb: 20px;
	--ns-slider-track: 5px;
	--ns-slider-pad: calc(var(--ns-slider-thumb) / 2);
	font-family: var(--nextshop-font-family, inherit);
	padding: 0.35rem 0 0.65rem;
}

.nextshop-price-slider__values {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 0.5rem 0.75rem;
	margin-bottom: 1.1rem;
	font-family: inherit;
	font-size: 0.9375rem;
	line-height: 1.35;
}

.nextshop-price-slider__range-text {
	display: inline-flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.35rem 0.45rem;
	min-width: 0;
}

.nextshop-price-slider__value {
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	letter-spacing: 0.01em;
	color: var(--filter-price-value);
}

.nextshop-price-slider__value--max {
	color: var(--filter-price-value-max);
	font-weight: 700;
}

.nextshop-price-slider__sep {
	color: var(--filter-price-sep);
	font-size: 0.8125rem;
	font-weight: 500;
	text-transform: lowercase;
}

.nextshop-price-slider__unit {
	flex-shrink: 0;
	padding: 0.15rem 0.5rem;
	border-radius: 6px;
	background: var(--filter-surface-muted);
	border: 1px solid var(--filter-border-light);
	color: var(--filter-price-unit);
	font-size: 0.75rem;
	font-weight: 600;
	font-family: inherit;
	letter-spacing: 0.04em;
}

.nextshop-price-slider__track-wrap {
	position: relative;
	box-sizing: border-box;
	height: var(--ns-slider-thumb);
	margin: 0;
	padding: 0 var(--ns-slider-pad);
	overflow: visible;
	/* اسلایدر range در RTL جابه‌جا می‌شود؛ مسیر همیشه چپ→راست */
	direction: ltr;
}

.nextshop-price-slider__rail,
.nextshop-price-slider__fill {
	position: absolute;
	top: 50%;
	right: var(--ns-slider-pad);
	left: var(--ns-slider-pad);
	height: var(--ns-slider-track);
	margin: 0;
	transform: translateY(-50%);
	border-radius: 999px;
}

.nextshop-price-slider__rail {
	background: var(--filter-rail);
	box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.06);
}

.nextshop-price-slider__fill {
	background: linear-gradient(90deg, var(--filter-slider-fill-start), var(--filter-slider-fill-end));
	box-shadow: 0 0 10px color-mix(in srgb, var(--ns-primary) 28%, transparent);
	pointer-events: none;
	z-index: 1;
}

.nextshop-price-slider__range {
	position: absolute;
	top: 50%;
	right: 0;
	left: 0;
	width: 100%;
	height: var(--ns-slider-thumb);
	margin: 0;
	padding: 0;
	border: none;
	background: transparent;
	transform: translateY(-50%);
	pointer-events: none;
	-webkit-appearance: none;
	appearance: none;
	touch-action: none;
}

.nextshop-price-slider__range::-webkit-slider-runnable-track {
	height: var(--ns-slider-track);
	border: none;
	border-radius: 999px;
	background: transparent;
}

.nextshop-price-slider__range::-moz-range-track {
	height: var(--ns-slider-track);
	border: none;
	border-radius: 999px;
	background: transparent;
}

.nextshop-price-slider__range::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	width: var(--ns-slider-thumb);
	height: var(--ns-slider-thumb);
	margin-top: calc((var(--ns-slider-track) - var(--ns-slider-thumb)) / 2);
	border: 2px solid var(--ns-primary);
	border-radius: 50%;
	background: var(--filter-slider-thumb);
	box-shadow:
		0 1px 3px rgba(15, 23, 42, 0.18),
		0 0 0 4px var(--filter-slider-thumb-ring);
	cursor: pointer;
	pointer-events: auto;
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.nextshop-price-slider__range::-moz-range-thumb {
	box-sizing: border-box;
	width: var(--ns-slider-thumb);
	height: var(--ns-slider-thumb);
	border: 2px solid var(--ns-primary);
	border-radius: 50%;
	background: var(--filter-slider-thumb);
	box-shadow:
		0 1px 3px rgba(15, 23, 42, 0.18),
		0 0 0 4px var(--filter-slider-thumb-ring);
	cursor: pointer;
	pointer-events: auto;
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.nextshop-price-slider__range::-webkit-slider-thumb:hover {
	transform: scale(1.06);
	box-shadow:
		0 2px 6px rgba(15, 23, 42, 0.22),
		0 0 0 5px var(--filter-slider-thumb-ring);
}

.nextshop-price-slider__range--max {
	z-index: 2;
}

.nextshop-price-slider__range--min {
	z-index: 3;
}

/* ——— سوئیچ وضعیت ——— */
.nextshop-filter-toggles {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.nextshop-filter-toggle {
	display: flex;
	align-items: center;
	gap: 0.65rem;
	cursor: pointer;
	padding: 0.55rem 0.75rem;
	border-radius: 10px;
	background: var(--filter-toggle-bg);
	border: 1px solid var(--filter-toggle-border);
	transition: background 0.2s, border-color 0.2s;
}

.nextshop-filter-toggle:hover {
	background: var(--filter-surface-hover);
	border-color: var(--filter-border);
}

.nextshop-filter-toggle input {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
}

.nextshop-filter-toggle__box {
	flex-shrink: 0;
	width: 2.5rem;
	height: 1.35rem;
	border-radius: 999px;
	background: var(--filter-toggle-track);
	position: relative;
	transition: background 0.2s;
}

.nextshop-filter-toggle__box::after {
	content: '';
	position: absolute;
	top: 2px;
	right: 2px;
	width: 1.05rem;
	height: 1.05rem;
	border-radius: 50%;
	background: var(--filter-toggle-thumb);
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
	transition: transform 0.2s;
}

.nextshop-filter-toggle input:checked + .nextshop-filter-toggle__box {
	background: var(--ns-primary);
}

.nextshop-filter-toggle input:checked + .nextshop-filter-toggle__box::after {
	transform: translateX(-1.15rem);
}

.nextshop-filter-toggle__text {
	font-size: 0.875rem;
	color: var(--filter-text);
}

/* ——— چک‌باکس‌های لیست ——— */
.nextshop-filter-checks--scroll {
	max-height: 180px;
	overflow-y: auto;
	padding-left: 2px;
	scrollbar-width: thin;
}

.nextshop-filter-check-item {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	padding: 0.45rem 0;
	cursor: pointer;
}

.nextshop-filter-check-item input {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
}

.nextshop-filter-check-item__mark {
	flex-shrink: 0;
	width: 1.125rem;
	height: 1.125rem;
	border: 2px solid var(--filter-check-border);
	border-radius: 4px;
	background: var(--filter-check-bg);
	transition: border-color 0.2s, background 0.2s;
	position: relative;
}

.nextshop-filter-check-item__mark::after {
	content: '';
	position: absolute;
	top: 1px;
	right: 4px;
	width: 5px;
	height: 9px;
	border: solid #fff;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
	opacity: 0;
}

.nextshop-filter-check-item input:checked + .nextshop-filter-check-item__mark {
	background: var(--ns-primary);
	border-color: var(--ns-primary);
}

.nextshop-filter-check-item input:checked + .nextshop-filter-check-item__mark::after {
	opacity: 1;
}

.nextshop-filter-check-item__text {
	font-size: 0.875rem;
	color: var(--filter-text-secondary);
}

.nextshop-filter-check-item:hover .nextshop-filter-check-item__text {
	color: var(--ns-primary);
}

/* ——— سلکت مرتب‌سازی ——— */
.nextshop-filter-select-wrap {
	position: relative;
}

.nextshop-filter-select-wrap .nextshop-filter-select {
	width: 100%;
	appearance: none;
	-webkit-appearance: none;
	padding: 0.7rem 2.25rem 0.7rem 0.85rem;
	border: 1px solid var(--filter-border);
	border-radius: 10px;
	background: var(--filter-surface-muted);
	font: inherit;
	font-size: 0.875rem;
	color: var(--filter-text);
	cursor: pointer;
	transition: border-color 0.2s, box-shadow 0.2s;
}

.nextshop-filter-select-wrap .nextshop-filter-select:focus {
	outline: none;
	border-color: var(--ns-primary);
	box-shadow: 0 0 0 3px var(--filter-focus-ring);
	background: var(--filter-surface-hover);
}

.nextshop-filter-select-wrap__icon {
	position: absolute;
	left: 0.85rem;
	top: 50%;
	transform: translateY(-50%);
	font-size: 0.7rem;
	color: var(--filter-icon);
	pointer-events: none;
}

/* Select2 */
.nextshop-filter-form--advanced .select2-container {
	width: 100% !important;
}

.nextshop-filter-form--advanced .select2-container--default .select2-selection--multiple {
	min-height: 42px;
	border: 1px solid var(--filter-border);
	border-radius: 10px;
	background: var(--filter-surface-muted);
	padding: 4px 6px;
}

.nextshop-filter-form--advanced .select2-container--default.select2-container--focus .select2-selection--multiple {
	border-color: var(--ns-primary);
	box-shadow: 0 0 0 3px var(--filter-focus-ring);
}

.nextshop-filter-form--advanced .select2-container--default .select2-selection--multiple .select2-selection__choice {
	background: var(--filter-select2-choice-bg);
	border: 1px solid var(--filter-select2-choice-border);
	color: var(--filter-select2-choice-text);
	border-radius: 6px;
	font-size: 0.8rem;
}

/* ——— دکمه‌ها ——— */
.nextshop-filter-form--advanced .nextshop-filter-actions {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	padding: 1rem 1.25rem 1.25rem;
	background: var(--filter-surface-subtle);
	border-top: 1px solid var(--filter-border-light);
}

.nextshop-filter-form--advanced .nextshop-filter-actions__apply {
	width: 100%;
	gap: 0.4rem;
	background: var(--ns-primary);
	border-color: var(--ns-primary);
	border-radius: 10px;
	padding: 0.75rem 1rem;
	font-weight: 600;
}

.nextshop-filter-form--advanced .nextshop-filter-actions__apply:hover {
	background: #d32f3f;
	border-color: #d32f3f;
}

.nextshop-filter-form--advanced .nextshop-filter-actions__clear {
	width: 100%;
	background: transparent;
	border: 1px dashed var(--filter-clear-border);
	color: var(--filter-text-muted);
	border-radius: 10px;
	padding: 0.6rem 1rem;
}

.nextshop-filter-form--advanced .nextshop-filter-actions__clear:hover {
	border-color: var(--filter-text-placeholder);
	color: var(--filter-text);
}

.nextshop-filter-status {
	padding: 0 1.25rem 1rem;
	margin-top: -0.5rem;
	font-size: 0.8rem;
	color: var(--filter-status);
	min-height: 1.1rem;
	text-align: center;
}

.nextshop-filter-status.is-loading::before {
	content: '';
	display: inline-block;
	width: 0.875rem;
	height: 0.875rem;
	margin-left: 0.35rem;
	border: 2px solid currentColor;
	border-right-color: transparent;
	border-radius: 50%;
	vertical-align: middle;
	animation: nextshop-filter-spin 0.7s linear infinite;
}

.nextshop-product-grid.is-loading {
	opacity: 0.55;
	pointer-events: none;
	transition: opacity 0.2s ease;
}

/* ——— Infinite scroll ——— */
.nextshop-product-grid--infinite ul.products > li.product.nextshop-product-enter {
	animation: nextshop-infinite-product-in 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes nextshop-infinite-product-in {
	from {
		opacity: 0;
		transform: translateY(18px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.nextshop-infinite-scroll {
	grid-column: 1 / -1;
	width: 100%;
	padding: 1.75rem 1rem 0.5rem;
	display: flex;
	justify-content: center;
	align-items: center;
	min-height: 4.5rem;
}

.nextshop-infinite-scroll.is-hidden {
	min-height: 1px;
	padding: 0.5rem 0;
	opacity: 0;
	pointer-events: none;
}

.nextshop-infinite-scroll__inner {
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	gap: 0.75rem;
	padding: 1rem 1.5rem;
	border-radius: 14px;
	background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(249, 250, 251, 0.98) 100%);
	border: 1px solid var(--filter-border);
	box-shadow: 0 8px 28px rgba(15, 23, 42, 0.06);
	transition: opacity 0.25s ease, transform 0.25s ease;
}

.nextshop-infinite-scroll.is-hidden .nextshop-infinite-scroll__inner {
	opacity: 0;
	transform: translateY(6px);
}

.nextshop-infinite-scroll.is-loading .nextshop-infinite-scroll__inner {
	border-color: color-mix(in srgb, var(--ns-primary) 25%, var(--filter-border));
	box-shadow: 0 10px 32px color-mix(in srgb, var(--ns-primary) 12%, transparent);
}

.nextshop-infinite-scroll__spinner {
	display: none;
	width: 2rem;
	height: 2rem;
	border-radius: 50%;
	border: 3px solid color-mix(in srgb, var(--ns-primary) 18%, transparent);
	border-top-color: var(--ns-primary);
	animation: nextshop-filter-spin 0.75s linear infinite;
}

.nextshop-infinite-scroll__dots {
	display: none;
	align-items: center;
	gap: 0.35rem;
}

.nextshop-infinite-scroll__dots i {
	display: block;
	width: 0.45rem;
	height: 0.45rem;
	border-radius: 50%;
	background: var(--ns-primary);
	animation: nextshop-infinite-dot 1.1s ease-in-out infinite;
}

.nextshop-infinite-scroll__dots i:nth-child(2) {
	animation-delay: 0.15s;
}

.nextshop-infinite-scroll__dots i:nth-child(3) {
	animation-delay: 0.3s;
}

@keyframes nextshop-infinite-dot {
	0%,
	80%,
	100% {
		opacity: 0.25;
		transform: translateY(0) scale(0.85);
	}
	40% {
		opacity: 1;
		transform: translateY(-4px) scale(1);
	}
}

.nextshop-infinite-scroll__text {
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--filter-text-secondary);
	text-align: center;
	line-height: 1.5;
}

.nextshop-infinite-scroll.is-loading .nextshop-infinite-scroll__spinner,
.nextshop-infinite-scroll.is-loading .nextshop-infinite-scroll__dots {
	display: inline-flex;
}

.nextshop-infinite-scroll.is-loading .nextshop-infinite-scroll__text {
	color: var(--filter-text-heading);
}

.nextshop-infinite-scroll.is-complete .nextshop-infinite-scroll__inner {
	background: linear-gradient(180deg, rgba(240, 253, 244, 0.95) 0%, rgba(255, 255, 255, 0.98) 100%);
	border-color: #bbf7d0;
	box-shadow: 0 6px 20px rgba(34, 197, 94, 0.08);
}

.nextshop-infinite-scroll.is-complete .nextshop-infinite-scroll__text {
	color: #15803d;
}

.nextshop-infinite-scroll.is-complete .nextshop-infinite-scroll__text::before {
	content: '✓';
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.25rem;
	height: 1.25rem;
	margin-left: 0.4rem;
	border-radius: 50%;
	background: #dcfce7;
	color: #15803d;
	font-size: 0.7rem;
	font-weight: 700;
	vertical-align: middle;
}

@media (min-width: 993px) {
	.nextshop-product-grid[data-infinite-desktop="1"] + nav.woocommerce-pagination,
	.nextshop-shop-layout:has(.nextshop-product-grid[data-infinite-desktop="1"]) nav.woocommerce-pagination {
		display: none !important;
	}
}

@media (min-width: 577px) and (max-width: 992px) {
	.nextshop-product-grid[data-infinite-tablet="1"] + nav.woocommerce-pagination,
	.nextshop-shop-layout:has(.nextshop-product-grid[data-infinite-tablet="1"]) nav.woocommerce-pagination {
		display: none !important;
	}
}

@media (max-width: 576px) {
	.nextshop-product-grid[data-infinite-mobile="1"] + nav.woocommerce-pagination,
	.nextshop-shop-layout:has(.nextshop-product-grid[data-infinite-mobile="1"]) nav.woocommerce-pagination {
		display: none !important;
	}
}

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

/* ——— موبایل: دکمه شناور + کشوی فیلتر ——— */
.nextshop-filter-fab,
.nextshop-filter-overlay,
.nextshop-filter-drawer-close {
	display: none;
}

.nextshop-filter-fab {
	position: fixed;
	top: auto;
	bottom: 70px;
	inset-inline-end: 1.25rem;
	inset-inline-start: auto;
	z-index: 9990;
	align-items: center;
	justify-content: center;
	gap: 0.4rem;
	padding: 0.85rem 1.1rem;
	border: 0;
	border-radius: 999px;
	background: var(--ns-filter-fab-bg, var(--ns-primary));
	color: #fff;
	font: inherit;
	font-size: 0.9rem;
	font-weight: 600;
	cursor: pointer;
	box-shadow: 0 6px 24px var(--ns-filter-fab-shadow, rgba(239, 57, 78, 0.45));
	transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.nextshop-filter-fab:hover {
	background: var(--ns-filter-fab-bg-hover, #d32f3f);
	transform: translateY(-2px);
	box-shadow: 0 8px 28px var(--ns-filter-fab-shadow-hover, rgba(239, 57, 78, 0.5));
}

.nextshop-filter-fab i {
	font-size: 1rem;
}

.nextshop-filter-overlay {
	position: fixed;
	inset: 0;
	z-index: 10000;
	background: rgba(15, 23, 42, 0.5);
	backdrop-filter: blur(2px);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.28s ease, visibility 0.28s ease;
}

body.nextshop-filter-open .nextshop-filter-overlay {
	display: block;
	opacity: 1;
	visibility: visible;
}

body.nextshop-filter-open {
	overflow: hidden;
}

@media (max-width: 991px) {
	.nextshop-filter-fab {
		display: inline-flex;
	}

	.nextshop-filter-drawer-close {
		position: sticky;
		top: 0;
		z-index: 2;
		display: flex;
		align-items: center;
		justify-content: center;
		width: 2.5rem;
		height: 2.5rem;
		margin: 0.75rem 0.75rem 0 auto;
		padding: 0;
		border: 0;
		border-radius: 10px;
		background: var(--filter-drawer-close-bg);
		color: var(--filter-text);
		cursor: pointer;
		transition: background 0.2s, color 0.2s;
	}

	.nextshop-filter-drawer-close:hover {
		background: var(--filter-drawer-close-hover-bg);
		color: var(--ns-primary);
	}

	/* سایدبار کشویی — محتوا تمام‌عرض */
	.nextshop-shop-layout--has-filter .nextshop-shop-content {
		flex: 1 1 100%;
		width: 100%;
		max-width: 100%;
	}

	.nextshop-shop-layout > .nextshop-filter-sidebar {
		position: fixed;
		top: 0;
		right: 0;
		bottom: 0;
		width: min(340px, 92vw) !important;
		max-width: none;
		flex: none !important;
		margin: 0 !important;
		padding: 0 0 1.5rem !important;
		z-index: 10001;
		overflow-x: hidden;
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
		background: var(--filter-drawer-bg);
		box-shadow: -8px 0 32px rgba(0, 0, 0, 0.12);
		transform: translate3d(100%, 0, 0);
		visibility: hidden;
		transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.3s;
	}

	body.nextshop-filter-open .nextshop-shop-layout > .nextshop-filter-sidebar {
		transform: translate3d(0, 0, 0);
		visibility: visible;
	}

	.nextshop-filter-sidebar .nextshop-filter-form--advanced {
		border-radius: 0;
		border-left: 0;
		border-right: 0;
		box-shadow: none;
		min-height: 100%;
	}
}

/* ——— کارت محصول فروشگاه (تنظیمات فیلترینگ) ——— */
.nextshop-shop-products {
	width: 100%;
	max-width: 100%;
	min-width: 0;
	box-sizing: border-box;
}

.nextshop-shop-products ul.products {
	width: 100%;
	max-width: 100%;
}

.nextshop-shop-products ul.products li.product {
	position: relative;
	display: flex;
	flex-direction: column;
	text-align: start;
	min-width: 0;
	max-width: 100%;
	overflow: hidden;
	box-sizing: border-box;
}

.nextshop-shop-products--title-1line .woocommerce-loop-product__title,
.nextshop-shop-products--title-1line .woocommerce-loop-product__title a {
	display: block;
	max-width: 100%;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.nextshop-shop-product-badge {
	position: absolute;
	z-index: 3;
	padding: 0.2rem 0.5rem;
	border-radius: 6px;
	font-size: 0.72rem;
	font-weight: 700;
	line-height: 1.3;
	white-space: nowrap;
	pointer-events: none;
}

.nextshop-shop-product-badge--sale {
	background: var(--ns-primary);
	color: #fff;
}

.nextshop-shop-product-badge--pos-top-right {
	top: 0.45rem;
	bottom: auto;
	inset-inline-start: auto;
	inset-inline-end: 0.45rem;
}

.nextshop-shop-product-badge--pos-top-left {
	top: 0.45rem;
	bottom: auto;
	inset-inline-start: 0.45rem;
	inset-inline-end: auto;
}

.nextshop-shop-product-badge--pos-bottom-right {
	top: auto;
	bottom: 0.45rem;
	inset-inline-start: auto;
	inset-inline-end: 0.45rem;
}

.nextshop-shop-product-badge--pos-bottom-left {
	top: auto;
	bottom: 0.45rem;
	inset-inline-start: 0.45rem;
	inset-inline-end: auto;
}

.nextshop-shop-product-badge--oos {
	background: #64748b;
	color: #fff;
	top: 0.45rem;
	bottom: auto;
	inset-inline-start: auto;
	inset-inline-end: 0.45rem;
}

.nextshop-shop-products ul.products li.product.is-out-of-stock {
	opacity: 0.9;
}

.nextshop-shop-products ul.products li.product.is-out-of-stock img {
	filter: grayscale(0.35);
}

.nextshop-shop-products ul.products li.product.is-out-of-stock .price {
	opacity: 0.72;
}

.nextshop-shop-products--custom-badges ul.products li.product .onsale {
	display: none !important;
}

.nextshop-shop-products--no-buttons ul.products li.product .button,
.nextshop-shop-products--no-buttons ul.products li.product a.added_to_cart {
	display: none !important;
}

.nextshop-shop-products--no-simple-cart ul.products li.product a.button.product_type_simple {
	display: none !important;
}

.nextshop-shop-products--no-variable-btn ul.products li.product a.button.product_type_variable {
	display: none !important;
}

.nextshop-shop-products .woocommerce-loop-product__title {
	font-size: 0.875rem;
	font-weight: 600;
	line-height: 1.35;
	margin: 0.35rem 0;
}

.nextshop-shop-products .price {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: start;
	gap: 0.2rem 0.35rem;
	font-size: 0.8rem;
	line-height: 1.35;
	margin-top: auto;
	max-width: 100%;
	min-width: 0;
	word-break: break-word;
}

.nextshop-shop-products .nextshop-fp-price {
	display: inline-flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.2rem;
	min-width: 0;
	max-width: 100%;
}

.nextshop-shop-products .price .woocommerce-Price-amount {
	white-space: normal;
}

.nextshop-shop-products .price del {
	font-size: 0.75em;
	opacity: 0.6;
}

.nextshop-shop-products .price ins {
	text-decoration: none;
	font-weight: 800;
	background: none;
}

.nextshop-shop-products ul.products li.product img {
	width: 100%;
	height: auto;
	object-fit: contain;
	border-radius: 8px;
	background: #f8fafc;
}

/* ——— تصویر کارت: هاور + سوآچ رنگ ——— */
.nextshop-shop-product-image {
	width: 100%;
	min-width: 0;
}

.nextshop-shop-product-image__link {
	display: block;
	text-decoration: none;
	color: inherit;
}

.nextshop-shop-product-image__stage {
	position: relative;
	display: block;
	width: 100%;
	aspect-ratio: 1;
	overflow: hidden;
	border-radius: 8px;
	background: #f8fafc;
}

.nextshop-shop-product-image__layer {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: opacity 0.35s ease;
}

.nextshop-shop-product-image__layer--secondary {
	opacity: 0;
	z-index: 2;
	pointer-events: none;
}

.nextshop-shop-product-image--has-hover:hover .nextshop-shop-product-image__layer--secondary,
.nextshop-shop-product-image--has-hover:focus-within .nextshop-shop-product-image__layer--secondary,
.nextshop-shop-products--image-hover .nextshop-shop-product-image--has-hover:hover .nextshop-shop-product-image__layer--secondary,
.nextshop-shop-products--image-hover .nextshop-shop-product-image--has-hover:focus-within .nextshop-shop-product-image__layer--secondary {
	opacity: 1;
}

.nextshop-shop-product-image__layer .nextshop-shop-product-image__img,
.nextshop-shop-product-image__layer img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	border-radius: 8px;
	background: #f8fafc;
}

.nextshop-shop-product-colors {
	display: flex;
	flex-wrap: nowrap;
	align-items: center;
	justify-content: flex-start;
	gap: 0.35rem;
	margin-top: 0.4rem;
	padding: 0.15rem 0 0.35rem;
	width: 100%;
	min-width: 0;
	max-width: 100%;
	min-height: 2.75rem;
	box-sizing: border-box;
	overflow-x: auto;
	overflow-y: hidden;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: thin;
	scrollbar-color: #cbd5e1 transparent;
}

.nextshop-shop-products--image-colors .nextshop-shop-product-colors--empty {
	visibility: hidden;
	pointer-events: none;
	overflow: hidden;
}

.nextshop-shop-product-colors::-webkit-scrollbar {
	height: 4px;
}

.nextshop-shop-product-colors::-webkit-scrollbar-thumb {
	background: #cbd5e1;
	border-radius: 999px;
}

.nextshop-shop-product-colors::-webkit-scrollbar-track {
	background: transparent;
}

.nextshop-shop-product-colors__btn {
	flex: 0 0 auto;
	width: 2rem;
	height: 2rem;
	padding: 2px;
	margin: 0;
	border: 2px solid transparent;
	border-radius: 6px;
	background: #fff;
	cursor: pointer;
	overflow: hidden;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.nextshop-shop-product-colors__btn:hover {
	border-color: #cbd5e1;
}

.nextshop-shop-product-colors__btn.is-active {
	border-color: var(--ns-primary);
	box-shadow: 0 0 0 1px rgba(239, 57, 78, 0.25);
}

.nextshop-shop-product-colors__img,
.nextshop-shop-product-colors__btn img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 4px;
}

/* صفحه اصلی — همان نسبت تصویر فروشگاه (aspect-ratio 1:1) */
.nextshop-fp-products.nextshop-product-loop-images ul.products li.product {
	position: relative;
	display: flex;
	flex-direction: column;
	text-align: start;
	min-width: 0;
	max-width: 100%;
	overflow: hidden;
	box-sizing: border-box;
}

.nextshop-fp-products.nextshop-product-loop-images ul.products li.product .nextshop-shop-product-image {
	width: 100%;
	margin-bottom: 1rem;
}

.woocommerce .nextshop-fp-products.nextshop-product-loop-images ul.products li.product .nextshop-shop-product-image__layer img,
.woocommerce .nextshop-fp-products.nextshop-product-loop-images ul.products li.product .nextshop-shop-product-image__layer .nextshop-shop-product-image__img {
	width: 100%;
	height: 100%;
	max-height: none;
	margin-bottom: 0;
	object-fit: contain;
	border-radius: 8px;
	background: #f8fafc;
}

.nextshop-fp-products.nextshop-product-loop-images ul.products li.product .nextshop-shop-product-colors__btn img {
	height: 100%;
	max-height: none;
	margin-bottom: 0;
	object-fit: cover;
	border-radius: 4px;
}

/* ——— نوار زیرشاخه‌های دسته‌بندی ——— */
.nextshop-subcat-bar {
	width: 100%;
	margin: 0 0 1.25rem;
}

.nextshop-subcat-bar__track {
	display: flex;
	flex-wrap: nowrap;
	align-items: stretch;
	gap: 0.75rem;
	overflow-x: auto;
	overflow-y: hidden;
	padding: 0.15rem 0 0.5rem;
	-webkit-overflow-scrolling: touch;
	scroll-snap-type: x proximity;
	scrollbar-width: thin;
	scrollbar-color: #cbd5e1 transparent;
}

.nextshop-subcat-bar__track::-webkit-scrollbar {
	height: 4px;
}

.nextshop-subcat-bar__track::-webkit-scrollbar-thumb {
	background: #cbd5e1;
	border-radius: 999px;
}

.nextshop-subcat-bar__track::-webkit-scrollbar-track {
	background: transparent;
}

.nextshop-subcat-bar__item {
	flex: 0 0 auto;
	scroll-snap-align: start;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: flex-start;
	gap: 0.55rem;
	width: clamp(5.75rem, 11vw, 7.25rem);
	min-height: 7.5rem;
	padding: 0.75rem 0.5rem 0.65rem;
	text-align: center;
	text-decoration: none;
	color: inherit;
	background: #f5f5f5;
	border: 1px solid rgba(15, 23, 42, 0.06);
	border-radius: 12px;
	transition:
		background-color 0.2s ease,
		border-color 0.2s ease,
		box-shadow 0.2s ease;
	-webkit-tap-highlight-color: transparent;
}

.nextshop-subcat-bar__item:hover,
.nextshop-subcat-bar__item:focus-visible {
	background: #fff;
	border-color: rgba(239, 57, 78, 0.18);
	box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
}

.nextshop-subcat-bar__item:focus-visible {
	outline: 2px solid rgba(239, 57, 78, 0.45);
	outline-offset: 2px;
}

.nextshop-subcat-bar__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 3.25rem;
	height: 3.25rem;
	overflow: hidden;
	border-radius: 8px;
	background: #fff;
}

.nextshop-subcat-bar__icon img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
}

.nextshop-subcat-bar__icon-fallback {
	font-size: 1.35rem;
	color: #94a3b8;
	line-height: 1;
}

.nextshop-subcat-bar__label {
	width: 100%;
	font-size: 0.78rem;
	font-weight: 600;
	line-height: 1.45;
	color: #334155;
	overflow: hidden;
	text-overflow: ellipsis;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

@media (prefers-reduced-motion: reduce) {
	.nextshop-subcat-bar__item {
		transition: none;
	}
}

/* ——— Dark / light base (خارج از صفحه فروشگاه هم) ——— */
body.nextshop-color-dark .nextshop-filter-form--advanced {
	--filter-surface: var(--ns-surface);
	--filter-surface-muted: var(--ns-input-bg);
	--filter-surface-subtle: var(--ns-bg);
	--filter-surface-hover: #242424;
	--filter-border: var(--ns-border);
	--filter-border-light: var(--ns-border);
	--filter-text: var(--ns-text);
	--filter-text-heading: var(--ns-text);
	--filter-text-secondary: var(--ns-secondary);
	--filter-text-muted: var(--ns-muted);
	--filter-text-placeholder: #8a8a8a;
	--filter-icon: #a8a8a8;
	--filter-toggle-bg: var(--ns-input-bg);
	--filter-toggle-border: var(--ns-border);
	--filter-toggle-track: #4a4a4a;
	--filter-toggle-thumb: #ffffff;
	--filter-check-bg: var(--ns-input-bg);
	--filter-check-border: #4a4a4a;
	--filter-cat-count-bg: #2a2a2a;
	--filter-cat-count-text: var(--ns-muted);
	--filter-rail: #4a4a4a;
	--filter-slider-fill-start: color-mix(in srgb, var(--ns-primary) 70%, #1a1a1a);
	--filter-slider-fill-end: var(--ns-primary);
	--filter-slider-thumb: #ffffff;
	--filter-slider-thumb-ring: color-mix(in srgb, var(--ns-primary) 35%, transparent);
	--filter-price-value: var(--ns-text);
	--filter-price-value-max: var(--ns-accent, var(--ns-primary));
	--filter-price-sep: var(--ns-secondary);
	--filter-price-unit: var(--ns-muted);
	--filter-focus-ring: var(--ns-primary-soft);
	--filter-clear-border: #4a4a4a;
	--filter-select2-choice-bg: rgba(255, 255, 255, 0.08);
	--filter-select2-choice-border: var(--ns-border);
	--filter-select2-choice-text: var(--ns-text);
	--filter-drawer-bg: var(--ns-body-bg);
	--filter-drawer-close-bg: var(--ns-input-bg);
	--filter-drawer-close-hover-bg: rgba(255, 255, 255, 0.08);
	--filter-status: var(--ns-muted);
	--filter-shadow: none;
}

body.nextshop-color-dark .nextshop-filter-form--advanced .select2-container--default .select2-selection--multiple,
body.nextshop-color-dark .nextshop-filter-form--advanced .select2-container--default .select2-selection--multiple .select2-selection__rendered,
body.nextshop-color-dark .nextshop-filter-form--advanced .select2-container--default .select2-search--inline .select2-search__field {
	color: var(--ns-text);
}

body.nextshop-color-dark .nextshop-filter-form--advanced .select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
	color: var(--ns-muted);
}

body.nextshop-color-dark .nextshop-filter-form--advanced .select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
	color: var(--ns-text);
}

body.nextshop-color-dark .nextshop-filter-checks--scroll {
	scrollbar-color: #4a4a4a transparent;
}

body.nextshop-color-dark .nextshop-price-slider__rail {
	box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.35);
}

body.nextshop-color-dark .nextshop-price-slider__unit {
	background: var(--filter-surface-muted);
	border-color: var(--filter-border);
}

body.nextshop-color-dark .nextshop-infinite-scroll__inner {
	background: linear-gradient(180deg, rgba(30, 30, 30, 0.96) 0%, rgba(24, 24, 24, 0.98) 100%);
	border-color: var(--filter-border);
	box-shadow: 0 8px 28px rgba(0, 0, 0, 0.25);
}

body.nextshop-color-dark .nextshop-infinite-scroll.is-complete .nextshop-infinite-scroll__inner {
	background: linear-gradient(180deg, rgba(20, 83, 45, 0.22) 0%, rgba(24, 24, 24, 0.98) 100%);
	border-color: rgba(34, 197, 94, 0.35);
}

body.nextshop-color-dark .nextshop-infinite-scroll.is-complete .nextshop-infinite-scroll__text {
	color: #86efac;
}

body.nextshop-color-dark .nextshop-infinite-scroll.is-complete .nextshop-infinite-scroll__text::before {
	background: rgba(34, 197, 94, 0.2);
	color: #86efac;
}

