/* Property map: price tags, clusters and the radius circle.
   Shared by the search results map and the homepage discovery map. */

/* Leaflet gives this element the marker's position and nothing else — it has no
   size, so the bubble inside can centre itself on the coordinate regardless of
   how wide the price happens to be. That is what keeps a tag's tail pointing at
   the listing instead of drifting with the label width. */
.rm-anchor { width: 0; height: 0; }

.rm-pin,
.rm-cluster {
  position: absolute;
  left: 0;
  bottom: 0;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  font-family: 'DM Sans', system-ui, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

/* ------------------------------------------------------------- price tags */

.rm-pin-label {
  display: block;
  padding: 5px 11px;
  border-radius: 100px;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
  white-space: nowrap;
  color: #fff;
  background: var(--saffron, #FF6B00);
  border: 1.5px solid rgba(255, 255, 255, 0.92);
  box-shadow: 0 2px 10px rgba(13, 27, 42, 0.28);
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

/* The tail is the part that actually touches the coordinate. */
.rm-pin-tail {
  display: block;
  width: 2px;
  height: 7px;
  margin-top: -1px;
  border-radius: 0 0 2px 2px;
  background: var(--saffron, #FF6B00);
  box-shadow: 0 1px 3px rgba(13, 27, 42, 0.3);
}

.rm-pin--rent .rm-pin-label,
.rm-pin--rent .rm-pin-tail { background: var(--rent, #3B82F6); }

.rm-pin--featured .rm-pin-label {
  background: linear-gradient(135deg, #0D1B2A, #1E3448);
  box-shadow: 0 3px 14px rgba(13, 27, 42, 0.4);
}
.rm-pin--featured .rm-pin-tail { background: #1E3448; }
.rm-pin--featured .rm-pin-label::after {
  content: '★';
  margin-left: 5px;
  color: #FFB74A;
  font-size: 0.72em;
}

.rm-pin:hover .rm-pin-label,
.rm-pin.is-hover .rm-pin-label {
  transform: translateY(-2px) scale(1.06);
  box-shadow: 0 6px 18px rgba(13, 27, 42, 0.35);
}

.rm-pin.is-active .rm-pin-label {
  transform: translateY(-3px) scale(1.12);
  background: #0D1B2A;
  border-color: #fff;
  box-shadow: 0 8px 22px rgba(13, 27, 42, 0.45), 0 0 0 4px rgba(255, 107, 0, 0.28);
}
.rm-pin.is-active .rm-pin-tail { background: #0D1B2A; }

.rm-pin:focus-visible .rm-pin-label {
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 107, 0, 0.55);
}

/* --------------------------------------------------------------- clusters */

.rm-cluster {
  transform: translate(-50%, 50%);
  align-items: center;
  justify-content: center;
  gap: 0;
  border-radius: 100px;
  color: #fff;
  background: radial-gradient(circle at 30% 25%, #FF8C38, #EA5B00);
  border: 2px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 4px 16px rgba(234, 91, 0, 0.4);
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.18s ease;
}
.rm-cluster:hover {
  transform: translate(-50%, 50%) scale(1.09);
  box-shadow: 0 7px 22px rgba(234, 91, 0, 0.5);
}
.rm-cluster-count {
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
}
.rm-cluster-from {
  font-size: 0.62rem;
  font-weight: 600;
  opacity: 0.92;
  line-height: 1;
  margin-top: 2px;
  white-space: nowrap;
}
.rm-cluster--sm { width: 48px; height: 48px; }
.rm-cluster--sm .rm-cluster-count { font-size: 0.95rem; }
.rm-cluster--md { width: 58px; height: 58px; }
.rm-cluster--md .rm-cluster-count { font-size: 1.08rem; }
.rm-cluster--lg { width: 68px; height: 68px; }
.rm-cluster--lg .rm-cluster-count { font-size: 1.2rem; }
.rm-cluster--lg .rm-cluster-from,
.rm-cluster--md .rm-cluster-from { font-size: 0.66rem; }

/* ------------------------------------------------- centre + radius handle */

.rm-center {
  position: absolute;
  left: 0;
  top: 0;
  transform: translate(-50%, -50%);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 107, 0, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
}
.rm-center::before {
  content: '';
  position: absolute;
  inset: -9px;
  border-radius: 50%;
  border: 2px solid rgba(255, 107, 0, 0.45);
  animation: rmPulse 2.4s ease-out infinite;
}
.rm-center-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--saffron, #FF6B00);
  border: 2.5px solid #fff;
  box-shadow: 0 2px 8px rgba(13, 27, 42, 0.35);
}
@keyframes rmPulse {
  0% { transform: scale(0.7); opacity: 0.85; }
  100% { transform: scale(1.5); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .rm-center::before { animation: none; opacity: 0.5; }
}

.rm-handle {
  position: absolute;
  left: 0;
  top: 0;
  transform: translate(-50%, -50%);
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: ew-resize;
}
.rm-handle span {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 4px solid var(--saffron, #FF6B00);
  box-shadow: 0 2px 8px rgba(13, 27, 42, 0.35);
  transition: transform 0.15s ease;
}
.rm-handle:hover span { transform: scale(1.22); }

.rm-radius-circle { stroke-dasharray: 7 6; }

/* ------------------------------------------------------ leaflet overrides */

.leaflet-container {
  font-family: 'DM Sans', system-ui, sans-serif;
  background: #E8EDF1;
}
.leaflet-container a { color: var(--saffron, #FF6B00); }
.leaflet-control-attribution {
  font-size: 0.62rem;
  background: rgba(255, 255, 255, 0.78);
  padding: 1px 6px;
  border-radius: 6px 0 0 0;
}
.leaflet-bar {
  border: none !important;
  border-radius: 10px !important;
  overflow: hidden;
  box-shadow: 0 3px 14px rgba(13, 27, 42, 0.22) !important;
}
.leaflet-bar a {
  width: 32px !important;
  height: 32px !important;
  line-height: 32px !important;
  color: #0D1B2A !important;
  border-bottom-color: rgba(13, 27, 42, 0.08) !important;
  font-weight: 600;
}
.leaflet-bar a:hover { background: var(--saffron-pale, #FFF3E9) !important; color: var(--saffron, #FF6B00) !important; }
.leaflet-touch .leaflet-bar a:first-child { border-radius: 10px 10px 0 0 !important; }
.leaflet-touch .leaflet-bar a:last-child { border-radius: 0 0 10px 10px !important; }
