:root {
  --bg: #f5f0ea;
  --card: #ffffff;
  --ink: #1c1b19;
  --ink-soft: #6b6660;
  --accent: #c96a2b;
  --radius: 14px;
}

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

body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.45 -apple-system, "Segoe UI", Roboto, sans-serif;
}

.top {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--bg);
  padding: 14px 16px;
  display: flex;
  align-items: center;
}

.brand {
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: .2px;
}

.top-nav { margin-left: auto; display: flex; gap: 14px; }
.top-nav a { color: var(--ink-soft); text-decoration: none; font-size: 14px; }
.top-nav a:active, .top-nav a:hover { color: var(--ink); }

main { padding: 0 16px 32px; max-width: 960px; margin: 0 auto; }

/* ── Лента ────────────────────────────────────────────────────────── */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: var(--ink);
  display: flex;
  flex-direction: column;
}

.card-photo { aspect-ratio: 4/3; background: #e9e2d9; }
.card-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-empty { width: 100%; height: 100%; }

.card-body { padding: 12px 14px 14px; }

.card-price { font-weight: 700; font-size: 17px; }
.per { font-weight: 400; color: var(--ink-soft); font-size: 13px; }

.card-title {
  margin-top: 4px;
  font-size: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta { margin-top: 6px; color: var(--ink-soft); font-size: 13px; }

.pager { display: flex; gap: 16px; justify-content: center; padding: 24px 0 0; }
.pager a { color: var(--accent); text-decoration: none; }

.empty { text-align: center; padding: 80px 20px; color: var(--ink-soft); }
.empty-title { font-weight: 700; color: var(--ink); margin-bottom: 6px; }

/* ── Объявление ───────────────────────────────────────────────────── */

.gallery { display: grid; gap: 10px; margin-bottom: 18px; }
.gallery img, .gallery video {
  width: 100%;
  border-radius: var(--radius);
  background: #e9e2d9;
  display: block;
}

.price { font-size: 26px; font-weight: 800; }
h1 { font-size: 19px; margin: 6px 0 18px; font-weight: 600; }

.props {
  background: var(--card);
  border-radius: var(--radius);
  padding: 6px 16px;
  margin-bottom: 18px;
}
.props > div {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #efe9e1;
}
.props > div:last-child { border-bottom: 0; }
.props span { color: var(--ink-soft); }

.desc { white-space: pre-wrap; }

/* ── Карта ────────────────────────────────────────────────────────── */

#map {
  height: calc(100vh - 62px);
  border-radius: var(--radius);
  z-index: 1;
}

.leaflet-container { font: inherit; }

/* Ценник вместо булавки: как у всех сайтов недвижимости, иначе
   на десять объявлений карта выглядит пустой. */
.pin-wrap { background: none; border: none; }
.pin {
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  padding: 5px 10px;
  border-radius: 999px;
  white-space: nowrap;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .25);
  position: relative;
  transform: translate(-50%, -100%);
}
.pin span { font-weight: 400; opacity: .85; font-size: 11px; }

/* Попап маркера: мини-карточка с фото и ценой. */
.pop { width: 200px; }
.pop-photo {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: 8px;
  display: block;
  background: #e9e2d9;
}
.pop-price { font-weight: 800; margin-top: 6px; }
.pop-title { font-size: 13px; margin: 4px 0 2px; }
.pop-city { font-size: 12px; color: var(--ink-soft); margin-bottom: 8px; }
.pop-link { color: var(--accent); text-decoration: none; font-weight: 600; }