/* ── Reset ── */
.realmap-search *, .realmap-search *::before, .realmap-search *::after { box-sizing: border-box !important; }

/* ══════════════════════════════════════════════════
   ROOT GRID — toolbar on top, sidebar + map below
   ══════════════════════════════════════════════════ */
.realmap-search {
  display: grid !important;
  grid-template-columns: 420px 1fr;
  grid-template-rows: auto 1fr;
  height: calc(100vh - 54px) !important;
  max-height: calc(100vh - 54px) !important;
  width: 100% !important;
  background: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  color: #1d2939;
  overflow: hidden !important;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1.5;
}
body.admin-bar .realmap-search { height: calc(100vh - 54px - 32px) !important; max-height: calc(100vh - 54px - 32px) !important; }
@media screen and (max-width: 782px) {
  body.admin-bar .realmap-search { height: calc(100vh - 54px - 46px) !important; max-height: calc(100vh - 54px - 46px) !important; }
}

/* ══════════════════════════════════════════════════
   TOOLBAR — Spitogatos-style filter bar
   ══════════════════════════════════════════════════ */
.realmap-toolbar {
  grid-column: 1 / -1;
  grid-row: 1;
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: 0;
  padding: 0 12px;
  background: #f8f8f8;
  border-bottom: 1px solid #e0e0e0;
  height: 46px;
  min-height: 46px;
  flex-shrink: 0;
  z-index: 100;
}

.realmap-filters {
  display: flex !important;
  flex: 1 1 auto !important;
  align-items: center !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  background: transparent !important;
  height: 100%;
}

/* ── Pills row (left side) ── */
.rm-pills {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: 0;
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
}
.rm-pills::-webkit-scrollbar { height: 0; display: none; }

/* ── Toolbar right (Map | Gallery) ── */
.rm-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-left: auto;
  padding-left: 8px;
  height: 100%;
}

/* ══════════════════════════════════════════════════
   PILLS — Spitogatos rectangular dropdown style
   ══════════════════════════════════════════════════ */
