/* ═══════════════════════════════════════════════════════════════════
   Advanced filters drawer.

   Every rule is written against .apsFilters and sets its own box-sizing,
   font and control appearance, so it renders identically regardless of
   what the surrounding theme resets.
   ═══════════════════════════════════════════════════════════════════ */

.apsFilters,
.apsFilters *,
.apsFilters *::before,
.apsFilters *::after { box-sizing: border-box; }

.apsFilters[hidden] { display: none; }

.apsFilters {
  --aps-green: #40733B;
  --aps-ink:   #0D0D0D;
  --aps-muted: #7A7A7A;
  --aps-line:  #ECECEC;

  position: fixed;
  inset: 0;
  z-index: 100000;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.45;
  color: var(--aps-ink);
}

.apsFilters__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(13, 13, 13, .5);
  opacity: 0;
  transition: opacity .3s ease;
}

.apsFilters.is-open .apsFilters__backdrop { opacity: 1; }

.apsFilters__panel {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: min(460px, 100%);
  background: #fff;
  display: flex;
  flex-direction: column;
  box-shadow: -10px 0 50px rgba(0, 0, 0, .2);
  transform: translateX(100%);
  transition: transform .32s cubic-bezier(.4, 0, .2, 1);
}

.apsFilters.is-open .apsFilters__panel { transform: translateX(0); }

/* ── Header ───────────────────────────────────────────────────────── */
.apsFilters__head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 26px 32px;
  border-bottom: 1px solid var(--aps-line);
}

.apsFilters__title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -.2px;
}

.apsFilters__count {
  min-width: 26px;
  height: 26px;
  padding: 0 8px;
  border-radius: 13px;
  background: var(--aps-green);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.apsFilters__count[hidden] { display: none; }

.apsFilters__close {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1.5px solid var(--aps-green);
  border-radius: 50%;
  background: transparent;
  color: var(--aps-green);
  font-size: 24px;
  font-family: inherit;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .2s ease, color .2s ease;
}

.apsFilters__close:hover { background: var(--aps-green); color: #fff; }

/* ── Scrolling body ───────────────────────────────────────────────── */
.apsFilters__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 26px 32px 0;
  margin: 0;
}

.apsFilters__body::-webkit-scrollbar { width: 6px; }
.apsFilters__body::-webkit-scrollbar-thumb {
  background: #D6D6D6;
  border-radius: 3px;
}

/* ── Chips ────────────────────────────────────────────────────────── */
.apsFilters__chips,
.propertyHero__chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 24px;
  padding: 0;
}

.propertyHero__chips { margin: 14px 0 0; }

.apsChip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 14px;
  border: 1px solid var(--aps-line);
  border-radius: 22px;
  background: #fff;
  font-size: 13.5px;
  color: var(--aps-ink);
  text-decoration: none;
  transition: border-color .2s ease, background .2s ease;
}

.apsChip:hover { border-color: var(--aps-green); background: #F7FAF6; }
.apsChip span { color: var(--aps-muted); font-size: 17px; line-height: 1; }
.apsChip:hover span { color: var(--aps-green); }

.apsFilters__clear {
  font-size: 13.5px;
  color: var(--aps-green);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── Labels and fields ────────────────────────────────────────────── */
.apsFilters__label,
.apsFilters__section {
  display: block;
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--aps-muted);
  text-transform: uppercase;
}

.apsFilters__label + .apsFilters__input { margin-bottom: 22px; }

.apsFilters__section {
  margin: 8px 0 6px;
  padding-top: 24px;
  border-top: 1px solid var(--aps-line);
}

.apsFilters input.apsFilters__input,
.apsFilters .apsFilters select.apsFilters__input {
  display: block;
  width: 100%;
  height: 52px;
  padding: 0 16px;
  border: 1px solid #E0E0E0;
  border-radius: 10px;
  background: #fff;
  font-family: inherit;
  font-size: 15px;
  color: var(--aps-ink);
  appearance: none;
  -webkit-appearance: none;
  transition: border-color .18s ease, box-shadow .18s ease;
}

.apsFilters input.apsFilters__input::placeholder { color: #ADADAD; }

.apsFilters input.apsFilters__input:focus,
.apsFilters select.apsFilters__input:focus {
  outline: none;
  border-color: var(--aps-green);
  box-shadow: 0 0 0 3px rgba(64, 115, 59, .12);
}

/* The host theme sizes bare selects and re-enables the native arrow, so width
   and appearance are restated here alongside the custom chevron. */
.apsFilters select.apsFilters__input {
  width: 100%;
  max-width: none;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237A7A7A' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 42px;
  cursor: pointer;
}

/* ── Feature groups ───────────────────────────────────────────────── */
.apsGroup { border-bottom: 1px solid var(--aps-line); }

.apsGroup__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 0;
  font-size: 15.5px;
  font-weight: 500;
  color: var(--aps-ink);
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.apsGroup__head::-webkit-details-marker { display: none; }

.apsGroup__head::after {
  content: '';
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  border-right: 1.7px solid var(--aps-muted);
  border-bottom: 1.7px solid var(--aps-muted);
  transform: rotate(45deg);
  margin-bottom: 3px;
  transition: transform .22s ease;
}

.apsGroup[open] > .apsGroup__head::after {
  transform: rotate(-135deg);
  margin: 3px 0 0;
}

.apsGroup__items {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 18px;
  padding: 2px 0 22px;
}

.apsGroup__item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  line-height: 1.35;
  color: #3D3D3D;
  cursor: pointer;
}

.apsGroup__item:hover { color: var(--aps-ink); }

.apsGroup__item input {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--aps-green);
  cursor: pointer;
}

/* ── Sticky footer ────────────────────────────────────────────────── */
/* The actions sit inside the scrolling form, so they are pinned with sticky
   rather than being a flex sibling of it. The negative margins let the bar
   span the body's full width despite the body's padding. */
.apsFilters__actions {
  position: sticky;
  bottom: 0;
  z-index: 2;
  margin: 8px -32px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 32px;
  border-top: 1px solid var(--aps-line);
  background: #fff;
  box-shadow: 0 -6px 22px rgba(0, 0, 0, .05);
}

.apsFilters__reset {
  font-size: 14.5px;
  color: var(--aps-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.apsFilters__reset:hover { color: var(--aps-green); }

.apsFilters__submit {
  flex: 0 1 240px;
  height: 52px;
  padding: 0 30px;
  border: 0;
  border-radius: 26px;
  background: var(--aps-green);
  color: #fff;
  font-family: inherit;
  font-size: 15.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s ease, transform .15s ease;
}

.apsFilters__submit:hover { background: #35602F; transform: translateY(-1px); }

/* ── Count badge on the bar's filter button ───────────────────────── */
.vlad-home .propertyHero__filter { position: relative; }

.vlad-home .propertyHero__filterCount {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 21px;
  height: 21px;
  padding: 0 6px;
  border-radius: 11px;
  background: #40733B;
  color: #fff;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 21px;
  text-align: center;
}

.vlad-home .propertyHero__filterCount[hidden] { display: none; }

@media (max-width: 640px) {
  .apsFilters__panel { width: 100%; }
  .apsFilters__head { padding: 20px; }
  .apsFilters__body { padding: 20px 20px 18px; }
  .apsFilters__actions { padding: 14px 20px; margin: 8px -20px 0; }
  .apsGroup__items { grid-template-columns: 1fr; gap: 12px; }
  .apsFilters__submit { flex: 1 1 auto; }
}
