/* Search-properties map view owns its redesigned map/list layout here.
   Legacy map slider styles for other pages remain in main.css. */

/* ── Map marker ───────────────────────────────────────────── */
.price-bubble-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.28));
  transition: filter 0.15s ease, transform 0.15s ease;
  transform-origin: bottom center;
}

.price-bubble-wrapper:hover {
  filter: drop-shadow(0 4px 14px rgba(136, 60, 174, 0.5));
  transform: scale(1.12) translateY(-2px);
}

.price-bubble-wrapper.rent-marker:hover {
  filter: drop-shadow(0 4px 14px rgba(3, 105, 161, 0.5));
}

.price-bubble-wrapper.project-marker:hover {
  filter: drop-shadow(0 4px 14px rgba(66, 193, 207, 0.5));
}

.price-bubble {
  color: #fff;
  padding: 5px 11px;
  border-radius: 20px;
  font-family: Arial, sans-serif;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  user-select: none;
  line-height: 1.3;
}

.price-bubble-tail {
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  /* color is set per-marker via inline style */
}

/* ── Cluster marker ───────────────────────────────────────── */
.cluster-bubble {
  background-color: #883cae;
  color: #fff;
  border-radius: 50%;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  font-family: Arial, sans-serif;
  border: 3px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.28);
  cursor: pointer;
  transition: transform 0.15s ease;
}

.cluster-bubble:hover {
  transform: scale(1.1);
}

/* ── Marker active state (card hover → marker highlight) ─── */
.price-bubble-wrapper.is-active {
  filter: drop-shadow(0 4px 14px rgba(136, 60, 174, 0.6));
  transform: scale(1.18) translateY(-3px);
  z-index: 999;
}

.price-bubble-wrapper.rent-marker.is-active {
  filter: drop-shadow(0 4px 14px rgba(3, 105, 161, 0.6));
}

.price-bubble-wrapper.project-marker.is-active {
  filter: drop-shadow(0 4px 14px rgba(66, 193, 207, 0.6));
}

/* ══════════════════════════════════════════════════════════
   MAP SPLIT PANEL LAYOUT  (Zoopla / PropertyFinder style)
   ══════════════════════════════════════════════════════════ */

/* Override main.css map height – the panel controls height now */
.searchList__wrapper.mapview {
  padding: 0 !important;
}

.searchList__map .gm-style .gm-style-iw,
.searchList__map .gm-style .gm-style-iw-c,
.map-panel .gm-style .gm-style-iw,
.map-panel .gm-style .gm-style-iw-c {
  padding: 0 !important;
  border-radius: 18px !important;
  background: transparent !important;
  box-shadow: none !important;
  overflow: visible !important;
}

.searchList__map .gm-style .gm-style-iw-d,
.map-panel .gm-style .gm-style-iw-d {
  padding: 0 !important;
  overflow: visible !important;
  max-height: none !important;
}

.searchList__map .gm-style .gm-style-iw-ch,
.searchList__map .gm-style .gm-style-iw-chr,
.searchList__map .gm-style .gm-ui-hover-effect,
.map-panel .gm-style .gm-style-iw-ch,
.map-panel .gm-style .gm-style-iw-chr,
.map-panel .gm-style .gm-ui-hover-effect {
  display: none !important;
}

.map-popup-card {
  max-width: 300px;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 18px 48px rgba(17, 24, 39, 0.18);
  overflow: clip;
}

.map-popup-card__media {
  position: relative;
}

.map-popup-card__media-link {
  display: block;
  color: inherit;
}

.map-popup-card__swiper,
.map-popup-card__swiper .swiper-slide {
  width: 100%;
}

.map-popup-card__swiper .swiper-slide {
  height: 196px;
}

.map-popup-card__swiper .swiper-slide img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.map-popup-card__swiper .swiper-pagination {
  bottom: 12px !important;
}

.map-popup-card__swiper .swiper-pagination-bullet {
  width: 7px;
  height: 7px;
  background: rgba(255, 255, 255, 0.68);
  opacity: 1;
}

.map-popup-card__swiper .swiper-pagination-bullet-active {
  background: #fff;
}

.map-popup-card__actions {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 8px;
  z-index: 2;
}

.map-popup-card__action {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: #374151;
  box-shadow: 0 6px 16px rgba(17, 24, 39, 0.18);
  padding: 0;
  cursor: pointer;
}

.map-popup-card__action .icon-fill {
  display: none;
}

.map-popup-card__action.active .icon {
  display: none;
}

.map-popup-card__action.active .icon-fill {
  display: block;
}

.map-popup-card__body {
  padding: 12px 14px 14px;
}

.map-popup-card__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  margin-bottom: 8px;
}

