/* ═══════════════════════════════════════
   FILTER MODAL
   ═══════════════════════════════════════ */

.modal-fs-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 1200;
  animation: backdropIn 0.2s ease;
}
@keyframes backdropIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal-fs {
  position: fixed;
  inset: 0 0 var(--tabbar-height, 64px) 0;
  background: var(--bg);
  z-index: 1201;
  display: flex;
  flex-direction: column;
  animation: modalIn 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes modalIn {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* ── Header ── */
.filt-head {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 8px 16px 12px;
  border-bottom: 1px solid var(--rule);
  flex-shrink: 0;
}
.filt-close {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  cursor: pointer;
}
.filt-close:hover { background: rgba(31, 58, 95, 0.06); }
.filt-head h1 {
  font-weight: 500;
  font-size: 18px;
  margin: 0;
  text-align: center;
  color: var(--primary);
}
.filt-reset-all {
  font-size: 13px;
  color: var(--primary);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 8px;
  cursor: pointer;
  white-space: nowrap;
}

/* ── Scrollable body ── */
.filt-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 4px 16px 100px;
}

/* ── Generic section ── */
.filt-section {
  padding: 20px 0;
  border-bottom: 1px solid var(--rule);
}
.filt-section:last-child { border-bottom: 0; }
.filt-section-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3, #8a9a7f);
  margin: 0 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ── Quick filter chips (PMR, budget, open, favorites) ── */
.filt-trans-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.filt-trans-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--surface);
  border-radius: 12px;
  border: 1px solid var(--rule);
  font-size: 13px;
  color: var(--primary);
  font-weight: 500;
  text-align: left;
  min-height: 44px;
  position: relative;
  cursor: pointer;
  width: 100%;
}
.filt-trans-chip.on,
.filt-trans-chip[aria-pressed="true"] {
  background: var(--primary);
  color: var(--surface);
  border-color: var(--primary);
}
.ft-emoji {
  width: 24px;
  text-align: center;
  font-size: 14px;
  flex-shrink: 0;
}
.ft-check {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
}

/* ── Category block ── */
.filt-cat-block {
  padding: 20px 0;
  border-bottom: 1px solid var(--rule);
}
.filt-cat-block:last-child { border-bottom: 0; }

.filt-cat-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.fch-l {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.fch-pill {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--surface);
}
.filt-cat-head h2 {
  font-weight: 600;
  font-size: 16px;
  margin: 0;
  color: var(--primary);
}
.fch-r { display: inline-flex; gap: 4px; }
.fch-mini {
  font-size: 11px;
  font-weight: 500;
  padding: 5px 8px;
  border-radius: 100px;
  color: var(--cc, var(--primary));
  background: var(--surface);
  border: 1px solid currentColor;
  cursor: pointer;
}
.fch-mini:disabled { opacity: 0.35; cursor: not-allowed; }

/* ── Subcategory checkbox rows ── */
.filt-sub-list { list-style: none; margin: 0; padding: 0; }
.filt-sub-list li + li { margin-top: 2px; }

.filt-sub-cb,
.filt-sub {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid transparent;
  border-radius: 10px;
  text-align: left;
  min-height: 44px;
  cursor: pointer;
  transition: background 0.12s;
}
.filt-sub-cb:hover,
.filt-sub:hover { background: #F8F2DC; }
.filt-sub-cb.on,
.filt-sub-cb[aria-checked="true"],
.filt-sub.on { border-color: var(--cc, var(--primary)); }

.fs-emoji { font-size: 16px; width: 20px; text-align: center; }
.fs-label {
  flex: 1;
  font-size: 14px;
  color: var(--primary);
}
.fs-check {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1.5px solid var(--cc, var(--primary));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--surface);
  flex-shrink: 0;
}
.filt-sub-cb[aria-checked="true"] .fs-check,
.filt-sub-cb.on .fs-check {
  background: var(--cc, var(--primary));
}

/* ── Sticky CTA ── */
.filt-cta-wrap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 12px 16px 24px;
  background: linear-gradient(to top, var(--bg) 60%, transparent);
  pointer-events: none;
}
.filt-cta-wrap > * { pointer-events: auto; }
.filt-cta { width: 100%; }

/* ── Login prompt ── */
.filt-login-prompt {
  padding: 12px 16px;
  background: #FFF8E7;
  border-top: 1px solid var(--rule);
  text-align: center;
  font-size: 13px;
  color: var(--primary);
  flex-shrink: 0;
}
.filt-login-btn {
  display: inline-block;
  margin-top: 8px;
}

/* ═══════════════════════════════════════
   ACTIVE FILTER CHIPS ROW
   ═══════════════════════════════════════ */

.filter-chips-row {
  display: flex;
  gap: 6px;
  padding: 0 16px 8px;
  overflow-x: auto;
  scrollbar-width: none;
  flex-shrink: 0;
}
.filter-chips-row:empty { display: none; }

.filt-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: var(--primary);
  color: var(--surface);
  border-radius: 100px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  border: none;
  flex-shrink: 0;
}
.filt-chip:hover { opacity: 0.85; }
.filt-chip-close {
  font-size: 14px;
  line-height: 1;
  opacity: 0.75;
}
