.aqar-map {
  width: 100%;
  height: 320px;
  border-radius: var(--radius-box, 0.5rem);
  overflow: hidden;
  border: 1px solid var(--color-base-300, #ddd);
}
.aqar-map-lg {
  height: min(70vh, 640px);
  min-height: 480px;
}
@media (max-width: 1023px) {
  .aqar-map-lg {
    height: min(48vh, 400px);
    min-height: 260px;
  }
}
.aqar-map-listing {
  height: min(68vh, 560px);
  min-height: 420px;
}
@media (max-width: 1023px) {
  .aqar-map-listing {
    height: 320px;
    min-height: 280px;
  }
}
.aqar-marker {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--color-primary, #4f46e5);
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgb(0 0 0 / 35%);
}
.aqar-marker-listing {
  width: 22px;
  height: 22px;
  background: #2563eb;
}
.aqar-marker-sale {
  background: #2563eb;
}
.aqar-marker-rent {
  background: #ea580c;
}
.aqar-marker-project {
  background: #0d9488;
}
.aqar-marker-poi {
  width: 12px;
  height: 12px;
  background: var(--color-secondary, #db2777);
}
.aqar-poi-listing { background: #2563eb; }
.aqar-poi-listing.aqar-marker-rent,
.aqar-legend-dot.aqar-marker-rent { background: #ea580c; }
.aqar-legend-dot.aqar-marker-sale { background: #2563eb; }
.aqar-legend-dot.aqar-marker-project { background: #0d9488; }
.aqar-poi-school { background: #2563eb; }
.aqar-poi-kindergarten { background: #ea580c; }
.aqar-poi-shop { background: #16a34a; }
.aqar-poi-bus_stop { background: #ca8a04; }
.aqar-poi-hospital { background: #dc2626; }
.aqar-poi-mosque { background: #0f766e; }
.aqar-poi-pharmacy { background: #7c3aed; }

.aqar-legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.5px solid #fff;
  box-shadow: 0 0 0 1px rgb(0 0 0 / 18%);
  flex-shrink: 0;
}
.aqar-legend-dot.aqar-legend-district {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  background: rgb(37 99 235 / 18%);
  border: 1.5px solid #2563eb;
  box-shadow: none;
}

.aqar-map-wrap {
  position: relative;
}
.aqar-map-toolbar {
  position: absolute;
  z-index: 2;
  left: 0.75rem;
  top: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem;
  max-width: calc(100% - 1.5rem);
}
.aqar-map-heat-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  height: 2rem;
  padding: 0 0.65rem;
  border-radius: var(--radius-field, 0.5rem);
  border: 1px solid var(--color-base-300, #ddd);
  background: color-mix(in oklab, var(--color-base-100, #fff) 92%, transparent);
  box-shadow: 0 1px 6px rgb(0 0 0 / 14%);
  cursor: pointer;
  user-select: none;
}

/* MapLibre applies translate3d on .maplibregl-marker — never transition that. */
.aqar-map .maplibregl-marker {
  transition: none !important;
  will-change: transform;
}
.aqar-price-marker {
  display: block;
  line-height: 0;
}
.aqar-price-bubble {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
  padding: 0.35rem 0.55rem;
  border-radius: 999px;
  color: #fff;
  box-shadow: 0 1px 4px rgb(0 0 0 / 35%);
  font-variant-numeric: tabular-nums;
  transform-origin: bottom center;
  transition: none;
  -webkit-tap-highlight-color: transparent;
}
.aqar-price-bubble::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -5px;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: inherit;
  pointer-events: none;
}
.aqar-price-bubble-sale {
  background: #2563eb;
  border-top-color: #2563eb;
}
.aqar-price-bubble-sale::after {
  border-top-color: #2563eb;
}
.aqar-price-bubble-rent {
  background: #ea580c;
  border-top-color: #ea580c;
}
.aqar-price-bubble-rent::after {
  border-top-color: #ea580c;
}
.aqar-price-bubble-project {
  background: #0d9488;
  border-top-color: #0d9488;
  min-width: 2.5rem;
}
.aqar-price-bubble-project::after {
  border-top-color: #0d9488;
}

.aqar-maplibre-popup .maplibregl-popup-content {
  padding: 0;
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: 0 8px 24px rgb(0 0 0 / 18%);
  position: relative;
}
.aqar-maplibre-popup .maplibregl-popup-close-button {
  position: absolute;
  z-index: 3;
  top: 0.4rem;
  right: 0.4rem;
  left: auto;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  margin: 0;
  border: 1px solid color-mix(in oklab, var(--color-base-content, #111) 12%, transparent);
  border-radius: 9999px;
  background: color-mix(in oklab, var(--color-base-100, #fff) 86%, transparent);
  color: color-mix(in oklab, var(--color-base-content, #111) 72%, transparent);
  font: 400 1.05rem/1 system-ui, -apple-system, "Segoe UI", sans-serif;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgb(0 0 0 / 14%);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  cursor: pointer;
  transition:
    background-color 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease,
    transform 0.15s ease;
}
[dir="rtl"] .aqar-maplibre-popup .maplibregl-popup-close-button {
  right: auto;
  left: 0.4rem;
}
.aqar-maplibre-popup .maplibregl-popup-close-button:hover,
.aqar-maplibre-popup .maplibregl-popup-close-button:focus-visible {
  background: var(--color-base-100, #fff);
  color: var(--color-base-content, #111);
  border-color: color-mix(in oklab, var(--color-base-content, #111) 22%, transparent);
  outline: none;
  transform: scale(1.04);
}
.aqar-maplibre-popup .maplibregl-popup-close-button:active {
  transform: scale(0.96);
}
.aqar-map-popup {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 220px;
  max-width: 268px;
  background: var(--color-base-100, #fff);
  color: var(--color-base-content, #111);
}
.aqar-map-popup-cover {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  overflow: hidden;
  background: var(--color-base-200, #eee);
  aspect-ratio: 16 / 10;
}
.aqar-map-popup-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}
.aqar-map-popup-cover img.is-portrait {
  object-fit: contain;
}
.aqar-map-popup-body {
  flex: 1 1 auto;
  padding: 0.55rem 0.65rem;
  min-width: 0;
}
.aqar-map-popup-title {
  display: block;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
  text-decoration: none;
  color: inherit;
}
.aqar-map-popup-title:hover {
  text-decoration: underline;
}
.aqar-map-popup-price {
  margin: 0.2rem 0 0;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  opacity: 0.85;
}
.aqar-map-popup-meta {
  margin: 0.15rem 0 0;
  font-size: 11px;
  opacity: 0.55;
}
.aqar-map-popup-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.4rem;
}
.aqar-map-popup-open {
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  color: var(--color-primary, #2563eb);
}
.aqar-map-popup-wa {
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
  color: #128c7e;
}

/* Never show MapLibre / tile attribution chrome */
.aqar-map .maplibregl-ctrl-attrib,
.aqar-map .maplibregl-compact-attrib,
.aqar-map .maplibregl-ctrl-logo {
  display: none !important;
}
