/* Smart listing filters — desktop accordion / mobile sheet / searchable pickers */
.listing-page .lf-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
}
.lf-result-count {
  margin: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .45rem .85rem;
  font-size: .84rem;
  color: var(--muted);
  box-shadow: var(--shadow);
}
.lf-result-count b { color: var(--navy); font-size: 1rem; }

.lf-shell {
  margin: 0 0 1.25rem;
  background: var(--glass);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.65);
  border-radius: 22px;
  padding: .85rem;
  box-shadow: var(--shadow);
}

.lf-top {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .55rem;
  align-items: center;
}
.lf-search {
  display: flex;
  align-items: center;
  gap: .45rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0 .75rem;
  min-height: 46px;
}
.lf-search:focus-within {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(255,107,53,.12);
}
.lf-search-icon { color: var(--muted); font-size: 1.1rem; }
.lf-search input {
  flex: 1;
  border: 0;
  background: transparent;
  font: inherit;
  min-width: 0;
  padding: .55rem 0;
}
.lf-search input:focus { outline: none; }

.lf-accordion-btn,
.lf-open-btn {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 14px;
  padding: .55rem .75rem;
  font: inherit;
  font-weight: 800;
  color: var(--navy);
  cursor: pointer;
  white-space: nowrap;
}
.lf-accordion-caret {
  font-size: .75rem;
  transition: transform .2s ease;
}
.lf-panel.is-expanded .lf-accordion-caret,
.js-lf-accordion[aria-expanded="true"] .lf-accordion-caret {
  transform: rotate(180deg);
}
.lf-open-btn { display: none; }
.lf-badge {
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  background: var(--orange);
  color: #fff;
  font-size: .72rem;
  font-weight: 900;
  display: grid;
  place-items: center;
  padding: 0 .25rem;
}

.lf-smart {
  display: flex;
  flex-wrap: nowrap;
  gap: .4rem;
  margin-top: .7rem;
  overflow-x: auto;
  padding-bottom: .15rem;
  scrollbar-width: none;
}
.lf-smart::-webkit-scrollbar { display: none; }
.lf-chip {
  flex: 0 0 auto;
  border: 1px solid #ffd8c4;
  background: #fff8f3;
  color: #c2410c;
  border-radius: 999px;
  padding: .35rem .7rem;
  font: inherit;
  font-size: .78rem;
  font-weight: 800;
  cursor: pointer;
  transition: background .15s ease, transform .15s ease;
}
.lf-chip:hover { background: #ffefe4; transform: translateY(-1px); }
.lf-chip.is-on {
  background: linear-gradient(135deg, var(--orange), var(--orange-2));
  color: #fff;
  border-color: transparent;
}

.lf-active {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  align-items: center;
  margin-top: .65rem;
}
.lf-active-chip {
  background: rgba(11,31,77,.08);
  color: var(--navy);
  border-radius: 999px;
  padding: .22rem .55rem;
  font-size: .74rem;
  font-weight: 800;
}
.lf-clear, .lf-reset {
  color: var(--orange);
  font-size: .78rem;
  font-weight: 800;
  text-decoration: none;
}
.lf-clear:hover, .lf-reset:hover { text-decoration: underline; }

/* Filter panel — accordion desktop / sheet mobile */
.lf-panel { margin-top: .65rem; }
.lf-back, .lf-handle, .lf-panel-head, .lf-panel-x { display: none; }
.lf-panel-inner {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
}
.lf-panel:not(.is-expanded) .lf-panel-inner { display: none; }
.lf-panel.is-expanded .lf-panel-inner {
  display: flex;
  flex-direction: column;
  animation: lf-acc-open .25s ease;
}
@keyframes lf-acc-open {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: none; }
}

.lf-panel-body { padding: .85rem; }
.lf-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .65rem;
}
.lf-field label {
  display: block;
  font-size: .74rem;
  font-weight: 800;
  color: var(--muted);
  margin-bottom: .28rem;
}
.lf-field input[type="number"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: .55rem .65rem;
  font: inherit;
  background: #fff;
}
.lf-field input:focus { outline: none; border-color: var(--orange); }