.map-popup-card__tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  background: #f3e8ff;
  color: #7c3aed;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1;
}

.map-popup-card__location {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  color: #9ca3af;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.map-popup-card__content {
  display: block;
  color: inherit;
  text-decoration: none;
}

.map-popup-card__title {
  margin: 0;
  font-size: 16px;
  line-height: 1.3;
  font-weight: 700;
  color: #111827;
}

.map-popup-card__desc {
  margin: 6px 0 10px;
  font-size: 12px;
  line-height: 1.5;
  color: #6b7280;
}

.map-popup-card__price {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  color: #883cae;
}

.map-panel {
  display: flex;
  height: calc(100vh - 130px);
  min-height: 580px;
  overflow: hidden;
  background: #f3f4f6;
}

/* ── Left sidebar ────────────────────────────────────────── */
.map-panel__sidebar {
  width: 400px;
  min-width: 360px;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-right: 1px solid #e5e7eb;
  z-index: 2;
  transition: width 0.3s ease, min-width 0.3s ease, opacity 0.3s ease;
  overflow: hidden;
  flex-shrink: 0;
}

.map-panel__sidebar.collapsed {
  width: 0 !important;
  min-width: 0 !important;
  opacity: 0;
}

.map-panel__sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px;
  border-bottom: 1px solid #e5e7eb;
  background: #f9fafb;
  flex-shrink: 0;
}

.map-panel__count {
  font-size: 14px;
  color: #374151;
  font-weight: 500;
  white-space: nowrap;
}

.map-panel__count strong {
  color: #883cae;
}

.map-panel__sidebar-collapse {
  background: none;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 5px 8px;
  cursor: pointer;
  color: #6b7280;
  display: flex;
  align-items: center;
  line-height: 1;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}

.map-panel__sidebar-collapse:hover {
  background: #f3f4f6;
  color: #374151;
}

.map-panel__cards-scroll {
  overflow-y: auto;
  flex: 1;
  padding: 14px 14px 20px;
  scroll-behavior: smooth;
}

.map-panel__cards-scroll::-webkit-scrollbar { width: 5px; }
.map-panel__cards-scroll::-webkit-scrollbar-track { background: #f9fafb; }
.map-panel__cards-scroll::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 10px; }

.map-panel__selected-summary {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f6effc;
  color: #6b21a8;
  font-size: 12px;
  font-weight: 600;
}

.map-panel__selected-summary strong {
  color: #883cae;
}

/* ── Mini property card ──────────────────────────────────── */
.map-card {
  display: flex;
  gap: 14px;
  padding: 14px;
  border-radius: 12px;
  border: 1.5px solid #e5e7eb;
  margin-bottom: 12px;
  text-decoration: none !important;
  color: inherit !important;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  cursor: pointer;
}

.map-card:hover,
.map-card.is-active {
  border-color: #883cae;
  box-shadow: 0 2px 12px rgba(136, 60, 174, 0.12);
  background: #fdf8ff;
  color: inherit !important;
  text-decoration: none !important;
}

.map-card.is-selected {
  border-color: #883cae;
  box-shadow: 0 0 0 2px rgba(136, 60, 174, 0.12), 0 4px 16px rgba(136, 60, 174, 0.14);
  background: linear-gradient(180deg, #fff 0%, #fdf8ff 100%);
}

.map-card__img {
  position: relative;
  width: 118px;
  min-width: 118px;
  height: 96px;
  border-radius: 8px;
  overflow: hidden;
  background: #f3f4f6;
  flex-shrink: 0;
}

.map-card__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.map-card__img-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.map-card__img-placeholder img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  opacity: 0.35;
}

