/* Filtros del feed (sections/product-feed.php, js/feed-filtros.js): columna en escritorio y hoja desde abajo en el móvil */
.ff-col {
	--ff-red: var(--bs-primary, #c1121f);
	--ff-text: #1b1b1f;
	--ff-muted: #6b6b73;
	--ff-line: #dcdce0;
	--ff-soft: #f5f5f7;
}

/* Barra del móvil: buscador + botón "Filtros" + filtros activos */
.ff-bar {
	--ff-red: var(--bs-primary, #c1121f);
	margin-bottom: 1rem;
}
.ff-search {
	position: relative;
	margin-bottom: .5rem;
}
.ff-search i {
	position: absolute;
	left: 14px;
	top: 50%;
	transform: translateY(-50%);
	color: #6b6b73;
	pointer-events: none;
}
.ff-search .form-control {
	height: 44px;
	padding-left: 40px;
	font-size: 1rem;
}
.ff-bar-row {
	display: flex;
	align-items: center;
	gap: .5rem;
}
.ff-open {
	flex: none;
	height: 40px;
	display: inline-flex;
	align-items: center;
	gap: .4rem;
	font-size: .8125rem;
}
.ff-chips-active {
	display: flex;
	gap: .375rem;
	overflow-x: auto;
	scrollbar-width: none;
	min-width: 0;
}
.ff-chips-active::-webkit-scrollbar {
	display: none;
}
.ff-active {
	flex: none;
	display: inline-flex;
	align-items: center;
	gap: .375rem;
	height: 34px;
	padding: 0 .75rem;
	border-radius: var(--bs-border-radius);
	background: #fdecee;
	color: #8f0d17;
	font-size: .8125rem;
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
}
.ff-active:hover {
	background: #f9d7db;
	color: #8f0d17;
}
.ff-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 20px;
	height: 20px;
	padding: 0 6px;
	border-radius: 10px;
	background: var(--ff-red);
	color: #fff;
	font-size: .75rem;
	font-weight: 700;
	line-height: 1;
}
.ff-open:hover .ff-badge,
.ff-open:active .ff-badge {
	background: #fff;
	color: var(--ff-red);
}

/* Panel */
.ff {
	background: #fff;
	color: var(--ff-text);
}
.ff-head {
	display: none;
}
.ff-label {
	display: block;
	float: none;
	width: auto;
	margin: 0 0 .5rem;
	padding: 0;
	font-size: .75rem;
	font-weight: 700;
	letter-spacing: .04em;
	text-transform: uppercase;
	color: var(--ff-muted);
}
.ff-group {
	margin: 0;
	padding: 0 0 1rem;
	border: 0;
	min-width: 0;
}
.ff-group + .ff-group {
	padding-top: 1rem;
	border-top: 1px solid var(--ff-line);
}
.ff .form-control,
.ff .form-select {
	font-size: 1rem;
	height: 42px;
}
.ff .form-control:focus,
.ff .form-select:focus {
	border-color: var(--ff-red);
	box-shadow: 0 0 0 .25rem rgba(193, 18, 31, .2);
}
.ff-chips {
	display: flex;
	flex-wrap: wrap;
	gap: .375rem;
}
.ff-chip {
	position: relative;
	margin: 0;
	cursor: pointer;
}
.ff-chip input {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
	pointer-events: none;
}
.ff-chip span {
	display: inline-flex;
	align-items: center;
	min-height: 36px;
	padding: 0 .75rem;
	border: 1px solid var(--ff-line);
	border-radius: var(--bs-border-radius);
	background: #fff;
	font-size: .875rem;
	font-weight: 500;
	user-select: none;
	transition: background-color .15s, border-color .15s, color .15s;
}
.ff-chip:hover span {
	border-color: var(--ff-red);
}
.ff-chip input:checked + span {
	background: var(--ff-red);
	border-color: var(--ff-red);
	color: #fff;
	font-weight: 600;
}
.ff-chip input:focus-visible + span {
	box-shadow: 0 0 0 .25rem rgba(193, 18, 31, .25);
}
.ff-sub {
	border-bottom: 1px solid var(--ff-soft);
}
.ff-sub:last-child {
	border-bottom: 0;
}
.ff-sub summary {
	display: flex;
	align-items: center;
	gap: .5rem;
	padding: .5rem 0;
	font-size: .875rem;
	font-weight: 600;
	cursor: pointer;
	list-style: none;
}
.ff-sub summary::-webkit-details-marker {
	display: none;
}
.ff-sub summary::after {
	content: "\f078"; /* chevron-down de Font Awesome */
	font-family: "Font Awesome 6 Free";
	font-weight: 900;
	font-size: .7rem;
	margin-left: auto;
	color: var(--ff-muted);
	transition: transform .15s;
}
.ff-sub[open] summary::after {
	transform: rotate(180deg);
}
.ff-sub .ff-chips {
	padding-bottom: .625rem;
}
.ff-foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: .75rem;
}
.ff-reset {
	color: var(--ff-muted);
	font-size: .875rem;
	font-weight: 600;
	text-decoration: underline;
}
.ff-reset:hover {
	color: var(--ff-red);
}
.ff.is-loading .ff-body {
	opacity: .5;
	pointer-events: none;
}
.ff-backdrop {
	display: none;
}

