.map-page {
  display: flex;
  height: 100vh;
  overflow: hidden;
  position: fixed;
  top: 80px;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9;
}

/* Admin bar offset */
.admin-bar .map-page {
  top: 32px;
  height: calc(100vh - 32px);
}
@media (max-width: 782px) {
  .admin-bar .map-page {
    top: 46px;
    height: calc(100vh - 46px);
  }
}

/* ── MAP (Left Fixed) ───────────────────────────────── */
.property-map-card {
  flex: 1 1 55%;
  height: 100%;
  position: relative;
  z-index: 1;
}

#property-map {
  width: 100%;
  height: 100%;
}

/* ── RIGHT PANEL (flex column) ──────────────────────── */
.property-list-card {
  flex: 1 0 420px;
  display: flex;
  flex-direction: column;
  height: 85%;
  background: #f8f8f6;
  border-left: 1px solid #e5e5e3;
  overflow: hidden;
}

/* ── FILTER BAR (flex-shrink:0 = fixed top) ─────────── */
.map-list-header {
  flex-shrink: 0;
  background: #fff;
  border-bottom: 1px solid #e5e5e3;
  padding: 12px 14px;
  z-index: 2;
}

.map-filter-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.map-filter-search-row {
  display: flex;
  gap: 8px;
  width: 100%;
}

.map-filter-search-row input[type="text"] {
  width: 100%;
  height: 38px;
  border: 1px solid #d8d8d5;
  border-radius: 8px;
  padding: 0 12px;
  font-size: 13px;
  background: #f8f8f6;
  color: #1a1a1a;
  outline: none;
  transition: border-color .2s;
}

.map-filter-search-row input[type="text"]:focus {
  border-color: #06364b;
  background: #fff;
}

#map-search-btn {
  height: 38px;
  padding: 0 16px;
  background: #06364b;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background .2s;
}
#map-search-btn:hover { background: #0c447c; }

.map-filter-selects {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.map-filter-selects select {
  flex: 1 1 calc(25% - 6px);
  min-width: 100px;
  height: 34px;
  border: 1px solid #d8d8d5;
  border-radius: 7px;
  padding: 0 10px;
  font-size: 12px;
  background: #f8f8f6;
  color: #333;
  cursor: pointer;
  outline: none;
  transition: border-color .2s;
  appearance: auto;
}

.map-filter-selects select:focus {
  border-color: #185FA5;
  background: #fff;
}

.map-filter-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
}

#map-result-count {
  font-size: 12px;
  color: #666;
  font-weight: 500;
}

#map-clear-filters {
  font-size: 12px;
  color: #888;
  background: #f8f8f6;
  border: none;
  cursor: pointer;
  padding: 2px 12px;
  border-radius: 4px;
  transition: color .2s, background .2s;
}
#map-clear-filters:hover {
  color: #06364b;
  background: #e8f0fb;
}

