/* ANPROFILE Product Filters
   All spacing uses logical properties, so this works in RTL and LTR unchanged.
   Override the variables below in Elementor > Site Settings > Custom CSS if the
   brand colours ever change. */

.anp-filters {
	--anp-accent: #8cc63f;
	--anp-accent-dark: #74ab2c;
	--anp-ink: #14181c;
	--anp-muted: #6b7280;
	--anp-line: #e5e7eb;
	--anp-surface: #ffffff;
	--anp-radius: 10px;

	font-family: inherit;
	color: var(--anp-ink);
	margin-block-end: 28px;
}

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

/* ---- Bar -------------------------------------------------------------- */

.anp-filters__bar {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 16px;
	padding: 18px;
	background: var(--anp-surface);
	border: 1px solid var(--anp-line);
	border-radius: var(--anp-radius);
	box-shadow: 0 1px 3px rgba(20, 24, 28, 0.06);
}

.anp-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 0;
}

.anp-field--search {
	flex: 1 1 320px;
}

.anp-field__label {
	font-size: 13px;
	font-weight: 600;
	color: var(--anp-muted);
	line-height: 1.2;
}

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

.anp-search {
	position: relative;
	display: flex;
	align-items: center;
}

.anp-search__icon {
	position: absolute;
	inset-inline-start: 12px;
	width: 18px;
	height: 18px;
	fill: none;
	stroke: var(--anp-muted);
	stroke-width: 2;
	stroke-linecap: round;
	pointer-events: none;
}

.anp-search__input {
	width: 100%;
	height: 46px;
	padding-inline: 40px 38px;
	font: inherit;
	font-size: 15px;
	color: var(--anp-ink);
	background: #fafafa;
	border: 1px solid var(--anp-line);
	border-radius: var(--anp-radius);
	transition: border-color 0.15s ease, background 0.15s ease;
}

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

.anp-search__input:focus {
	outline: none;
	background: #fff;
	border-color: var(--anp-accent);
	box-shadow: 0 0 0 3px rgba(140, 198, 63, 0.22);
}

.anp-search__clear {
	position: absolute;
	inset-inline-end: 10px;
	display: none;
	width: 24px;
	height: 24px;
	padding: 0;
	font-size: 20px;
	line-height: 1;
	color: var(--anp-muted);
	background: none;
	border: 0;
	cursor: pointer;
}

.anp-search__input:not(:placeholder-shown) ~ .anp-search__clear {
	display: block;
}

/* ---- Price ------------------------------------------------------------ */

.anp-price {
	display: flex;
	align-items: center;
	gap: 8px;
	height: 46px;
	padding-inline: 12px;
	background: #fafafa;
	border: 1px solid var(--anp-line);
	border-radius: var(--anp-radius);
}

.anp-price__input {
	width: 76px;
	height: 100%;
	font: inherit;
	font-size: 15px;
	color: var(--anp-ink);
	text-align: center;
	background: none;
	border: 0;
	appearance: textfield;
	-moz-appearance: textfield;
}

.anp-price__input::-webkit-outer-spin-button,
.anp-price__input::-webkit-inner-spin-button {
	margin: 0;
	appearance: none;
	-webkit-appearance: none;
}

.anp-price__input:focus {
	outline: none;
}

.anp-price:focus-within {
	background: #fff;
	border-color: var(--anp-accent);
	box-shadow: 0 0 0 3px rgba(140, 198, 63, 0.22);
}

.anp-price__sep,
.anp-price__currency {
	font-size: 13px;
	color: var(--anp-muted);
}

/* ---- Sort ------------------------------------------------------------- */

.anp-select {
	height: 46px;
	min-width: 190px;
	padding-inline: 14px 34px;
	font: inherit;
	font-size: 15px;
	color: var(--anp-ink);
	background-color: #fafafa;
	background-image: linear-gradient(45deg, transparent 50%, var(--anp-muted) 50%),
		linear-gradient(135deg, var(--anp-muted) 50%, transparent 50%);
	background-position: right 16px center, right 11px center;
	background-size: 5px 5px, 5px 5px;
	background-repeat: no-repeat;
	border: 1px solid var(--anp-line);
	border-radius: var(--anp-radius);
	appearance: none;
	-webkit-appearance: none;
	cursor: pointer;
}

