.npf-shop-layout {
	display: flex !important;
	flex-direction: row !important;
	align-items: flex-start;
	gap: 34px;
	width: 100%;
	max-width: var(--wd-container-w, 1222px);
	margin-inline: auto;
	padding-inline: 15px;
	direction: rtl;
}

.npf-sidebar {
	order: 0;
	flex: 0 0 280px;
	width: 280px;
	min-width: 0;
	direction: rtl;
}

.npf-products-column {
	order: 1;
	flex: 1 1 auto;
	width: calc(100% - 314px);
	min-width: 0;
	direction: rtl;
}

.npf-products-column > * {
	max-width: 100%;
}

.npf-products-column > .container,
.npf-products-column > .wd-content-layout,
.npf-products-column > .content-layout-wrapper {
	width: 100% !important;
	max-width: none !important;
	margin-inline: 0 !important;
	padding-inline: 0 !important;
}

.npf-filter-card {
	--npf-primary: var(--wd-primary-color, #D52D4E);
	position: sticky;
	top: 90px;
	font: inherit;
	color: inherit;
	background: transparent;
}

.npf-filter-panel {
	position: static;
	width: 100%;
	background: transparent;
}

.npf-filter-heading {
	display: block;
	margin: 0 0 18px;
	padding: 0;
	font-size: 18px;
	font-weight: 800;
	line-height: 1.5;
	color: var(--wd-title-color, #242424);
}

.npf-filter-body {
	padding: 0;
}

.npf-all-products,
.npf-node__link,
.npf-node__toggle,
.npf-mobile-toggle,
.npf-mobile-close {
	-webkit-tap-highlight-color: transparent;
}

.npf-all-products {
	display: flex;
	align-items: center;
	min-height: 34px;
	margin: 0 0 3px;
	padding: 5px 0;
	color: var(--wd-text-color, #777) !important;
	font-weight: 500;
	line-height: 1.6;
	text-decoration: none !important;
	transition: color .18s ease;
}

.npf-all-products:hover,
.npf-all-products:focus,
.npf-all-products.is-active {
	color: var(--npf-primary) !important;
}

.npf-all-products.is-active {
	font-weight: 700;
}

.npf-filter-tree {
	display: block;
}

.npf-node {
	margin: 0;
}

.npf-node__row {
	display: flex;
	align-items: center;
	min-height: 36px;
	border: 0;
	background: transparent;
}

.npf-node__link {
	display: flex;
	align-items: center;
	flex: 1 1 auto;
	min-width: 0;
	padding: 6px 0;
	color: var(--wd-text-color, #777) !important;
	font-weight: 500;
	line-height: 1.6;
	text-decoration: none !important;
	transition: color .18s ease;
}

.npf-node__label {
	display: block;
	min-width: 0;
	overflow-wrap: anywhere;
}

.npf-node__count {
	display: none !important;
}

.npf-node__link:hover,
.npf-node__link:focus,
.npf-node.is-active > .npf-node__row > .npf-node__link {
	color: var(--npf-primary) !important;
}

.npf-node.is-active > .npf-node__row > .npf-node__link {
	font-weight: 700;
}

.npf-node__toggle {
	display: grid;
	place-items: center;
	flex: 0 0 28px;
	width: 28px;
	height: 34px;
	margin-inline-start: 4px;
	padding: 0;
	border: 0 !important;
	border-radius: 0;
	background: transparent !important;
	box-shadow: none !important;
	color: #b7b7b7 !important;
	cursor: pointer;
	transition: color .18s ease;
}

.npf-node__toggle:hover,
.npf-node__toggle:focus {
	background: transparent !important;
	color: var(--npf-primary) !important;
	outline: none;
}

.npf-node__toggle svg {
	width: 15px;
	height: 15px;
	transition: transform .2s ease;
}

.npf-node.is-open > .npf-node__row .npf-node__toggle svg {
	transform: rotate(180deg);
}

.npf-node__children {
	display: block;
	margin: 0;
	padding-inline-start: 17px;
}

.npf-node__children[hidden] {
	display: none !important;
}

.npf-node--level-1 > .npf-node__row .npf-node__link {
	font-size: 13.5px;
}

.npf-node--level-2 > .npf-node__row .npf-node__link,
.npf-node--level-3 > .npf-node__row .npf-node__link,
.npf-node--level-4 > .npf-node__row .npf-node__link,
.npf-node--level-5 > .npf-node__row .npf-node__link,
.npf-node--level-6 > .npf-node__row .npf-node__link {
	font-size: 13px;
}

.npf-empty {
	margin: 0;
	padding: 12px 0;
	color: var(--wd-text-color, #777);
	font-size: 13px;
}

/* Mobile controls are intentionally absent on desktop. */
.npf-mobile-toggle,
.npf-mobile-panel-header,
.npf-mobile-backdrop {
	display: none;
}

@media (max-width: 1024px) {
	.npf-shop-layout {
		gap: 24px;
	}

	.npf-sidebar {
		flex-basis: 245px;
		width: 245px;
	}

	.npf-products-column {
		width: calc(100% - 269px);
	}
}

@media (max-width: 767px) {
	body.npf-mobile-filter-open {
		overflow: hidden !important;
		touch-action: none;
	}

	.npf-shop-layout {
		flex-direction: column !important;
		gap: 18px;
	}

	.npf-sidebar,
	.npf-products-column {
		order: initial;
		flex: 0 0 auto;
		width: 100%;
	}

	.npf-sidebar {
		order: 0;
	}

	.npf-products-column {
		order: 1;
	}

	.npf-filter-card {
		position: static;
		background: transparent;
	}

	body.npf-filter-enabled .woodmart-show-sidebar-btn,
	body.npf-filter-enabled .wd-show-sidebar-btn {
		display: none !important;
	}

	.npf-mobile-toggle {
		display: inline-flex;
		align-items: center;
		justify-content: flex-start;
		gap: 7px;
		width: auto;
		min-height: 40px;
		margin: 0;
		padding: 5px 0;
		border: 0 !important;
		background: transparent !important;
		box-shadow: none !important;
		color: var(--wd-title-color, #242424) !important;
		font: inherit;
		font-size: 14px;
		font-weight: 600;
		cursor: pointer;
	}

	.npf-mobile-toggle:hover,
	.npf-mobile-toggle:focus {
		background: transparent !important;
		color: var(--npf-primary) !important;
		outline: none;
	}

	.npf-mobile-toggle__icon,
	.npf-mobile-toggle__icon::before {
		display: block;
		width: 18px;
		height: 2px;
		border-radius: 2px;
		background: currentColor;
		content: "";
	}

	.npf-mobile-toggle__icon::before {
		transform: rotate(90deg);
	}

	.npf-mobile-backdrop {
		display: block;
		position: fixed;
		inset: 0;
		z-index: 100001;
		background: rgba(0, 0, 0, .48);
		opacity: 0;
		visibility: hidden;
		pointer-events: none;
		transition: opacity .28s ease, visibility .28s ease;
	}

	.npf-filter-panel {
		position: fixed;
		top: 0;
		right: 0;
		bottom: 0;
		z-index: 100002;
		width: min(88vw, 380px);
		height: 100dvh;
		padding: 0 22px 28px;
		background: #fff;
		box-shadow: -12px 0 40px rgba(0, 0, 0, .18);
		overflow-y: auto;
		overscroll-behavior: contain;
		transform: translate3d(105%, 0, 0);
		transition: transform .32s cubic-bezier(.22, .61, .36, 1);
		will-change: transform;
	}

	.npf-filter-card.is-mobile-open .npf-mobile-backdrop {
		opacity: 1;
		visibility: visible;
		pointer-events: auto;
	}

	.npf-filter-card.is-mobile-open .npf-filter-panel {
		transform: translate3d(0, 0, 0);
	}

	.npf-mobile-panel-header {
		display: flex;
		position: sticky;
		top: 0;
		z-index: 2;
		align-items: center;
		justify-content: space-between;
		min-height: 66px;
		margin-inline: -22px;
		margin-bottom: 10px;
		padding-inline: 22px;
		border-bottom: 1px solid var(--brdcolor-gray-300, #e7e7e7);
		background: #fff;
		color: var(--wd-title-color, #242424);
		font-size: 18px;
		font-weight: 800;
	}

	.npf-mobile-close {
		display: grid;
		place-items: center;
		width: 40px;
		height: 40px;
		padding: 0;
		border: 0 !important;
		border-radius: 50%;
		background: transparent !important;
		box-shadow: none !important;
		color: var(--wd-title-color, #242424) !important;
		cursor: pointer;
	}

	.npf-mobile-close:hover,
	.npf-mobile-close:focus {
		background: var(--bgcolor-gray-100, #f6f6f6) !important;
		color: var(--npf-primary) !important;
		outline: none;
	}

	.npf-filter-heading {
		display: none;
	}

	.npf-filter-body {
		display: block;
		padding: 0;
	}

	.npf-all-products,
	.npf-node__link {
		min-height: 40px;
		padding-block: 8px;
	}

	.npf-node__row {
		min-height: 40px;
	}

	.npf-node__toggle {
		height: 40px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.npf-filter-panel,
	.npf-mobile-backdrop,
	.npf-node__toggle svg {
		transition: none !important;
	}
}

/* Mattress-only advanced filters. */
@media (min-width: 768px) {
	.npf-mobile-toggle,
	.npf-mobile-backdrop,
	.npf-mobile-panel-header {
		display: none !important;
	}
}

.npf-advanced {
	margin-top: 24px;
	padding-top: 20px;
	border-top: 1px solid var(--brdcolor-gray-300, #e5e5e5);
}

.npf-advanced__heading {
	margin: 0 0 16px;
	font-size: 16px;
	font-weight: 800;
	color: var(--wd-title-color, #242424);
}

.npf-advanced__form {
	display: grid;
	gap: 0;
}

.npf-filter-group {
	padding: 14px 0;
	border-bottom: 1px solid var(--brdcolor-gray-300, #ececec);
}

.npf-custom-size-group {
	width: 100%;
	margin-top: 18px;
	direction: rtl;
}

.npf-custom-size-group > .npf-filter-group {
	padding: 20px 18px 18px;
	border: 1px solid #dedede;
	border-radius: 17px;
	background: #fff;
	box-shadow: none;
}

.npf-custom-size-group .npf-filter-group__title {
	margin: 0 0 18px;
	color: #252525;
	font-size: 17px;
	font-weight: 800;
	line-height: 1.7;
	text-align: right;
}

.npf-custom-size-group .npf-check-list {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 10px 8px;
}

.npf-custom-size-group .npf-size-link {
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 0;
	min-height: 43px;
	margin: 0;
	padding: 8px 7px;
	border: 1px solid transparent;
	border-radius: 999px;
	background: #f7f7f7;
	color: #444;
	font-size: 13px;
	font-weight: 700;
	line-height: 1;
	text-align: center;
	text-decoration: none;
	transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}

.npf-custom-size-group .npf-size-link:hover,
.npf-custom-size-group .npf-size-link:focus-visible {
	border-color: var(--npf-primary);
	background: var(--npf-primary);
	color: #fff;
}

.npf-custom-size-group .npf-size-link:focus-visible {
	outline: 2px solid var(--npf-primary);
	outline-offset: 2px;
}

.npf-custom-size-group .npf-size-link span {
	display: block;
	width: 100%;
	direction: ltr;
	unicode-bidi: isolate;
	white-space: nowrap;
}

.npf-custom-size-group .npf-size-link.is-active {
	border-color: var(--npf-primary);
	background: var(--npf-primary);
	color: #fff;
}

@media (max-width: 360px) {
	.npf-custom-size-group .npf-check-list {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

.npf-filter-group__title {
	margin-bottom: 10px;
	font-size: 14px;
	font-weight: 750;
	color: var(--wd-title-color, #242424);
}

.npf-filter-group__hint {
	display: block;
	margin-top: 8px;
	color: var(--wd-text-color, #777);
	font-size: 11.5px;
	line-height: 1.7;
}

.npf-price-fields {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 8px;
}

.npf-price-fields label {
	display: grid;
	gap: 5px;
	margin: 0;
	font-size: 12px;
	color: var(--wd-text-color, #777);
}

.npf-price-fields input {
	width: 100%;
	min-width: 0;
	height: 40px;
	padding: 7px 9px;
	border: 1px solid var(--brdcolor-gray-300, #dfdfdf);
	border-radius: 8px;
	background: #fff;
	box-shadow: none;
	font: inherit;
	font-size: 12px;
	color: var(--wd-title-color, #242424);
}

.npf-price-fields input:focus {
	border-color: var(--npf-primary);
	outline: none;
}

.npf-check-list {
	display: grid;
	gap: 9px;
}

.npf-check-item {
	display: flex;
	align-items: center;
	gap: 9px;
	margin: 0;
	color: var(--wd-text-color, #666);
	font-size: 13px;
	line-height: 1.6;
	cursor: pointer;
}

/* Keep the numeric length × width order stable inside the RTL filter. */
.npf-check-item--size .npf-check-item__label {
	direction: ltr;
	unicode-bidi: isolate;
	display: inline-block;
}

.npf-check-item input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.npf-check-item__box {
	display: grid;
	place-items: center;
	flex: 0 0 18px;
	width: 18px;
	height: 18px;
	border: 1px solid var(--brdcolor-gray-400, #cfcfcf);
	border-radius: 4px;
	background: #fff;
	transition: border-color .18s ease, background-color .18s ease;
}

.npf-check-item__box::after {
	box-sizing: border-box;
	width: 6px;
	height: 10px;
	border-right: 2px solid #fff;
	border-bottom: 2px solid #fff;
	content: "";
	opacity: 0;
	transform: translateY(-1px) rotate(45deg);
}

.npf-check-item input:checked + .npf-check-item__box {
	border-color: var(--npf-primary);
	background: var(--npf-primary);
}

.npf-check-item input:checked + .npf-check-item__box::after {
	opacity: 1;
}

.npf-check-item:hover .npf-check-item__label,
.npf-check-item input:focus-visible ~ .npf-check-item__label {
	color: var(--npf-primary);
}

.npf-filter-group--switches {
	border-bottom: 0;
}

.npf-advanced__actions {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 8px;
	align-items: center;
	padding-top: 14px;
}

.npf-apply-button {
	min-height: 42px;
	padding: 9px 14px;
	border: 1px solid var(--npf-primary) !important;
	border-radius: 8px;
	background: var(--npf-primary) !important;
	box-shadow: none !important;
	color: #fff !important;
	font: inherit;
	font-size: 13px;
	font-weight: 750;
	cursor: pointer;
}

.npf-apply-button:hover,
.npf-apply-button:focus {
	filter: brightness(.94);
	color: #fff !important;
}

.npf-clear-button {
	padding: 8px 4px;
	color: var(--wd-text-color, #777) !important;
	font-size: 12px;
	text-decoration: none !important;
}

.npf-clear-button:hover,
.npf-clear-button:focus {
	color: var(--npf-primary) !important;
}

@media (max-width: 767px) {
	.npf-advanced {
		margin-top: 22px;
		padding-bottom: 18px;
	}

	.npf-price-fields input {
		height: 44px;
	}

	.npf-check-item {
		min-height: 34px;
		font-size: 14px;
	}
}
