/* ================================================================
   PrimeArz — archive.css
   Zillow-style: sticky filter sidebar LEFT, results RIGHT
   ================================================================ */

/* ── Page wrapper ─────────────────────────────────────────────── */
.pr-archive { min-height: 60vh; }

/* ── Top filter bar (sticky) ──────────────────────────────────── */
.pr-filter-bar {
  background: #fff; border-bottom: 2px solid var(--pr-border);
  position: sticky; top: calc(var(--pr-header-h) + var(--pr-topbar-h));
  z-index: 80;
  box-shadow: 0 2px 12px rgba(0,0,0,.07);
  transition: top var(--pr-t);
}
html.night-mode .pr-filter-bar { background: var(--pr-bg); }
.is-webview .pr-filter-bar,
body:not(:has(.pr-topbar)) .pr-filter-bar { top: var(--pr-header-h); }

.pr-filter-bar__inner {
  display: flex; align-items: center; gap: 8px;
  padding: 10px var(--pr-gutter); flex-wrap: nowrap; overflow-x: auto;
  scrollbar-width: none;
}
.pr-filter-bar__inner::-webkit-scrollbar { display: none; }

/* Purpose pills */
.pr-filter-bar__purpose { display: flex; background: var(--pr-surface); border-radius: var(--pr-radius-sm); padding: 3px; flex-shrink: 0; }
.pr-purpose-pill {
  padding: 6px 18px; border-radius: 6px; font-size: 13px; font-weight: 700;
  color: var(--pr-text-muted); transition: all var(--pr-t); cursor: pointer; border: none;
}
.pr-purpose-pill.is-active { background: var(--pr-blue); color: #fff; }
.pr-purpose-pill:not(.is-active):hover { color: var(--pr-text); }

/* Filter chips */
.pr-filter-chip {
  display: flex; align-items: center; gap: 5px;
  height: 38px; padding: 0 14px; flex-shrink: 0;
  border: 2px solid var(--pr-border); border-radius: var(--pr-radius-sm);
  font-size: 13px; font-weight: 500; color: var(--pr-text);
  background: var(--pr-bg); cursor: pointer; transition: all var(--pr-t);
  white-space: nowrap;
}
.pr-filter-chip:hover { border-color: var(--pr-blue); color: var(--pr-blue); background: var(--pr-blue-light); }
.pr-filter-chip.is-set { border-color: var(--pr-blue); color: var(--pr-blue); background: var(--pr-blue-light); font-weight: 700; }
.pr-filter-chip svg { flex-shrink: 0; }
.pr-filter-chip__chevron { transition: transform var(--pr-t); }
.pr-filter-chip.is-open .pr-filter-chip__chevron { transform: rotate(180deg); }

/* Keyword search field */
.pr-filter-bar__search { position: relative; flex-shrink: 0; min-width: 200px; flex: 1; max-width: 320px; }
.pr-filter-bar__search input {
  width: 100%; height: 38px; padding: 0 14px 0 38px;
  border: 2px solid var(--pr-border); border-radius: var(--pr-radius-sm);
  font-size: 13px; background: var(--pr-bg); color: var(--pr-text); outline: none;
  transition: border-color var(--pr-t);
}
.pr-filter-bar__search input:focus { border-color: var(--pr-blue); }
.pr-filter-bar__search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--pr-text-muted); pointer-events: none; }
.pr-filter-bar__search-btn {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  height: 30px; padding: 0 12px; background: var(--pr-blue); color: #fff;
  border: none; border-radius: 6px; font-size: 12px; font-weight: 700; cursor: pointer;
  transition: background var(--pr-t);
}
.pr-filter-bar__search-btn:hover { background: var(--pr-blue-dark); }

