/* Bảng bộ lọc (App.FilterPanel) */
body.fp-lock { overflow: hidden; }
.fp-overlay { position: fixed; inset: 0; z-index: 4000; background: rgba(17,24,39,0); transition: background .28s ease; display: flex; justify-content: flex-end; }
.fp-overlay.open { background: rgba(17,24,39,.5); }
.fp-drawer { width: 460px; max-width: 100%; height: 100%; background: #fff; display: flex; flex-direction: column; transform: translateX(100%); transition: transform .28s cubic-bezier(.22,.8,.3,1); box-shadow: -10px 0 40px rgba(0,0,0,.2); border-radius: 16px 0 0 16px; overflow: hidden; }
.fp-overlay.open .fp-drawer { transform: none; }
.fp-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); flex: none; }
.fp-head h2 { margin: 0; font-size: 19px; }
.fp-x { width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--bg); font-size: 24px; line-height: 1; cursor: pointer; color: var(--text); }
.fp-x:hover { background: #e5e7eb; }
.fp-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 4px 18px 16px; }
.fp-sec { border-bottom: 1px solid var(--line); }
.fp-sec-h { width: 100%; display: flex; align-items: center; gap: 8px; padding: 14px 0; background: none; border: 0; font: inherit; font-weight: 700; font-size: 16px; color: var(--text); cursor: pointer; text-align: left; }
.fp-sec-t { flex: 1; }
.fp-badge { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--primary); color: var(--primary-ink); font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.fp-chev { transition: transform .25s; color: var(--muted); }
.fp-sec.collapsed .fp-chev { transform: rotate(-90deg); }
.fp-sec-w { display: grid; grid-template-rows: 1fr; transition: grid-template-rows .28s ease; }
.fp-sec.collapsed .fp-sec-w { grid-template-rows: 0fr; }
.fp-sec-b { overflow: hidden; min-height: 0; }
.fp-sec-b > :last-child { margin-bottom: 16px; }
.fp-sec.collapsed .fp-sec-b { visibility: hidden; transition: visibility 0s .28s; }
.fp-flabel { font-size: 13px; font-weight: 600; color: var(--muted); margin: 12px 0 6px; }
.fp-flabel small { font-weight: 400; }
.fp-sec-b > .fp-flabel:first-child, .fp-sec-b > .fp-field:first-child .fp-flabel { margin-top: 0; }
.fp-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.fp-chip { border: 1px solid #d1d5db; background: #fff; color: var(--text); border-radius: 999px; padding: 7px 14px; font: inherit; font-size: 14px; cursor: pointer; transition: all .15s; min-height: 36px; }
.fp-chip:hover { border-color: var(--text); color: var(--text); }
.fp-chip.active { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); font-weight: 600; box-shadow: 0 2px 6px color-mix(in srgb, var(--primary) 40%, transparent); }
.fp-chip:focus-visible, .fp-toggle:focus-visible, .fp-sec-h:focus-visible, .fp-x:focus-visible, .fp-btn:focus-visible, .fp-apply:focus-visible, .fp-clear:focus-visible { outline: 0; box-shadow: var(--focus); }
.fp-chip, .fp-btn, .fp-apply, .fp-x, .fp-toggle { -webkit-appearance: none; appearance: none; -webkit-tap-highlight-color: transparent; }
.fp-toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; margin-top: 4px; }
.fp-toggle { position: relative; width: 46px; height: 26px; border: 0; border-radius: 13px; background: #d1d5db; cursor: pointer; transition: background .2s; flex: none; }
.fp-toggle::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .2s; }
.fp-toggle.active { background: var(--primary); }
.fp-toggle.active::after { transform: translateX(20px); }
.fp-minmax { display: flex; align-items: flex-end; gap: 8px; margin-top: 10px; }
.fp-minmax i { padding-bottom: 10px; color: var(--muted); font-style: normal; }
.fp-minmax label { flex: 1; position: relative; display: block; min-width: 0; }
.fp-minmax label span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 3px; }
.fp-minmax input { padding-right: 30px; }
.fp-minmax em { position: absolute; right: 10px; bottom: 10px; font-style: normal; color: var(--muted); font-size: 13px; pointer-events: none; }
.fp-selects { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fp-selects span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 3px; }
.fp-around-top { display: flex; gap: 8px; flex-wrap: wrap; }
.fp-btn { border: 1px solid var(--primary); background: var(--primary-soft); color: var(--accent-ink); border-radius: 8px; padding: 8px 14px; font: inherit; font-weight: 600; cursor: pointer; }
.fp-btn:hover { background: var(--cream); }
.fp-btn-ghost { border-color: #d1d5db; background: #fff; color: var(--muted); }
.fp-btn[hidden], .fp-badge[hidden] { display: none; }
.fp-hint { font-size: 13px; color: var(--muted); margin: 8px 0; }
.fp-minimap { height: 200px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: #e5e7eb; z-index: 0; }
.fp-foot { flex: none; display: flex; gap: 12px; padding: 12px 18px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: #fff; box-shadow: 0 -4px 16px rgba(0,0,0,.06); }
.fp-clear { background: none; border: 0; font: inherit; font-weight: 600; color: var(--text); text-decoration: underline; cursor: pointer; padding: 0 6px; }
.fp-apply { flex: 1; border: 0; border-radius: 14px; background: var(--primary); color: var(--primary-ink); font: inherit; font-weight: 800; font-size: 16px; padding: 14px 16px; min-height: 48px; cursor: pointer; transition: background .15s, transform .1s; }
.fp-apply:hover { background: var(--primary-d, var(--primary)); }
.fp-apply:active { transform: scale(.98); }
.fp-apply.busy { opacity: .75; }

/* Popup khoảng giá */
.fp-pop { position: fixed; z-index: 3500; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 36px rgba(0,0,0,.2); padding: 14px; opacity: 0; transform: translateY(-6px); transition: opacity .15s, transform .15s; }
.fp-pop.open { opacity: 1; transform: none; }
.fp-pop-t { font-weight: 700; margin-bottom: 10px; }
.fp-pop-f { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 14px; }
.fp-pop-f .fp-apply { flex: none; padding: 9px 22px; font-size: 15px; }

.fp-grab { display: none; }
.fp-overlay, .fp-body, .fp-drawer { overscroll-behavior: contain; }
.fp-body { -webkit-overflow-scrolling: touch; }
@media (max-width: 640px) {
  /* bottom sheet */
  .fp-overlay { align-items: flex-end; justify-content: stretch; -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
  .fp-drawer { width: 100%; height: auto; max-height: 92vh; max-height: 92dvh; border-radius: 22px 22px 0 0; transform: translateY(100%); box-shadow: 0 -10px 40px rgba(0,0,0,.2); will-change: transform; }
  .fp-overlay.open .fp-drawer { transform: none; }
  .fp-drawer.dragging { transition: none; }
  .fp-grab { display: block; flex: none; width: 40px; height: 5px; border-radius: 3px; background: var(--line-strong); margin: 8px auto 0; }
  .fp-head { padding: 10px 14px 10px 18px; touch-action: none; }
  .fp-x { width: 44px; height: 44px; }
  .fp-sec-h { min-height: 48px; }
  .fp-chip { padding: 8px 14px; min-height: 44px; }
  .fp-toggle-row { min-height: 48px; }
  .fp-minimap { height: 220px; }
  .fp-selects { grid-template-columns: 1fr; }
  .fp-minmax input, .fp-selects select, .fp-body input, .fp-body select, .fp-pop input { font-size: 16px; min-height: 44px; -webkit-appearance: none; appearance: none; }
  .fp-foot { position: sticky; bottom: 0; padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  .fp-pop { left: 8px !important; right: 8px !important; width: auto !important; }
}
@media (prefers-reduced-motion: reduce) { .fp-drawer, .fp-overlay, .fp-sec-w, .fp-chev, .fp-pop { transition: none; } }
