/**
 * Sale Discovery Premium Parity V3 — complete cosmetic parity with Residential Dense Trust.
 * body.sale-page.listings-page inherits bayut SERP chrome from style.css.
 * This file (loaded after sale-public.css) restores Residential geometry and applies
 * Sale navy / blue / light-blue accents only. Does not modify frozen Residential CSS.
 */

body.sale-page.listings-page {
  --pg-sale-navy: #062b5b;
  --pg-sale-navy-deep: #041e42;
  --pg-sale-blue: #1a4f8c;
  --pg-sale-blue-mid: #2f6fad;
  --pg-sale-light: #eaf3fa;
  --pg-sale-pale: #f4f8fc;
  --pg-sale-border: #d5dde8;
  --pg-sale-muted: #5a6b7d;
  --rv-sale-accent: #062b5b;
  --rv-sale-accent-soft: #eaf3fa;
}

/* ------------------------------------------------------------------
 * Shell: restore Residential Dense Trust toolbar / filter panel chrome.
 * Neutralize sale-public + prior V2 overrides that diverged (12px/8px panel,
 * taller toolbar padding, missing shadow).
 * ------------------------------------------------------------------ */
body.sale-page.listings-page .bayut-serp__toolbar[data-sale-toolbar],
body.sale-page.listings-page.bayut-serp-page .bayut-serp__toolbar[data-sale-toolbar] {
  position: static;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  min-height: 48px;
  padding: 7px 10px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #d7e0ea;
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(10, 16, 32, 0.06);
}

body.sale-page.listings-page .bayut-serp__toolbar-actions {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

body.sale-page.listings-page .bayut-serp__count[data-sale-count] {
  margin: 0;
  color: #5a6b7d;
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
  min-height: 38px;
  max-width: min(100%, 352px);
  display: flex;
  align-items: center;
  white-space: nowrap;
  overflow: hidden;
}

body.sale-page.listings-page.bayut-serp-page .bayut-serp__toolbar .bayut-sort.filter-select,
body.sale-page.listings-page.bayut-serp-page .bayut-serp__toolbar .filter-select--sort {
  position: relative;
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  min-height: 0;
  max-width: 16rem;
  margin: 0;
}

body.sale-page.listings-page.bayut-serp-page .bayut-serp__toolbar .bayut-sort.filter-select::after,
body.sale-page.listings-page.bayut-serp-page .bayut-serp__toolbar .filter-select--sort::after {
  content: none !important;
  display: none !important;
}

body.sale-page.listings-page.bayut-serp-page .bayut-serp__toolbar .bayut-sort__label {
  display: inline-block !important;
  margin: 0;
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #5a697b;
  white-space: nowrap;
}

/* Desktop sidebar filter panel = Residential A2B chrome (14px / 16–18 pad). */
@media (min-width: 901px) {
  body.sale-page.listings-page.bayut-serp-page .bayut-serp__sidebar .bayut-filter-panel {
    background: #fff;
    border: 1px solid #e4e8ee;
    border-radius: 14px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 8px 22px rgba(16, 24, 40, 0.05);
    padding: 16px 16px 18px;
  }

  body.sale-page.listings-page.bayut-serp-page .bayut-serp__sidebar .bayut-filter-panel__head {
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eef1f4;
  }
}

body.sale-page.listings-page.bayut-serp-page .bayut-filter-panel > .bayut-filter-field,
body.sale-page.listings-page.bayut-serp-page .bayut-filter-panel > .bayut-filter-fieldset,
body.sale-page.listings-page.bayut-serp-page .bayut-filter-panel > .bayut-filter-check {
  margin-bottom: 14px;
  padding-top: 0;
  gap: 6px;
}

body.sale-page.listings-page.bayut-serp-page .bayut-filter-label {
  margin-bottom: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #243040;
}

/* ------------------------------------------------------------------
 * Category segmentor — Residential geometry, Sale navy active.
 * ------------------------------------------------------------------ */
body.sale-page.listings-page .pg-sale-type-channel.pg-for-rent-channel {
  margin: 0 0 16px;
}

body.sale-page.listings-page .pg-sale-type-channel .pg-for-rent-channel__tab:hover {
  color: var(--pg-sale-navy-deep) !important;
  background: rgba(6, 43, 91, 0.08);
}

body.sale-page.listings-page .pg-sale-type-channel .pg-for-rent-channel__tab.is-active {
  background: var(--pg-sale-navy);
  color: #fff !important;
  box-shadow: 0 1px 2px rgba(6, 43, 91, 0.16);
}

body.sale-page.listings-page .pg-sale-type-channel .pg-for-rent-channel__tab.is-active:hover {
  background: var(--pg-sale-navy-deep);
  color: #fff !important;
}

body.sale-page.listings-page .pg-sale-type-channel .pg-for-rent-channel__tab.is-active .pg-for-rent-channel__count {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

body.sale-page.listings-page .pg-sale-type-channel .pg-for-rent-channel__tab:focus-visible {
  outline: 2px solid var(--pg-sale-navy);
  outline-offset: 2px;
}

/* ------------------------------------------------------------------
 * Needs bar — Residential row geometry; Sale blue CTA.
 * ------------------------------------------------------------------ */
body.sale-page.listings-page.bayut-serp-page .rv-needs-bar[data-buying-needs-bar] {
  margin: 0 0 8px;
  padding: 6px 10px;
  min-height: 0;
  gap: 6px 12px;
  border: 1px solid #d7e0ea;
  border-radius: 8px;
  background: #fff;
}

body.sale-page.listings-page.bayut-serp-page .rv-needs-bar[data-buying-needs-bar] .rv-needs-bar__invite {
  display: none;
}

body.sale-page.listings-page.bayut-serp-page .rv-needs-bar[data-buying-needs-bar] .rv-needs-bar__title {
  font-size: 0.84rem;
  font-weight: 700;
  color: #152028;
}

body.sale-page.listings-page.bayut-serp-page .rv-needs-bar[data-buying-needs-bar] .rv-needs-bar__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--pg-sale-navy);
  border-radius: 12px;
  color: #0a3a72;
  font-size: 0.8rem;
  font-weight: 700;
  background: var(--pg-sale-pale);
  box-shadow: 0 1px 2px rgba(10, 16, 32, 0.06);
}