/* More filters + clear */
.pr-filter-bar__more-btn {
  display: flex; align-items: center; gap: 5px;
  height: 38px; padding: 0 14px; flex-shrink: 0;
  border: 2px solid var(--pr-border); border-radius: var(--pr-radius-sm);
  font-size: 13px; font-weight: 600; color: var(--pr-text); background: var(--pr-bg);
  cursor: pointer; transition: all var(--pr-t); white-space: nowrap;
}
.pr-filter-bar__more-btn:hover { border-color: var(--pr-blue); color: var(--pr-blue); background: var(--pr-blue-light); }
.pr-filter-bar__more-btn.has-active { background: var(--pr-blue); border-color: var(--pr-blue); color: #fff; }
.pr-filter-bar__divider { width: 1px; height: 24px; background: var(--pr-border); flex-shrink: 0; }

/* ── Filter dropdowns (floating panels) ───────────────────────── */
.pr-filter-panel {
  position: absolute; top: calc(100% + 8px); left: 0;
  background: var(--pr-bg); border: 1px solid var(--pr-border);
  border-radius: var(--pr-radius); box-shadow: var(--pr-shadow-lg);
  padding: 16px; min-width: 280px; z-index: 300;
  animation: pr-fade-in .15s var(--pr-ease);
}
.pr-filter-panel[hidden] { display: none; }
.pr-filter-panel__title { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: var(--pr-text-muted); margin-bottom: 12px; }
.pr-filter-panel__row { display: flex; align-items: center; gap: 8px; }
.pr-filter-panel__sep { font-size: 12px; color: var(--pr-text-muted); flex-shrink: 0; }
.pr-filter-panel .pr-form-control { height: 40px; font-size: 13px; }
.pr-filter-panel__foot { display: flex; justify-content: flex-end; gap: 8px; padding-top: 12px; border-top: 1px solid var(--pr-border); margin-top: 12px; }

/* Pill picker (beds/baths) */
.pr-pill-row { display: flex; flex-wrap: wrap; gap: 6px; }
.pr-pill {
  height: 36px; padding: 0 14px; border: 2px solid var(--pr-border);
  border-radius: var(--pr-radius-sm); font-size: 13px; font-weight: 600;
  color: var(--pr-text-muted); cursor: pointer; transition: all var(--pr-t); background: var(--pr-bg);
}
.pr-pill:hover { border-color: var(--pr-blue); color: var(--pr-blue); }
.pr-pill.is-active { background: var(--pr-blue); border-color: var(--pr-blue); color: #fff; }

/* Amenity checkboxes */
.pr-amenity-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; }
.pr-amenity-item { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--pr-text); cursor: pointer; padding: 4px 0; }
.pr-amenity-check { width: 16px; height: 16px; accent-color: var(--pr-blue); cursor: pointer; }

/* ── Archive body layout ───────────────────────────────────────── */
.pr-archive__body { padding: 0; }
.pr-archive__layout { display: grid; grid-template-columns: var(--pr-sidebar-w) 1fr; min-height: 70vh; }

/* ── Left: results header + list ──────────────────────────────── */
.pr-archive__results { padding: 20px 24px; min-width: 0; }

.pr-results-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 18px; flex-wrap: wrap;
}
.pr-results-header__left h1 { font-family: 'Poppins', sans-serif; font-size: 18px; font-weight: 700; color: var(--pr-text); }
.pr-results-count { font-size: 13px; color: var(--pr-text-muted); margin-top: 2px; }
.pr-results-count strong { color: var(--pr-blue); font-weight: 700; }
.pr-results-header__right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* Sort */
.pr-sort { position: relative; }
.pr-sort select { height: 36px; font-size: 12px; padding: 0 32px 0 10px; border-radius: var(--pr-radius-sm); border: 1px solid var(--pr-border); color: var(--pr-text); background: var(--pr-bg); min-width: 150px; appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235A6A7E' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 9px center; cursor: pointer; outline: none; }

/* View toggle */
.pr-view-toggle { display: flex; border: 1px solid var(--pr-border); border-radius: var(--pr-radius-sm); overflow: hidden; }
.pr-view-btn { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; color: var(--pr-text-muted); transition: all var(--pr-t); cursor: pointer; background: var(--pr-bg); border: none; }
.pr-view-btn.is-active, .pr-view-btn:hover { background: var(--pr-blue); color: #fff; }

/* Save search */
.pr-save-search-btn { height: 36px; display: flex; align-items: center; gap: 6px; padding: 0 12px; border: 1px solid var(--pr-border); border-radius: var(--pr-radius-sm); font-size: 12px; font-weight: 600; color: var(--pr-text-muted); background: var(--pr-bg); cursor: pointer; transition: all var(--pr-t); }
.pr-save-search-btn:hover { border-color: var(--pr-blue); color: var(--pr-blue); }
.pr-save-search-btn.is-saved { color: var(--pr-blue); border-color: var(--pr-blue); background: var(--pr-blue-light); }

/* ── Property list (list mode) ────────────────────────────────── */
.pr-prop-list--list { display: flex; flex-direction: column; gap: 14px; }
.pr-prop-list--grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }

/* ── Property card — LIST mode ────────────────────────────────── */
.pr-prop-list--list .pr-card {
  display: grid; grid-template-columns: 280px 1fr;
  background: var(--pr-bg); border: 1px solid var(--pr-border);
  border-radius: var(--pr-radius); overflow: hidden;
  transition: box-shadow var(--pr-t), transform var(--pr-t), border-color var(--pr-t);
}
.pr-prop-list--list .pr-card:hover { box-shadow: var(--pr-shadow); transform: translateY(-2px); border-color: var(--pr-blue); }

/* ── Property card — GRID mode ────────────────────────────────── */
.pr-prop-list--grid .pr-card {
  display: flex; flex-direction: column;
  background: var(--pr-bg); border: 1px solid var(--pr-border);
  border-radius: var(--pr-radius); overflow: hidden;
  transition: box-shadow var(--pr-t), transform var(--pr-t), border-color var(--pr-t);
}
.pr-prop-list--grid .pr-card:hover { box-shadow: var(--pr-shadow); transform: translateY(-2px); border-color: var(--pr-blue); }
.pr-prop-list--grid .pr-card .pr-card__excerpt { display: none; }
.pr-prop-list--grid .pr-card .pr-card__body { flex: 1; display: flex; flex-direction: column; }
.pr-prop-list--grid .pr-card .pr-card__footer { margin-top: auto; }

/* ── Card image ───────────────────────────────────────────────── */
.pr-card__img-wrap {
  position: relative; overflow: hidden; background: var(--pr-surface);
  aspect-ratio: 16/10;
}
.pr-prop-list--list .pr-card__img-wrap { aspect-ratio: unset; height: 100%; min-height: 180px; }
.pr-card__img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s var(--pr-ease); display: block; }
.pr-card:hover .pr-card__img { transform: scale(1.04); }