.lf-picker {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: .55rem .65rem;
  font: inherit;
  background: #fff;
  color: var(--navy);
  cursor: pointer;
  text-align: right;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.lf-picker:hover { border-color: #c9d4e6; }
.lf-picker.has-value { border-color: rgba(255,107,53,.45); background: #fffaf7; }
.lf-picker-value {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}
.lf-picker-caret { color: var(--muted); font-size: .8rem; }

.lf-field-range { grid-column: span 2; }
.lf-range {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: .4rem;
  align-items: center;
}
.lf-range span { color: var(--muted); font-size: .78rem; font-weight: 700; }
.lf-check {
  display: flex;
  align-items: center;
  gap: .45rem;
  min-height: 42px;
  font-size: .84rem;
  font-weight: 700;
  color: var(--navy);
  cursor: pointer;
}
.lf-check input { width: 18px; height: 18px; accent-color: var(--orange); }
.lf-panel-foot {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: .75rem;
  padding: .75rem .85rem;
  border-top: 1px solid var(--line);
  background: #f8fafc;
}

.lf-empty {
  text-align: center;
  background: #fff;
  border: 1px dashed var(--line);
  border-radius: 20px;
  padding: 2rem 1rem;
}
.lf-empty p { color: var(--muted); margin: 0 0 1rem; }

/* Searchable picker popup */
.lf-picker-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 1rem;
  pointer-events: none;
  opacity: 0;
  transition: opacity .22s ease;
}
.lf-picker-modal[hidden] { display: none; }
.lf-picker-modal.in {
  pointer-events: auto;
  opacity: 1;
}
.lf-picker-back {
  position: absolute;
  inset: 0;
  background: rgba(6,14,34,.5);
  backdrop-filter: blur(6px);
}
.lf-picker-sheet {
  position: relative;
  width: min(440px, 100%);
  max-height: min(72vh, 560px);
  background: #fff;
  border-radius: 20px;
  border: 1px solid var(--line);
  box-shadow: 0 28px 70px rgba(11,31,77,.22);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(10px) scale(.98);
  transition: transform .22s ease;
}
.lf-picker-modal.in .lf-picker-sheet { transform: none; }
.lf-picker-handle { display: none; }
.lf-picker-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .5rem;
  padding: .75rem .85rem .5rem;
  border-bottom: 1px solid var(--line);
}
.lf-picker-head h3 {
  margin: 0;
  font-size: 1rem;
  color: var(--navy);
}
.lf-picker-x {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 1.25rem;
  cursor: pointer;
}
.lf-picker-search-wrap {
  display: flex;
  align-items: center;
  gap: .4rem;
  margin: .65rem .85rem .45rem;
  padding: 0 .65rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
}
.lf-picker-search-wrap:focus-within {
  border-color: var(--orange);
  background: #fff;
}
.lf-picker-search-icon { color: var(--muted); }
.lf-picker-search {
  flex: 1;
  border: 0;
  background: transparent;
  font: inherit;
  padding: .6rem 0;
  min-width: 0;
}
.lf-picker-search:focus { outline: none; }
.lf-picker-status {
  padding: 0 .85rem .35rem;
  font-size: .75rem;
  color: var(--muted);
}
.lf-picker-list {
  list-style: none;
  margin: 0;
  padding: .25rem .5rem .65rem;
  overflow: auto;
  flex: 1;
}
.lf-picker-item {
  padding: .62rem .7rem;
  border-radius: 12px;
  font-weight: 700;
  color: var(--navy);
  cursor: pointer;
  transition: background .12s ease;
}
.lf-picker-item:hover,
.lf-picker-item:focus {
  background: #f1f5f9;
  outline: none;
}
.lf-picker-item.is-selected {
  background: #fff4ec;
  color: #c2410c;
}
.lf-picker-item.is-clear { color: var(--muted); font-weight: 600; }

body.lf-open,
body.lf-picker-open { overflow: hidden; }

@media (max-width: 960px) {
  .lf-grid { grid-template-columns: repeat(2, 1fr); }
  .lf-field-range { grid-column: span 2; }
}

@media (max-width: 720px) {
  .lf-accordion-btn { display: none; }
  .lf-open-btn { display: inline-flex; }

  .lf-panel {
    position: fixed;
    inset: 0;
    z-index: 70;
    margin: 0;
    display: grid;
    place-items: end center;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease, visibility .25s ease;
  }
  .lf-panel.is-open {
    pointer-events: auto;
    opacity: 1;
    visibility: visible;
  }
  .lf-panel:not(.is-expanded) .lf-panel-inner { display: none; }
  .lf-panel.is-open.is-expanded .lf-panel-inner { display: flex; }

  .lf-back {
    display: block;
    position: absolute;
    inset: 0;
    background: rgba(6,14,34,.55);
    backdrop-filter: blur(6px);
  }
  .lf-panel-inner {
    position: relative;
    width: 100%;
    max-height: min(90vh, 820px);
    border-radius: 22px 22px 0 0;
    border: 0;
    transform: translateY(100%);
    transition: transform .28s ease;
  }
  .lf-panel.is-open .lf-panel-inner { transform: translateY(0); }
  .lf-handle {
    display: block;
    width: 46px;
    height: 4px;
    border-radius: 99px;
    background: #cbd5e1;
    margin: .15rem auto .55rem;
    flex-shrink: 0;
  }
  .lf-panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 .85rem .55rem;
  }
  .lf-panel-head h2 { margin: 0; font-size: 1.05rem; color: var(--navy); }
  .lf-panel-x {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: #fff;
    font-size: 1.3rem;
    cursor: pointer;
  }
  .lf-panel-body {
    overflow: auto;
    flex: 1;
    padding: 0 .85rem .25rem;
  }
  .lf-grid { grid-template-columns: 1fr; }
  .lf-field-range { grid-column: span 1; }
  .lf-panel-foot {
    flex-shrink: 0;
    padding: .65rem .85rem 1rem;
  }
  .lf-panel-foot .btn-primary { flex: 1; }

  /* Picker — mobile bottom sheet */
  .lf-picker-modal {
    place-items: end center;
    padding: 0;
  }
  .lf-picker-sheet {
    width: 100%;
    max-height: min(78vh, 640px);
    border-radius: 22px 22px 0 0;
    transform: translateY(100%);
  }
  .lf-picker-modal.in .lf-picker-sheet { transform: translateY(0); }
  .lf-picker-handle {
    display: block;
    width: 46px;
    height: 4px;
    border-radius: 99px;
    background: #cbd5e1;
    margin: .15rem auto .45rem;
  }
  .lf-picker-item {
    padding: .72rem .8rem;
    font-size: .95rem;
  }
}

@media (min-width: 721px) {
  .lf-panel {
    position: static;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }
  .lf-panel[hidden] { display: block !important; }
}