.map-card__badge {
  display: inline-block;
  align-self: flex-start;
  background: #f3e8ff;
  color: #883cae;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.4px;
  line-height: 1.5;
  text-transform: uppercase;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.map-card__badge--project {
  background: #e0f2fe;
  color: #0284c7;
}

.map-card__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.map-card__location {
  font-size: 10px;
  color: #9ca3af;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.map-card__title {
  font-size: 13px;
  font-weight: 600;
  color: #1f2937;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.map-card__features {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
  overflow: hidden;
  margin-top: 2px;
}

.map-card__feat {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: #4b5563;
  font-weight: 500;
  white-space: nowrap;
}

.map-card__feat svg {
  opacity: 0.7;
  flex-shrink: 0;
  color: #883cae;
}

.map-card__price {
  font-size: 14px;
  font-weight: 700;
  color: #883cae;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* No results state */
.map-panel__no-results {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 52px 20px;
  text-align: center;
  gap: 8px;
}

.map-panel__no-results svg {
  opacity: 0.4;
  margin-bottom: 6px;
}

.map-panel__no-results p {
  font-size: 15px;
  font-weight: 500;
  color: #6b7280;
  margin: 0;
}

.map-panel__no-results small {
  font-size: 12px;
  color: #9ca3af;
}

/* ── Map wrap (right side) ───────────────────────────────── */
.map-panel__map-wrap {
  flex: 1;
  position: relative;
  min-width: 0;
}

.map-panel__map-wrap #map {
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, #f8f5fe 0%, #efe8fb 100%);
}



/* Expand-list button (shown when sidebar is collapsed) */
.map-panel__expand-list {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  transition: background 0.15s, box-shadow 0.15s;
  line-height: 1;
}

.map-panel__expand-list:hover {
  background: #f9fafb;
  box-shadow: 0 4px 14px rgba(0,0,0,0.14);
}

/* "Search this area" floating button */
.map-search-area-btn {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: none;
  align-items: center;
  gap: 7px;
  background: #fff;
  border: 1.5px solid #883cae;
  border-radius: 24px;
  padding: 10px 22px;
  font-size: 13px;
  font-weight: 700;
  color: #883cae;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(136, 60, 174, 0.2);
  transition: background 0.15s, box-shadow 0.15s, transform 0.15s;
  white-space: nowrap;
  animation: slide-up 0.25s ease;
}

@keyframes slide-up {
  from { opacity: 0; transform: translateX(-50%) translateY(12px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.map-search-area-btn:hover {
  background: #883cae;
  color: #fff;
  box-shadow: 0 6px 22px rgba(136, 60, 174, 0.35);
}

.map-search-area-btn svg {
  flex-shrink: 0;
}

/* ── Tablet: narrower sidebar, still side-by-side ────────── */
@media (max-width: 991px) {
  .map-panel {
    flex-direction: row;
    height: calc(100vh - 110px);
  }

  .map-panel__map-wrap {
    position: relative;
    flex: 1;
    height: 100%;
  }

  .map-panel__sidebar {
    position: relative;
    width: 300px !important;
    min-width: 280px !important;
    max-height: 100%;
    border-right: 1px solid #e5e7eb;
    border-top: none;
    border-radius: 0;
    box-shadow: none;
    z-index: 2;
    transform: none !important;
    transition: width 0.3s ease, min-width 0.3s ease, opacity 0.3s ease;
    opacity: 1 !important;
  }

  .map-panel__sidebar.collapsed {
    width: 0 !important;
    min-width: 0 !important;
    opacity: 0;
  }

  .map-panel__sidebar-header {
    cursor: default;
    padding: 13px 16px;
    user-select: auto;
    justify-content: space-between;
  }

  .map-panel__sidebar-header::before {
    display: none;
  }

  .map-panel__sidebar-collapse {
    display: flex;
  }

  .map-panel__cards-scroll {
    pointer-events: auto !important;
  }

  .map-panel__expand-list {
    display: flex !important;
  }

  .map-search-area-btn {
    bottom: 28px;
    padding: 10px 22px;
    font-size: 13px;
  }
}

/* ── Mobile: show map only, hide the list drawer ───────────── */
@media (max-width: 767px) {
  .map-panel {
    display: block;
    height: calc(100vh - 110px);
    min-height: 420px;
  }

  .map-panel__map-wrap {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 420px;
    flex-shrink: 0;
  }

  .map-panel__sidebar {
    display: none !important;
  }

  .map-panel__sidebar-header {
    cursor: default;
    padding: 13px 16px;
    justify-content: space-between;
  }

  .map-panel__sidebar-header::before {
    display: none;
  }

  .map-panel__sidebar-collapse {
    display: flex;
  }

  .map-panel__expand-list {
    display: none !important;
  }

  .map-search-area-btn {
    bottom: 14px;
    font-size: 12px;
    padding: 9px 16px;
  }

  .map-card__img {
    width: 96px;
    min-width: 96px;
    height: 82px;
  }

  .map-card {
    padding: 12px;
    gap: 12px;
  }

  /* Popup card: shrink to fit narrow screens */
  .map-popup-card {
    width: calc(100vw - 48px);
    max-width: 300px;
  }

  .map-popup-card__swiper .swiper-slide {
    height: 160px;
  }

  .map-popup-card__actions {
    top: 8px;
    right: 8px;
    gap: 6px;
  }

  .map-popup-card__action {
    width: 30px;
    height: 30px;
  }

  /* Ensure Google's InfoWindow doesn't clip the card */
  .searchList__map .gm-style .gm-style-iw,
  .searchList__map .gm-style .gm-style-iw-c {
    max-width: calc(100vw - 24px) !important;
  }
}