/* ============================================================
   Barra de filtros de los listados (módulo filtros.php) · v1.2
   v1.2: fija sólo con filtros aplicados (.is-filtrado); al quedar fija se oscurece
   de a poco (--ap-fl-a, lo pone filtros.js) hasta el color del header.
   v1.1.3: la barra sigue al header (--ap-hdr-vis): sube cuando el header se oculta.
   v1.1.2: el texto de los campos de precio queda blanco fijo (la regla :focus
   de Blocksy lo pasaba a #404040 sobre el fondo oscuro), también con autocompletar.
   v1.1.1: 20px entre el banner y la barra, 36px entre la barra y las tarjetas.
   v1.1: 4 o 3 productos por fila.
   v1.0.1: la barra queda fija debajo del header en todo el listado.
   Barra clara y fija bajo el header; panel oscuro como el header.
============================================================= */

body.ap-filtros .woo-listing-top{ display:none; }

.ap-fl, .ap-fl-drawer, .ap-fl-scrim, .ap-fl-empty{
  --ap-ink:#161a1f; --ap-text:#3d4148; --ap-muted:#72767d; --ap-line:#e2dfd8;
  --ap-cu:#d9a079; --ap-cu2:#C38356; --ap-ease:cubic-bezier(.16,1,.3,1);
}
/* display:contents: la barra queda fija respecto de todo el listado y no sólo de
   su propio contenedor, que es bajito (v1.0.1). */
.ap-fl{ display:contents; color:var(--ap-text); font-size:15px; }
.ap-fl-tb{ margin-bottom:36px; }
.ap-fl-tb:has(+ .ap-fl-active){ margin-bottom:0; }
.ap-fl-active{ margin-bottom:36px; }
/* Menos aire entre el banner y la barra (el tema deja 65px arriba del listado). v1.1.1 */
body.ap-filtros .ct-container:has(.ap-fl-tb){ padding-top:20px; }
/* El panel va al <body> (filtros.js): toma la tipografía del sitio y no la de formularios o títulos del tema. */
.ap-fl-drawer, .ap-fl-drawer *{ font-family:var(--theme-font-family, inherit); }
.ap-fl-drawer{ font-size:15px; line-height:1.4; letter-spacing:normal; text-transform:none; }
.ap-fl-drawer a{ text-decoration:none; }
.ap-fl-drawer :focus-visible{ outline:2px solid var(--ap-cu); outline-offset:2px; }
.ap-fl a{ text-decoration:none; }
.ap-fl :focus-visible{ outline:2px solid var(--ap-cu2); outline-offset:2px; }

