/**
 * Filters by Pelican — base styles.
 *
 * The plugin ships its own CSS so filters look right on any site with no
 * theme code. Everything themable is driven by CSS custom properties, which
 * the widgets' Elementor Style controls override per instance:
 *
 *   --pel-accent            selected states, slider fill, handles
 *   --pel-pf-border         control borders
 *   --pel-pf-radius         control corner radius
 *   --pel-pf-tile-cols      image-tile columns
 *   --pel-pf-tile-gap       image-tile gap
 */

.pel-pf {
	--pel-accent: #333333;
	--pel-pf-border: #d5d5d5;
	--pel-pf-radius: 6px;
	--pel-pf-muted: #777777;
}

/* ── Grid loading state ──────────────────────────────────────────────── */

.pel-pf-loading {
	opacity: 0.45;
	pointer-events: none;
	transition: opacity 0.2s ease;
}

/* ── Select (sort + taxonomy dropdown) ───────────────────────────────── */

/* The arrow is a real element (.pel-pf-select__icon) layered over the
   select's right edge; clicks pass through it to the select. */
.pel-pf-select-wrap {
	position: relative;
}

.pel-pf-select__icon {
	position: absolute;
	top: 50%;
	right: 14px;
	transform: translateY(-50%);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 10px;
	line-height: 1;
	color: #555555;
	pointer-events: none;
	transition: color var(--pel-pf-transition, 0.2s) ease, background-color var(--pel-pf-transition, 0.2s) ease;
}

.pel-pf-select__icon svg {
	width: 1em;
	height: 1em;
	fill: currentColor;
}

.pel-pf-select__icon svg.pel-pf-select__chevron {
	height: 0.6em;
	fill: none;
}

.pel-pf-select {
	width: 100%;
	padding: 10px 36px 10px 12px;
	border: 1px solid var(--pel-pf-border);
	border-radius: var(--pel-pf-radius);
	background-color: #ffffff;
	background-image: none;
	color: inherit;
	font: inherit;
	line-height: 1.4;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
	transition: color var(--pel-pf-transition, 0.2s) ease, background-color var(--pel-pf-transition, 0.2s) ease, border-color var(--pel-pf-transition, 0.2s) ease;
}

.pel-pf-select:focus-visible {
	outline: 2px solid var(--pel-accent);
	outline-offset: 1px;
}

/* ── Checkbox / radio lists ──────────────────────────────────────────── */

/* The label is the styleable "item" box (pill/button looks come from the
   widget's List controls), so the whole item is clickable. */

.pel-pf-list {
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	justify-content: var(--pel-pf-list-justify, flex-start);
	gap: 0.5em;
}

.pel-pf-list__item {
	margin: 0;
	padding: 0;
}

/* Bumped so theme list styles (e.g. ".elementor ul li") can't bring
   bullets back. */
.pel-pf .pel-pf-list,
.pel-pf .pel-pf-list__item {
	list-style: none;
}

.pel-pf-list__item::marker {
	content: none;
}

.pel-pf-list__item label {
	display: flex;
	align-items: center;
	justify-content: var(--pel-pf-list-justify, flex-start);
	gap: 0.55em;
	margin: 0;
	cursor: pointer;
	line-height: 1.4;
	box-sizing: border-box;
	transition: color var(--pel-pf-transition, 0.2s) ease, background-color var(--pel-pf-transition, 0.2s) ease, border-color var(--pel-pf-transition, 0.2s) ease;
}

.pel-pf-list__item label .pel-pf-count {
	transition: color var(--pel-pf-transition, 0.2s) ease;
}

.pel-pf-list__item input {
	margin: 0;
	flex: 0 0 auto;
	width: 1.05em;
	height: 1.05em;
	accent-color: var(--pel-accent);
	cursor: pointer;
}

/* "Hide checkbox / radio": visually hidden but still focusable, so the
   list stays keyboard-operable; the item shows the focus ring instead. */
.pel-pf-list--hide-input-yes .pel-pf-list__item input {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	border: 0;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	overflow: hidden;
	white-space: nowrap;
}

.pel-pf-list--hide-input-yes .pel-pf-list__item label:has(input:focus-visible) {
	outline: 2px solid var(--pel-accent);
	outline-offset: 2px;
}

