/* PromoPal Product Filter */
.pp-filter {
	--pp-navy: #1b2a63;
	--pp-teal: #2bb3c0;
	--pp-text: #2b2f38;
	--pp-muted: #6b7280;
	--pp-border: #e3e6ec;
	--pp-blue: #2f6fed;
	--pp-selected: #e3132f;
	--pp-hover: rgba( 227, 19, 47, 0.07 );
	font-family: inherit;
	color: var( --pp-text );
	max-width: 280px;
	position: relative;
}

.pp-filter * {
	box-sizing: border-box;
}

/* Header */
.pp-filter__head {
	margin-bottom: 18px;
}
.pp-filter__title {
	font-size: 18px;
	font-weight: 700;
	color: var( --pp-navy );
	margin: 0 0 4px;
}
.pp-filter__empty {
	font-size: 13px;
	color: var( --pp-muted );
	margin: 0;
}
.pp-filter__clear {
	font-size: 13px;
	color: var( --pp-selected );
	text-decoration: none;
	display: none;
}
.pp-filter__clear:hover {
	text-decoration: underline;
}
/* Toggle empty-state vs clear-all based on active filters. */
.pp-filter__head.is-active .pp-filter__empty {
	display: none;
}
.pp-filter__head.is-active .pp-filter__clear {
	display: inline-block;
	margin-top: 8px;
}

/* Active filter chips */
.pp-filter__chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}
.pp-filter__head.is-active .pp-filter__chips {
	margin-top: 4px;
}
.pp-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 3px 8px 3px 10px;
	background: var( --pp-hover );
	border: 1px solid var( --pp-selected );
	border-radius: 14px;
	font-size: 12px;
	line-height: 1.4;
	color: var( --pp-text );
}
.pp-chip__label {
	white-space: nowrap;
}
.pp-chip__remove {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 16px !important;
	height: 16px !important;
	min-width: 0 !important;
	padding: 0 !important;
	margin: 0 !important;
	border: 0 !important;
	box-shadow: none !important;
	border-radius: 50% !important;
	background: var( --pp-selected ) !important;
	color: #fff !important;
	font-size: 12px;
	line-height: 1;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}
.pp-chip__remove:hover {
	opacity: 0.8;
}

/* Facet */
.pp-facet {
	padding: 18px 0;
	border-top: 1px solid var( --pp-border );
}
.pp-facet__title {
	font-size: 15px;
	font-weight: 700;
	color: var( --pp-navy );
	margin: 0 0 14px;
}

/* Category-only mode: no divider line above the lone section. */
.pp-filter--nav-only .pp-facet {
	border-top: 0;
	padding-top: 0;
}

/* Slider */
.pp-slider {
	position: relative;
	height: 18px;
	margin: 6px 6px 18px;
}
.pp-slider__track {
	position: absolute;
	top: 50%;
	left: 0;
	right: 0;
	height: 3px;
	transform: translateY( -50% );
	background: var( --pp-border );
	border-radius: 3px;
}
.pp-slider__range {
	position: absolute;
	height: 100%;
	background: var( --pp-teal );
	border-radius: 3px;
}
.pp-slider__input {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 18px;
	margin: 0;
	background: none;
	pointer-events: none;
	-webkit-appearance: none;
	appearance: none;
}
.pp-slider__input::-webkit-slider-thumb {
	-webkit-appearance: none;
	pointer-events: auto;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: #fff;
	border: 2px solid var( --pp-teal );
	cursor: pointer;
	box-shadow: 0 1px 3px rgba( 0, 0, 0, 0.2 );
}
.pp-slider__input::-moz-range-thumb {
	pointer-events: auto;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: #fff;
	border: 2px solid var( --pp-teal );
	cursor: pointer;
}

/* Price inputs */
.pp-price-inputs {
	display: flex;
	align-items: center;
	gap: 8px;
}
.pp-price-inputs__field {
	position: relative;
	flex: 1;
	min-width: 0;
}
.pp-price-inputs__field input {
	width: 100%;
	padding: 8px 22px 8px 10px;
	border: 1px solid var( --pp-border );
	border-radius: 4px;
	font-size: 13px;
	color: var( --pp-text );
}
.pp-price-inputs__symbol {
	position: absolute;
	right: 8px;
	top: 50%;
	transform: translateY( -50% );
	font-size: 13px;
	color: var( --pp-muted );
}
.pp-price-inputs__update {
	flex: 0 0 auto;
	padding: 8px 14px;
	background: #fff;
	color: var( --pp-blue );
	border: 1px solid var( --pp-blue );
	border-radius: 4px;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.03em;
	cursor: pointer;
}
.pp-price-inputs__update:hover {
	background: var( --pp-blue );
	color: #fff;
}

/* Category list */
.pp-cat-list {
	list-style: none;
	margin: 0;
	padding: 0;
}
.pp-cat-list__item {
	margin: 0 0 1px;
}

/* Clickable bands (leaf links + parent rows) */
.pp-cat-list__item > a,
.pp-cat-row {
	padding: 7px 8px;
	border-radius: 4px;
	font-size: 14px;
	color: var( --pp-text );
	text-decoration: none;
}
.pp-cat-list__item > a {
	display: block;
}
.pp-cat-list__item > a:hover,
.pp-cat-row:hover {
	background: var( --pp-hover );
}
.pp-cat-list__item > a:hover,
.pp-cat-row:hover .pp-cat-row__label {
	color: var( --pp-selected );
	text-decoration: underline !important;
}
.pp-cat-list__item.is-current > a,
.pp-cat-list__item.is-current > .pp-cat-row > .pp-cat-row__label {
	font-weight: 700;
	color: var( --pp-selected );
}