[dir="rtl"] .anp-select,
.anp-filters--rtl .anp-select {
	background-position: left 11px center, left 16px center;
	background-image: linear-gradient(225deg, transparent 50%, var(--anp-muted) 50%),
		linear-gradient(315deg, var(--anp-muted) 50%, transparent 50%);
}

.anp-select:focus {
	outline: none;
	border-color: var(--anp-accent);
	box-shadow: 0 0 0 3px rgba(140, 198, 63, 0.22);
}

/* ---- Category chips --------------------------------------------------- */

.anp-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-block-start: 14px;
}

.anp-chip {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	height: 38px;
	padding-inline: 16px;
	font: inherit;
	font-size: 14px;
	font-weight: 500;
	color: var(--anp-ink);
	background: var(--anp-surface);
	border: 1px solid var(--anp-line);
	border-radius: 999px;
	cursor: pointer;
	transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.anp-chip:hover {
	border-color: var(--anp-accent);
}

.anp-chip.is-active {
	color: #fff;
	background: var(--anp-accent);
	border-color: var(--anp-accent);
}

.anp-chip__count {
	font-size: 12px;
	font-variant-numeric: tabular-nums;
	color: var(--anp-muted);
}

.anp-chip.is-active .anp-chip__count {
	color: rgba(255, 255, 255, 0.85);
}

.anp-chip:focus-visible,
.anp-reset:focus-visible,
.anp-search__clear:focus-visible {
	outline: 2px solid var(--anp-accent-dark);
	outline-offset: 2px;
}

/* ---- Footer row ------------------------------------------------------- */

.anp-filters__foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-block-start: 14px;
	min-height: 24px;
}

.anp-count {
	margin: 0;
	font-size: 14px;
	color: var(--anp-muted);
}

.anp-count strong {
	color: var(--anp-ink);
	font-variant-numeric: tabular-nums;
}

.anp-reset {
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	color: var(--anp-muted);
	background: none;
	border: 0;
	padding: 4px 0;
	cursor: pointer;
	visibility: hidden;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.anp-reset.is-visible {
	visibility: visible;
}

.anp-reset:hover {
	color: var(--anp-ink);
}

/* ---- Results loading state -------------------------------------------- */

.anp-is-loading {
	position: relative;
	opacity: 0.45;
	transition: opacity 0.2s ease;
	pointer-events: none;
}

.anp-is-loading::after {
	content: "";
	position: absolute;
	inset-block-start: 40px;
	inset-inline-start: 50%;
	width: 32px;
	height: 32px;
	margin-inline-start: -16px;
	border: 3px solid var(--anp-line, #e5e7eb);
	border-top-color: var(--anp-accent, #8cc63f);
	border-radius: 50%;
	animation: anp-spin 0.7s linear infinite;
}

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

@media (prefers-reduced-motion: reduce) {
	.anp-is-loading::after {
		animation-duration: 2s;
	}
	.anp-chip,
	.anp-search__input {
		transition: none;
	}
}

/* ---- Mobile ----------------------------------------------------------- */

@media (max-width: 767px) {
	.anp-filters__bar {
		padding: 14px;
		gap: 12px;
	}
	.anp-field--search,
	.anp-field--price,
	.anp-field--sort {
		flex: 1 1 100%;
	}
	.anp-select,
	.anp-price {
		width: 100%;
	}
	.anp-price__input {
		flex: 1;
		width: auto;
	}
	.anp-chips {
		flex-wrap: nowrap;
		overflow-x: auto;
		scrollbar-width: none;
		padding-block-end: 4px;
	}
	.anp-chips::-webkit-scrollbar {
		display: none;
	}
	.anp-chip {
		flex-shrink: 0;
	}
}
