.samcue-map-page {
  background: #f5f7fa;
}

.samcue-map-fullscreen {
  padding-top: 2rem !important;
  padding-bottom: 2.5rem !important;
}

.samcue-map-intro {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.samcue-map-intro h3 {
  font-weight: 700;
  color: var(--samcue-navy, #0f1b3d);
}

/* Filters bar */
.samcue-map-filters {
  margin-bottom: 1.25rem;
}

.samcue-map-filters-card {
  background: #fff;
  border-radius: 16px;
  border: 1px solid #e8edf4;
  box-shadow: 0 8px 28px rgba(15, 27, 61, 0.06);
  padding: 1.25rem 1.35rem;
}

.samcue-map-filters-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  gap: 12px;
}

.samcue-map-filters-head h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--samcue-navy, #0f1b3d);
}

.samcue-map-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #7a8ba3;
  margin-bottom: 0.35rem;
}

.samcue-map-filters .form-control {
  border-radius: 10px;
  border-color: #dbe3ef;
  min-height: 42px;
  font-size: 0.9rem;
}

.samcue-map-filters-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #eef2f7;
}

.samcue-map-filters-actions .btn {
  border-radius: 10px;
  font-weight: 600;
  padding: 0.5rem 1.15rem;
}

.samcue-map-link-alt {
  color: #5b6b82 !important;
  font-weight: 600;
  text-decoration: none !important;
}

.samcue-map-link-alt:hover {
  color: #17c788 !important;
}

.samcue-map-count {
  font-size: 0.88rem;
  color: #5b6b82;
}

.samcue-map-count strong {
  color: var(--samcue-navy, #0f1b3d);
  font-size: 1rem;
}

/* Main layout */
.samcue-map-layout {
  align-items: stretch;
}

.samcue-map-layout > [class*="col-"] {
  display: flex;
  flex-direction: column;
}

/* Map */
.samcue-property-map-wrap {
  position: relative;
  flex: 1;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid #e8edf4;
  box-shadow: 0 12px 40px rgba(15, 27, 61, 0.1);
  background: #dbe3ef;
  min-height: 520px;
}

.samcue-map-fullscreen .samcue-property-map-wrap {
  min-height: calc(100vh - 340px);
}

#samcue-property-map {
  width: 100%;
  height: 100%;
  min-height: 520px;
  z-index: 1;
}

.samcue-map-fullscreen #samcue-property-map {
  min-height: calc(100vh - 340px);
}

.samcue-map-overlay-controls {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 500;
}

.samcue-map-overlay-controls .btn {
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.82rem;
  border: 0;
}

/* Results panel */
.samcue-map-results-card {
  background: #fff;
  border-radius: 16px;
  border: 1px solid #e8edf4;
  box-shadow: 0 8px 28px rgba(15, 27, 61, 0.06);
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 400px;
  max-height: calc(100vh - 340px);
  overflow: hidden;
}

.samcue-map-fullscreen .samcue-map-results-card {
  min-height: calc(100vh - 340px);
}

.samcue-map-results-head {
  padding: 1rem 1.15rem;
  border-bottom: 1px solid #eef2f7;
  flex-shrink: 0;
}

.samcue-map-results-head h5 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--samcue-navy, #0f1b3d);
}

.samcue-map-results-hint {
  display: block;
  font-size: 0.78rem;
  color: #8a97a8;
  margin-top: 0.25rem;
}

.samcue-map-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem;
}

.samcue-map-list::-webkit-scrollbar {
  width: 5px;
}

.samcue-map-list::-webkit-scrollbar-thumb {
  background: #c9d4e3;
  border-radius: 999px;
}