/* ── Term counts ─────────────────────────────────────────────────────── */

.pel-pf-count {
	color: var(--pel-pf-muted);
	font-size: 0.85em;
}

/* ── Image tiles ─────────────────────────────────────────────────────── */

.pel-pf-tiles {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(var(--pel-pf-tile-cols, 2), minmax(0, 1fr));
	gap: var(--pel-pf-tile-gap, 12px);
}

.pel-pf-tile {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 12px;
	border: 1px solid var(--pel-pf-border);
	border-radius: var(--pel-pf-radius);
	background: #ffffff;
	cursor: pointer;
	text-align: center;
	transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
	height: 100%;
	box-sizing: border-box;
}

/* The real input stays in the DOM (keyboard + no-JS) but is visually hidden. */
.pel-pf-tile input {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	border: 0;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	overflow: hidden;
	white-space: nowrap;
}

.pel-pf-tile__img {
	display: block;
	position: relative;
	width: 100%;
}

.pel-pf-tile__img img {
	display: block;
	width: 100%;
	height: var(--pel-pf-tile-img-h, auto);
	max-width: 100%;
	object-fit: cover;
	border-radius: calc(var(--pel-pf-radius) - 2px);
}

/* Optional hover image, cross-fading over the base image. */
.pel-pf-tile__img-hover {
	position: absolute;
	inset: 0;
	opacity: 0;
	transition: opacity 0.2s ease;
}

.pel-pf-tile__img-hover img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.pel-pf-tile:hover .pel-pf-tile__img-hover {
	opacity: 1;
}

.pel-pf-tile__label {
	display: block;
	line-height: 1.3;
}

.pel-pf-tile:hover {
	border-color: var(--pel-pf-tile-sel-border, var(--pel-accent));
}

.pel-pf-tile:has(input:checked) {
	border-color: var(--pel-pf-tile-sel-border, var(--pel-accent));
	box-shadow: inset 0 0 0 var(--pel-pf-tile-ring, 1px) var(--pel-pf-tile-sel-border, var(--pel-accent));
}

.pel-pf-tile:has(input:focus-visible) {
	outline: 2px solid var(--pel-accent);
	outline-offset: 2px;
}

/* ── Price slider ────────────────────────────────────────────────────── */

.pel-pf-price {
	--pel-pf-track: #e2e2e2;
	--pel-pf-handle-size: 18px;
	padding-top: calc(var(--pel-pf-handle-size) / 2);
}

.pel-pf-price__slider {
	position: relative;
	height: 4px;
	margin: 0 calc(var(--pel-pf-handle-size) / 2);
	border-radius: 999px;
	background: var(--pel-pf-track);
	cursor: pointer;
	touch-action: none;
}

.pel-pf-price__range {
	position: absolute;
	top: 0;
	height: 100%;
	border-radius: 999px;
	background: var(--pel-accent);
}

.pel-pf-price__handle {
	position: absolute;
	top: 50%;
	width: var(--pel-pf-handle-size);
	height: var(--pel-pf-handle-size);
	transform: translate(-50%, -50%);
	border-radius: 50%;
	background: var(--pel-accent);
	border: 2px solid #ffffff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
	cursor: grab;
	touch-action: none;
}

.pel-pf-price__handle.is-dragging {
	cursor: grabbing;
}

.pel-pf-price__handle:focus-visible {
	outline: 2px solid var(--pel-accent);
	outline-offset: 2px;
}

.pel-pf-price__display {
	margin-top: 0.75em;
	line-height: 1.4;
}

/* ── Keyword search ──────────────────────────────────────────────────── */

/* The visible box is .pel-pf-search__field; the input inside it is
   stripped bare so an optional icon can sit within the border. */

.pel-pf--search {
	--pel-pf-search-gap: 10px;
}

.pel-pf-search__wrap {
	display: flex;
	align-items: center;
	gap: var(--pel-pf-search-gap);
	width: 100%;
	margin: 0;
	cursor: text;
}

.pel-pf-search__field {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	align-items: center;
	gap: var(--pel-pf-search-gap);
	padding: 10px 12px;
	border: 1px solid var(--pel-pf-border);
	border-radius: var(--pel-pf-radius);
	background-color: #ffffff;
	box-sizing: border-box;
	transition: background-color var(--pel-pf-transition, 0.2s) ease, border-color var(--pel-pf-transition, 0.2s) ease, box-shadow var(--pel-pf-transition, 0.2s) ease;
}

