.tpf { --tpf-accent: #0050a5; --tpf-border: #c8c8c8; font-size: 15px; color: #444; }
.tpf.is-loading .tpf__form { opacity: .5; pointer-events: none; }
.tpf__open, .tpf__head, .tpf__footer { display: none; }

.tpf__group { margin: 0 0 22px; padding: 0; border: 0; min-width: 0; }
.tpf__title { display: block; margin: 0 0 8px; padding: 0; color: #333; font-size: 15px; font-weight: 600; line-height: 22px; }
.tpf__select {
	width: 100%;
	height: 45px;
	padding: 0 36px 0 12px;
	border: 1px solid var(--tpf-border);
	border-radius: 4px;
	background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m7 10 5 5 5-5' fill='none' stroke='%23555' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 10px center / 18px;
	color: #444;
	font: inherit;
	-webkit-appearance: none;
	appearance: none;
	cursor: pointer;
}
.tpf__select:focus, .tpf__find:focus { outline: 2px solid var(--tpf-accent); outline-offset: 0; border-color: var(--tpf-accent); }
.tpf__find { width: 100%; height: 38px; margin: 0 0 8px; padding: 0 10px; border: 1px solid var(--tpf-border); border-radius: 4px; font: inherit; font-size: 14px; }
.tpf__list { list-style: none; margin: 0; padding: 0; }
.tpf__option { display: flex; align-items: center; gap: 10px; padding: 5px 0; cursor: pointer; line-height: 20px; }
.tpf__option input { width: 18px; height: 18px; margin: 0; accent-color: var(--tpf-accent); flex: 0 0 auto; cursor: pointer; }
.tpf__name { flex: 1 1 auto; min-width: 0; }
.tpf__option:hover .tpf__name { color: var(--tpf-accent); }
.tpf__count { flex: 0 0 auto; min-width: 28px; padding: 0 6px; border-radius: 10px; background: #f0f2f5; color: #6b6b7a; font-size: 12px; line-height: 20px; text-align: center; }
.tpf__option input:checked ~ .tpf__name { color: #0050a5; font-weight: 600; }
.tpf__more { margin-top: 6px; padding: 0; border: 0; background: none; color: var(--tpf-accent); font: inherit; font-size: 14px; cursor: pointer; }
.tpf__more:hover { text-decoration: underline; }

/* Accordion groups */
.tpf__acc { margin-bottom: 0; border-top: 1px solid #e6e8ee; }
.tpf__acc:last-of-type { border-bottom: 1px solid #e6e8ee; }
.tpf__summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0; padding: 14px 2px; list-style: none; cursor: pointer; user-select: none; }
.tpf__summary::-webkit-details-marker { display: none; }
.tpf__summary:hover { color: var(--tpf-accent); }
.tpf__summary:focus-visible { outline: 2px solid var(--tpf-accent); outline-offset: 2px; }
.tpf__chev { flex: 0 0 auto; color: #7a7f8f; transition: transform .2s; }
.tpf__acc[open] .tpf__chev { transform: rotate(180deg); }
.tpf__acc-body { padding: 0 2px 16px; }
.tpf__badge--sm { display: inline-block; min-width: 18px; height: 18px; margin-left: 6px; padding: 0 5px; border-radius: 9px; background: var(--tpf-accent); color: #fff; font-size: 11px; line-height: 18px; text-align: center; vertical-align: 2px; }

/* Desktop: the filter column follows the visitor while scrolling the products. */
/* The sticky element is the Elementor widget holding [tp_filtros]: its parent column is as tall as
   the product list, so the filters stay visible all the way down. */
@media (min-width: 1024px) {
	.elementor-widget:has(> .elementor-widget-container [data-tpf]),
	.elementor-widget:has(> [data-tpf]) {
		position: sticky;
		top: calc(var(--tup-header-h, 75px) + 20px);
		align-self: flex-start;
		max-height: calc(100vh - var(--tup-header-h, 75px) - 40px);
		overflow-y: auto;
		overscroll-behavior: contain;
		width: 100%;
		padding-right: 8px;
		scrollbar-width: thin;
		scrollbar-color: #c9cfdb transparent;
	}
	.admin-bar .elementor-widget:has(> .elementor-widget-container [data-tpf]) { top: calc(var(--tup-header-h, 75px) + 52px); }
	/* Compact filter column so the products sit close to the filters. */
	.e-con:has(> .elementor-widget > .elementor-widget-container [data-tpf]) { flex: 0 0 250px; width: 250px; max-width: 250px; }
}

.tpf__active { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 22px; }
.tpf__chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: #e8f3fe; color: #0050a5; font-size: 13px; line-height: 20px; text-decoration: none; }
.tpf__chip span { font-size: 16px; line-height: 1; }
.tpf__chip:hover { background: #d3e8fd; color: #003f82; }
.tpf__clear { align-self: center; margin-left: 4px; color: #b32d2e; font-size: 13px; text-decoration: underline; }

@media (max-width: 1023px) {
	/* Floating "Filtrar" button, bottom-left (WhatsApp is bottom-right). */
	.tpf__open {
		position: fixed; left: 16px; bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 950;
		display: inline-flex; align-items: center; gap: 8px;
		height: 48px; padding: 0 20px;
		border: 2px solid #fff; border-radius: 999px; background: var(--tpf-accent);
		color: #fff; font: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
		box-shadow: 0 6px 18px rgba(0, 40, 90, .28);
		transition: transform .15s ease, box-shadow .15s ease;
	}
	.tpf__open:active { transform: scale(.96); }
	.tpf__badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: #fff; color: var(--tpf-accent); font-size: 12px; font-weight: 700; line-height: 20px; text-align: center; }
	/* Side drawer up to 320px; the dimmed rest of the screen closes it on click. */
	.tpf__backdrop { position: fixed; inset: 0; z-index: 99999; background: rgba(1, 7, 39, .45); opacity: 0; visibility: hidden; cursor: pointer; transition: opacity .3s ease, visibility 0s .3s; }
	body.tpf-open .tpf__backdrop { opacity: 1; visibility: visible; transition: opacity .3s ease, visibility 0s; }
	.tpf__panel {
		position: fixed; top: 0; bottom: 0; left: 0; z-index: 100000;
		width: min(320px, calc(100vw - 48px));
		box-shadow: 6px 0 24px rgba(1, 7, 39, .15);
		display: flex; flex-direction: column;
		background: #fff;
		transform: translateX(-100%);
		visibility: hidden;
		transition: transform .26s cubic-bezier(.4, 0, 1, 1), visibility 0s .26s;
	}
	.tpf__panel.is-open { transform: none; visibility: visible; transition: transform .32s cubic-bezier(.22, .8, .24, 1), visibility 0s; }
	.tpf__head { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; border-bottom: 1px solid #e6e6ea; font-size: 17px; color: #222; }
	.tpf__close { width: 40px; height: 40px; border: 0; background: none; font-size: 30px; line-height: 1; color: #333; cursor: pointer; }
	.tpf__form { flex: 1; display: flex; flex-direction: column; min-height: 0; }
	.tpf__form > :not(.tpf__footer) { margin-left: 16px; margin-right: 16px; }
	.tpf__form > :first-child { margin-top: 18px; }
	.tpf__form { overflow-y: auto; }
	.tpf__footer { display: block; position: sticky; bottom: 0; margin-top: auto; padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); background: #fff; box-shadow: 0 -4px 12px rgba(0, 0, 0, .06); }
	.tpf__apply { width: 100%; height: 48px; border: 0; border-radius: 4px; background: var(--tpf-accent); color: #fff; font: inherit; font-weight: 500; cursor: pointer; }
}
/* Up to 1023px the theme shows its bottom bar (64px), so the button floats just above it. */
@media (max-width: 1023px) {
	.tpf__open { bottom: calc(64px + 14px + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) { .tpf__panel, .tpf__panel.is-open, .tpf__backdrop { transition: none; } }
body.tpf-open { overflow: hidden; }
/* The filters already offer "Ordenar por": hide WooCommerce's duplicate sorting dropdown. */
.elementor-widget-wc-archive-products .woocommerce-ordering { display: none; }
body.tpf-open #ht-ctc-chat { display: none !important; }

/* Price filter */
.tpf__ranges { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; padding: 0; list-style: none; }
.tpf__range { display: inline-block; padding: 6px 11px; border: 1px solid #dfe5ee; border-radius: 999px; color: #13284f; font-size: 13px; text-decoration: none; transition: border-color .15s, color .15s, background-color .15s; }
.tpf__range:hover { border-color: var(--tpf-accent); color: var(--tpf-accent); }
.tpf__range.is-on { border-color: var(--tpf-accent); background: var(--tpf-accent); color: #fff; }
.tpf__price { display: grid; grid-template-columns: 1fr 1fr 40px; gap: 8px; align-items: end; }
.tpf__price label { display: flex; flex-direction: column; gap: 4px; color: #7a8293; font-size: 12px; }
.tpf__price input { width: 100%; min-width: 0; height: 40px; padding: 0 10px; border: 1px solid #c8c8c8; border-radius: 6px; font: inherit; font-size: 14px; -moz-appearance: textfield; }
.tpf__price input::-webkit-outer-spin-button, .tpf__price input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.tpf__price input:focus { border-color: var(--tpf-accent); outline: 2px solid rgba(0, 80, 165, .15); }
.tpf__price-go { height: 40px; border: 0; border-radius: 6px; background: var(--tpf-accent); color: #fff; font-size: 18px; cursor: pointer; }

/* Categories: main category + its subcategories (▸), and the links of a subcategory page. */
.tpf__row { display: flex; align-items: center; gap: 4px; }
.tpf__row .tpf__option { flex: 1 1 auto; min-width: 0; }
.tpf__toggle { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: #6b6b7a; cursor: pointer; }
.tpf__toggle:hover { background: #f0f2f5; color: var(--tpf-accent); }
.tpf__toggle svg { transition: transform .15s ease; }
.tpf__toggle[aria-expanded="true"] svg { transform: rotate(90deg); }
.tpf__sub { list-style: none; margin: 0 0 4px 28px; padding: 0 0 0 10px; border-left: 2px solid #eef1f5; }
.tpf__sub .tpf__option { padding: 3px 0; font-size: 14px; }
.tpf__links li { margin: 0; }
.tpf__link { display: flex; align-items: center; gap: 10px; padding: 5px 0; color: inherit; line-height: 20px; text-decoration: none; }
.tpf__link:hover { color: var(--tpf-accent); }
.tpf__link--all { font-weight: 600; }
.tpf__link.is-current { color: #0050a5; font-weight: 600; }

/* Color filter: a swatch of each color (same palette as the ficha técnica). */
.tpf__swatch { flex: 0 0 auto; width: 16px; height: 16px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .18); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35); }
.tpf__swatch--clear { background-image: linear-gradient(135deg, transparent 45%, rgba(0, 0, 0, .25) 46%, rgba(0, 0, 0, .25) 54%, transparent 55%) !important; }
