/**
 * ARSYNL Product Filters
 *
 * Diseño minimalista, vertical en una sola columna.
 *
 * Nota de especificidad: los temas y el kit de Elementor suelen definir reglas
 * globales para `a`, `input` y `button` que ganan a un selector de clase suelto.
 * Por eso todo va anidado bajo `.arsynl-pf` (dos clases) y las pocas
 * propiedades que el tema pisa de forma agresiva llevan `!important`.
 * El campo de búsqueda, en cambio, hereda a propósito el aspecto del tema
 * (fondo, radio, tipografía) para que se vea nativo del sitio.
 */

.arsynl-pf {
	--arsynl-pf-cols: 1;
	--arsynl-pf-gap: 0px;
	--arsynl-pf-radius: 6px;
	--arsynl-pf-accent: currentColor;
	--arsynl-pf-text: inherit;
	--arsynl-pf-muted: rgba(0, 0, 0, .45);
	--arsynl-pf-border: rgba(0, 0, 0, .08);
	--arsynl-pf-hover-bg: rgba(0, 0, 0, .03);
	--arsynl-pf-active-bg: transparent;
	--arsynl-pf-dot: 15px;
	--arsynl-pf-item-py: 9px;
	--arsynl-pf-item-px: 0px;

	width: 100%;
	color: var(--arsynl-pf-text);
	line-height: 1.4;
}

.arsynl-pf *,
.arsynl-pf *::before,
.arsynl-pf *::after {
	box-sizing: border-box;
}

/* ------------------------------------------------------------------ Heading */

.arsynl-pf .arsynl-pf__heading {
	margin: 0 0 12px;
	font-size: .78em;
	font-weight: 600;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--arsynl-pf-muted);
}

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

.arsynl-pf .arsynl-pf__search {
	position: relative;
	display: flex;
	align-items: center;
	margin: 0 0 16px;
	padding: 0;
	border: 0;
}

/*
 * El input conserva el estilo del tema (fondo, radio, tipografía). Sólo se
 * fuerza el hueco de la derecha para que el texto nunca pase por debajo del
 * botón de limpiar.
 */
.arsynl-pf .arsynl-pf__input {
	flex: 1 1 auto;
	width: 100%;
	min-width: 0;
	margin: 0;
	padding-right: 44px !important;
	color: inherit;
	-webkit-appearance: none;
	appearance: none;
}

.arsynl-pf .arsynl-pf__input::-webkit-search-cancel-button,
.arsynl-pf .arsynl-pf__input::-webkit-search-decoration {
	-webkit-appearance: none;
	display: none;
}

.arsynl-pf .arsynl-pf__clear {
	position: absolute;
	right: 10px;
	top: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	margin: 0;
	padding: 0 !important;
	transform: translateY(-50%);
	border: 0 !important;
	border-radius: 50% !important;
	background: none !important;
	color: var(--arsynl-pf-muted) !important;
	line-height: 0;
	cursor: pointer;
	opacity: .8;
	transition: opacity .15s ease, color .15s ease;
}

.arsynl-pf .arsynl-pf__clear svg {
	width: 13px;
	height: 13px;
}

.arsynl-pf .arsynl-pf__clear:hover,
.arsynl-pf .arsynl-pf__clear:focus-visible {
	opacity: 1;
	color: var(--arsynl-pf-accent) !important;
}

.arsynl-pf .arsynl-pf__clear[hidden] {
	display: none;
}

.arsynl-pf .arsynl-pf__submit {
	margin-left: 8px;
}

/* --------------------------------------------------------------------- List */

.arsynl-pf .arsynl-pf__list {
	display: grid;
	grid-template-columns: repeat(var(--arsynl-pf-cols), minmax(0, 1fr));
	gap: var(--arsynl-pf-gap);
}

.arsynl-pf .arsynl-pf__item {
	display: flex;
	align-items: center;
	gap: 10px;
	min-height: 0;
	margin: 0;
	padding: var(--arsynl-pf-item-py) var(--arsynl-pf-item-px) !important;
	border: 0;
	border-radius: var(--arsynl-pf-radius);
	background: none;
	color: inherit !important;
	font-size: .95em;
	font-weight: 400;
	text-decoration: none !important;
	box-shadow: none;
	cursor: pointer;
	transition: color .15s ease, background-color .15s ease;
}

.arsynl-pf .arsynl-pf__item:hover {
	color: var(--arsynl-pf-accent) !important;
	background: var(--arsynl-pf-hover-bg);
}

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