.pel-pf-search__field:focus-within {
	outline: 2px solid var(--pel-accent);
	outline-offset: 1px;
}

/* Typography defaults only — low specificity so the widget's Text
   controls always win. */
.pel-pf-search__input {
	color: inherit;
	font: inherit;
	line-height: 1.4;
}

/* Box reset. Deliberately heavy: the theme reset (input[type=search]) and
   Elementor's Site Settings → Form Fields both style bare inputs, and would
   otherwise draw a second border/padding inside the field. */
.pel-pf.pel-pf--search .pel-pf-search__field input.pel-pf-search__input {
	flex: 1 1 auto;
	min-width: 0;
	width: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	box-shadow: none;
	outline: none;
	transition: color var(--pel-pf-transition, 0.2s) ease;
	-webkit-appearance: none;
	appearance: none;
}

.pel-pf-search__input::placeholder {
	transition: color var(--pel-pf-transition, 0.2s) ease;
}

.pel-pf-search__icon {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
	color: var(--pel-pf-muted);
	transition: color var(--pel-pf-transition, 0.2s) ease;
}

.pel-pf-search__icon svg {
	width: 1em;
	height: 1em;
	fill: currentColor;
	transition: fill var(--pel-pf-transition, 0.2s) ease;
}

/* ── Off-canvas drawer ───────────────────────────────────────────────── */

/* The toggle stays hidden until the engine activates it below the
   configured breakpoint (and stays hidden entirely without JS). */
.pel-pf-offcanvas-toggle {
	display: inline-flex;
	align-items: center;
	gap: 0.5em;
	padding: 10px 16px;
	border: 1px solid var(--pel-pf-border);
	border-radius: var(--pel-pf-radius);
	background: #ffffff;
	color: inherit;
	font: inherit;
	line-height: 1.2;
	cursor: pointer;
}

.pel-pf-offcanvas-toggle[hidden] {
	display: none;
}

.pel-pf-offcanvas-toggle__icon {
	flex: 0 0 auto;
}

.pel-pf-offcanvas-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 1.6em;
	height: 1.6em;
	padding: 0 0.4em;
	border-radius: 999px;
	background: var(--pel-accent);
	color: #ffffff;
	font-size: 0.75em;
	line-height: 1;
}

.pel-pf-offcanvas-badge[hidden] {
	display: none;
}

/* The builder's own container, promoted to a fixed drawer by the engine. */
.pel-pf-offcanvas-panel {
	position: fixed;
	top: 0;
	bottom: 0;
	width: var(--pel-pf-offcanvas-w, 320px);
	max-width: 85vw;
	z-index: 99999;
	background: var(--pel-pf-offcanvas-bg, #ffffff);
	overflow-y: auto;
	padding: 48px 24px 24px;
	box-sizing: border-box;
	transition: transform 0.25s ease;
	box-shadow: 0 0 24px rgba(0, 0, 0, 0.18);
}

.pel-pf-offcanvas-panel--left {
	left: 0;
	transform: translateX(-105%);
}

.pel-pf-offcanvas-panel--right {
	right: 0;
	transform: translateX(105%);
}

.pel-pf-offcanvas-panel.is-open {
	transform: translateX(0);
}

.pel-pf-offcanvas-overlay {
	position: fixed;
	inset: 0;
	z-index: 99998;
	background: rgba(0, 0, 0, 0.5);
}

.pel-pf-offcanvas-close {
	position: absolute;
	top: 8px;
	right: 12px;
	padding: 4px 8px;
	border: 0;
	background: none;
	color: inherit;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
}

body.pel-pf-offcanvas-lock {
	overflow: hidden;
}

/* ── Reset link ──────────────────────────────────────────────────────── */

.pel-pf-reset {
	display: inline-block;
	cursor: pointer;
	text-decoration: underline;
	text-underline-offset: 2px;
}

/* Auto-hide until a filter is active (server sets is-active on load,
   the JS engine keeps it in sync after AJAX changes). */
.pel-pf-reset[data-auto-hide] {
	display: none;
}

.pel-pf-reset[data-auto-hide].is-active {
	display: inline-block;
}
