/* Customer product filters: sidebar on desktop, drawer on mobile. */

.nlt-shop-layout {
	display: grid;
	grid-template-columns: 258px minmax(0, 1fr);
	align-items: start;
	gap: 30px;
	margin-top: 18px;
}

.nlt-shop-results {
	min-width: 0;
}

/* Keep the grid readable now that the sidebar takes a column. */
@media (min-width: 1151px) {
	.nlt-shop-layout ul.products {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

@media (max-width: 1150px) and (min-width: 901px) {
	.nlt-shop-layout ul.products {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

/* Sidebar shell. */
.nlt-filters {
	border: 1px solid var(--nlt-border);
	border-radius: var(--nlt-radius);
	background: var(--nlt-white, #fff);
	padding: 4px 16px 12px;
}

.nlt-filters-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 12px 0 10px;
	border-bottom: 1px solid var(--nlt-border);
}

.nlt-filters-title {
	margin: 0;
	font-size: 13px;
	font-weight: 800;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--nlt-black);
}

.nlt-filters-close {
	display: none;
	border: 0;
	background: none;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	color: var(--nlt-grey);
	padding: 0 4px;
}

.nlt-filters-clear {
	display: inline-block;
	margin: 12px 0 0;
	font-size: 13px;
	font-weight: 700;
	color: var(--nlt-red);
	text-decoration: none;
}

.nlt-filters-clear:hover {
	text-decoration: underline;
}

/* Facets. */
.nlt-facet {
	padding: 16px 0 4px;
	border-bottom: 1px solid var(--nlt-border);
}

.nlt-facet:last-of-type {
	border-bottom: 0;
}

.nlt-facet-title {
	margin: 0 0 10px;
	font-size: 14px;
	font-weight: 800;
	color: var(--nlt-black);
}

.nlt-facet-list {
	margin: 0;
	padding: 0;
	list-style: none;
	max-height: 320px;
	overflow-y: auto;
}

.nlt-facet.is-collapsed .nlt-facet-item--overflow {
	display: none;
}

.nlt-facet-option {
	display: flex;
	align-items: center;
	gap: 9px;
	padding: 6px 0;
	font-size: 13.5px;
	line-height: 1.35;
	color: var(--nlt-text);
	text-decoration: none;
}

.nlt-facet-option:hover .nlt-facet-name {
	color: var(--nlt-red);
}

.nlt-facet-box {
	flex: 0 0 16px;
	width: 16px;
	height: 16px;
	border: 1.5px solid var(--nlt-border);
	border-radius: 3px;
	background: #fff;
	position: relative;
}

.nlt-facet-option:hover .nlt-facet-box {
	border-color: var(--nlt-red);
}

.nlt-facet-option.is-active .nlt-facet-box {
	background: var(--nlt-red);
	border-color: var(--nlt-red);
}

.nlt-facet-option.is-active .nlt-facet-box::after {
	content: "";
	position: absolute;
	left: 4.5px;
	top: 1px;
	width: 4px;
	height: 9px;
	border: solid #fff;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}

.nlt-facet-name {
	flex: 1 1 auto;
	min-width: 0;
}

.nlt-facet-option.is-active .nlt-facet-name {
	font-weight: 700;
}

.nlt-facet-count {
	flex: 0 0 auto;
	font-size: 12px;
	color: var(--nlt-grey);
}

.nlt-facet-more {
	margin: 8px 0 4px;
	padding: 0;
	border: 0;
	background: none;
	font-size: 13px;
	font-weight: 700;
	color: var(--nlt-red);
	cursor: pointer;
}

.nlt-facet-more:hover {
	text-decoration: underline;
}

/* Nested subcategory branches. */
.nlt-facet--tree .nlt-facet-list {
	max-height: 460px;
}

.nlt-facet-row {
	display: flex;
	align-items: center;
	gap: 2px;
}

.nlt-facet-row .nlt-facet-option {
	flex: 1 1 auto;
	min-width: 0;
}

.nlt-facet-expand {
	position: relative;
	flex: 0 0 22px;
	width: 22px;
	height: 22px;
	padding: 0;
	border: 0;
	border-radius: 3px;
	background: none;
	color: var(--nlt-grey);
	cursor: pointer;
}

.nlt-facet-expand::after {
	content: "";
	position: absolute;
	left: 7px;
	top: 7px;
	width: 6px;
	height: 6px;
	border: solid currentColor;
	border-width: 0 1.5px 1.5px 0;
	transform: rotate(45deg);
}

.nlt-facet-expand:hover {
	background: var(--nlt-light);
	color: var(--nlt-red);
}

.nlt-facet-branch.is-open > .nlt-facet-row .nlt-facet-expand::after {
	top: 9px;
	transform: rotate(-135deg);
}

.nlt-facet-sub {
	margin: 0 0 4px;
	padding: 0 0 0 25px;
	list-style: none;
}

.nlt-has-filter-js .nlt-facet-branch:not(.is-open) > .nlt-facet-sub {
	display: none;
}

.nlt-facet-sub .nlt-facet-option {
	gap: 8px;
	padding: 5px 0;
	font-size: 13px;
}

.nlt-facet-sub .nlt-facet-box {
	flex: 0 0 14px;
	width: 14px;
	height: 14px;
}

.nlt-facet-sub .nlt-facet-option.is-active .nlt-facet-box::after {
	left: 3.5px;
	top: 0.5px;
	height: 8px;
}

/* Type-to-find inside a long facet. */
.nlt-facet-search {
	margin: 0 0 9px;
}

.nlt-facet-search-input {
	width: 100%;
	padding: 7px 10px;
	border: 1px solid var(--nlt-border);
	border-radius: 4px;
	background: var(--nlt-white);
	font: inherit;
	font-size: 13px;
	line-height: 1.3;
	color: var(--nlt-text);
}

.nlt-facet-search-input:focus {
	outline: 0;
	border-color: var(--nlt-red);
}

.nlt-facet-item.is-filtered-out {
	display: none;
}

.nlt-facet-empty {
	margin: 2px 0 6px;
	font-size: 13px;
	color: var(--nlt-grey);
}

/* Sibling categories: navigation, not toggles, so no checkbox. */
.nlt-facet-option--nav .nlt-facet-name {
	text-decoration: none;
}

/* Toolbar above the grid. */
.nlt-shop-toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 12px;
	margin: 0 0 14px;
}

.nlt-shop-toolbar .woocommerce-result-count,
.nlt-shop-toolbar .woocommerce-ordering {
	margin: 0;
	float: none;
}

.nlt-shop-toolbar .woocommerce-result-count {
	font-size: 13.5px;
	color: var(--nlt-grey);
}

.nlt-shop-toolbar .woocommerce-ordering select {
	padding: 8px 10px;
	border: 1px solid var(--nlt-border);
	border-radius: var(--nlt-radius);
	background: #fff;
	font-size: 13.5px;
	max-width: 100%;
}

/* Active filter chips. */
.nlt-filter-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0 0 14px;
}

.nlt-filter-chip {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 6px 11px;
	border: 1px solid var(--nlt-border);
	border-radius: 999px;
	background: var(--nlt-light);
	font-size: 13px;
	font-weight: 600;
	color: var(--nlt-text);
	text-decoration: none;
}

.nlt-filter-chip:hover {
	border-color: var(--nlt-red);
	color: var(--nlt-red);
}

.nlt-filter-chip-x {
	font-size: 16px;
	line-height: 1;
	color: var(--nlt-grey);
}

.nlt-filter-chip:hover .nlt-filter-chip-x {
	color: var(--nlt-red);
}

.nlt-filter-chip--clear {
	background: none;
	border-style: dashed;
	color: var(--nlt-grey);
}

/* Mobile drawer backdrop, only ever visible under the mobile breakpoint. */
.nlt-filters-backdrop {
	display: none;
}

/* Mobile toggle button. */
.nlt-filters-toggle {
	display: none;
	align-items: center;
	gap: 9px;
	width: 100%;
	padding: 12px 16px;
	margin: 0 0 14px;
	border: 1px solid var(--nlt-border);
	border-radius: var(--nlt-radius);
	background: #fff;
	font-size: 14px;
	font-weight: 800;
	color: var(--nlt-black);
	cursor: pointer;
}

.nlt-filters-toggle-icon {
	width: 16px;
	height: 2px;
	background: currentColor;
	position: relative;
	box-shadow: 0 5px 0 currentColor, 0 -5px 0 currentColor;
}

.nlt-filters-toggle-count {
	margin-left: auto;
	min-width: 22px;
	height: 22px;
	padding: 0 6px;
	border-radius: 999px;
	background: var(--nlt-red);
	color: #fff;
	font-size: 12px;
	line-height: 22px;
	text-align: center;
}

@media (max-width: 900px) {
	.nlt-shop-layout {
		grid-template-columns: 1fr;
		gap: 0;
	}

	body.nlt-has-filter-js .nlt-filters-toggle {
		display: flex;
		order: -1;
	}

	body.nlt-has-filter-js .nlt-filters {
		position: fixed;
		top: 0;
		left: 0;
		bottom: 0;
		z-index: 1000;
		width: min(88vw, 340px);
		max-width: 100%;
		border: 0;
		border-radius: 0;
		overflow-y: auto;
		overscroll-behavior: contain;
		transform: translateX(-100%);
		transition: transform .22s ease;
		box-shadow: var(--nlt-shadow);
	}

	body.nlt-filters-open .nlt-filters {
		transform: none;
	}

	body.nlt-has-filter-js .nlt-filters-close {
		display: block;
	}

	.nlt-filters-backdrop {
		display: block;
		position: fixed;
		inset: 0;
		z-index: 999;
		background: rgba(0, 0, 0, .45);
		opacity: 0;
		visibility: hidden;
		transition: opacity .22s ease, visibility .22s ease;
	}

	body.nlt-filters-open .nlt-filters-backdrop {
		opacity: 1;
		visibility: visible;
	}

	body.nlt-filters-open {
		overflow: hidden;
	}

	.nlt-filters:not([hidden]) {
		margin-bottom: 16px;
	}

	.nlt-facet-list {
		max-height: none;
	}
}