.arsynl-pf .arsynl-pf__item.is-active {
	background: var(--arsynl-pf-active-bg);
	color: var(--arsynl-pf-accent) !important;
	font-weight: 500;
}

.arsynl-pf .arsynl-pf__item[hidden] {
	display: none;
}

/* Punto de radio dibujado en CSS. */
.arsynl-pf .arsynl-pf__radio {
	position: relative;
	flex: 0 0 auto;
	width: var(--arsynl-pf-dot);
	height: var(--arsynl-pf-dot);
	border: 1px solid var(--arsynl-pf-border);
	border-radius: 50%;
	background: none;
	transition: border-color .15s ease;
}

.arsynl-pf .arsynl-pf__item:hover .arsynl-pf__radio,
.arsynl-pf .arsynl-pf__item.is-active .arsynl-pf__radio {
	border-color: var(--arsynl-pf-accent);
}

.arsynl-pf .arsynl-pf__radio::after {
	content: "";
	position: absolute;
	inset: 3px;
	border-radius: 50%;
	background: var(--arsynl-pf-accent);
	transform: scale(0);
	transition: transform .15s ease;
}

.arsynl-pf .arsynl-pf__item.is-active .arsynl-pf__radio::after {
	transform: scale(1);
}

.arsynl-pf .arsynl-pf__name {
	flex: 1 1 auto;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.arsynl-pf .arsynl-pf__count {
	flex: 0 0 auto;
	color: var(--arsynl-pf-muted);
	font-size: .8em;
	font-weight: 400;
	font-variant-numeric: tabular-nums;
	opacity: .85;
}

/* ------------------------------------------------------- Variante con líneas */

.arsynl-pf--divided .arsynl-pf__item:not(:last-child) {
	border-bottom: 1px solid var(--arsynl-pf-border);
	border-radius: 0;
}

/* ------------------------------------------------------------ Variante boxed */

.arsynl-pf--boxed {
	--arsynl-pf-gap: 8px;
	--arsynl-pf-item-px: 12px;
	--arsynl-pf-item-py: 10px;
}

.arsynl-pf--boxed .arsynl-pf__item {
	border: 1px solid var(--arsynl-pf-border);
}

.arsynl-pf--boxed .arsynl-pf__item.is-active {
	border-color: var(--arsynl-pf-accent);
}

/* ------------------------------------------------------------------- Extras */

/*
 * El botón de limpiar filtros lleva a propósito las clases de botón del sitio
 * (elementor-button por defecto), así que aquí sólo se controla su hueco y su
 * visibilidad: el aspecto lo pone el tema.
 */
.arsynl-pf .arsynl-pf__reset {
	margin-top: 16px;
	cursor: pointer;
}

.arsynl-pf .arsynl-pf__reset[hidden] {
	display: none;
}

/* Si no se le pasan clases del tema, cae en un enlace de texto discreto. */
.arsynl-pf .arsynl-pf__reset--plain {
	padding: 0;
	border: 0;
	background: none;
	color: var(--arsynl-pf-muted);
	font: inherit;
	font-size: .82em;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.arsynl-pf .arsynl-pf__reset--plain:hover {
	color: var(--arsynl-pf-accent);
}

.arsynl-pf .arsynl-pf__status {
	margin: 12px 0 0;
	min-height: 1.2em;
	color: var(--arsynl-pf-muted);
	font-size: .8em;
}

.arsynl-pf .arsynl-pf__status:empty {
	display: none;
}

.arsynl-pf__empty {
	margin: 40px 0;
	text-align: center;
	opacity: .6;
}

/* ---------------------------------------------------- Estado de carga (grid) */

.arsynl-pf-target {
	position: relative;
	transition: opacity .18s ease;
}

.arsynl-pf-target.is-loading {
	opacity: .35;
	pointer-events: none;
}

.arsynl-pf-target.is-loading::after {
	content: "";
	position: absolute;
	top: 40px;
	left: 50%;
	width: 26px;
	height: 26px;
	margin-left: -13px;
	border: 2px solid rgba(0, 0, 0, .12);
	border-top-color: currentColor;
	border-radius: 50%;
	animation: arsynl-pf-spin .7s linear infinite;
}

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

/* --------------------------------------------------------------- Responsive */

@media (max-width: 767px) {
	.arsynl-pf .arsynl-pf__list {
		grid-template-columns: 1fr;
	}

	.arsynl-pf {
		--arsynl-pf-item-py: 11px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.arsynl-pf *,
	.arsynl-pf-target {
		transition: none !important;
		animation: none !important;
	}
}

/* Clase estándar de WP, por si el tema no la define. */
.arsynl-pf .screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}