body.sale-page.listings-page.bayut-serp-page .rv-needs-bar[data-buying-needs-bar] .rv-needs-bar__cta:hover,
body.sale-page.listings-page.bayut-serp-page .rv-needs-bar[data-buying-needs-bar] .rv-needs-bar__cta:focus-visible {
  background: var(--pg-sale-light);
  border-color: var(--pg-sale-navy-deep);
  color: var(--pg-sale-navy-deep);
}

body.sale-page.listings-page.bayut-serp-page .rv-needs-bar[data-buying-needs-bar] .rv-needs-bar__cta:focus-visible {
  outline: 2px solid var(--pg-sale-blue-mid);
  outline-offset: 2px;
}

body.sale-page.listings-page.bayut-serp-page .rv-needs-bar[data-buying-needs-bar] .rv-needs-bar__cta .icon {
  width: 14px;
  height: 14px;
  color: var(--pg-sale-navy);
}

/* ------------------------------------------------------------------
 * View toggle / Saved chip — beat body.listings-page emerald (0,3,1).
 * ------------------------------------------------------------------ */
/* View toggle — Residential geometry; Sale soft active (no border crush). */
body.sale-page.listings-page.bayut-serp-page .bayut-view-toggle__btn:hover {
  color: var(--pg-sale-navy);
  background: var(--pg-sale-light);
}

body.sale-page.listings-page.bayut-serp-page .bayut-view-toggle__btn.is-active,
body.sale-page.listings-page.bayut-serp-page .bayut-view-toggle__btn[aria-pressed="true"] {
  background: var(--pg-sale-light);
  color: var(--pg-sale-navy);
  box-shadow: none;
}

body.sale-page.listings-page.bayut-serp-page .bayut-view-toggle__btn:focus-visible {
  outline: 2px solid var(--pg-sale-navy);
  outline-offset: -2px;
  z-index: 1;
}

/*
 * Saved chip — match Residential Dense Trust compact chip geometry exactly.
 * Sale navy only for active / focus (not a heavy navy outline at rest).
 */
body.sale-page.listings-page.bayut-serp-page .bayut-serp__toolbar-actions .bayut-saved-chip {
  appearance: none;
  -webkit-appearance: none;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  gap: 5px;
  min-height: 28px;
  height: auto;
  max-height: none;
  padding: 3px 7px;
  border: 1px solid #d7dee6;
  border-radius: 8px;
  background: #f5f7f9;
  color: #062b5b;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 650;
  line-height: 1.2;
  white-space: nowrap;
  box-shadow: none;
  filter: none;
}

body.sale-page.listings-page.bayut-serp-page .bayut-serp__toolbar-actions .bayut-saved-chip .icon,
body.sale-page.listings-page.bayut-serp-page .bayut-serp__toolbar-actions .bayut-saved-chip .rv-save-heart {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  color: inherit;
}

body.sale-page.listings-page.bayut-serp-page .bayut-serp__toolbar-actions .bayut-saved-chip:hover {
  border-color: #c5ced8;
  background: #eef2f5;
  color: #062b5b;
  box-shadow: none;
}

body.sale-page.listings-page.bayut-serp-page .bayut-serp__toolbar-actions .bayut-saved-chip:focus-visible {
  outline: 2px solid rgba(47, 111, 173, 0.45);
  outline-offset: 2px;
  box-shadow: none;
}

body.sale-page.listings-page.bayut-serp-page .bayut-serp__toolbar-actions .bayut-saved-chip.is-active,
body.sale-page.listings-page.bayut-serp-page .bayut-serp__toolbar-actions .bayut-saved-chip[aria-pressed="true"] {
  background: var(--pg-sale-navy);
  border-color: var(--pg-sale-navy-deep);
  color: #fff;
  box-shadow: 0 1px 2px rgba(6, 43, 91, 0.18);
}

body.sale-page.listings-page.bayut-serp-page .bayut-serp__toolbar-actions .bayut-saved-chip.is-active .icon,
body.sale-page.listings-page.bayut-serp-page .bayut-serp__toolbar-actions .bayut-saved-chip[aria-pressed="true"] .icon {
  color: #fff;
}

body.sale-page.listings-page.bayut-serp-page .bayut-serp__toolbar-actions .bayut-saved-chip.is-active:hover,
body.sale-page.listings-page.bayut-serp-page .bayut-serp__toolbar-actions .bayut-saved-chip.is-active:focus-visible,
body.sale-page.listings-page.bayut-serp-page .bayut-serp__toolbar-actions .bayut-saved-chip[aria-pressed="true"]:hover,
body.sale-page.listings-page.bayut-serp-page .bayut-serp__toolbar-actions .bayut-saved-chip[aria-pressed="true"]:focus-visible {
  background: var(--pg-sale-navy-deep);
  border-color: #031632;
  color: #fff;
  box-shadow: 0 1px 2px rgba(6, 43, 91, 0.22);
}

/* Result count — Residential Dense Trust typography/alignment */
body.sale-page.listings-page.bayut-serp-page .bayut-serp__count[data-sale-count] {
  margin: 0;
  color: #5a6b7d;
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
  min-height: 38px;
  max-width: min(100%, 352px);
  display: flex;
  align-items: center;
  white-space: nowrap;
  overflow: hidden;
}