/* Badges on image */
.pr-card__status {
  position: absolute; top: 10px; left: 10px;
  padding: 4px 10px; border-radius: var(--pr-radius-pill);
  font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em;
  color: #fff; z-index: 1;
}
.pr-card__status--buy { background: var(--pr-blue); }
.pr-card__status--rent { background: var(--pr-success); }

.pr-card__label {
  position: absolute; top: 10px; right: 44px;
  padding: 4px 10px; border-radius: var(--pr-radius-pill);
  font-size: 10px; font-weight: 800; color: #fff; z-index: 1;
}
.pr-card__fav {
  position: absolute; top: 8px; right: 8px; z-index: 1;
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255,255,255,.92); display: flex; align-items: center; justify-content: center;
  color: var(--pr-text-muted); box-shadow: var(--pr-shadow-xs);
  transition: all var(--pr-t); cursor: pointer; border: none;
}
.pr-card__fav:hover, .pr-card__fav.is-active { color: var(--pr-red); background: #fff; }
html.night-mode .pr-card__fav { background: rgba(13,27,42,.88); }

/* Photo count badge */
.pr-card__photo-count {
  position: absolute; bottom: 8px; left: 10px;
  display: flex; align-items: center; gap: 4px;
  background: rgba(0,0,0,.55); color: #fff; font-size: 11px; font-weight: 600;
  padding: 3px 9px; border-radius: var(--pr-radius-pill); z-index: 1;
}

/* ── Card body ────────────────────────────────────────────────── */
.pr-card__body { padding: 14px 16px 12px; }

.pr-card__price-line { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.pr-card__price { font-family: 'Poppins', sans-serif; font-size: 19px; font-weight: 800; color: var(--pr-text); line-height: 1.2; }
.pr-card__type { font-size: 11px; font-weight: 600; color: var(--pr-blue); background: var(--pr-blue-light); padding: 2px 8px; border-radius: var(--pr-radius-pill); flex-shrink: 0; white-space: nowrap; }

.pr-card__location { display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--pr-text-muted); margin-bottom: 8px; }
.pr-card__location svg { color: var(--pr-blue); flex-shrink: 0; }

.pr-card__specs { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 8px; }
.pr-card__spec { display: flex; align-items: center; gap: 5px; font-size: 13px; color: var(--pr-text); }
.pr-card__spec svg { color: var(--pr-text-muted); flex-shrink: 0; }
.pr-card__spec strong { font-weight: 700; }
.pr-card__spec small { color: var(--pr-text-muted); font-size: 11px; }

.pr-card__title { font-size: 14px; font-weight: 600; color: var(--pr-text); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; transition: color var(--pr-t); text-decoration: none !important; display: block; margin-bottom: 4px; }
.pr-card__title:hover { color: var(--pr-blue); }
.pr-card__excerpt { font-size: 12px; color: var(--pr-text-muted); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 8px; }

/* ── Card footer ──────────────────────────────────────────────── */
.pr-card__footer { display: flex; align-items: center; gap: 8px; padding-top: 10px; border-top: 1px solid var(--pr-border); margin-top: 10px; flex-wrap: wrap; }
.pr-card__added { display: flex; align-items: center; gap: 3px; font-size: 11px; color: var(--pr-text-light); flex-shrink: 0; }
.pr-card__cta-btns { display: flex; gap: 6px; margin-left: auto; }
.pr-card__wa-btn {
  width: 32px; height: 32px; border-radius: 50%; background: #25D366; color: #fff;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  text-decoration: none !important; transition: background var(--pr-t);
}
.pr-card__wa-btn:hover { background: #128C7E; }
.pr-card__call-btn {
  display: flex; align-items: center; gap: 5px; height: 32px; padding: 0 12px;
  border-radius: var(--pr-radius-sm); background: var(--pr-blue); color: #fff;
  font-size: 12px; font-weight: 700; text-decoration: none !important; transition: background var(--pr-t);
}
.pr-card__call-btn:hover { background: var(--pr-blue-dark); }
.pr-card__agent-thumb { width: 32px; height: 32px; border-radius: 50%; overflow: hidden; border: 2px solid var(--pr-border); flex-shrink: 0; transition: border-color var(--pr-t); }
.pr-card__agent-thumb:hover { border-color: var(--pr-blue); }
.pr-card__agent-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* ── Right sidebar (archive) ──────────────────────────────────── */
.pr-archive__sidebar {
  border-left: 1px solid var(--pr-border);
  background: var(--pr-bg-alt);
  position: sticky; top: calc(var(--pr-header-h) + var(--pr-topbar-h) + 56px);
  height: calc(100vh - var(--pr-header-h) - var(--pr-topbar-h) - 56px);
  overflow-y: auto; display: flex; flex-direction: column; gap: 0;
}
.pr-archive__sidebar-inner { padding: 20px; display: flex; flex-direction: column; gap: 20px; }
.pr-sidebar-widget { background: var(--pr-bg); border: 1px solid var(--pr-border); border-radius: var(--pr-radius); overflow: hidden; }
.pr-sidebar-widget__title { font-size: 13px; font-weight: 700; color: var(--pr-text); padding: 12px 16px; border-bottom: 1px solid var(--pr-border); text-transform: uppercase; letter-spacing: .05em; }
.pr-sidebar-featured { padding: 4px 0; }
.pr-sidebar-featured-item { display: flex; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--pr-border); text-decoration: none !important; transition: background var(--pr-t); }
.pr-sidebar-featured-item:last-child { border-bottom: none; }
.pr-sidebar-featured-item:hover { background: var(--pr-blue-light); }
.pr-sidebar-featured-item img { width: 62px; height: 48px; object-fit: cover; border-radius: 6px; flex-shrink: 0; }
.pr-sidebar-feat-price { font-size: 13px; font-weight: 800; color: var(--pr-blue); }
.pr-sidebar-feat-title { font-size: 12px; font-weight: 600; color: var(--pr-text); line-height: 1.3; margin: 2px 0; }
.pr-sidebar-feat-loc { font-size: 11px; color: var(--pr-text-muted); }
.pr-sidebar-agent-cta { padding: 16px; text-align: center; }
.pr-sidebar-agent-cta p { font-size: 13px; color: var(--pr-text-muted); margin-bottom: 12px; line-height: 1.5; }

/* No results */
.pr-no-results { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 60px 24px; color: var(--pr-text-muted); text-align: center; }
.pr-no-results svg { opacity: .3; color: var(--pr-blue); }
.pr-no-results h3 { font-size: 18px; font-weight: 700; color: var(--pr-text); }
.pr-no-results p { font-size: 14px; max-width: 320px; }

/* ── Loading overlay ──────────────────────────────────────────── */
.pr-results-loading { position: absolute; inset: 0; background: rgba(var(--pr-bg), .7); backdrop-filter: blur(2px); display: flex; align-items: center; justify-content: center; z-index: 10; border-radius: var(--pr-radius); }

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 1100px) { .pr-archive__layout { grid-template-columns: 1fr; } .pr-archive__sidebar { display: none; } }
@media (max-width: 768px) {
  .pr-prop-list--list .pr-card { grid-template-columns: 1fr; }
  .pr-prop-list--list .pr-card__img-wrap { aspect-ratio: 16/9; height: auto; }
  .pr-results-header { flex-direction: column; align-items: flex-start; gap: 10px; }
}
@media (max-width: 480px) {
  .pr-prop-list--grid { grid-template-columns: 1fr; }
  .pr-archive__results { padding: 14px 16px; }
}
