/* Poder Filtros — estilos. Toma tipografía y color primario del tema (variables de Woodmart) con fallbacks. */
.pf, .pf-tiles-slot {
	--pf-text: #1a1a1a;
	--pf-soft: #6b6b70;
	--pf-border: #e6e6e9;
	--pf-bg: #ffffff;
	--pf-bg-soft: #f6f6f8;
	--pf-dark: #000000;
	--pf-primary: var(--wd-primary-color, #1e73be);
	--pf-title-font: var(--wd-title-font, inherit);
	--pf-radius: 10px;
	font-size: 14px;
	color: var(--pf-text);
}

/* ---------- Mosaicos de categorías ---------- */
.pf-tiles-slot { max-width: 1400px; margin: 4px auto 26px; padding: 0 15px; }
.pf-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 12px; }
.pf-tile {
	display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
	min-height: 96px; padding: 16px 14px; text-align: center; text-decoration: none !important;
	background: var(--pf-bg); border: 1.5px solid var(--pf-border); border-radius: var(--pf-radius);
	color: var(--pf-text) !important; font-family: var(--pf-title-font); font-weight: 500; font-size: 14px; line-height: 1.25;
	box-shadow: 0 1px 2px rgba(0,0,0,.04); transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease, background .15s ease;
	position: relative;
}
.pf-tile:hover { border-color: var(--pf-primary); color: var(--pf-primary) !important; transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,.07); }
.pf-tile.is-current { background: var(--pf-dark); border-color: var(--pf-dark); color: #fff !important; }
.pf-tile-icon { display: flex; align-items: center; justify-content: center; width: 52px; height: 52px; }
.pf-tile-icon img { max-width: 52px; max-height: 52px; width: auto; height: auto; object-fit: contain; }
.pf-tile.is-current .pf-tile-icon img { filter: brightness(0) invert(1); }
.pf-tile--back { background: var(--pf-bg-soft); border-style: dashed; color: var(--pf-soft) !important; font-weight: 500; }
.pf-tile--back:hover { color: var(--pf-text) !important; border-color: var(--pf-text); }
.pf-tile--back .pf-tile-icon { width: auto; height: auto; }

/* ---------- Panel lateral ---------- */
.pf-panel { background: var(--pf-bg); border: 1px solid var(--pf-border); border-radius: var(--pf-radius); padding: 18px 18px 20px; box-shadow: 0 1px 2px rgba(0,0,0,.04); transition: opacity .15s ease; }
.pf.is-loading .pf-panel { opacity: .55; pointer-events: none; }
.pf-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.pf-title { font-family: var(--pf-title-font); font-size: 16px; font-weight: 600; letter-spacing: .01em; }
.pf-clear { font-size: 12px; font-weight: 600; color: var(--pf-soft) !important; text-decoration: none !important; white-space: nowrap; transition: color .15s; }
.pf-clear:hover { color: #d32f2f !important; }

.pf-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 4px; }
.pf-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; background: var(--pf-dark); color: #fff !important; font-size: 12px; font-weight: 600; text-decoration: none !important; transition: background .15s; }
.pf-chip span { font-size: 14px; line-height: 1; opacity: .7; }
.pf-chip:hover { background: #333; }

.pf-group { padding-top: 16px; margin-top: 16px; border-top: 1px solid var(--pf-border); }
.pf-group-title { margin: 0 0 10px; font-family: inherit; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--pf-text); }
.pf-options { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.pf-option label { display: flex; align-items: center; gap: 10px; margin: 0; padding: 6px 6px; border-radius: 6px; cursor: pointer; transition: background .12s; }
.pf-option label:hover { background: var(--pf-bg-soft); }
.pf-option input { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }
.pf-box { flex: 0 0 16px; width: 16px; height: 16px; border: 1.5px solid #bdbdc3; border-radius: 4px; background: #fff; position: relative; transition: background .12s, border-color .12s; }
.pf-option.is-on .pf-box { background: var(--pf-dark); border-color: var(--pf-dark); }
.pf-option.is-on .pf-box::after { content: ""; position: absolute; left: 4.5px; top: 1.5px; width: 4px; height: 8px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.pf-label { flex: 1 1 auto; font-size: 13.5px; color: var(--pf-text); }
.pf-option.is-on .pf-label { font-weight: 600; }
.pf-count { font-size: 11px; color: var(--pf-soft); background: var(--pf-bg-soft); border-radius: 999px; padding: 1px 7px; min-width: 22px; text-align: center; }
.pf-group--many .pf-option:nth-child(n+9) { display: none; }
.pf-group--many.is-open .pf-option:nth-child(n+9) { display: block; }
.pf-more { margin-top: 6px; background: none; border: 0; padding: 4px 6px; font-size: 12px; font-weight: 600; color: var(--pf-primary); cursor: pointer; }
.pf-none { margin: 12px 0 0; font-size: 13px; color: var(--pf-soft); }

/* atributo mostrado como desplegable (ej. Marca) */
.pf-select {
	width: 100%; height: 42px; padding: 0 14px; border: 1px solid var(--pf-border); border-radius: 8px;
	background: #fff; color: var(--pf-text); font-size: 13.5px; font-family: inherit; cursor: pointer;
	appearance: none; -webkit-appearance: none;
	background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='16' height='16'%3E%3Cpath fill='none' stroke='%236b6b70' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
	background-repeat: no-repeat; background-position: right 12px center;
}
.pf-select:focus { outline: none; border-color: var(--pf-dark); }

/* precio */
.pf-price-values { display: flex; justify-content: center; gap: 8px; font-family: var(--pf-title-font); font-weight: 600; font-size: 14px; color: var(--pf-primary); margin-bottom: 12px; }
.pf-price-values .woocommerce-Price-currencySymbol { font-size: .85em; }
.pf-price-sep { color: var(--pf-soft); font-weight: 400; }
.pf-range { position: relative; height: 24px; margin: 0 8px 12px; }
.pf-range-track { position: absolute; left: 0; right: 0; top: 10px; height: 4px; border-radius: 4px; background: #e2e2e6; }
.pf-range-fill { position: absolute; top: 0; bottom: 0; background: var(--pf-dark); border-radius: 4px; }
.pf-range input[type=range] { position: absolute; left: -8px; right: -8px; width: calc(100% + 16px); top: 0; margin: 0; height: 24px; background: transparent; -webkit-appearance: none; appearance: none; pointer-events: none; }
.pf-range input[type=range]::-webkit-slider-runnable-track { background: transparent; height: 24px; }
.pf-range input[type=range]::-moz-range-track { background: transparent; height: 24px; }
.pf-range input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; pointer-events: auto; width: 18px; height: 18px; margin-top: 3px; border-radius: 50%; background: #fff; border: 2px solid var(--pf-dark); box-shadow: 0 1px 4px rgba(0,0,0,.25); cursor: pointer; }
.pf-range input[type=range]::-moz-range-thumb { pointer-events: auto; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 2px solid var(--pf-dark); box-shadow: 0 1px 4px rgba(0,0,0,.25); cursor: pointer; }
.pf-price-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pf-price-inputs label { display: flex; flex-direction: column; gap: 4px; margin: 0; font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--pf-soft); }
.pf-price-inputs input { width: 100%; height: 38px; padding: 0 10px; border: 1px solid var(--pf-border); border-radius: 8px; font-size: 13px; text-align: center; color: var(--pf-text); background: #fff; }
.pf-price-inputs input:focus { outline: none; border-color: var(--pf-dark); }

/* grilla mientras carga */
.pf-grid-loading { opacity: .45; pointer-events: none; transition: opacity .15s; }

/* botón flotante y cierre: solo mobile (y nunca en modo "drawer del tema") */
.pf .pf-fab, .pf .pf-close, .pf .pf-backdrop,
html.pf-drawer-theme .pf .pf-fab, html.pf-drawer-theme .pf .pf-close, html.pf-drawer-theme .pf .pf-backdrop { display: none !important; }
@media (max-width: 1024px) {
	/* Modo tema: el panel queda estático dentro de la columna off-canvas del tema */
	html.pf-drawer-theme [data-pf-id="main"] .pf-panel { position: static !important; width: auto !important; transform: none !important; box-shadow: none !important; border: 0 !important; border-radius: 0 !important; padding: 4px 0 24px !important; }
}

/* ---------- Mobile: el panel se vuelve un cajón lateral propio ---------- */
@media (max-width: 1024px) {
	.pf .pf-fab {
		display: inline-flex !important; align-items: center; gap: 8px; position: fixed; left: 50%; bottom: 76px; transform: translateX(-50%); z-index: 990;
		padding: 12px 20px; border: 0; border-radius: 999px; background: var(--pf-dark); color: #fff; font-weight: 600; font-size: 14px;
		box-shadow: 0 8px 24px rgba(0,0,0,.25); cursor: pointer;
	}
	.pf-fab-count { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--pf-primary); font-size: 11px; }
	.pf .pf-backdrop { display: block !important; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 9998; opacity: 0; pointer-events: none; transition: opacity .2s; }
	.pf-backdrop:not([hidden]) { opacity: 1; pointer-events: auto; }
	[data-pf-id="main"] .pf-panel {
		position: fixed; top: 0; left: 0; bottom: 0; width: min(88vw, 360px); z-index: 9999; overflow-y: auto; -webkit-overflow-scrolling: touch;
		border: 0; border-radius: 0; box-shadow: 0 0 40px rgba(0,0,0,.25); padding: 18px 18px 90px;
		transform: translateX(-105%); transition: transform .25s ease;
	}
	body.pf-open [data-pf-id="main"] .pf-panel { transform: none; }
	body.pf-open { overflow: hidden; }
	.pf .pf-close { display: inline-flex !important; align-items: center; justify-content: center; width: 32px; height: 32px; border: 0; border-radius: 50%; background: var(--pf-bg-soft); color: var(--pf-text); font-size: 20px; line-height: 1; cursor: pointer; }
	.pf-head { align-items: center; }
	.pf-head .pf-clear { order: 3; width: 100%; margin-top: 4px; }
	.pf-head .pf-title { flex: 1; font-size: 18px; }
	.pf-tiles { display: flex; overflow-x: auto; gap: 10px; padding: 2px 2px 8px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
	.pf-tiles::-webkit-scrollbar { height: 0; }
	.pf-tile { flex: 0 0 auto; min-width: 140px; min-height: 72px; padding: 12px 14px; scroll-snap-align: start; }
	.pf-tile-icon { width: 36px; height: 36px; }
	.pf-tile-icon img { max-width: 36px; max-height: 36px; }
}

/* Woodmart muestra su propia barra de filtros activos; los chips del panel ya cumplen esa función */
body:has([data-pf]) .wd-active-filters { display: none !important; }