/* Sort — Residential custom-select row geometry; prevent label wrap */
body.sale-page.listings-page.bayut-serp-page .bayut-serp__toolbar .bayut-sort .custom-select-menu,
body.sale-page.listings-page.bayut-serp-page .bayut-serp__toolbar .listing-custom-select .custom-select-menu {
  min-width: 100%;
  width: max(100%, 260px);
  padding: 6px;
  border: 1px solid #d7e0ea;
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(10, 16, 32, 0.1);
  background: #fff;
}

body.sale-page.listings-page.bayut-serp-page .bayut-serp__toolbar .bayut-sort .custom-select-menu button,
body.sale-page.listings-page.bayut-serp-page .bayut-serp__toolbar .listing-custom-select .custom-select-menu button {
  min-height: 38px;
  height: auto;
  padding: 9px 10px;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
  text-align: left;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--heading, #142033);
}

body.sale-page.listings-page.bayut-serp-page .bayut-serp__toolbar .bayut-sort .custom-select-menu button:hover,
body.sale-page.listings-page.bayut-serp-page .bayut-serp__toolbar .listing-custom-select .custom-select-menu button:hover {
  background: var(--pg-sale-light);
  color: var(--pg-sale-navy);
}

body.sale-page.listings-page.bayut-serp-page .bayut-serp__toolbar .bayut-sort .custom-select-menu button.is-selected,
body.sale-page.listings-page.bayut-serp-page .bayut-serp__toolbar .listing-custom-select .custom-select-menu button.is-selected {
  background: var(--pg-sale-light);
  color: var(--pg-sale-navy);
  font-weight: 700;
}

body.sale-page.listings-page.bayut-serp-page .bayut-serp__toolbar .bayut-sort .custom-select-trigger:focus-visible,
body.sale-page.listings-page.bayut-serp-page .bayut-serp__toolbar .bayut-sort .custom-select-menu button:focus-visible,
body.sale-page.listings-page.bayut-serp-page .bayut-serp__toolbar .listing-custom-select .custom-select-menu button:focus-visible {
  outline: 2px solid var(--pg-sale-navy);
  outline-offset: 2px;
}

/* ------------------------------------------------------------------
 * Filter controls — compact chips, Sale focus, blue histogram.
 * ------------------------------------------------------------------ */
body.sale-page.listings-page.bayut-serp-page .bayut-filter-field--pills .bayut-filter-pills,
body.sale-page.listings-page.bayut-serp-page .bayut-filter-pills--compact {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

body.sale-page.listings-page.bayut-serp-page .bayut-filter-pills--compact .bayut-filter-pill,
body.sale-page.listings-page.bayut-serp-page .bayut-filter-field--pills .bayut-filter-pill {
  flex: 0 0 auto;
  min-height: 28px;
  padding: 3px 7px;
  font-size: 0.72rem;
  font-weight: 650;
  border-radius: 8px;
  border: 1px solid #d7dee6;
  background: #f5f7f9;
  color: #24303a;
  box-shadow: none;
}

body.sale-page.listings-page.bayut-serp-page .bayut-filter-pills--compact .bayut-filter-pill:hover,
body.sale-page.listings-page.bayut-serp-page .bayut-filter-field--pills .bayut-filter-pill:hover {
  border-color: rgba(6, 43, 91, 0.35);
  color: var(--pg-sale-navy);
  background: #fff;
}

body.sale-page.listings-page.bayut-serp-page .bayut-filter-pills--compact .bayut-filter-pill.is-active,
body.sale-page.listings-page.bayut-serp-page .bayut-filter-field--pills .bayut-filter-pill.is-active,
body.sale-page.listings-page.bayut-serp-page .bayut-filter-pills--compact .bayut-filter-pill[aria-pressed="true"],
body.sale-page.listings-page.bayut-serp-page .bayut-filter-field--pills .bayut-filter-pill[aria-pressed="true"] {
  background: var(--pg-sale-navy);
  border-color: var(--pg-sale-navy-deep);
  color: #fff;
  box-shadow: none;
}

body.sale-page.listings-page.bayut-serp-page .bayut-filter-pills--compact .bayut-filter-pill.is-active:hover,
body.sale-page.listings-page.bayut-serp-page .bayut-filter-field--pills .bayut-filter-pill.is-active:hover {
  background: var(--pg-sale-navy-deep);
  color: #fff;
}

body.sale-page.listings-page.bayut-serp-page .bayut-filter-pills--compact .bayut-filter-pill:focus-visible,
body.sale-page.listings-page.bayut-serp-page .bayut-filter-field--pills .bayut-filter-pill:focus-visible {
  outline: 2px solid var(--pg-sale-blue-mid);
  outline-offset: 2px;
}

/* Search: single-layer Sale blue focus (never emerald). */
body.sale-page.listings-page.bayut-serp-page .bayut-filter-field--search .bayut-filter-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid #dbe1e8;
  border-radius: 10px;
  background: #fbfcfd;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

body.sale-page.listings-page.bayut-serp-page .bayut-filter-field--search .bayut-filter-input-wrap:focus-within {
  border-color: var(--pg-sale-blue-mid);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(47, 111, 173, 0.18);
}

body.sale-page.listings-page.bayut-serp-page .bayut-filter-field--search .bayut-filter-input-wrap .icon {
  width: 16px;
  height: 16px;
  color: #5a697b;
}

body.sale-page.listings-page.bayut-serp-page .bayut-filter-field select:focus,
body.sale-page.listings-page.bayut-serp-page .bayut-filter-field input:focus,
body.sale-page.listings-page.bayut-serp-page .bayut-sort select:focus,
body.sale-page.listings-page.bayut-serp-page .listing-custom-select .custom-select-trigger:focus,
body.sale-page.listings-page.bayut-serp-page .listing-custom-select.is-open .custom-select-trigger {
  border-color: var(--pg-sale-blue-mid);
  box-shadow: 0 0 0 3px rgba(47, 111, 173, 0.16);
}

body.sale-page.listings-page.bayut-serp-page .bayut-filter-clear {
  color: var(--pg-sale-blue);
}

/* Recently confirmed — keep genuine checkbox; match Dense Trust check chrome. */
body.sale-page.listings-page.bayut-serp-page .bayut-filter-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid #e3e8ef;
  border-radius: 10px;
  background: var(--pg-sale-pale);
  color: #243040;
  font-size: 0.78rem;
  line-height: 1.35;
}

