*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f7f5f2;
  color: #1a1a1a;
  min-height: 100vh;
}

/* ── Header ─────────────────────────────────────────── */
.site-header {
  background: #fff;
  border-bottom: 1px solid #ede9e3;
  padding: 0 32px;
  height: 80px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 0 #ede9e3;
}
.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}
.header-logo { width: 36px; height: 36px; }
.header-name {
  font-size: 17px;
  font-weight: 800;
  color: #1a1a1a;
  letter-spacing: -0.4px;
}
.header-tagline {
  font-size: 10px;
  color: #a0793c;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
  flex-shrink: 0;
}
.header-count {
  font-size: 13px;
  color: #999;
  white-space: nowrap;
}

/* ── Centred filter pill ─────────────────────────────── */
.header-filters {
  display: flex;
  justify-content: center;
  align-items: center;
}
.filter-bar-inner {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid #ddd;
  border-radius: 40px;
  background: #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  transition: box-shadow .2s;
}
.filter-bar-inner:hover {
  box-shadow: 0 3px 16px rgba(0,0,0,0.12);
}
.filter-segment {
  padding: 10px 32px;
  cursor: pointer;
  border-radius: 40px;
  min-width: 190px;
  position: relative;
  user-select: none;
  transition: background .15s;
}
.filter-segment:hover { background: #f2ede6; }
.filter-segment.open  { background: #f2ede6; }
.filter-segment.has-value .filter-seg-value {
  color: #1a1a1a;
  font-weight: 600;
}
.filter-seg-label {
  font-size: 10px;
  font-weight: 700;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 3px;
}
.filter-seg-value {
  font-size: 13px;
  color: #777;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}
.filter-sep {
  width: 1px;
  background: #e8e3dc;
  align-self: stretch;
  margin: 10px 0;
  flex-shrink: 0;
}

/* ── Search icon button (inside pill) ────────────────── */
.search-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 6px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: #1a1a1a;
  color: #fff;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .15s, transform .12s;
}
.search-icon-btn:hover {
  background: #a0793c;
  transform: scale(1.06);
}
.search-icon-btn svg { display: block; }

/* ── Dropdown panels ─────────────────────────────────── */
.filter-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 12px);
  left: 0;
  background: #fff;
  border: 1px solid #e0dbd3;
  border-radius: 18px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  padding: 14px 10px;
  min-width: 210px;
  z-index: 200;
}
.filter-dropdown.open { display: block; }
/* ── Dropdown search input ───────────────────────────── */
.dropdown-search-wrap {
  display: flex;
  align-items: center;
  gap: 7px;
  background: #f7f5f2;
  border: 1px solid #e8e3dc;
  border-radius: 10px;
  padding: 7px 10px;
  margin-bottom: 8px;
  transition: border-color .15s;
}
.dropdown-search-wrap:focus-within {
  border-color: #a0793c;
}
.dropdown-search-wrap svg { flex-shrink: 0; color: #bbb; }
.dropdown-search {
  border: none;
  background: none;
  outline: none;
  font-size: 13px;
  color: #1a1a1a;
  width: 100%;
}
.dropdown-search::placeholder { color: #ccc; }

.dropdown-title {
  font-size: 10px;
  font-weight: 700;
  color: #bbb;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 0 10px 8px;
}
.dropdown-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: background .12s;
  font-size: 14px;
  color: #333;
  user-select: none;
}
.dropdown-option:hover { background: #f7f5f2; }
.dropdown-option.selected { color: #7a5c28; }
.dropdown-check {
  width: 20px; height: 20px;
  border: 2px solid #ddd;
  border-radius: 6px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: transparent;
  transition: all .12s;
}
.dropdown-option.selected .dropdown-check {
  background: #a0793c;
  border-color: #a0793c;
  color: #fff;
}

/* ── Clear button ────────────────────────────────────── */
.clear-btn {
  font-size: 12px;
  font-weight: 600;
  color: #666;
  cursor: pointer;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid #ddd;
  background: #fff;
  display: none;
  white-space: nowrap;
  transition: all .15s;
}
.clear-btn.visible { display: block; }
.clear-btn:hover { border-color: #a0793c; color: #a0793c; }

/* ── Search row (slides in below header) ─────────────── */
.search-row {
  background: #fff;
  border-bottom: 1px solid #ede9e3;
  padding: 10px 32px;
  position: sticky;
  top: 80px;
  z-index: 99;
  display: none;
  animation: slideDown .18s ease;
}
.search-row.open { display: block; }
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.search-row-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f7f5f2;
  border: 1.5px solid #a0793c;
  border-radius: 12px;
  padding: 10px 16px;
  max-width: 520px;
  margin: 0 auto;
  box-shadow: 0 0 0 3px rgba(160,121,60,0.08);
}
.search-row-inner svg { flex-shrink: 0; color: #a0793c; }
.search-input {
  flex: 1;
  border: none;
  background: none;
  outline: none;
  font-size: 14px;
  color: #1a1a1a;
}
.search-input::placeholder { color: #bbb; }
.search-close-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #aaa;
  font-size: 16px;
  padding: 0 2px;
  line-height: 1;
  flex-shrink: 0;
}
.search-close-btn:hover { color: #555; }

/* ── Main content ────────────────────────────────────── */
.main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 32px 80px;
}

/* ── Results bar ─────────────────────────────────────── */
.results-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.results-count {
  font-size: 14px;
  color: #666;
}
.results-count strong { color: #1a1a1a; }

/* ── Property grid ───────────────────────────────────── */
.property-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

/* ── Property card ───────────────────────────────────── */
.prop-card {
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  transition: transform .18s, box-shadow .18s;
  border: 1px solid #ede9e3;
  text-decoration: none;
  color: inherit;
  display: block;
}
.prop-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.10);
}
.prop-card-photo {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  display: block;
  background: #ede9e3;
}
.prop-card-photo-placeholder {
  width: 100%;
  aspect-ratio: 4/3;
  background: linear-gradient(135deg, #ede9e3 0%, #e4dfd7 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  color: #c8bfb0;
}
.prop-card-body {
  padding: 14px 16px 16px;
}
.prop-card-name {
  font-size: 15px;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.prop-card-meta {
  font-size: 13px;
  color: #888;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.prop-card-dot { color: #ccc; }
.prop-card-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  background: #e8f5e9;
  color: #2e7d32;
}
.prop-card-badge.private { background: #e3f2fd; color: #1565c0; }

/* ── Empty state ─────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 80px 24px;
  color: #aaa;
  grid-column: 1 / -1;
}
.empty-state .emoji { font-size: 40px; margin-bottom: 16px; }
.empty-state h3 { font-size: 18px; font-weight: 700; color: #555; margin-bottom: 8px; }
.empty-state p { font-size: 14px; }

/* ── Loading skeleton ────────────────────────────────── */
.skeleton-card {
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid #ede9e3;
}
.skeleton-photo {
  width: 100%;
  aspect-ratio: 4/3;
  background: linear-gradient(90deg, #ede9e3 25%, #e4dfd7 50%, #ede9e3 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}
.skeleton-body { padding: 14px 16px 16px; }
.skeleton-line {
  height: 14px;
  border-radius: 6px;
  background: linear-gradient(90deg, #ede9e3 25%, #e4dfd7 50%, #ede9e3 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  margin-bottom: 8px;
}
.skeleton-line.short { width: 60%; }
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Mobile ──────────────────────────────────────────── */
@media (max-width: 860px) {
  .site-header {
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    height: auto;
    padding: 12px 16px;
    gap: 12px;
  }
  .header-filters {
    grid-column: 1 / -1;
    justify-content: stretch;
  }
  .filter-bar-inner { width: 100%; }
  .filter-segment { min-width: 0; flex: 1; padding: 8px 14px; }
  .filter-seg-value { max-width: 100px; font-size: 12px; }
  .header-right { display: none; }
  .search-row { top: 0; position: sticky; }
  .main { padding: 20px 16px 60px; }
  .property-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
}

@media (max-width: 520px) {
  .filter-segment { padding: 8px 10px; }
  .filter-seg-label { font-size: 9px; }
  .filter-seg-value { font-size: 11px; max-width: 70px; }
  .search-icon-btn { width: 30px; height: 30px; margin: 5px; }
}