/* Collapsible tree — label navigates, rest of the row toggles */
.pp-cat-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	cursor: pointer;
}
.pp-cat-row__label {
	line-height: 1.3;
	color: var( --pp-text );
	text-decoration: none;
}
.pp-cat-toggle {
	flex: 0 0 auto;
	width: 18px;
	height: 18px;
	position: relative;
	cursor: pointer;
	padding: 0 !important;
	margin: 0 !important;
	border: 0 !important;
	background: none !important;
	box-shadow: none !important;
	-webkit-appearance: none;
	appearance: none;
}
.pp-cat-toggle:focus-visible {
	outline: 2px solid var( --pp-selected );
	outline-offset: 2px;
}
.pp-cat-toggle::before {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 6px;
	height: 6px;
	border-right: 2px solid var( --pp-selected );
	border-bottom: 2px solid var( --pp-selected );
	transform: translate( -50%, -65% ) rotate( -45deg );
	transition: transform 0.15s ease;
}
.pp-cat-toggle[aria-expanded="true"]::before {
	transform: translate( -50%, -35% ) rotate( 45deg );
}
.pp-cat-sublist {
	list-style: none;
	margin: 4px 0 4px;
	padding-left: 12px;
	border-left: 2px solid var( --pp-border );
}
.pp-cat-sublist__item {
	margin: 0 0 1px;
}
.pp-cat-sublist__item > a {
	display: block;
	padding: 5px 8px;
	border-radius: 4px;
	font-size: 13px;
	color: var( --pp-muted );
	text-decoration: none;
}
.pp-cat-sublist__item > a:hover {
	background: var( --pp-hover );
	color: var( --pp-selected );
}

/* Swatches */
.pp-options--swatch {
	display: grid;
	grid-template-columns: repeat( 6, 1fr );
	gap: 8px;
}
.pp-swatch {
	position: relative;
	cursor: pointer;
	margin: 0;
	aspect-ratio: 1 / 1;
}
.pp-swatch input {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
}
.pp-swatch__chip {
	display: block;
	width: 100%;
	height: 100%;
	min-height: 28px;
	border-radius: 4px;
	border: 1px solid rgba( 0, 0, 0, 0.12 );
}
.pp-swatch.is-checked .pp-swatch__chip {
	outline: 2px solid var( --pp-navy );
	outline-offset: 1px;
}
.pp-swatch.pp-unavailable {
	display: none;
}

/* Checkbox list */
.pp-options--check {
	list-style: none;
	margin: 0;
	padding: 0;
}
.pp-check {
	margin: 0 0 10px;
}
.pp-check label {
	display: flex;
	align-items: center;
	gap: 9px;
	cursor: pointer;
	font-size: 14px;
}
.pp-check input {
	position: absolute;
	opacity: 0;
}
.pp-check__box {
	width: 18px;
	height: 18px;
	border: 1px solid #c4c9d4;
	border-radius: 3px;
	flex: 0 0 auto;
	position: relative;
}
.pp-check input:checked + .pp-check__box {
	background: var( --pp-blue );
	border-color: var( --pp-blue );
}
.pp-check input:checked + .pp-check__box::after {
	content: '';
	position: absolute;
	left: 5px;
	top: 1px;
	width: 5px;
	height: 10px;
	border: solid #fff;
	border-width: 0 2px 2px 0;
	transform: rotate( 45deg );
}
.pp-check.pp-unavailable {
	display: none;
}

/* Show more */
.pp-show-more {
	display: inline-block;
	margin-top: 12px;
	font-size: 14px;
	color: var( --pp-blue );
	text-decoration: none;
}
.pp-show-more:hover {
	text-decoration: underline;
}

/* Utility */
.pp-hidden {
	display: none;
}

/* Loading */
.pp-filter.is-loading {
	opacity: 0.6;
	pointer-events: none;
}
.pp-grid-loading {
	opacity: 0.45;
	transition: opacity 0.15s ease;
}
.pp-grid-loading-wrap {
	position: relative;
}
.pp-grid-spinner {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 10;
	pointer-events: none;
}
.pp-spinner {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	border: 4px solid rgba( 227, 19, 47, 0.2 );
	border-top-color: #e3132f;
	animation: pp-spin 0.7s linear infinite;
}
@keyframes pp-spin {
	to {
		transform: rotate( 360deg );
	}
}

/* Sort dropdown ([promopal_sort]) — lives outside .pp-filter */
select.pp-orderby {
	padding: 9px 34px 9px 12px;
	border: 1px solid var( --pp-border, #e3e6ec );
	border-radius: 4px;
	background-color: #fff;
	font-size: 14px;
	color: #2b2f38;
	cursor: pointer;
	max-width: 100%;
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	background-image: url( "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='%236b7280' d='M6 8 0 2l1.4-1.4L6 5.2 10.6.6 12 2z'/%3E%3C/svg%3E" );
	background-repeat: no-repeat;
	background-position: right 12px center;
	background-size: 10px;
}
select.pp-orderby:focus {
	outline: none;
	border-color: var( --pp-selected, #e3132f );
}

/* Mobile: collapse to a toggle */
@media ( max-width: 768px ) {
	.pp-filter {
		max-width: none;
	}
}