.samcue-map-card {
  display: flex;
  gap: 12px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid #e8edf4;
  background: #fafbfc;
  margin-bottom: 8px;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.samcue-map-card:last-child {
  margin-bottom: 0;
}

.samcue-map-card:hover,
.samcue-map-card.is-active {
  background: #fff;
  border-color: #17c788;
  box-shadow: 0 6px 18px rgba(23, 199, 136, 0.15);
}

.samcue-map-card-thumb {
  width: 80px;
  min-width: 80px;
  height: 68px;
  border-radius: 8px;
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
}

.samcue-map-card-body {
  min-width: 0;
  flex: 1;
}

.samcue-map-card-body h6 {
  font-size: 0.88rem;
  margin: 0 0 3px;
  line-height: 1.35;
  color: #1a2744;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.samcue-map-card-body .price {
  color: #17c788;
  font-weight: 700;
  font-size: 0.92rem;
}

.samcue-map-card-body .meta {
  font-size: 0.76rem;
  color: #6c7a90;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.samcue-map-badge {
  position: absolute;
  top: 5px;
  left: 5px;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 2px 6px;
  border-radius: 999px;
  color: #fff;
}

.samcue-map-badge.sale { background: #17c788; }
.samcue-map-badge.rent { background: #1a2980; }

/* Markers */
.samcue-price-marker-wrap { background: transparent; border: 0; }

.samcue-price-marker {
  position: relative;
  transform: translate(-50%, -100%);
  background: linear-gradient(135deg, #17c788, #12a86d);
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  box-shadow: 0 6px 16px rgba(23, 199, 136, 0.4);
  border: 2px solid #fff;
  white-space: nowrap;
}

.samcue-price-marker.is-rent {
  background: linear-gradient(135deg, #1a2980, #243da8);
  box-shadow: 0 6px 16px rgba(26, 41, 128, 0.35);
}

.samcue-price-marker::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -6px;
  transform: translateX(-50%);
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 7px solid #12a86d;
}

.samcue-price-marker.is-rent::after { border-top-color: #243da8; }

.samcue-cluster-wrap { background: transparent; border: 0; }

.samcue-cluster-marker {
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--samcue-navy, #0f1b3d), var(--samcue-blue, #1a2980));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  box-shadow: 0 8px 20px rgba(15, 27, 61, 0.3);
  border: 3px solid #fff;
}

/* Popups */
.samcue-leaflet-popup .leaflet-popup-content-wrapper {
  border-radius: 14px;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 14px 36px rgba(15, 27, 61, 0.2);
}

.samcue-leaflet-popup .leaflet-popup-content {
  margin: 0;
  width: 260px !important;
}

.samcue-leaflet-popup .leaflet-popup-tip { background: #fff; }

.samcue-map-popup-media { position: relative; }

.samcue-map-popup img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
}

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

.samcue-map-popup h6 {
  font-size: 0.92rem;
  margin-bottom: 5px;
  color: #1a2744;
}

.samcue-map-popup .price {
  color: #17c788;
  font-weight: 700;
  font-size: 0.95rem;
}

.samcue-map-popup .price span {
  color: #6c7a90;
  font-weight: 500;
  font-size: 0.82rem;
}

.samcue-map-popup .meta {
  font-size: 0.78rem;
  color: #6c7a90;
  margin-top: 2px;
}

.samcue-map-empty,
.samcue-map-loading {
  text-align: center;
  color: #8a97a8;
  padding: 2.5rem 1rem;
  font-size: 0.88rem;
}

.samcue-map-footnote {
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

/* Embedded mode (property.php) */
.samcue-map-embedded {
  padding-top: 1.25rem !important;
  padding-bottom: 0.5rem !important;
}

.samcue-map-embedded .samcue-map-filters-card {
  margin-bottom: 0;
}

.samcue-map-embedded .samcue-property-map-wrap,
.samcue-map-embedded #samcue-property-map {
  min-height: 380px;
}

.samcue-map-embedded .samcue-map-results-card {
  min-height: 380px;
  max-height: 480px;
  margin-bottom: 1rem;
}

.samcue-map-embedded .samcue-map-list {
  max-height: 320px;
}

@media (max-width: 991px) {
  .samcue-map-fullscreen .samcue-property-map-wrap,
  .samcue-map-fullscreen #samcue-property-map,
  .samcue-map-fullscreen .samcue-map-results-card {
    min-height: 360px;
    max-height: none;
  }

  .samcue-map-results-card {
    margin-bottom: 1rem;
  }

  .samcue-map-filters-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .samcue-map-count {
    margin-left: 0 !important;
    text-align: center;
  }
}