body.sale-page.listings-page.bayut-serp-page .bayut-filter-check:has(input:checked) {
  border-color: var(--pg-sale-navy);
  background: var(--pg-sale-light);
  color: var(--pg-sale-navy);
}

body.sale-page.listings-page.bayut-serp-page .bayut-filter-check input[type="checkbox"] {
  accent-color: var(--pg-sale-navy);
  margin-top: 2px;
}

/* Asking-price histogram — Sale blue bars/fill/handles (Residential proportions). */
body.sale-page.listings-page.bayut-serp-page .bayut-price-range__bar {
  background: rgba(47, 111, 173, 0.28);
}

body.sale-page.listings-page.bayut-serp-page .bayut-price-range__bar.is-active,
body.sale-page.listings-page.bayut-serp-page .bayut-price-range__bar[data-active="1"] {
  background: rgba(6, 43, 91, 0.55);
}

body.sale-page.listings-page.bayut-serp-page .bayut-price-range__fill {
  background: var(--pg-sale-blue-mid);
}

body.sale-page.listings-page.bayut-serp-page .bayut-price-range__input::-webkit-slider-thumb {
  border: 2px solid var(--pg-sale-navy);
  background: #fff;
}

body.sale-page.listings-page.bayut-serp-page .bayut-price-range__input::-moz-range-thumb {
  border: 2px solid var(--pg-sale-navy);
  background: #fff;
}

body.sale-page.listings-page.bayut-serp-page .bayut-price-range__input:focus-visible::-webkit-slider-thumb {
  outline: 2px solid rgba(47, 111, 173, 0.45);
  outline-offset: 2px;
}

body.sale-page.listings-page.bayut-serp-page .bayut-price-range__input:focus-visible::-moz-range-thumb {
  outline: 2px solid rgba(47, 111, 173, 0.45);
  outline-offset: 2px;
}

/* ------------------------------------------------------------------
 * Card + agent rail — full-height Dense Trust list anatomy.
 * Root cause of blank space: sale-public margin-top:auto on list grid item.
 * ------------------------------------------------------------------ */
@media (min-width: 1025px) {
  body.sale-page.listings-page .bayut-serp__results[data-view-mode="list"] .bayut-card--sale {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr) 192px;
    align-items: stretch;
    min-height: 200px;
  }
}