/* ── LOADER (flex-shrink:0) ─────────────────────────── */
#map-loader {
  display: none;
  flex-shrink: 0;
  height: 3px;
  background: linear-gradient(90deg, #185FA5 0%, #5ba3e8 50%, #185FA5 100%);
  background-size: 200% 100%;
  animation: mpc-loader-slide 1.2s linear infinite;
}
@keyframes mpc-loader-slide {
  0%   { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* ── LISTINGS (flex:1 = scrollable middle) ──────────── */
#map-listings {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}

#map-listings::-webkit-scrollbar       { width: 4px; }
#map-listings::-webkit-scrollbar-track { background: transparent; }
#map-listings::-webkit-scrollbar-thumb { background: #d0d0cc; border-radius: 4px; }

/* ── MAP LIST CARD ──────────────────────────────────── */
.map-list-card {
  background: #fff;
  border-radius: 12px;
  border: 1.5px solid #eee;
  overflow: hidden;
  cursor: pointer;
  transition: border-color .2s, box-shadow .2s, transform .15s;
  flex-shrink: 0;
}

.map-list-card:hover {
  border-color: #185FA5;
  box-shadow: 0 4px 16px rgba(24,95,165,.12);
  transform: translateY(-1px);
}

.map-list-card.mpc-active {
  border-color: #185FA5;
  box-shadow: 0 0 0 3px rgba(24,95,165,.15), 0 4px 20px rgba(24,95,165,.15);
}

.map-list-card .card-top {
  padding: 12px 14px 8px;
}

.map-list-card .card-top h2 {
  font-size: 16px;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 4px;
}

.map-list-card .card-top p {
  font-size: 12px;
  color: #6b7280;
  margin: 0 0 6px;
}

.map-list-card .meta {
  display: flex;
  gap: 8px;
  font-size: 12px;
  color: #374151;
}

.map-list-card .meta span {
  padding: 2px 8px;
  font-weight: 500;
}

.map-list-card .mlsListing {
  font-size: 11px;
  color: #9ca3af;
  margin-top: 4px;
}

.map-list-card .slider-wrapper {
  position: relative;
  height: 160px;
  overflow: hidden;
}

.map-list-card .slider-wrapper img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
}

.map-list-card .banner {
  position: absolute;
  top: 20px;
  left: 8px;
  background: #e63a46;
  color: #fff;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 12px;
  backdrop-filter: blur(4px);
  pointer-events: none;
}

.map-list-card .view-btn {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: #185FA5;
  color: #fff;
  font-size: 14px;
  padding: 10px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 500;
  transition: background .2s;
}
.map-list-card .view-btn:hover { background: #0c447c; color: #fff; }

.map-card-nophoto {
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: #aaa;
  background: #f5f5f3;
}

/* ── EMPTY / LOADING STATES ─────────────────────────── */
.mpc-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 60px 20px;
  color: #aaa;
  text-align: center;
  flex: 1;
}
.mpc-empty svg   { opacity: .3; }
.mpc-empty p     { font-size: 15px; color: #666; margin: 0; }
.mpc-empty span  { font-size: 13px; color: #aaa; }

.mpc-loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 60px 20px;
  color: #999;
  font-size: 13px;
  flex: 1;
}

.mpc-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #e5e5e3;
  border-top-color: #185FA5;
  border-radius: 50%;
  animation: mpc-spin .7s linear infinite;
}
@keyframes mpc-spin { to { transform: rotate(360deg); } }

/* ── PAGINATION (flex-shrink:0 = fixed bottom) ──────── */
#map-pagination {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px 14px;
  background: #fff;
  border-top: 1px solid #e5e5e3;
  flex-wrap: wrap;
}

button.mpc-pg-btn {
  padding: 5px 10px !important;
  border: 1px solid #e0e0dd;
  border-radius: 5px;
  background: #fff;
  color: #444;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
}

.mpc-pg-btn:hover:not([disabled]):not(.active) {
  border-color: #06364b;
  color: #06364b;
  background: #e8f0fb;
}

.mpc-pg-btn.active {
  background: #06364b;
  color: #fff;
  border-color: #06364b;
}

.mpc-pg-btn[disabled] {
  opacity: .3;
  cursor: not-allowed;
}

.mpc-pg-dots {
  font-size: 13px;
  color: #bbb;
  padding: 0 4px;
}

/* ── GOOGLE MAPS POPUP ──────────────────────────────── */
.gm-style .gm-style-iw-c {
  border-radius: 10px !important;
  box-shadow: 0 4px 16px rgba(0,0,0,.15) !important;
}
.gm-style .gm-style-iw-d { overflow: hidden !important; }

/* ── RESPONSIVE ─────────────────────────────────────── */
@media (max-width: 900px) {
  .map-page {
    flex-direction: column;
    position: relative;
    height: auto;
    overflow: visible;
	  top:0px;
  }

  .property-map-card {
    flex: none;
    width: 100%;
    height: 45vh;
    position: sticky;
    top: 0;
    z-index: 2;
	  order: 2;
  }

  .property-list-card {
    flex: none;
    width: 100%;
    height: 55vh;
    border-left: none;
    border-top: 1px solid #e5e5e3; order: 1;
  }
	
}

@media (max-width: 600px) {
  .property-map-card { height: 100vh; }
  .property-list-card { height: 100vh; }

  .map-filter-selects select {
    flex: 1 1 calc(50% - 6px);
  }

  .map-list-header { padding: 10px; }
  #map-listings { padding: 8px; gap: 8px; }

  .map-list-card .slider-wrapper,
  .map-list-card .slider-wrapper img { height: 130px; }
	
}