.search-results-map-shell {
  position: relative;
  overflow: hidden;
  min-height: 620px;
  border: 1px solid rgba(15, 23, 42, .1);
  border-radius: 22px;
  background: #edf1f6;
  box-shadow: 0 18px 42px rgba(15, 23, 42, .1);
}

.search-results-map-canvas {
  width: 100%;
  height: min(68vh, 720px);
  min-height: 620px;
}

.search-results-map-status {
  position: absolute;
  z-index: 500;
  bottom: 20px;
  left: 20px;
  max-width: calc(100% - 40px);
  padding: 8px 18px;
  border: 1px solid rgba(15, 23, 42, .08);
  border-radius: 9999px;
  background: #ffffff;
  color: #0f172a;
  font-size: .88rem;
  font-weight: 750;
  line-height: 1.2;
  text-align: left;
  box-shadow: 0 4px 18px rgba(15, 23, 42, .14);
  backdrop-filter: blur(10px);
  transition: opacity .16s ease, visibility .16s ease;
}

.search-results-map-shell.has-open-popup .search-results-map-status {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.search-results-map-status[data-state="loading"]::before {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 8px;
  border: 2px solid rgba(var(--brand-rgb, 180, 95, 54), .28);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: search-map-spin .75s linear infinite;
}

.search-results-map-status[data-state="error"] {
  color: #991b1b;
}

.search-map-toolbar {
  position: absolute;
  z-index: 505;
  top: 16px;
  left: 16px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 4px;
  border: 1px solid rgba(15, 23, 42, .08);
  border-radius: 9999px;
  background: #ffffff;
  box-shadow: 0 4px 18px rgba(15, 23, 42, .14);
}

.search-map-toolbar__btn {
  all: unset;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 4px 14px;
  border-radius: 9999px;
  background: transparent;
  color: #334155;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .16s ease;
  user-select: none;
  box-sizing: border-box;
}

.search-map-toolbar__btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.search-map-toolbar__btn[aria-pressed="true"] {
  background: #0f2744;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(15, 39, 68, 0.25);
}

.search-map-toolbar__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  color: inherit;
}

.search-map-toolbar__icon svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
}

.search-map-popup-streetview {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #f8fafc;
  color: #334155;
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  transition: all .14s ease;
}

.search-map-popup-streetview:hover {
  background: #f1f5f9;
  border-color: #007a93;
  color: #007a93;
}

.saved-map-kinds {
  position: absolute;
  z-index: 510;
  left: 20px;
  bottom: 64px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-width: calc(100% - 40px);
  padding: 4px;
  border: 1px solid rgba(15, 23, 42, .08);
  border-radius: 9999px;
  background: #ffffff;
  box-shadow: 0 4px 18px rgba(15, 23, 42, .14);
}

.saved-map-kinds button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 11px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #334155;
  font-weight: 700;
  cursor: pointer;
}

.saved-map-kinds button.is-active,
.saved-map-kinds button:hover {
  background: #eef1f5;
  color: #0f172a;
}

