/* Catalog filters (/ and /villas/): sticky bar, chosen filters, panels.
   Colours only from tokens.css (--hrp-*). Tap targets are at least 44px. */

.vf-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Sticky bar ------------------------------------------------------- */
.vf-bar { position: sticky; top: 0; z-index: 30; background: var(--hrp-bg-2); border-bottom: 1px solid transparent; transition: border-color .2s, box-shadow .2s; }
.vf-bar.is-stuck { background: var(--hrp-bg); border-bottom-color: var(--hrp-line); box-shadow: 0 6px 18px rgba(0,0,0,.06); }
.vf-bar__in { display: flex; align-items: center; gap: 10px; padding-top: 12px; padding-bottom: 12px; }
.vf-quick { display: flex; gap: 8px; flex: 1 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.vf-quick::-webkit-scrollbar { display: none; }
.vf-btn { display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; min-height: 44px; padding: 0 16px; border-radius: 22px; border: 1.5px solid var(--hrp-line); background: var(--hrp-card); color: var(--hrp-ink); font: 700 15px/1.1 var(--brand-sans); white-space: nowrap; text-decoration: none; cursor: pointer; }
.vf-btn:hover { border-color: var(--hrp-ink); }
.vf-btn.is-on { background: var(--hrp-pop-soft); border-color: var(--hrp-ink); }
.vf-btn--main { background: var(--hrp-deep); border-color: var(--hrp-deep); color: var(--hrp-on-deep); }
.vf-btn--main:hover { border-color: var(--hrp-deep); color: var(--hrp-pop); }
.vf-btn--dark { background: var(--hrp-deep); border-color: var(--hrp-deep); color: var(--hrp-on-deep); }
.vf-btn--dark[aria-pressed="true"] { background: var(--hrp-pop); border-color: var(--hrp-pop); color: var(--hrp-on-pop); }
.vf-caret { opacity: .7; }
.vf-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--hrp-pop); color: var(--hrp-on-pop); font-size: 13px; font-weight: 800; }
.vf-sort { order: 3; display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; margin-inline-start: auto; font-size: 15px; color: var(--hrp-muted); }
.vf-sort select { min-height: 44px; padding: 0 34px 0 14px; border-radius: 22px; border: 1.5px solid var(--hrp-line); background: var(--hrp-card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%235A6F70' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center; color: var(--hrp-ink); font: 700 15px var(--brand-sans); -webkit-appearance: none; appearance: none; cursor: pointer; }
[dir="rtl"] .vf-sort select { padding: 0 14px 0 34px; background-position: left 12px center; }

/* Chosen filters ---------------------------------------------------- */
.vf-picked { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 4px; padding-bottom: 14px; }
.vf-picked__t { font-size: 14px; color: var(--hrp-muted); }
.vf-tag { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 8px 0 14px; border-radius: 18px; background: var(--hrp-deep); color: var(--hrp-on-deep); font-size: 14px; font-weight: 700; text-decoration: none; }
[dir="rtl"] .vf-tag { padding: 0 14px 0 8px; }
.vf-tag small { color: var(--hrp-on-deep-2); font-size: 12px; font-weight: 700; }
.vf-tag__x { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 14px; font-size: 18px; line-height: 1; }
.vf-tag:hover .vf-tag__x { background: rgba(255,255,255,.14); }
.vf-reset { margin-inline-start: 4px; font-size: 14px; font-weight: 800; color: var(--hrp-accent); }

/* Panels ------------------------------------------------------------ */
.vf-panel { position: fixed; inset: 0; z-index: 10000; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgba(0,0,0,.45); }
.vf-panel[hidden] { display: none; }
.vf-panel__box { display: flex; flex-direction: column; width: 100%; max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px); border-radius: 24px; background: var(--hrp-card); color: var(--hrp-ink); box-shadow: 0 24px 60px rgba(0,0,0,.25); overflow: hidden; }
.vf-panel--areas .vf-panel__box { max-width: 880px; }
.vf-panel--budget .vf-panel__box { max-width: 460px; }
.vf-panel--all { justify-content: flex-end; padding: 0; }
.vf-panel--all .vf-panel__box { max-width: 480px; height: 100%; max-height: none; border-radius: 0; }
.vf-panel__head { display: flex; align-items: center; gap: 12px; padding: 16px 16px 12px 24px; border-bottom: 1px solid var(--hrp-line); }
[dir="rtl"] .vf-panel__head { padding: 16px 24px 12px 16px; }
.vf-panel__head h3 { margin: 0; flex: 1 1 auto; font-size: 22px; font-weight: 800; letter-spacing: -.03em; }
.vf-x { width: 44px; height: 44px; border-radius: 22px; border: 0; background: var(--hrp-bg-2); color: var(--hrp-ink); font-size: 24px; line-height: 1; cursor: pointer; }
.vf-link { min-height: 44px; padding: 0 6px; border: 0; background: transparent; color: var(--hrp-accent); font: 800 14px var(--brand-sans); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; display: inline-flex; align-items: center; }
.vf-panel__body { flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; padding: 18px 24px 24px; display: flex; flex-direction: column; gap: 16px; }
.vf-panel__foot { padding: 14px 24px calc(14px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--hrp-line); background: var(--hrp-card); }
.vf-show { width: 100%; }
.vf-show[disabled] { opacity: .55; cursor: default; }
.vf-note { margin: 0; font-size: 14px; color: var(--hrp-muted); }
.vf-note--small { font-size: 13px; }

/* Segmented control (list / map, night / month) */
.vf-seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; border-radius: 16px; background: var(--hrp-bg-2); }
.vf-seg > button, .vf-seg > label > span { display: flex; align-items: center; justify-content: center; min-height: 44px; border-radius: 12px; border: 0; background: transparent; color: var(--hrp-muted); font: 700 15px var(--brand-sans); cursor: pointer; }
.vf-seg > label { display: block; }
.vf-seg > label > input { position: absolute; opacity: 0; pointer-events: none; }
.vf-seg > button.is-on, .vf-seg > label > input:checked + span { background: var(--hrp-card); color: var(--hrp-ink); box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.vf-seg > label > input:focus-visible + span { outline: 2px solid var(--hrp-accent); outline-offset: 2px; }

/* Include / exclude */
.vf-mode { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.vf-mode__opt { position: relative; display: block; cursor: pointer; }
.vf-mode__opt input { position: absolute; opacity: 0; pointer-events: none; }
.vf-mode__opt span { display: flex; flex-direction: column; gap: 2px; min-height: 64px; padding: 12px 14px; border-radius: 16px; border: 2px solid var(--hrp-line); }
.vf-mode__opt b { font-size: 15px; }
.vf-mode__opt small { font-size: 13px; color: var(--hrp-muted); }
.vf-mode__opt input:checked + span { border-color: var(--hrp-ink); background: var(--hrp-pop-soft); }
.vf-mode__opt input:focus-visible + span { outline: 2px solid var(--hrp-accent); outline-offset: 2px; }

.vf-group { display: flex; flex-direction: column; gap: 10px; }
.vf-group__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.vf-group__head b { font-size: 15px; }
.vf-areas { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.vf-area { position: relative; display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 14px; border-radius: 14px; border: 1.5px solid var(--hrp-line); cursor: pointer; }
.vf-area input { position: absolute; opacity: 0; pointer-events: none; }
.vf-area__n { flex: 1 1 auto; font-size: 15px; font-weight: 700; }
.vf-area__c { font-size: 13px; color: var(--hrp-muted); }
.vf-area__x { display: none; font-size: 12px; font-weight: 800; color: var(--hrp-muted); }
.vf-area:has(input:checked) { border-color: var(--hrp-ink); background: var(--hrp-pop-soft); }
.vf-area:has(input:focus-visible) { outline: 2px solid var(--hrp-accent); outline-offset: 2px; }
.vf-panel[data-mode="out"] .vf-area:has(input:checked) { background: var(--hrp-bg-2); border-style: dashed; }
.vf-panel[data-mode="out"] .vf-area:has(input:checked) .vf-area__n { text-decoration: line-through; color: var(--hrp-muted); }
.vf-panel[data-mode="out"] .vf-area:has(input:checked) .vf-area__c { display: none; }
.vf-panel[data-mode="out"] .vf-area:has(input:checked) .vf-area__x { display: inline; }

/* Map with drawing */
.vf-map__tools { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.vf-map { position: relative; height: min(520px, 58vh); border-radius: 18px; overflow: hidden; background: var(--hrp-bg-2); }
.vf-map__draw { position: absolute; inset: 0; z-index: 5; width: 100%; height: 100%; cursor: crosshair; touch-action: none; }
.vf-map .maplibregl-marker.vf-pin { position: absolute; top: 0; left: 0; }
.vf-pin { padding: 4px 10px; border-radius: 14px; border: 0; background: var(--hrp-card); color: var(--hrp-ink); font: 800 12px var(--brand-sans); white-space: nowrap; box-shadow: 0 2px 8px rgba(0,0,0,.18); cursor: pointer; }
.vf-pin.is-on { background: var(--hrp-deep); color: var(--hrp-pop); }
.vf-pin.is-out { background: var(--hrp-bg-2); color: var(--hrp-muted); text-decoration: line-through; }

/* Options */
.vf-opts { display: flex; flex-direction: column; gap: 8px; }
.vf-opt { position: relative; display: block; cursor: pointer; }
.vf-opt input { position: absolute; opacity: 0; pointer-events: none; }
.vf-opt span { display: flex; align-items: center; min-height: 48px; padding: 0 16px; border-radius: 14px; border: 1.5px solid var(--hrp-line); font-size: 15px; font-weight: 700; }
.vf-opt input:checked + span { border-color: var(--hrp-ink); background: var(--hrp-pop-soft); }
.vf-opt input:focus-visible + span { outline: 2px solid var(--hrp-accent); outline-offset: 2px; }

.vf-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 64px; padding: 10px 0; border: 0; border-bottom: 1px solid var(--hrp-line); background: transparent; color: var(--hrp-ink); font: inherit; text-align: start; cursor: pointer; }
.vf-row > span:first-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.vf-row b { font-size: 16px; }
.vf-row small { font-size: 14px; color: var(--hrp-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vf-row__go { flex: 0 0 auto; font-size: 14px; font-weight: 800; color: var(--hrp-accent); text-decoration: underline; text-underline-offset: 3px; }

.vf-sec { display: flex; flex-direction: column; gap: 12px; padding-bottom: 6px; scroll-margin-top: 12px; }
.vf-sec h4 { margin: 4px 0 0; font-size: 17px; font-weight: 800; letter-spacing: -.02em; }
.vf-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.vf-pill { position: relative; cursor: pointer; }
.vf-pill input { position: absolute; opacity: 0; pointer-events: none; }
.vf-pill span { display: inline-flex; align-items: center; justify-content: center; min-width: 52px; min-height: 44px; padding: 0 16px; border-radius: 22px; border: 1.5px solid var(--hrp-line); font-size: 15px; font-weight: 700; }
.vf-pill input:checked + span { background: var(--hrp-deep); border-color: var(--hrp-deep); color: var(--hrp-on-deep); }
.vf-pill input:focus-visible + span { outline: 2px solid var(--hrp-accent); outline-offset: 2px; }
.vf-step { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; }
.vf-step > span { flex: 1 1 auto; }
.vf-step button { width: 44px; height: 44px; border-radius: 22px; border: 1.5px solid var(--hrp-line); background: var(--hrp-card); color: var(--hrp-ink); font-size: 20px; cursor: pointer; }
.vf-step input { width: 56px; height: 44px; border: 0; background: transparent; color: var(--hrp-ink); font: 800 17px var(--brand-sans); text-align: center; -moz-appearance: textfield; }
.vf-step input::-webkit-outer-spin-button, .vf-step input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.vf-checks { display: flex; flex-direction: column; }
.vf-check { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 52px; padding: 6px 0; border-bottom: 1px solid var(--hrp-line); cursor: pointer; }
.vf-check:last-child { border-bottom: 0; }
.vf-check__t { display: flex; flex-direction: column; gap: 2px; }
.vf-check b { font-size: 15px; font-weight: 700; }
.vf-check small { font-size: 13px; color: var(--hrp-muted); }
.vf-check input { position: absolute; opacity: 0; pointer-events: none; }
.vf-switch { position: relative; flex: 0 0 auto; width: 48px; height: 28px; border-radius: 14px; background: var(--hrp-line); transition: background-color .2s; }
.vf-switch::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 22px; height: 22px; border-radius: 11px; background: var(--hrp-card); box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .2s; }
.vf-check input:checked ~ .vf-switch { background: var(--hrp-deep); }
.vf-check input:checked ~ .vf-switch::after { transform: translateX(20px); }
[dir="rtl"] .vf-check input:checked ~ .vf-switch::after { transform: translateX(-20px); }
.vf-check input:focus-visible ~ .vf-switch { outline: 2px solid var(--hrp-accent); outline-offset: 2px; }
.vf-check.is-disabled { cursor: default; opacity: .6; }

/* Empty state */
.vf-suggest { list-style: none; margin: 0; padding: 0; width: 100%; max-width: 560px; display: flex; flex-direction: column; gap: 8px; }
.vf-suggest a { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 0 18px; border-radius: 16px; border: 1.5px solid var(--hrp-line); background: var(--hrp-bg); color: var(--hrp-ink); font-weight: 700; text-decoration: none; }
.vf-suggest a:hover { border-color: var(--hrp-ink); }
.vf-suggest b { color: var(--hrp-accent); }
.vf-empty__actions { display: flex; flex-wrap: wrap; gap: 10px; padding-top: 6px; }

/* Phones ------------------------------------------------------------ */
@media (max-width: 900px) {
  .vf-bar__in { flex-wrap: wrap; gap: 8px; padding-top: 10px; padding-bottom: 10px; }
  .vf-btn--main { flex: 1 1 0; justify-content: center; }
  .vf-sort { order: 0; flex: 1 1 0; margin: 0; }
  .vf-sort__t { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .vf-sort select { width: 100%; }
  .vf-quick { order: 4; flex: 1 0 100%; margin: 0 -16px; padding: 0 16px; }
  .vf-desk { display: none; }
  .vf-picked { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 12px; }
  .vf-picked::-webkit-scrollbar { display: none; }
  .vf-tag, .vf-reset, .vf-picked__t { flex: 0 0 auto; }

  .vf-panel { align-items: flex-end; padding: 0; }
  .vf-panel__box, .vf-panel--areas .vf-panel__box, .vf-panel--budget .vf-panel__box { max-width: none; max-height: 92vh; max-height: 92dvh; border-radius: 24px 24px 0 0; }
  .vf-panel--all .vf-panel__box { max-height: none; height: 100%; border-radius: 0; }
  .vf-panel__head { padding: 12px 12px 10px 18px; }
  [dir="rtl"] .vf-panel__head { padding: 12px 18px 10px 12px; }
  .vf-panel__body { padding: 14px 18px 20px; }
  .vf-panel__foot { padding: 12px 18px calc(12px + env(safe-area-inset-bottom, 0px)); }
  .vf-mode__opt span { min-height: 56px; padding: 10px 12px; }
  .vf-mode__opt b { font-size: 14px; }
  .vf-areas { grid-template-columns: 1fr 1fr; }
  .vf-map { height: 56vh; }
}
@media (max-width: 1240px) {
  .vf-sort__t { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
}
@media (max-width: 380px) {
  .vf-areas { grid-template-columns: 1fr; }
  .vf-mode__opt small { display: none; }
}