body.sale-page.listings-page.bayut-serp-page .bayut-card--sale .bayut-card__agent {
  margin-top: 0;
  align-self: stretch;
  height: auto;
  min-height: 0;
  border-top: 0;
  background: var(--surface-warm, #f5f7fc);
}

body.sale-page.listings-page.bayut-serp-page .bayut-serp__results[data-view-mode="list"] .bayut-card--sale .bayut-card__agent {
  margin-top: 0;
  align-self: stretch;
  height: auto;
  /* QA-03: never use min-height:100% on stacked mobile list cards — it inflates the
     agent rail to the full card height, then overflow:hidden clips Listed-by chrome. */
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 10px;
  padding: 12px 10px;
  background: var(--surface-warm, #f5f7fc);
  border-top: 0;
  border-left: 1px solid #ececec;
}

/* Desktop Dense Trust rail only — stretch the side column to match media/body height. */
@media (min-width: 1025px) {
  body.sale-page.listings-page.bayut-serp-page .bayut-serp__results[data-view-mode="list"] .bayut-card--sale .bayut-card__agent {
    min-height: 100%;
  }
}

/* QA-03 Buy cards — stacked list/grid geometry: keep agency block + CTAs inside the card. */
@media (max-width: 1024px) {
  body.sale-page.listings-page.bayut-serp-page .bayut-serp__results[data-view-mode="list"] .bayut-card--sale,
  body.sale-page.listings-page.bayut-serp-page .bayut-serp__results[data-view-mode="grid"] .bayut-card--sale {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    height: auto;
    min-height: 0;
    align-items: stretch;
  }

  body.sale-page.listings-page.bayut-serp-page .bayut-serp__results[data-view-mode="list"] .bayut-card--sale .bayut-card__agent,
  body.sale-page.listings-page.bayut-serp-page .bayut-serp__results[data-view-mode="grid"] .bayut-card--sale .bayut-card__agent {
    min-height: 0 !important;
    height: auto !important;
    flex: 0 0 auto;
    justify-content: flex-start;
    border-left: 0;
    border-top: 1px solid #ececec;
  }

  body.sale-page.listings-page.bayut-serp-page .bayut-card--sale .bayut-card__agent-brand {
    flex: 0 1 auto;
    align-items: center;
    height: auto;
    min-height: 0;
  }
}

/* Grid: match Residential Dense Trust footer — compact row, brand + CTAs side-by-side.
   Do NOT use min-height:100% / column stretch here (that created the empty grey brand band). */
body.sale-page.listings-page.bayut-serp-page .bayut-serp__results[data-view-mode="grid"] .bayut-card--sale .bayut-card__agent {
  margin-top: auto;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  height: auto;
  min-height: 0;
  padding: 10px 14px 12px;
  background: #fafbfd;
  border-top: 1px solid rgba(227, 232, 241, 0.9);
  opacity: 0.88;
}

body.sale-page.listings-page.bayut-serp-page .bayut-serp__results[data-view-mode="grid"] .bayut-card--sale .bayut-card__agent-brand {
  min-width: 0;
  flex: 1 1 0;
  max-width: 100%;
  align-items: center;
}

body.sale-page.listings-page.bayut-serp-page .bayut-serp__results[data-view-mode="grid"] .bayut-card--sale .bayut-card__agent-brand-copy {
  min-width: 0;
  flex: 1 1 auto;
  max-width: 100%;
}

body.sale-page.listings-page.bayut-serp-page .bayut-serp__results[data-view-mode="grid"] .bayut-card--sale .bayut-card__agent-brand strong,
body.sale-page.listings-page.bayut-serp-page .bayut-serp__results[data-view-mode="grid"] .bayut-card--sale .lister-brand-name,
body.sale-page.listings-page.bayut-serp-page .bayut-serp__results[data-view-mode="grid"] .bayut-card--sale .lister-brand-name-link {
  font-size: 0.76rem;
  font-weight: 600;
  color: #6a7884;
  white-space: normal;
  overflow: visible;
  overflow-wrap: anywhere;
}

body.sale-page.listings-page.bayut-serp-page .bayut-serp__results[data-view-mode="grid"] .bayut-card--sale .lister-brand-eyebrow {
  font-size: 0.64rem;
}

body.sale-page.listings-page.bayut-serp-page .bayut-serp__results[data-view-mode="grid"] .bayut-card--sale .lister-brand-logo {
  width: 36px !important;
  height: 36px !important;
  flex-shrink: 0;
}

body.sale-page.listings-page.bayut-serp-page .bayut-serp__results[data-view-mode="grid"] .bayut-card--sale .bayut-card__agent-actions:not(.bayut-card__agent-actions--single) {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  width: auto;
  min-width: 0;
  flex: 0 1 auto;
  max-width: 48%;
}

body.sale-page.listings-page.bayut-serp-page .bayut-serp__results[data-view-mode="grid"] .bayut-card--sale .bayut-card__agent-actions .bayut-btn {
  width: 100%;
  min-height: 36px;
  padding: 8px 10px;
  font-size: 0.8125rem;
  font-weight: 700;
  border-radius: 4px;
  white-space: nowrap;
}

@media (max-width: 560px) {
  body.sale-page.listings-page.bayut-serp-page .bayut-serp__results[data-view-mode="grid"] .bayut-card--sale .bayut-card__agent {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  body.sale-page.listings-page.bayut-serp-page .bayut-serp__results[data-view-mode="grid"] .bayut-card--sale .bayut-card__agent-actions:not(.bayut-card__agent-actions--single) {
    width: 100%;
    max-width: none;
    flex: 0 0 auto;
    grid-template-columns: 1fr 1fr !important;
  }
}

body.sale-page.listings-page.bayut-serp-page .bayut-card--sale .bayut-card__body {
  gap: 0;
  padding: 15px 16px 13px;
}

/* Match Residential Dense Trust information hierarchy (Sale navy price only). */
body.sale-page.listings-page.bayut-serp-page .bayut-card--sale .bayut-card__price-row {
  margin: 0 0 6px;
}

body.sale-page.listings-page.bayut-serp-page .bayut-card--sale .bayut-card__price,
body.sale-page.listings-page.bayut-serp-page .bayut-card--sale .bayut-card__price strong {
  margin: 0;
  color: var(--pg-sale-navy);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

body.sale-page.listings-page.bayut-serp-page .bayut-serp__results[data-view-mode="list"] .bayut-card--sale .bayut-card__location {
  margin: 0 0 4px;
  color: #1c2734;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.3;
}

/* Location pin — Sale blue (never Residential emerald). Targets sprite + Dense Trust pin. */
body.sale-page.listings-page.bayut-serp-page .bayut-card--sale .bayut-card__location .icon,
body.sale-page.listings-page.bayut-serp-page .bayut-card--sale .bayut-card__location-pin,
body.sale-page.listings-page.bayut-serp-page .bayut-card--sale .bayut-card__location .icon.bayut-card__location-pin {
  color: var(--pg-sale-blue-mid);
  stroke: currentColor;
  stroke-width: 1.75 !important;
  fill: none !important;
  opacity: 1;
}

/* Recently Confirmed — light-blue bg + darker blue text (Sale channel only). */
body.sale-page.listings-page.bayut-serp-page .bayut-card--sale .bayut-card__avail,
body.sale-page.listings-page.bayut-serp-page .bayut-card--sale .bayut-card__trust-row .bayut-card__avail {
  background: var(--pg-sale-light);
  color: var(--pg-sale-navy);
  border: 1px solid rgba(6, 43, 91, 0.08);
}

body.sale-page.listings-page.bayut-serp-page .bayut-card--sale .bayut-card__trust-row {
  margin: 0 0 4px;
}

body.sale-page.listings-page.bayut-serp-page .bayut-card--sale .bayut-card__specs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin: 4px 0 6px;
  row-gap: 6px;
  column-gap: 10px;
  color: #2a2a2a;
  font-size: 0.8125rem; /* 13px — match Residential */
  font-weight: 600;
  line-height: 1.45;
}

body.sale-page.listings-page.bayut-serp-page .bayut-card--sale .bayut-card__specs li {
  padding-inline: 10px;
  border-right: 1px solid #d8d8d8;
  max-width: 100%;
}

body.sale-page.listings-page.bayut-serp-page .bayut-card--sale .bayut-card__specs li:first-child {
  padding-left: 0;
}

body.sale-page.listings-page.bayut-serp-page .bayut-card--sale .bayut-card__specs li:last-child {
  border-right: none;
  padding-right: 0;
}

/*
 * Listing title — Residential Dense Trust presentational treatment.
 * CSS uppercase only; catalogue source string unchanged.
 * D1: use approved public --font-body (Plus Jakarta via propglen-typography).
 */
body.sale-page.listings-page.bayut-serp-page .bayut-card--sale .bayut-card__title,
body.sale-page.listings-page.bayut-serp-page .bayut-card--sale .bayut-card__title a {
  text-transform: uppercase;
  letter-spacing: -0.015em;
  overflow-wrap: anywhere;
  word-break: normal;
}

body.sale-page.listings-page.bayut-serp-page .bayut-serp__results[data-view-mode="list"] .bayut-card--sale .bayut-card__title,
body.sale-page.listings-page.bayut-serp-page .bayut-serp__results[data-view-mode="list"] .bayut-card--sale .bayut-card__title a {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  margin: 0 0 2px;
  color: #5a697b; /* match Residential rendered title link */
  font-family: var(--font-body);
  font-size: 0.8rem; /* 12.8px — match Residential rendered size */
  font-weight: 600;
  line-height: 1.3;
  max-height: calc(1.3em * 2);
  text-transform: uppercase;
}

body.sale-page.listings-page.bayut-serp-page .bayut-serp__results[data-view-mode="grid"] .bayut-card--sale .bayut-card__title,
body.sale-page.listings-page.bayut-serp-page .bayut-serp__results[data-view-mode="grid"] .bayut-card--sale .bayut-card__title a {
  color: #5a697b;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.8rem;
  line-height: 1.3;
  letter-spacing: -0.015em;
  text-transform: uppercase;
}

/* Agency / location stay title-case presentation (never inherit title uppercase).
 * Inner .lister-brand-name-link.lister-brand-name--agency also needs an explicit
 * none — the shared style.css agency rule otherwise wins on the anchor alone. */
body.sale-page.listings-page.bayut-serp-page .bayut-card--sale .bayut-card__location,
body.sale-page.listings-page.bayut-serp-page .bayut-card--sale .lister-brand-name,
body.sale-page.listings-page.bayut-serp-page .bayut-card--sale .lister-brand-name--agency,
body.sale-page.listings-page.bayut-serp-page .bayut-card--sale .lister-brand-name-link,
body.sale-page.listings-page.bayut-serp-page .bayut-card--sale .lister-brand-name-link.lister-brand-name--agency,
body.sale-page.listings-page.bayut-serp-page .bayut-card--sale .bayut-card__agent-brand strong,
body.sale-page.listings-page.bayut-serp-page .bayut-card--sale .lister-brand-eyebrow {
  text-transform: none;
  letter-spacing: normal;
}

/* Restrained agency label — smaller/normal weight vs property title. */
body.sale-page.listings-page.bayut-serp-page .bayut-card--sale .lister-brand-name,
body.sale-page.listings-page.bayut-serp-page .bayut-card--sale .lister-brand-name--agency,
body.sale-page.listings-page.bayut-serp-page .bayut-card--sale .lister-brand-name-link,
body.sale-page.listings-page.bayut-serp-page .bayut-card--sale .lister-brand-name-link.lister-brand-name--agency,
body.sale-page.listings-page.bayut-serp-page .bayut-card--sale .bayut-card__agent-brand strong {
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.3;
  color: #5a697b;
}

/* D1 — Sale Discovery H1 / lede rhythm parity with Residential / Commercial. */
body.sale-page.listings-page.bayut-serp-page .bayut-serp__title[data-sale-h1],
body.sale-page.listings-page.bayut-serp-page h1.bayut-serp__title {
  margin: 0 0 6px;
  color: #062b5b;
  font-family: var(--font-body);
  font-size: clamp(1.35rem, 2.2vw, 1.7rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

body.sale-page.listings-page.bayut-serp-page .bayut-serp__lede,
body.sale-page.listings-page.bayut-serp-page .bayut-serp__intro p,
body.sale-page.listings-page.bayut-serp-page [data-sale-lede] {
  margin: 0 0 14px;
  color: #5a6b7d;
  font-size: 0.78rem;
  line-height: 1.45;
  max-width: 52rem;
}

@media (max-width: 900px) {
  body.sale-page.listings-page.bayut-serp-page .bayut-serp__title[data-sale-h1],
  body.sale-page.listings-page.bayut-serp-page h1.bayut-serp__title {
    font-size: 1.28rem;
  }

  body.sale-page.listings-page.bayut-serp-page .bayut-card--sale .bayut-card__title,
  body.sale-page.listings-page.bayut-serp-page .bayut-card--sale .bayut-card__title a {
    font-size: 0.78rem;
    line-height: 1.32;
  }

  body.sale-page.listings-page.bayut-serp-page .bayut-card--sale .bayut-card__agent-actions .bayut-btn {
    min-height: 40px;
  }
}

@media (max-width: 390px) {
  body.sale-page.listings-page.bayut-serp-page .bayut-serp__title[data-sale-h1],
  body.sale-page.listings-page.bayut-serp-page h1.bayut-serp__title {
    font-size: 1.18rem;
  }
}

/* Agent brand + CTAs */
body.sale-page.listings-page.bayut-serp-page .bayut-serp__results[data-view-mode="list"] .bayut-card--sale .bayut-card__agent-brand {
  gap: 6px;
  max-width: 100%;
}

body.sale-page.listings-page.bayut-serp-page .bayut-serp__results[data-view-mode="list"] .bayut-card--sale .lister-brand-eyebrow {
  font-size: 0.68rem;
  font-weight: 650;
  color: #6a7787;
}

body.sale-page.listings-page.bayut-serp-page .bayut-serp__results[data-view-mode="list"] .bayut-card--sale .bayut-card__agent-brand strong,
body.sale-page.listings-page.bayut-serp-page .bayut-serp__results[data-view-mode="list"] .bayut-card--sale .lister-brand-name {
  font-size: 0.77rem;
  font-weight: 700;
  line-height: 1.2;
  color: #333;
}

body.sale-page.listings-page.bayut-serp-page .bayut-card--sale .lister-brand-logo {
  width: 44px !important;
  height: 44px !important;
}

body.sale-page.listings-page.bayut-serp-page .bayut-card--sale .lister-brand-logo--initials {
  background: var(--pg-sale-navy) !important;
  border: 1px solid var(--pg-sale-navy) !important;
  color: #fff !important;
}

body.sale-page.listings-page.bayut-serp-page .bayut-card--sale .bayut-card__agent-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  width: 100%;
  flex: 0 0 auto;
}

body.sale-page.listings-page.bayut-serp-page .bayut-btn--sale-primary {
  background: var(--pg-sale-navy);
  border-color: var(--pg-sale-navy);
  color: #fff;
  box-shadow: none;
}

body.sale-page.listings-page.bayut-serp-page .bayut-btn--sale-primary:hover,
body.sale-page.listings-page.bayut-serp-page .bayut-btn--sale-primary:focus-visible {
  background: var(--pg-sale-navy-deep);
  border-color: var(--pg-sale-navy-deep);
  color: #fff;
  box-shadow: none;
}

body.sale-page.listings-page.bayut-serp-page .bayut-card--sale .bayut-card__agent-actions .bayut-btn {
  width: 100%;
  min-height: 36px;
  padding: 8px 10px;
  font-size: 0.8125rem;
  font-weight: 700;
  border-radius: 4px;
  box-shadow: none;
  transform: none;
}

body.sale-page.listings-page.bayut-serp-page .bayut-card--sale .bayut-card__agent-actions .bayut-btn--outline {
  color: var(--pg-sale-navy);
  background: #fff;
  border-color: var(--pg-sale-navy);
}

body.sale-page.listings-page.bayut-serp-page .bayut-card--sale .bayut-card__agent-actions .bayut-btn--outline:hover,
body.sale-page.listings-page.bayut-serp-page .bayut-card--sale .bayut-card__agent-actions .bayut-btn--outline:focus-visible {
  color: var(--pg-sale-navy);
  border-color: var(--pg-sale-navy);
  background: var(--pg-sale-light);
}

body.sale-page.listings-page.bayut-serp-page .bayut-card--sale .bayut-card__agent-actions .bayut-btn:focus-visible {
  outline: 2px solid var(--pg-sale-blue-mid);
  outline-offset: 2px;
}

/* ------------------------------------------------------------------
 * Map hold / empty states / popular searches spacing
 * ------------------------------------------------------------------ */
body.sale-page.listings-page [data-sale-map-workspace],
body.sale-page.listings-page .bayut-map-shell[data-sale-map-workspace] {
  display: none !important;
}

body.sale-page.listings-page .bayut-serp__map-hold[data-sale-map-hold] {
  margin: 0 0 14px;
  padding: 10px 12px;
  border: 1px solid #e3e8ef;
  border-radius: 8px;
  background: #f7f9fc;
  color: #4a5568;
  font-size: 0.84rem;
  line-height: 1.4;
}

body.sale-page.listings-page .bayut-serp__map-hold[hidden] {
  display: none !important;
}

body.sale-page.listings-page [data-sale-empty-filtered],
body.sale-page.listings-page [data-sale-empty],
body.sale-page.listings-page [data-sale-empty-fresh],
body.sale-page.listings-page [data-sale-empty-saved] {
  margin: 8px 0 20px;
  padding: 22px 18px;
  border: 1px solid #e3e8ef;
  border-radius: 12px;
  background: #fff;
}

body.sale-page.listings-page [data-sale-empty-filtered] > h2,
body.sale-page.listings-page [data-sale-empty] > h2,
body.sale-page.listings-page [data-sale-empty-filtered] .bayut-empty__recover-block > h2 {
  margin: 0 0 8px;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
  color: var(--heading, #0f1b2d);
}

body.sale-page.listings-page [data-sale-empty-filtered] > p,
body.sale-page.listings-page [data-sale-empty-filtered] .bayut-empty__recover-block > p {
  margin: 0 0 14px;
  color: #5a6b7d;
  font-size: 0.92rem;
  line-height: 1.45;
}

body.sale-page.listings-page [data-sale-empty-filtered] .bayut-empty__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

body.sale-page.listings-page .bayut-popular,
body.sale-page.listings-page [data-popular-searches],
body.sale-page.listings-page .bayut-serp__popular {
  margin-top: 24px;
}

@media (min-width: 901px) {
  body.sale-page.listings-page .bayut-toolbar-filters[data-sale-mobile-open] {
    display: none !important;
  }
}

@media (max-width: 900px) {
  body.sale-page.listings-page .bayut-toolbar-filters[data-sale-mobile-open] {
    display: inline-flex !important;
  }
}

/* ------------------------------------------------------------------
 * Buying needs modal — Residential .rv-needs-* architecture + Sale accents.
 * Shell dimensions/padding match Residential; only chrome colours differ.
 * ------------------------------------------------------------------ */
.rv-buying-needs-dialog.rv-needs-dialog {
  /* Same outer geometry as Residential; overflow visible so fixed menus are not clipped. */
  overflow: visible;
}

/* Sale has one extra field (land) — pin footer while fields scroll (Residential chrome otherwise). */
.rv-buying-needs-dialog .rv-needs-dialog__panel,
.rv-buying-needs-dialog .rv-buying-needs-dialog__panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-sizing: border-box;
  max-height: min(90vh, 42rem);
  padding: 18px 18px 16px;
  overflow: hidden;
  background: #fff;
}

.rv-buying-needs-dialog .rv-buying-needs-dialog__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  display: grid;
  gap: 12px;
}

.rv-buying-needs-dialog .rv-needs-dialog__head,
.rv-buying-needs-dialog .rv-needs-dialog__helper,
.rv-buying-needs-dialog .rv-needs-dialog__actions {
  flex: 0 0 auto;
}

.rv-buying-needs-dialog .rv-needs-dialog__close:focus-visible,
.rv-buying-needs-dialog .rv-needs-link:focus-visible,
.rv-buying-needs-dialog .rv-needs-select__trigger:focus-visible,
.rv-buying-needs-dialog .rv-needs-select__option:focus-visible,
.rv-buying-needs-dialog .rv-needs-input:focus-visible,
.rv-buying-needs-dialog .bayut-btn:focus-visible {
  outline: 2px solid rgba(47, 111, 173, 0.7);
  outline-offset: 2px;
}

.rv-buying-needs-dialog .rv-needs-select.is-open .rv-needs-select__trigger {
  border-color: var(--pg-sale-blue-mid, #2f6fad);
  box-shadow: 0 0 0 3px rgba(47, 111, 173, 0.16);
}

.rv-buying-needs-dialog .rv-needs-select__option:hover,
.rv-buying-needs-dialog .rv-needs-select__option.is-active {
  background: rgba(47, 111, 173, 0.1);
}

.rv-buying-needs-dialog .rv-needs-select__option[aria-selected="true"] {
  color: var(--pg-sale-navy, #062b5b);
  font-weight: 700;
  background: rgba(47, 111, 173, 0.14);
}

.rv-buying-needs-dialog .rv-needs-link {
  color: var(--pg-sale-blue, #1a4f8c);
}

.rv-buying-needs-dialog .rv-needs-link--from-filters {
  color: var(--pg-sale-blue, #1a4f8c);
  border: 1px solid rgba(47, 111, 173, 0.28);
  border-radius: 10px;
  background: var(--pg-sale-pale, #f4f8fc);
}

.rv-buying-needs-dialog .rv-needs-link--from-filters .icon {
  color: var(--pg-sale-blue-mid, #2f6fad);
}

.rv-buying-needs-dialog .rv-needs-link--from-filters:hover,
.rv-buying-needs-dialog .rv-needs-link--from-filters:focus-visible {
  color: var(--pg-sale-navy, #062b5b);
  border-color: rgba(47, 111, 173, 0.5);
  background: var(--pg-sale-light, #eaf3fa);
}

.rv-buying-needs-dialog .rv-needs-link--quiet {
  color: #8a6238;
}

.rv-buying-needs-dialog .rv-needs-from-filters-status[data-tone="ok"] {
  color: var(--pg-sale-navy, #062b5b);
  background: var(--pg-sale-light, #eaf3fa);
  border-color: #c5d8ea;
}

.rv-buying-needs-dialog .rv-needs-from-filters-status[data-tone="warn"] {
  color: #7a4e12;
  background: #fff7eb;
  border-color: #f0dfbf;
}

.rv-buying-needs-dialog .rv-needs-dialog__actions .bayut-btn--primary,
.rv-buying-needs-dialog .bayut-btn--primary {
  min-width: 7.5rem;
  min-height: 44px;
  margin-left: auto;
  border-radius: 12px;
  color: #fff;
  background: var(--pg-sale-navy, #062b5b);
  border-color: var(--pg-sale-navy, #062b5b);
  box-shadow: none;
}

.rv-buying-needs-dialog .rv-needs-dialog__actions .bayut-btn--primary:hover,
.rv-buying-needs-dialog .bayut-btn--primary:hover {
  background: var(--pg-sale-navy-deep, #041e42);
  border-color: var(--pg-sale-navy-deep, #041e42);
  color: #fff;
  box-shadow: none;
}

.rv-buying-needs-dialog .rv-needs-input {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  color: var(--heading, #142033);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 650;
  background: #fff;
  border: 1px solid #d4dbe8;
  border-radius: 12px;
  box-sizing: border-box;
}

.rv-buying-needs-dialog .rv-needs-input:focus {
  border-color: var(--pg-sale-blue-mid, #2f6fad);
  box-shadow: 0 0 0 3px rgba(47, 111, 173, 0.16);
  outline: none;
}

.rv-buying-needs-dialog .rv-buying-land {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 0.5rem;
  align-items: start;
}

.rv-buying-needs-dialog .rv-buying-land-note {
  margin: 0.35rem 0 0;
}

.rv-buying-needs-dialog .rv-needs-select__search {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 2px 2px 6px;
  background: #fff;
}

.rv-buying-needs-dialog .rv-needs-select__search-input {
  width: 100%;
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid #d4dbe8;
  border-radius: 10px;
  font: inherit;
  font-size: 0.88rem;
  box-sizing: border-box;
}

.rv-buying-needs-dialog .rv-needs-select__search-input:focus {
  border-color: var(--pg-sale-blue-mid, #2f6fad);
  box-shadow: 0 0 0 3px rgba(47, 111, 173, 0.16);
  outline: none;
}

.rv-buying-needs-dialog .rv-needs-select__empty {
  margin: 6px 8px;
}

@media (max-width: 520px) {
  .rv-buying-needs-dialog.rv-needs-dialog {
    width: calc(100vw - 16px);
    max-width: calc(100vw - 16px);
  }

  .rv-buying-needs-dialog .rv-needs-dialog__panel {
    padding: 14px 12px 12px;
  }
}

@media (max-width: 390px) {
  .rv-buying-needs-dialog .rv-buying-land {
    grid-template-columns: 1fr;
  }
}