/* Escritorio: tarjeta fija al hacer scroll; filtra al marcar (sin botón) */
@media (min-width: 768px) {
	.ff {
		position: sticky;
		top: 1rem;
		max-height: calc(100vh - 2rem);
		overflow-y: auto;
		padding: 1rem;
		border: 1px solid var(--ff-line);
		border-radius: var(--bs-border-radius-lg);
	}
	.ff-apply {
		display: none;
	}
	.ff-foot:not(:has(.ff-reset)) {
		display: none;
	}
	.ff-foot {
		padding-top: .75rem;
		border-top: 1px solid var(--ff-line);
	}
}

/* Móvil: hoja desde abajo */
@media (max-width: 767.98px) {
	.ff-col {
		margin: 0 !important;
		padding: 0;
		height: 0;
	}
	.ff-backdrop {
		position: fixed;
		inset: 0;
		z-index: 1055;
		background: rgba(0, 0, 0, .45);
		opacity: 0;
		visibility: hidden;
		transition: opacity .2s, visibility .2s;
	}
	.ff-opened .ff-backdrop {
		display: block;
		opacity: 1;
		visibility: visible;
	}
	.ff {
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 1056;
		display: flex;
		flex-direction: column;
		max-height: 88vh;
		max-height: 88dvh;
		border-radius: var(--bs-border-radius-lg) var(--bs-border-radius-lg) 0 0;
		box-shadow: 0 -8px 30px rgba(0, 0, 0, .18);
		transform: translateY(105%);
		visibility: hidden;
		transition: transform .25s ease, visibility .25s;
	}
	.ff-opened .ff {
		transform: none;
		visibility: visible;
	}
	.ff-head {
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: .75rem 1rem;
		border-bottom: 1px solid var(--ff-line);
	}
	.ff-title {
		font-weight: 800;
		text-transform: uppercase;
	}
	.ff-x {
		width: 40px;
		height: 40px;
		margin-right: -.5rem;
		border: 0;
		background: none;
		font-size: 1.25rem;
		color: var(--ff-text);
	}
	.ff-body {
		flex: 1;
		overflow-y: auto;
		padding: 1rem;
		overscroll-behavior: contain;
	}
	.ff-group-search {
		display: none; /* el buscador está encima, en la barra */
	}
	.ff-group-search + .ff-group {
		padding-top: 0;
		border-top: 0;
	}
	.ff-chip span {
		min-height: 40px;
	}
	.ff-foot {
		padding: .75rem 1rem calc(.75rem + env(safe-area-inset-bottom));
		border-top: 1px solid var(--ff-line);
	}
	.ff-apply {
		flex: 1;
		max-width: 60%;
		height: 46px;
		margin-left: auto;
	}
	html.ff-lock,
	html.ff-lock body {
		overflow: hidden;
	}
}