.saved-map-kinds__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.saved-map-kinds__dot--home { background: var(--brand, #b45f36); }
.saved-map-kinds__dot--project { background: #203c59; }

.search-results-map-popup {
  z-index: 700;
}

.search-results-map-popup .maplibregl-popup-content {
  overflow-x: hidden;
  overflow-y: auto;
  max-height: var(--search-map-popup-max-height, calc(min(68vh, 720px) - 36px));
  box-sizing: border-box;
  overscroll-behavior: contain;
  padding: 0;
  border: 1px solid rgba(15, 23, 42, .08);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 20px 48px rgba(15, 23, 42, .24);
}

.search-results-map-shell .maplibregl-ctrl-attrib.maplibregl-compact:not(.maplibregl-compact-show) {
  width: 30px !important;
  min-width: 30px !important;
  max-width: 30px !important;
  overflow: hidden !important;
  background: transparent !important;
  box-shadow: none;
}

.search-results-map-shell .maplibregl-ctrl-attrib.maplibregl-compact:not(.maplibregl-compact-show) .maplibregl-ctrl-attrib-inner {
  display: none !important;
}

.search-results-map-popup .maplibregl-popup-content {
  width: min(316px, calc(100vw - 58px)) !important;
  margin: 0;
}

.search-results-map-popup .maplibregl-popup-close-button {
  top: 9px;
  right: 9px;
  z-index: 3;
  width: 30px;
  height: 30px;
  padding: 3px 0 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .94);
  color: #0f172a;
  font-size: 22px;
  line-height: 27px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, .18);
}

.search-results-map-popup .maplibregl-popup-tip {
  border-top-color: #fff;
}

.search-map-popup {
  position: relative;
  overflow: hidden;
  width: 100%;
  color: #334155;
}

.search-map-popup-kind {
  margin: 0 0 5px;
  color: var(--brand, #b45f36);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.search-map-popup-wishlist {
  position: absolute;
  z-index: 4;
  top: 10px;
  right: 50px;
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(15, 23, 42, .08);
  border-radius: 50%;
  background: rgba(255, 255, 255, .96);
  color: #0f172a;
  font-size: 1rem;
  box-shadow: 0 4px 14px rgba(15, 23, 42, .18);
}

.search-map-popup-wishlist.active,
.search-map-popup-wishlist:hover {
  color: var(--brand);
}

.search-map-popup-media {
  position: relative;
  display: block;
  height: 168px;
  overflow: hidden;
  background: linear-gradient(135deg, #e2e8f0, #f8fafc);
}

.search-map-popup-gallery {
  position: relative;
}

.search-map-popup-gallery--loading {
  overflow: hidden;
}

.search-map-popup-media-skeleton {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(105deg, transparent 32%, rgba(255, 255, 255, .72) 48%, transparent 64%),
    linear-gradient(135deg, #dbe3ec, #f5f7fa);
  background-size: 220% 100%, 100% 100%;
  animation: search-map-skeleton 1.1s ease-in-out infinite;
}

.search-map-popup-gallery-arrow {
  position: absolute;
  z-index: 5;
  top: 50%;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  padding: 0 0 2px;
  transform: translateY(-50%);
  border: 1px solid rgba(15, 23, 42, .08);
  border-radius: 50%;
  background: rgba(255, 255, 255, .96);
  color: #0f172a;
  font-size: 1.35rem;
  line-height: 1;
  box-shadow: 0 6px 18px rgba(15, 23, 42, .2);
}

.search-map-popup-gallery-arrow:hover {
  color: var(--brand);
}

.search-map-popup-gallery-arrow--prev {
  left: 10px;
}

.search-map-popup-gallery-arrow--next {
  right: 10px;
}

.search-map-popup-gallery-count {
  position: absolute;
  z-index: 5;
  right: 10px;
  bottom: 9px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, .82);
  color: #fff;
  font-size: .68rem;
  font-weight: 800;
  line-height: 1;
}

.search-map-popup-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .25s ease;
}

.search-map-popup-media:hover img {
  transform: scale(1.025);
}

.search-map-popup-options {
  display: inline-flex;
  width: max-content;
  margin: 12px 14px 0;
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: 999px;
  background: rgba(15, 23, 42, .84);
  color: #fff;
  font-size: .72rem;
  font-weight: 800;
  line-height: 1;
}

.search-map-popup-media .search-map-popup-options {
  position: absolute;
  top: 0;
  left: 0;
  margin: 12px;
  backdrop-filter: blur(8px);
}

.search-map-popup-body {
  padding: 15px 16px 16px;
}

.search-map-popup h3 {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: #0f172a;
  font-family: inherit;
  font-size: 1.02rem;
  font-weight: 850;
  line-height: 1.25;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.search-map-popup p {
  overflow: hidden;
  margin: 5px 0 0;
  color: #64748b;
  font-size: .82rem;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-map-popup ul {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.search-map-popup li {
  display: flex;
  align-items: baseline;
  gap: 4px;
  padding: 5px 7px;
  border-radius: 8px;
  background: #f1f5f9;
  color: #64748b;
  font-size: .7rem;
  line-height: 1;
}

.search-map-popup li strong {
  color: #0f172a;
  font-size: .76rem;
}

.search-map-popup-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #e2e8f0;
}

.search-map-popup-footer b {
  color: var(--brand);
  font-size: 1rem;
  line-height: 1.15;
}

.search-map-popup-footer a {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  padding: 9px 12px;
  border-radius: 10px;
  background: #0f172a;
  color: #fff !important;
  font-size: .8rem;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
}

@keyframes search-map-spin {
  to { transform: rotate(360deg); }
}

@keyframes search-map-skeleton {
  to { background-position: -180% 0, 0 0; }
}

@media (max-width: 767.98px) {
  .search-results-map-shell,
  .search-results-map-canvas {
    min-height: 520px;
  }

  .search-results-map-canvas {
    height: 68vh;
  }

  .search-results-map-shell {
    border-radius: 16px;
  }

  .search-results-map-status {
    top: 12px;
    padding: 9px 13px;
    font-size: .85rem;
  }

  .search-results-map-popup .maplibregl-popup-content {
    width: min(292px, calc(100vw - 54px)) !important;
    max-height: var(--search-map-popup-max-height, calc(68vh - 28px));
  }

  .search-map-popup-media {
    height: 150px;
  }

  .search-map-popup-body {
    padding: 13px 14px 14px;
  }
}

.search-map-popup-group { display: flex; align-items: center; justify-content: space-between; padding: .5rem .75rem; gap: .75rem; }
.search-map-popup-group button { min-width: 44px; min-height: 44px; border: 1px solid #d5d5d5; border-radius: .4rem; background: #fff; cursor: pointer; }

.search-map-toolbar__btn[aria-busy="true"] {
  opacity: .65;
  cursor: progress;
}

.search-map-toolbar__btn:disabled {
  opacity: .5;
  cursor: default;
}