.rm-pill {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px;
  height: 100% !important;
  padding: 0 14px !important;
  margin: 0 !important;
  border: none !important;
  border-right: 1px solid #e0e0e0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  font-size: 13px !important;
  font-weight: 500;
  color: #333 !important;
  cursor: pointer;
  white-space: nowrap;
  outline: none !important;
  transition: background 0.15s;
  -webkit-appearance: none !important;
  appearance: none !important;
  line-height: 46px !important;
  flex-shrink: 0 !important;
}
.rm-pill:hover { background: #efefef !important; }
.rm-pill:focus { background: #e8e8e8 !important; box-shadow: none !important; }

/* First pill gets left border */
.rm-pills > .rm-pill:first-child,
.rm-pills > .rm-pill-range:first-child {
  border-left: 1px solid #e0e0e0 !important;
}

/* Select pill — caret arrow */
select.rm-pill,
.rm-pills > select.rm-pill {
  padding-right: 28px !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23666' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 10px center !important;
  background-color: transparent !important;
  width: auto !important;
  max-width: 130px !important;
  box-shadow: none !important;
}

/* ── Range pill group (price / size) ── */
.rm-pill-range {
  display: inline-flex !important;
  align-items: center;
  border: none !important;
  border-right: 1px solid #e0e0e0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  height: 100%;
  flex-shrink: 0 !important;
  transition: background 0.15s;
}
.rm-pill-range:hover { background: #efefef; }
.rm-pill-range:focus-within { background: #e8e8e8; }

.rm-pill-range > .rm-pill-input,
.rm-pills .rm-pill-input {
  border: none !important;
  background: transparent !important;
  height: 100% !important;
  width: 72px !important;
  min-width: 72px !important;
  max-width: 72px !important;
  flex: 0 0 72px !important;
  padding: 0 10px !important;
  margin: 0 !important;
  font-size: 13px !important;
  color: #333 !important;
  outline: none !important;
  -webkit-appearance: none !important;
  appearance: none !important;
  -moz-appearance: textfield !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}
.rm-pill-input::-webkit-inner-spin-button,
.rm-pill-input::-webkit-outer-spin-button { -webkit-appearance: none !important; margin: 0 !important; }
.rm-pill-input::placeholder { color: #999; }

.rm-pill-sep {
  color: #bbb;
  font-size: 12px;
  flex-shrink: 0;
  line-height: 1;
}

/* ── Filters button ── */
.rm-pill-filters {
  font-weight: 600;
  gap: 5px;
}
.rm-pill-filters svg { flex-shrink: 0; }
.rm-pill-chevron { flex-shrink: 0; margin-left: 2px; }

/* ── Reset button ── */
.rm-pill-reset {
  border: 1px solid #d0d5dd !important;
  background: #fff !important;
  color: #344054 !important;
  font-weight: 600;
  font-size: 13px !important;
  gap: 5px;
  padding: 0 14px !important;
  height: 32px !important;
  line-height: 32px !important;
  border-radius: 6px !important;
  margin: 0 2px !important;
  cursor: pointer;
  transition: all 0.15s;
}
.rm-pill-reset:hover { background: #f9fafb !important; border-color: #98a2b3 !important; }
.rm-pill-reset svg { flex-shrink: 0; }

/* ── Save search button (orange) ── */
.rm-pill-search {
  border: none !important;
  border-right: none !important;
  background: #f5793b !important;
  color: #fff !important;
  font-weight: 700;
  font-size: 13px !important;
  gap: 6px;
  padding: 0 16px !important;
  height: 32px !important;
  line-height: 32px !important;
  border-radius: 6px !important;
  margin: 0 4px !important;
  cursor: pointer;
  transition: all 0.15s;
}
.rm-pill-search:hover { background: #e56a2e !important; }
.rm-pill-search svg { flex-shrink: 0; }

/* Save search confirmation toast */
.rm-save-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #1d2939;
  color: #fff;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 8px 30px rgba(0,0,0,0.2);
  z-index: 100002;
  transition: transform 0.3s ease;
  pointer-events: none;
}
.rm-save-toast.is-visible {
  transform: translateX(-50%) translateY(0);
}

/* ── View toggle (Map | Gallery) in toolbar ── */
.rm-toolbar-right .realmap-view-toggle {
  display: inline-flex;
  border: 1px solid #d0d5dd;
  border-radius: 6px;
  overflow: hidden;
  height: 32px;
}
.rm-toolbar-right .realmap-view-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 100%;
  border: 0;
  background: #fff;
  color: #667085;
  cursor: pointer;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.1s;
  white-space: nowrap;
}
.rm-toolbar-right .realmap-view-button:hover { background: #f2f4f7; }
.rm-toolbar-right .realmap-view-button.is-active { background: #1a56db; color: #fff; }
.rm-toolbar-right .realmap-view-button + .realmap-view-button { border-left: 1px solid #d0d5dd; }

/* ══════════════════════════════════════════════════
   MODAL OVERLAY — "More filters" popup
   ══════════════════════════════════════════════════ */
.realmap-modal-overlay {
  position: fixed !important;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4);
  z-index: 100010;
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.realmap-modal-overlay[hidden] { display: none !important; }

.realmap-modal {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  width: 100%;
  max-width: 660px;
  max-height: calc(100vh - 80px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.realmap-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid #eaecf0;
  flex-shrink: 0;
}
.realmap-modal-header h3 {
  margin: 0 !important;
  font-size: 18px;
  font-weight: 700;
  color: #101828;
}
.realmap-modal-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: #667085;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.1s;
  padding: 0;
}
.realmap-modal-close:hover { background: #f2f4f7; color: #344054; }

.realmap-modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
}
.realmap-modal-body::-webkit-scrollbar { width: 5px; }
.realmap-modal-body::-webkit-scrollbar-thumb { background: #d0d5dd; border-radius: 5px; }

.realmap-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  border-top: 1px solid #eaecf0;
  flex-shrink: 0;
  gap: 12px;
}

.realmap-modal-clear {
  border: none;
  background: none;
  color: #667085;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  padding: 6px 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.realmap-modal-clear:hover { color: #344054; }

.realmap-modal-apply {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 24px;
  border: none;
  border-radius: 8px;
  background: #f5793b;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(245,121,59,0.35);
  transition: background 0.15s;
}
.realmap-modal-apply:hover { background: #e56a2e; }

/* ── Modal sections ── */
.rm-modal-section { margin-bottom: 18px; }
.rm-modal-section:last-child { margin-bottom: 0; }

.rm-modal-label {
  display: block !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  color: #344054 !important;
  margin-bottom: 8px !important;
}

.rm-modal-row {
  display: flex;
  gap: 16px;
}
.rm-modal-row > .rm-modal-section { flex: 1 1 0%; margin-bottom: 18px; }

.rm-modal-inline {
  display: flex;
  align-items: center;
  gap: 8px;
}
.rm-modal-inline .rm-modal-input { flex: 1 1 0%; }

.rm-modal-sep {
  color: #98a2b3;
  font-size: 14px;
  flex-shrink: 0;
}

.rm-modal-input {
  display: block;
  width: 100%;
  height: 38px;
  padding: 0 12px;
  margin: 0;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
  color: #344054;
  outline: none;
  transition: border-color 0.15s;
  -webkit-appearance: none;
  appearance: none;
}
.rm-modal-input:focus { border-color: #1a56db; box-shadow: 0 0 0 3px rgba(26,86,219,0.12); }
.rm-modal-input::placeholder { color: #98a2b3; }
.rm-modal-input--full { width: 100%; }
.rm-modal-input[type="number"]::-webkit-inner-spin-button,
.rm-modal-input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none !important; margin: 0; }
.rm-modal-input[type="number"] { -moz-appearance: textfield; }
select.rm-modal-input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23667085' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 12px center !important;
  padding-right: 30px;
}

/* ── Filter location search (inline autocomplete) ── */
.rm-location-search { position: relative; }
.og-filter-search-wrap {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  padding: 4px 8px;
  background: #fff;
  min-height: 38px;
  position: relative;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.og-filter-search-wrap:focus-within {
  border-color: #1a56db;
  box-shadow: 0 0 0 3px rgba(26,86,219,0.12);
}
.og-filter-search-wrap .og-search-tags {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.og-filter-search-wrap .og-search-tag {
  background: #f0f5ff;
  border: 1px solid #c7d7fe;
  color: #1d2939;
  font-size: 12px;
  padding: 2px 6px 2px 8px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.og-filter-search-wrap .og-tag-remove {
  background: none;
  border: none;
  color: #667085;
  cursor: pointer;
  font-size: 14px;
  padding: 0 2px;
  line-height: 1;
}
.og-filter-search-wrap .og-tag-remove:hover { color: #d92d20; }
.og-filter-search-wrap .og-search-input {
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  padding: 2px 4px !important;
  font-size: 13px;
  flex: 1 1 80px;
  min-width: 80px;
  background: transparent;
  height: auto;
}
.og-filter-search-wrap .og-search-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  width: 100%;
  min-width: 280px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.18);
  max-height: 280px;
  overflow-y: auto;
  z-index: 100001;
  padding: 6px 0;
}
.og-filter-search-wrap .og-dropdown--open { display: block; }

/* ── Chips (radio/checkbox styled as tags) ── */
.rm-modal-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.rm-chip {
  display: inline-flex !important;
  align-items: center;
  gap: 4px;
  height: 32px;
  padding: 0 14px;
  border: 1px solid #d0d5dd;
  border-radius: 20px;
  background: #fff;
  font-size: 13px;
  color: #344054;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  user-select: none;
}
.rm-chip:hover { border-color: #98a2b3; background: #f9fafb; }
.rm-chip input[type="checkbox"],
.rm-chip input[type="radio"] {
  display: none !important;
}
.rm-chip:has(input:checked) {
  background: #f0f5ff;
  border-color: #1a56db;
  color: #1a56db;
  font-weight: 600;
}

/* ══════════════════════════════════════════════════
   SIDEBAR — cards panel
   ══════════════════════════════════════════════════ */
.realmap-sidebar {
  grid-column: 1;
  grid-row: 2;
  display: flex !important;
  flex-direction: column !important;
  border-right: 1px solid #e4e7ec;
  background: #fff;
  overflow: hidden;
  width: 100% !important;
  max-width: 100% !important;
  min-height: 0;
}

/* ── Listings head ── */
.realmap-listings-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 6px 10px;
  border-bottom: 1px solid #eaecf0;
  background: #fafafa;
  flex-shrink: 0;
  min-height: 34px;
}
.realmap-results-meta {
  font-size: 12px;
  font-weight: 600;
  color: #1d2939;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.realmap-listings-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.realmap-sort-select {
  height: 28px;
  border: 1px solid #d0d5dd;
  border-radius: 4px;
  font-size: 11px;
  color: #475467;
  padding: 0 6px;
  background: #fff;
}

.realmap-map-actions { display: inline-flex; gap: 2px; }
.realmap-draw-area, .realmap-clear-area, .realmap-my-location, .realmap-layer-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: 1px solid #d0d5dd;
  border-radius: 4px;
  background: #fff;
  color: #667085;
  cursor: pointer;
  padding: 0;
  transition: all 0.1s;
}
.realmap-draw-area:hover, .realmap-clear-area:hover, .realmap-my-location:hover, .realmap-layer-toggle:hover { background: #f2f4f7; color: #344054; }
.realmap-layer-toggle.is-active { background: #1a56db; color: #fff; border-color: #1a56db; }

/* ── Results list ── */
.realmap-results-list {
  flex: 1 1 0% !important;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0 !important;
  background: #f7f8fa;
}
.realmap-results-list::-webkit-scrollbar { width: 5px; }
.realmap-results-list::-webkit-scrollbar-thumb { background: #d0d5dd; border-radius: 5px; }

.realmap-scroll-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px;
  font-size: 13px;
  color: #667085;
  flex-shrink: 0;
}
.realmap-scroll-loader[hidden] {
  display: none;
}
.realmap-loader-spinner {
  width: 18px; height: 18px;
  border: 2.5px solid #e4e7ec;
  border-top-color: #1a56db;
  border-radius: 50%;
  animation: realmap-spin 0.6s linear infinite;
}
@keyframes realmap-spin { to { transform: rotate(360deg); } }

/* ══════════════════════════════════════════════════
   CARDS
   ══════════════════════════════════════════════════ */
.realmap-card {
  background: #fff;
  border: 1px solid #e4e7ec;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(16,24,40,0.05);
  transition: box-shadow 0.2s, border-color 0.2s;
  flex-shrink: 0;
  min-height: 0;
}
.realmap-card:hover {
  box-shadow: 0 4px 12px rgba(16,24,40,0.1);
  border-color: #d0d5dd;
}
.realmap-card.is-active {
  border-color: #f5793b;
  box-shadow: 0 0 0 2px rgba(245,121,59,0.2), 0 4px 12px rgba(16,24,40,0.08);
}
.realmap-card-inner {
  display: grid;
  grid-template-columns: 160px 1fr;
  grid-template-rows: 1fr;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  min-height: 0;
}

.realmap-card-photo {
  width: 160px;
  height: 140px;
  background: linear-gradient(135deg, #e8eaef 0%, #dfe2e8 100%);
  position: relative;
  overflow: hidden;
}
.realmap-card-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.realmap-card-photo-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 140px;
  color: #bfc5ce;
}

/* ── Card image slider ── */
.rm-slider { position: relative; }
.rm-slide {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}
.rm-slide.is-active {
  opacity: 1;
  position: relative;
  pointer-events: auto;
}
.rm-slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rm-slider-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.9);
  color: #344054;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.18);
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 2;
}
.rm-slider:hover .rm-slider-btn { opacity: 1; }
.rm-slider-btn:hover { background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,0.22); }
.rm-slider-prev { left: 4px; }
.rm-slider-next { right: 4px; }
.rm-slider-dots {
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 3px;
  z-index: 2;
}
.rm-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  transition: background 0.15s;
}
.rm-dot.is-active { background: #fff; }

.realmap-card-body {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0;
  min-width: 0;
  overflow: hidden;
}
.realmap-card-top { min-width: 0; }
.realmap-card-bottom {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 6px;
  margin-top: auto;
}
.realmap-card-badges { display: flex; flex-wrap: wrap; gap: 4px; }
.realmap-card-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1.5;
}
.realmap-badge-type { background: #fff3ec; color: #c4551a; }

.realmap-card-title {
  margin: 0;
  font-size: 13.5px;
  font-weight: 700;
  color: #1d2939;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.realmap-card-location {
  font-size: 11.5px;
  color: #667085;
  display: flex;
  align-items: center;
  gap: 3px;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.realmap-card-location svg { flex-shrink: 0; color: #98a2b3; }
.realmap-card-price {
  font-size: 17px;
  font-weight: 800;
  color: #101828;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.realmap-card-ppm2 {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: #667085;
  letter-spacing: 0;
  margin-top: 1px;
}
.realmap-card-specs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  font-size: 11.5px;
  color: #475467;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid #f0f1f3;
}
.realmap-card-spec {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
}
.realmap-card-spec svg { flex-shrink: 0; color: #98a2b3; }
.realmap-card-tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 5px;
}
.realmap-card-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  white-space: nowrap;
}
.realmap-tag-energy {
  background: #ecfdf5;
  color: #059669;
}
.realmap-tag-year {
  background: #eff6ff;
  color: #2563eb;
}
.realmap-card-date {
  font-size: 10.5px;
  color: #98a2b3;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Empty ── */
.realmap-empty-card { text-align: center; padding: 40px 20px; color: #667085; grid-column: 1 / -1; }
.realmap-empty-card svg { color: #d0d5dd; margin-bottom: 14px; }
.realmap-empty-card h3 { margin: 0 0 6px; font-size: 16px; color: #344054; }
.realmap-empty-card p { margin: 0; font-size: 13px; }

/* ══════════════════════════════════════════════════
   MAP
   ══════════════════════════════════════════════════ */
.realmap-map-wrap {
  grid-column: 2;
  grid-row: 2;
  position: relative;
  min-height: 0;
  overflow: hidden;
}
.realmap-map { width: 100% !important; height: 100% !important; position: absolute !important; top: 0; left: 0; right: 0; bottom: 0; }
/* Outer Leaflet div — zero-size anchor, no visuals */
.leaflet-marker-icon.realmap-price-marker {
  width: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  border: none !important;
  background: none !important;
  box-shadow: none !important;
  overflow: visible !important;
}

/* Inner label — all visuals live here, centered on the anchor point */
.realmap-price-marker-label {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: #f5793b;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 12px;
  border: 1.5px solid #c4551a;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0,0,0,0.22);
  text-align: center;
  line-height: 1.3;
  cursor: pointer;
  transition: padding 0.12s, font-size 0.12s, box-shadow 0.12s, background 0.12s, border-color 0.12s;
}

.leaflet-marker-icon.realmap-price-marker:hover .realmap-price-marker-label,
.leaflet-marker-icon.realmap-price-marker.is-highlighted .realmap-price-marker-label {
  padding: 5px 10px;
  font-size: 12px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.32);
}
.leaflet-marker-icon.realmap-price-marker:hover {
  z-index: 10000 !important;
}
.leaflet-marker-icon.realmap-price-marker.is-highlighted {
  z-index: 10000 !important;
}
.leaflet-marker-icon.realmap-price-marker.is-highlighted .realmap-price-marker-label {
  background: #1a56db;
  border-color: #1346b0;
}

/* Hover popup card on map */
.realmap-hover-popup .leaflet-popup-content-wrapper {
  padding: 0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 6px 24px rgba(0,0,0,0.18);
}
.realmap-hover-popup .leaflet-popup-content {
  margin: 0;
  width: 240px !important;
}
.realmap-hover-popup .leaflet-popup-tip {
  background: #fff;
}
.realmap-hover-card {
  display: grid;
  grid-template-columns: 80px 1fr;
  background: #fff;
  min-height: 80px;
}
.realmap-hover-card-photo {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, #e8eaef, #dfe2e8);
  overflow: hidden;
}
.realmap-hover-card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.realmap-hover-card-body {
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.realmap-hover-card-title {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: #1d2939;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.realmap-hover-card-location {
  font-size: 10px;
  color: #667085;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.realmap-hover-card-price {
  font-size: 15px;
  font-weight: 800;
  color: #101828;
  letter-spacing: -0.02em;
  margin-top: auto;
}
.realmap-hover-card-specs {
  display: flex;
  gap: 6px;
  font-size: 10px;
  color: #475467;
}

/* ══════════════════════════════════════════════════
   GALLERY VIEW (list mode)
   ══════════════════════════════════════════════════ */
.realmap-search.realmap-view-list {
  grid-template-columns: 1fr;
  grid-template-rows: auto auto;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}
.realmap-search.realmap-view-list .realmap-map-wrap { display: none; }
.realmap-search.realmap-view-list .realmap-sidebar {
  border-right: 0;
  max-height: none;
  overflow: visible;
}
.realmap-search.realmap-view-list .realmap-results-list {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  padding: 20px 24px;
  flex-direction: unset;
  overflow-y: visible;
  background: #f5f6f8;
  max-width: 1300px;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
}
.realmap-search.realmap-view-list .realmap-card {
  border-radius: 10px;
  border: 1px solid #e8eaef;
  box-shadow: 0 1px 3px rgba(16,24,40,0.06);
  transition: box-shadow 0.2s, transform 0.15s;
  overflow: hidden;
  min-height: auto !important;
}
.realmap-search.realmap-view-list .realmap-card:hover {
  box-shadow: 0 6px 20px rgba(16,24,40,0.1);
  transform: translateY(-2px);
}
.realmap-search.realmap-view-list .realmap-card-inner {
  display: flex !important;
  flex-direction: column !important;
  grid-template-columns: unset;
  min-height: auto !important;
}
.realmap-search.realmap-view-list .realmap-card-photo {
  width: 100% !important;
  min-height: 0 !important;
  height: 0;
  padding-bottom: 62%;
  position: relative;
}
.realmap-search.realmap-view-list .realmap-card-photo img,
.realmap-search.realmap-view-list .realmap-card-photo .rm-slide img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.realmap-search.realmap-view-list .realmap-card-photo .rm-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}
.realmap-search.realmap-view-list .realmap-card-photo .realmap-card-photo-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.realmap-search.realmap-view-list .realmap-card-body {
  padding: 14px 16px 16px;
}
.realmap-search.realmap-view-list .realmap-card {
  overflow: visible !important;
}
.realmap-search.realmap-view-list .realmap-card-inner {
  overflow: visible !important;
}
.realmap-search.realmap-view-list .realmap-card-title {
  font-size: 15px;
  font-weight: 700;
  margin: 0;
  white-space: normal;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.3;
}
.realmap-search.realmap-view-list .realmap-card-location {
  font-size: 13px;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.realmap-search.realmap-view-list .realmap-card-specs {
  font-size: 12.5px;
  margin-top: 6px;
  gap: 10px;
}
.realmap-search.realmap-view-list .realmap-card-price {
  font-size: 22px;
  font-weight: 800;
  margin-top: 8px;
  line-height: 1.1;
}
.realmap-search.realmap-view-list .realmap-card-date {
  font-size: 12px;
  margin-top: 4px;
}

@media (max-width: 1100px) {
  .realmap-search.realmap-view-list .realmap-results-list {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    padding: 16px;
  }
}
@media (max-width: 600px) {
  .realmap-search.realmap-view-list .realmap-results-list {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 10px;
  }
  .realmap-search.realmap-view-list .realmap-card-body { padding: 10px 12px 12px; }
  .realmap-search.realmap-view-list .realmap-card-title { font-size: 14px; }
  .realmap-search.realmap-view-list .realmap-card-price { font-size: 18px; margin-top: 6px; }
  .realmap-search.realmap-view-list .realmap-card-specs { font-size: 11.5px; }
  .realmap-search.realmap-view-list .realmap-card-date { font-size: 11px; }
}

/* ══════════════════════════════════════════════════
   TABLET & MOBILE (max-width: 900px)
   ══════════════════════════════════════════════════ */
@media (max-width: 900px) {

  /* ── Main grid: single column — toolbar → map → sidebar ── */
  .realmap-search {
    grid-template-columns: 1fr !important;
    grid-template-rows: auto auto 1fr;
    height: calc(100vh - 54px) !important;
    max-height: calc(100vh - 54px) !important;
    min-height: 0 !important;
    overflow: clip !important;
  }
  body.admin-bar .realmap-search {
    height: calc(100vh - 54px - 46px) !important;
    max-height: calc(100vh - 54px - 46px) !important;
    min-height: 0 !important;
  }

  /* ── Toolbar: vertical stack ── */
  .realmap-toolbar {
    height: auto;
    min-height: auto;
    flex-wrap: nowrap !important;
    flex-direction: column !important;
    padding: 8px 10px 6px;
    gap: 0;
    align-items: stretch !important;
  }

  /* ── Form: column so pills + toolbar-right stack ── */
  .realmap-filters {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0;
    width: 100% !important;
    height: auto !important;
  }

  /* ── Pills: clean 2-column grid ── */
  .rm-pills {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 6px !important;
    flex-wrap: unset !important;
    flex-direction: unset !important;
    height: auto !important;
  }

  .rm-pill {
    height: 34px !important;
    line-height: 34px !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 6px !important;
    padding: 0 10px !important;
    font-size: 12.5px !important;
    width: 100% !important;
    flex-shrink: unset !important;
  }
  select.rm-pill,
  .rm-pills > select.rm-pill {
    max-width: none !important;
    width: 100% !important;
  }

  .rm-pill-range {
    border: 1px solid #e0e0e0 !important;
    border-radius: 6px !important;
    height: 34px;
    width: 100%;
  }
  .rm-pill-input {
    flex: 1 1 0% !important;
    width: 0 !important;
    min-width: 0 !important;
    max-width: none !important;
    height: 32px !important;
    font-size: 12px !important;
    padding: 0 8px !important;
  }

  .rm-pill-filters {
    justify-content: center !important;
  }
  .rm-pill-reset {
    height: 34px !important;
    line-height: 34px !important;
    font-size: 12px !important;
    justify-content: center !important;
  }
  .rm-pill-search {
    display: none !important;
  }

  /* ── Toolbar right: compact row below filters ── */
  .rm-toolbar-right {
    display: flex !important;
    width: 100%;
    padding: 6px 0 0;
    margin: 6px 0 0;
    margin-left: 0;
    height: auto !important;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
    border-top: 1px solid rgba(128,128,128,0.15);
  }
  .rm-toolbar-right .realmap-view-toggle { height: 30px; }
  .rm-toolbar-right .realmap-view-button { font-size: 11px; padding: 0 8px; }

  /* ── Map: between toolbar and cards, full-width, ~1.5 card height ── */
  .realmap-map-wrap {
    grid-column: 1;
    grid-row: 2;
    min-height: 0 !important;
    height: 210px;
    max-height: 210px;
    overflow: hidden;
  }

  /* ── Sidebar: below map, scrollable cards ── */
  .realmap-sidebar {
    grid-column: 1;
    grid-row: 3;
    border-right: 0;
    border-top: 1px solid #e4e7ec;
    overflow: hidden;
    min-height: 0;
    display: flex !important;
    flex-direction: column !important;
  }

  /* ── Collapse on card scroll: slim toolbar + hide map ── */
  .realmap-search.realmap-map-collapsed .realmap-map-wrap {
    display: none !important;
  }
  .realmap-search.realmap-map-collapsed {
    grid-template-rows: auto 1fr !important;
  }
  .realmap-search.realmap-map-collapsed .realmap-sidebar {
    grid-row: 2;
    border-top: none;
  }
  .realmap-search.realmap-map-collapsed .realmap-toolbar {
    padding: 5px 10px !important;
  }
  .realmap-search.realmap-map-collapsed select.rm-pill,
  .realmap-search.realmap-map-collapsed .rm-pill-range,
  .realmap-search.realmap-map-collapsed .rm-toolbar-right {
    display: none !important;
  }
  .realmap-search.realmap-map-collapsed .rm-pills {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 6px !important;
  }
  .realmap-search.realmap-map-collapsed .rm-pill-filters,
  .realmap-search.realmap-map-collapsed .rm-pill-reset {
    width: 100% !important;
    height: 32px !important;
    line-height: 32px !important;
    font-size: 12px !important;
    justify-content: center !important;
  }

  /* ── Listings head ── */
  .realmap-listings-head { padding: 4px 8px; min-height: 30px; }
  .realmap-results-meta { font-size: 11px; }
  .realmap-sort-select { font-size: 10px; height: 26px; }
  .realmap-draw-area, .realmap-clear-area, .realmap-my-location, .realmap-layer-toggle {
    width: 24px; height: 24px;
  }

  /* ── Modal ── */
  .realmap-modal-overlay { padding: 12px; padding-top: 60px; align-items: flex-start; }
  .realmap-modal { max-width: 100%; margin: 0; max-height: calc(100vh - 70px); }
  .realmap-modal-body { padding: 16px; }

  .rm-lang-switcher { margin-left: 0; }
}

/* ══════════════════════════════════════════════════
   MOBILE (max-width: 600px)
   ══════════════════════════════════════════════════ */
@media (max-width: 600px) {

  /* ── Toolbar tighter ── */
  .realmap-toolbar { padding: 6px 8px 5px; }
  .rm-pills { gap: 5px !important; }

  .rm-pill {
    height: 32px !important;
    line-height: 32px !important;
    font-size: 11.5px !important;
    padding: 0 8px !important;
    border-radius: 5px !important;
  }
  select.rm-pill {
    padding-right: 22px !important;
    background-position: right 6px center !important;
  }

  .rm-pill-range { height: 32px; border-radius: 5px !important; }
  .rm-pill-input {
    height: 30px !important;
    font-size: 11px !important;
    padding: 0 6px !important;
  }
  .rm-pill-sep { font-size: 10px; }

  .rm-pill-filters svg { width: 11px; height: 11px; }
  .rm-pill-chevron { width: 8px; height: 5px; }
  .rm-pill-reset {
    height: 32px !important;
    line-height: 32px !important;
    font-size: 11px !important;
    padding: 0 10px !important;
    gap: 3px;
  }
  .rm-pill-reset svg { width: 11px; height: 11px; }

  /* ── Toolbar right ── */
  .rm-toolbar-right { padding-top: 5px; margin-top: 5px; gap: 4px; }
  .rm-toolbar-right .realmap-view-toggle { height: 28px; }
  .rm-toolbar-right .realmap-view-button { font-size: 10px; padding: 0 7px; gap: 3px; }
  .rm-toolbar-right .realmap-view-button svg { width: 12px; height: 12px; }
  .rm-lang-btn { font-size: 10px; padding: 3px 8px; }

  /* ── Map / sidebar — shorter map on small phones ── */
  .realmap-map-wrap { height: 180px; max-height: 180px; }

  /* ── Listings head ── */
  .realmap-listings-head { padding: 3px 6px; min-height: 28px; }
  .realmap-results-meta { font-size: 10px; }
  .realmap-sort-select { font-size: 9px; height: 24px; padding: 0 4px; }
  .realmap-draw-area, .realmap-clear-area, .realmap-my-location, .realmap-layer-toggle { width: 22px; height: 22px; }
  .realmap-draw-area svg, .realmap-clear-area svg, .realmap-my-location svg, .realmap-layer-toggle svg { width: 12px; height: 12px; }

  /* ── Modal ── */
  .realmap-modal-overlay { padding: 6px; align-items: flex-start; padding-top: 54px; }
  .realmap-modal { margin: 0; border-radius: 10px; max-height: calc(100vh - 60px); }
  .realmap-modal-header { padding: 10px 14px; }
  .realmap-modal-header h3 { font-size: 15px; }
  .realmap-modal-body { padding: 10px 12px; }
  .rm-modal-section { margin-bottom: 12px; }
  .rm-modal-label { font-size: 11px !important; margin-bottom: 4px !important; }
  .rm-modal-input { height: 32px; font-size: 12px; border-radius: 6px; }
  .rm-modal-row { gap: 8px; }
  .rm-chip { height: 26px; font-size: 11px; padding: 0 9px; }
  .realmap-modal-footer { padding: 8px 14px; }
  .realmap-modal-apply { height: 34px; font-size: 12px; padding: 0 16px; }
  .realmap-modal-clear { font-size: 11px; }
  .rm-save-toast { font-size: 12px; padding: 8px 16px; bottom: 16px; }
}

/* ══════════════════════════════════════════════════
   MOBILE EXTRA SMALL (max-width: 400px)
   ══════════════════════════════════════════════════ */
@media (max-width: 400px) {
  .realmap-toolbar { padding: 5px 6px 4px; }
  .rm-pills { gap: 4px !important; }

  .rm-pill {
    height: 30px !important;
    line-height: 30px !important;
    font-size: 10.5px !important;
    padding: 0 6px !important;
  }
  select.rm-pill { padding-right: 20px !important; background-position: right 5px center !important; }

  .rm-pill-range { height: 30px; }
  .rm-pill-input { height: 28px !important; font-size: 10px !important; padding: 0 5px !important; }

  .rm-pill-reset {
    height: 30px !important;
    line-height: 30px !important;
    font-size: 10px !important;
    padding: 0 8px !important;
  }

  .rm-toolbar-right .realmap-view-toggle { height: 26px; }
  .rm-toolbar-right .realmap-view-button { font-size: 9px; padding: 0 5px; }
  .rm-lang-btn { font-size: 9px; padding: 2px 6px; }
}

/* ── Language Switcher ── */

.rm-lang-switcher {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: 8px;
  background: #f3f4f6;
  border-radius: 6px;
  padding: 2px;
}

.rm-lang-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: #6b7280;
  text-decoration: none;
  border-radius: 4px;
  transition: background 0.15s, color 0.15s;
  line-height: 1;
  cursor: pointer;
}

.rm-lang-btn:hover {
  color: #111827;
  background: #e5e7eb;
}

.rm-lang-btn.is-active {
  color: #fff;
  background: #1a56db;
  pointer-events: none;
}