/* ---------- Barra ---------- */
.ap-fl-tb{
  --ap-fl-a:0;
  position:relative; z-index:20;
  transition:top .75s cubic-bezier(.22,1,.36,1);
  margin-left:calc(-1 * var(--ap-fl-bleed,0px)); margin-right:calc(-1 * var(--ap-fl-bleed,0px)); /* sin pisar el margen inferior (v1.1.1) */
  padding:0 var(--ap-fl-bleed,0px);
  background:linear-gradient(rgba(22,26,31,var(--ap-fl-a)), rgba(22,26,31,var(--ap-fl-a))), rgba(255,255,255,.94);
  -webkit-backdrop-filter:blur(12px); backdrop-filter:blur(12px);
  border-bottom:1px solid rgba(226,223,216,calc(1 - var(--ap-fl-a)));
}
.ap-fl-tb.is-filtrado{ position:sticky; top:var(--ap-hdr-vis, var(--ap-fl-top,0px)); }
.ap-fl-marca{ display:block; height:0; margin:0; }
.ap-fl-tb-in{ display:flex; align-items:center; gap:14px; min-height:62px; }
.ap-fl-open{
  display:inline-flex; align-items:center; gap:10px; flex:none; height:40px; padding:0 4px;
  border:0; background:none; font:inherit; font-size:15.5px; font-weight:500; color:var(--ap-ink); cursor:pointer;
}
.ap-fl-open svg{ width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:1.5; stroke-linecap:round; }
.ap-fl-badge{
  display:inline-grid; place-items:center; min-width:22px; height:22px; padding:0 6px; border-radius:999px;
  background:var(--ap-ink); color:#fff; font-size:12px; font-weight:600;
}
.ap-fl-sep{ flex:none; width:1px; height:24px; background:var(--ap-line); }
.ap-fl-quick{ display:flex; gap:8px; flex:1; min-width:0; overflow-x:auto; scrollbar-width:none; padding:2px 0; }
.ap-fl-quick::-webkit-scrollbar{ display:none; }
.ap-fl-qk{
  display:inline-flex; align-items:center; gap:7px; flex:none; height:34px; padding:0 14px;
  border:1px solid var(--ap-line); border-radius:999px; background:#fff;
  font-size:13.5px; font-weight:500; color:var(--ap-ink); white-space:nowrap;
  transition:background .2s, border-color .2s, color .2s;
}
a.ap-fl-qk:hover{ border-color:var(--ap-ink); color:var(--ap-ink); }
.ap-fl-qk em{ font-style:normal; font-size:12px; font-weight:400; color:var(--ap-muted); }
.ap-fl-qk[aria-pressed="true"]{ background:var(--ap-ink); border-color:var(--ap-ink); color:#fff; }
.ap-fl-qk[aria-pressed="true"]:hover{ color:#fff; }
.ap-fl-qk[aria-pressed="true"] em{ color:rgba(255,255,255,.6); }
.ap-fl-qk[aria-pressed="true"]::before{ content:""; width:6px; height:6px; border-radius:50%; background:var(--ap-cu); }
.ap-fl-qk.is-off{ opacity:.4; }
.ap-fl-right{ display:flex; align-items:center; gap:18px; margin-left:auto; flex:none; white-space:nowrap; }
.ap-fl-count{ font-size:14px; color:var(--ap-muted); }

.ap-fl-sort{ position:relative; }
.ap-fl-sort-btn{
  display:inline-flex; align-items:center; gap:8px; height:40px; padding:0 4px;
  border:0; background:none; font:inherit; font-size:15px; color:var(--ap-ink); cursor:pointer;
}
.ap-fl-sort-btn span{ color:var(--ap-muted); }
.ap-fl-sort-btn b{ font-weight:600; }
.ap-fl-sort-btn svg{ width:12px; height:12px; fill:none; stroke:currentColor; stroke-width:1.8; transition:transform .3s var(--ap-ease); }
.ap-fl-sort.is-open .ap-fl-sort-btn svg{ transform:rotate(180deg); }
.ap-fl-sort-menu{
  position:absolute; right:0; top:calc(100% + 8px); z-index:5; min-width:240px; margin:0; padding:8px; list-style:none;
  background:#161a1f; border:1px solid rgba(255,255,255,.08); border-radius:12px;
  box-shadow:0 24px 48px -20px rgba(0,0,0,.55);
  opacity:0; visibility:hidden; transform:translateY(-6px);
  transition:opacity .25s, transform .35s var(--ap-ease), visibility 0s .35s;
}
.ap-fl-sort.is-open .ap-fl-sort-menu{ opacity:1; visibility:visible; transform:none; transition-delay:0s; }
.ap-fl-sort-menu li{ margin:0; padding:0; }
.ap-fl-sort-menu a{
  display:flex; justify-content:space-between; align-items:center; padding:10px 12px; border-radius:8px;
  color:rgba(237,237,235,.78); font-size:14.5px;
}
.ap-fl-sort-menu a:hover{ background:rgba(255,255,255,.07); color:#fff; }
.ap-fl-sort-menu a[aria-checked="true"]{ font-weight:600; color:#fff; }
.ap-fl-sort-menu a[aria-checked="true"]::after{ content:""; width:6px; height:6px; border-radius:50%; background:var(--ap-cu2); }

/* ---------- Productos por fila (v1.1) ---------- */
.ap-fl-view{ display:flex; gap:4px; }
.ap-fl-view button{
  display:grid; place-items:center; width:36px; height:36px; padding:0;
  border:1px solid transparent; border-radius:8px; background:none; color:var(--ap-muted); cursor:pointer;
}
.ap-fl-view button:hover{ color:var(--ap-ink); }
.ap-fl-view button[aria-pressed="true"]{ border-color:var(--ap-line); background:#f4f3ef; color:var(--ap-ink); }
.ap-fl-view svg{ width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:1.5; }
@media (min-width:1000px){
  body.ap-fl-cols-3 ul.products[data-products]{ --shop-columns:repeat(3, minmax(0, 1fr)); }
}

/* ---------- Filtros aplicados ---------- */
.ap-fl-active{ display:flex; flex-wrap:wrap; align-items:center; gap:6px; padding:14px 0 0; }
.ap-fl-chip{
  display:inline-flex; align-items:center; gap:6px; height:30px; padding:0 6px 0 12px;
  border:1px solid var(--ap-line); border-radius:999px; background:#f6f5f2; font-size:13px; color:var(--ap-ink);
}
.ap-fl-chip:hover{ border-color:var(--ap-ink); color:var(--ap-ink); }
.ap-fl-chip i{ display:grid; place-items:center; width:18px; height:18px; font-style:normal; font-size:13px; color:var(--ap-muted); }
.ap-fl-chip.ap-fl-clear{ background:none; border-color:transparent; padding:0 6px; text-decoration:underline; text-underline-offset:3px; }

/* ---------- Listado mientras carga ---------- */
.ap-fl-busy ul.products, .ap-fl-busy .ct-pagination, .ap-fl-busy .woocommerce-pagination{ opacity:.35; transition:opacity .2s; pointer-events:none; }

.ap-fl-empty{ padding:60px 0; text-align:center; color:var(--ap-muted); }
.ap-fl-empty p{ margin:0 0 16px; }

/* ---------- Panel ---------- */
.ap-fl-scrim{ position:fixed; inset:0; z-index:99990; background:rgba(10,12,15,.5); opacity:0; pointer-events:none; transition:opacity .35s; }
.ap-fl-drawer{
  --d-text:rgba(237,237,235,.78); --d-line:rgba(255,255,255,.1);
  position:fixed; z-index:99991; top:var(--wp-admin--admin-bar--height, 0px); bottom:0; left:0; width:min(420px,100%); margin:0;
  display:flex; flex-direction:column; background:#161a1f; color:var(--d-text);
  transform:translateX(-102%); visibility:hidden;
  transition:transform .5s var(--ap-ease), visibility 0s .5s;
}
body.ap-fl-is-open .ap-fl-scrim{ opacity:1; pointer-events:auto; }
body.ap-fl-is-open .ap-fl-drawer{ transform:none; visibility:visible; transition-delay:0s; }
body.ap-fl-is-open{ overflow:hidden; }
body.ap-fl-instant .ap-fl-drawer, body.ap-fl-instant .ap-fl-scrim{ transition:none; }

.ap-fl-head{ display:flex; align-items:center; justify-content:space-between; padding:22px 26px; border-bottom:1px solid var(--d-line); }
.ap-fl-head h2{ margin:0; font-size:22px; font-weight:600; letter-spacing:-.02em; color:#fff; }
.ap-fl-x{ display:grid; place-items:center; width:40px; height:40px; padding:0; border:0; border-radius:50%; background:none; cursor:pointer; }
.ap-fl-x:hover{ background:rgba(255,255,255,.08); }
.ap-fl-x svg{ width:18px; height:18px; stroke:#fff; stroke-width:1.6; fill:none; }
.ap-fl-body{ flex:1; overflow:auto; overscroll-behavior:contain; padding:4px 26px; }

.ap-fl-grp{ border-bottom:1px solid var(--d-line); }
.ap-fl-grp summary{
  display:flex; align-items:center; padding:18px 0; list-style:none; cursor:pointer;
  font-size:16px; font-weight:600; color:#fff;
}
.ap-fl-grp summary::-webkit-details-marker{ display:none; }
.ap-fl-grp summary small{ margin-left:10px; padding:1px 8px; border-radius:999px; background:var(--ap-cu); color:#161a1f; font-size:12px; font-weight:500; }
.ap-fl-grp summary small:empty{ display:none; }
.ap-fl-grp summary::after{
  content:""; margin-left:auto; width:9px; height:9px;
  border-right:1.6px solid currentColor; border-bottom:1.6px solid currentColor;
  transform:rotate(45deg) translateY(-3px); transition:transform .3s var(--ap-ease);
}
.ap-fl-grp[open] summary::after{ transform:rotate(225deg) translateY(-3px); }
.ap-fl-hint{ margin:-8px 0 12px; font-size:12.5px; color:rgba(237,237,235,.5); }
.ap-fl-range + .ap-fl-hint{ margin:0 0 20px; }

.ap-fl-opts{ display:grid; gap:2px; padding:0 0 18px; }
.ap-fl-opt{ display:flex; align-items:center; gap:12px; margin:0; padding:8px 0; font-size:15px; font-weight:400; color:var(--d-text); cursor:pointer; }
.ap-fl-opt:hover{ color:#fff; }
.ap-fl-opt input{
  flex:none; -webkit-appearance:none; appearance:none; display:grid; place-items:center;
  width:18px; height:18px; margin:0; border:1.5px solid rgba(255,255,255,.35); border-radius:4px; background:none; cursor:pointer;
}
.ap-fl-opt input:checked{ background:var(--ap-cu); border-color:var(--ap-cu); }
.ap-fl-opt input:checked::after{ content:""; width:5px; height:9px; border:solid #161a1f; border-width:0 2px 2px 0; transform:rotate(45deg) translate(-1px,-1px); }
.ap-fl-opt em{ margin-left:auto; font-style:normal; font-size:13px; color:rgba(237,237,235,.5); }
.ap-fl-opt.is-zero{ opacity:.35; cursor:default; }
.ap-fl-opt.is-zero:hover{ color:var(--d-text); }
.ap-fl-opt.is-zero input{ cursor:default; }

.ap-fl-pills{ display:flex; flex-wrap:wrap; gap:6px; padding:0 0 14px; }
.ap-fl-pill{
  display:inline-flex; align-items:center; height:32px; padding:0 12px;
  border:1px solid rgba(255,255,255,.2); border-radius:999px; color:var(--d-text); font-size:13px;
}
.ap-fl-pill:hover{ color:#fff; border-color:rgba(255,255,255,.45); }
.ap-fl-pill[aria-pressed="true"]{ background:var(--ap-cu); border-color:var(--ap-cu); color:#161a1f; font-weight:600; }
.ap-fl-range{ display:grid; grid-template-columns:1fr auto 1fr; align-items:end; gap:10px; padding:2px 0 10px; }
.ap-fl-range span{ padding-bottom:12px; }
.ap-fl-range label{ display:block; margin-bottom:5px; font-size:12px; color:rgba(237,237,235,.6); }
.ap-fl-range input{
  width:100%; height:44px; margin:0; padding:0 12px; border:1px solid rgba(255,255,255,.18); border-radius:10px;
  background:rgba(255,255,255,.04); color:#fff; font:inherit; font-size:15px; box-shadow:none;
}
.ap-fl-range input:focus{ outline:0; border-color:var(--ap-cu); }
.ap-fl-range input::placeholder{ color:rgba(237,237,235,.4); }
/* Blocksy pinta los campos con foco con input:is([type=…]):focus (más específico que
   .ap-fl-range input): el selector con la raíz del panel lo supera siempre. v1.1.2 */
.ap-fl-drawer .ap-fl-range input,
.ap-fl-drawer .ap-fl-range input:focus{
  color:#fff; -webkit-text-fill-color:#fff; caret-color:#fff;
  background-color:rgba(255,255,255,.04); transition:border-color .2s;
}
.ap-fl-drawer .ap-fl-range input:focus{ border-color:var(--ap-cu); outline:0; }
.ap-fl-drawer .ap-fl-range input:-webkit-autofill,
.ap-fl-drawer .ap-fl-range input:-webkit-autofill:focus{
  -webkit-text-fill-color:#fff; box-shadow:0 0 0 40px #22262b inset; transition:background-color 9999s;
}

.ap-fl-switch{
  display:flex; align-items:center; justify-content:space-between; margin:0; padding:18px 0;
  border-bottom:1px solid var(--d-line); font-size:16px; font-weight:600; color:#fff; cursor:pointer;
}
.ap-fl-switch input{
  -webkit-appearance:none; appearance:none; position:relative; width:44px; height:26px; margin:0;
  border:0; border-radius:999px; background:rgba(255,255,255,.18); cursor:pointer; transition:background .25s;
}
.ap-fl-switch input::after{ content:""; position:absolute; top:3px; left:3px; width:20px; height:20px; border-radius:50%; background:#fff; transition:transform .3s var(--ap-ease); }
.ap-fl-switch input:checked{ background:var(--ap-cu); }
.ap-fl-switch input:checked::after{ transform:translateX(18px); }

.ap-fl-foot{ display:grid; grid-template-columns:auto 1fr; gap:10px; padding:18px 26px; border-top:1px solid var(--d-line); }
.ap-fl-btn{
  display:inline-flex; align-items:center; justify-content:center; height:52px; padding:0 22px; margin:0;
  border:1px solid #ededeb; border-radius:999px; background:#ededeb; color:#161a1f;
  font:inherit; font-size:15.5px; font-weight:600; cursor:pointer; transition:background .25s;
}
.ap-fl-btn:hover{ background:#fff; color:#161a1f; }
.ap-fl-btn--ghost{ background:transparent; color:#fff; border-color:rgba(255,255,255,.25); }
.ap-fl-btn--ghost:hover{ background:rgba(255,255,255,.06); color:#fff; }
.ap-fl-btn--dark{ height:42px; background:#161a1f; border-color:#161a1f; color:#fff; font-size:14px; }
.ap-fl-btn--dark:hover{ background:#2a2f36; color:#fff; }

/* ---------- Tablet y celular ---------- */
@media (max-width:999px){
  .ap-fl-count, .ap-fl-view{ display:none; }
}
@media (max-width:689px){
  .ap-fl-tb, .ap-fl-active{ margin-bottom:24px; }
  .ap-fl-tb:has(+ .ap-fl-active){ margin-bottom:0; }
  .ap-fl-tb-in{ flex-wrap:wrap; gap:0 12px; min-height:0; padding-top:6px; }
  .ap-fl-sep{ display:none; }
  .ap-fl-right{ order:2; }
  .ap-fl-sort-btn span{ display:none; }
  .ap-fl-quick{ order:3; flex-basis:100%; margin:0 -16px; padding:4px 16px 10px; }
}
@media (prefers-reduced-motion:reduce){
  .ap-fl *, .ap-fl-drawer, .ap-fl-scrim{ transition:none !important; }
}

/* ---------- v1.2 · Barra fija oscura (con filtros aplicados, al bajar) ---------- */
.ap-fl-tb :is(.ap-fl-open, .ap-fl-badge, .ap-fl-sep, .ap-fl-qk, .ap-fl-qk em, .ap-fl-count, .ap-fl-sort-btn, .ap-fl-sort-btn span, .ap-fl-view button){
  transition:color .3s, background-color .3s, border-color .3s;
}
.ap-fl-tb.is-oscura .ap-fl-open, .ap-fl-tb.is-oscura .ap-fl-sort-btn{ color:#EDEDEB; }
.ap-fl-tb.is-oscura .ap-fl-badge{ background:#EDEDEB; color:#161a1f; }
.ap-fl-tb.is-oscura .ap-fl-sep{ background:rgba(255,255,255,.16); }
.ap-fl-tb.is-oscura .ap-fl-qk{ background:transparent; border-color:rgba(255,255,255,.2); color:#EDEDEB; }
.ap-fl-tb.is-oscura a.ap-fl-qk:hover{ border-color:#EDEDEB; color:#fff; }
.ap-fl-tb.is-oscura .ap-fl-qk em, .ap-fl-tb.is-oscura .ap-fl-count, .ap-fl-tb.is-oscura .ap-fl-sort-btn span{ color:rgba(237,237,235,.56); }
.ap-fl-tb.is-oscura .ap-fl-qk[aria-pressed="true"]{ background:#EDEDEB; border-color:#EDEDEB; color:#161a1f; }
.ap-fl-tb.is-oscura .ap-fl-qk[aria-pressed="true"] em{ color:rgba(22,26,31,.55); }
.ap-fl-tb.is-oscura .ap-fl-view button{ color:rgba(237,237,235,.56); }
.ap-fl-tb.is-oscura .ap-fl-view button:hover{ color:#fff; }
.ap-fl-tb.is-oscura .ap-fl-view button[aria-pressed="true"]{ border-color:transparent; background:rgba(255,255,255,.1); color:#fff; }
