.box-dashboard-content {
  display: flex;
  width: 100%;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  align-items: flex-start;
  position: relative;
}

.box-list-realestate {
  width: 100%;
  max-width: 1250px;
  margin: auto;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.box-dashboard-map {
  width: 0;
  opacity: 0;
  visibility: hidden;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  height: calc(100vh - 85px);
  position: sticky;
  top: 85px;
  align-self: flex-start;
}

.box-dashboard-content.map-open .box-dashboard-map {
  position: sticky;
  top: 85px;
}

.box-dashboard-content.map-open {
  max-width: 100%;
  padding: 0 15px;
}

.box-dashboard-content.map-open .box-list-realestate {
  width: 45%;
  max-width: 45%;
  margin: 0;
  padding-right: 25px;
}

.box-dashboard-content.map-open .box-dashboard-map {
  width: 55%;
  opacity: 1;
  visibility: visible;
}

.box-dashboard-content.map-open .right-sidebar {
  display: none;
}

.box-dashboard-content.map-open .left-content {
  width: 100%;
}

.btn-map.opened {
  background: #e63946;
}

.btn-map.opened:hover {
  background: #c1121f;
}

@media (max-width: 1200px) {
  .box-dashboard-content.map-open {
    flex-direction: column-reverse;
    padding: 0;
  }

  .box-dashboard-content.map-open .box-list-realestate,
  .box-dashboard-content.map-open .box-dashboard-map {
    width: 100%;
    max-width: 100%;
    padding-right: 0;
  }

  .box-dashboard-content.map-open .box-dashboard-map {
    position: relative;
    top: 0;
    height: 45vh;
    margin-bottom: 20px;
    border-radius: 0;
  }

  #mapDashboard {
    border-radius: 0;
  }
}

.custom-marker-map {
  position: relative;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: max-content;
}

.custom-marker-map:hover {
  z-index: 99 !important;
}

.custom-marker-map .marker-dot,
.custom-marker-map .marker-content {
  transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.custom-marker-map:hover .marker-dot,
.custom-marker-map:hover .marker-content {
  transform: scale(1.15) translateY(-5px);
}

.custom-marker-map .marker-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background-color: #ccc;
  border: 2px solid #fff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
  display: none;
}

.custom-marker-map .marker-content {
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
  border: 1px solid #fff;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.custom-marker-map .marker-content::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px 6px 0;
  border-style: solid;
  border-color: #333 transparent transparent transparent;
}

.custom-marker-map .vip-tag {
  background: rgba(255, 255, 255, 0.25);
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 9px;
  text-transform: uppercase;
  margin-left: 2px;
}

.custom-marker-map.tier-1 {
  z-index: 10;
}

.custom-marker-map.tier-1 .marker-content {
  background-color: #333;
}

.custom-marker-map.tier-1 .marker-content::after {
  border-top-color: #333;
}

.custom-marker-map.tier-2 {
  z-index: 20;
}

.custom-marker-map.tier-2 .marker-content {
  background-color: #009194;
}

.custom-marker-map.tier-2 .marker-content::after {
  border-top-color: #009194;
}

.custom-marker-map.tier-3 {
  z-index: 30;
}

.custom-marker-map.tier-3 .marker-content {
  background-color: #cfc925;
  color: #111;
}

.custom-marker-map.tier-3 .marker-content::after {
  border-top-color: #cfc925;
}

.custom-marker-map.tier-3 .vip-tag {
  background: rgba(0, 0, 0, 0.15);
}

.custom-marker-map.tier-4 {
  z-index: 40;
}

.custom-marker-map.tier-4 .marker-content {
  background-color: #432f80;
}

.custom-marker-map.tier-4 .marker-content::after {
  border-top-color: #432f80;
}

.mapboxgl-map.zoom-far .custom-marker-map.tier-1 .marker-content {
  display: none;
}

.mapboxgl-map.zoom-far .custom-marker-map.tier-1 .marker-dot {
  display: block;
}

.mapboxgl-popup-content {
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.map-popup-custom img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: 8px;
}

.map-popup-custom h4 {
  font-size: 14px;
  margin: 10px 0 6px;
  line-height: 1.4;
  color: #222;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.map-popup-custom .price {
  color: #e63946;
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 12px;
}

.map-popup-custom .btn-detail {
  display: block;
  text-align: center;
  background: #003c47;
  color: #fff;
  padding: 8px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  transition: 0.2s;
}

.map-popup-custom .btn-detail:hover {
  background: #e63946;
}

#mapDashboard {
  width: 100%;
  height: 100%;
  border-radius: 12px;
}

.btn-map-close {
  display: none;
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 10;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  background: #fff;
  border: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  color: #333;
  transition:
    background 0.2s,
    color 0.2s;
}

.btn-map-close:hover {
  background: #e63946;
  color: #fff;
}

.box-dashboard-content.map-open .btn-map-close {
  display: flex;
}

.box-dashboard-content.map-open .map-box-elite {
  display: none;
}

.map-style-switcher {
  position: absolute;
  bottom: 30px;
  right: 12px;
  z-index: 10;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  display: flex;
  overflow: hidden;
}

.style-btn {
  border: none;
  background: transparent;
  padding: 8px 15px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: #333;
  transition: all 0.2s ease;
}

.style-btn:hover {
  background: #f1f3f5;
}

.style-btn.active {
  background: #003c47;
  color: #fff;
}

/* =========================================
   FIX LỖI Z-INDEX CHO POPUP
========================================= */
.mapboxgl-popup {
  z-index: 10000 !important; /* Đảm bảo Popup luôn nằm trên cùng, đè lên ghim VIP */
}

/* Ép popup mất padding viền trắng mặc định để Card tràn viền đẹp hơn */
.mapboxgl-popup-content {
  padding: 0 !important;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

/* =========================================
   CHỈNH ICON TRONG GHIM (MARKER CONTENT)
========================================= */
.custom-marker-map .marker-content {
  display: flex;
  align-items: center;
  gap: 4px;
}
.custom-marker-map .marker-content svg {
  margin-right: 2px;
  vertical-align: middle;
}
.custom-marker-map .marker-area,
.custom-marker-map .price-text {
  display: flex;
  align-items: center;
}
.custom-marker-map .marker-separator {
  color: rgba(255, 255, 255, 0.6);
  margin: 0 2px;
}

/* =========================================
   TRANG TRÍ MINI CARD TRONG POPUP THEO TIER
========================================= */
.mini-property-card {
  position: relative;
  background: #fff;
  width: 260px;
  display: flex;
  flex-direction: column;
}

/* Tag góc trái trên cùng */
.mini-tag-vip {
  position: absolute;
  top: 0;
  left: 0;
  color: #fff;
  padding: 4px 10px;
  font-size: 10px;
  font-weight: bold;
  border-radius: 0 0 10px 0;
  z-index: 2;
  box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.2);
}

.mini-tag-vip.diamond {
  background: linear-gradient(45deg, #432f80, #6c4ab6);
}
.mini-tag-vip.gold {
  background: linear-gradient(45deg, #a69800, #cfc925);
  color: #000;
}
.mini-tag-vip.silver {
  background: linear-gradient(45deg, #007375, #009194);
}

/* Hình ảnh */
.mini-gallery img {
  width: 100%;
  height: 130px;
  object-fit: cover;
  border-radius: 12px 12px 0 0;
}

/* Nội dung Card */
.mini-body {
  padding: 12px;
}

.mini-title {
  font-size: 13px;
  margin: 0 0 10px 0;
  line-height: 1.4;
  color: #222;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Khu vực Giá & Diện tích */
.mini-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  border-bottom: 1px dashed #eee;
  padding-bottom: 10px;
}

.mini-meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.mini-meta-item.price {
  color: #e63946;
  font-weight: 700;
  font-size: 14px;
}

.mini-meta-item.area {
  color: #444;
  font-size: 13px;
  font-weight: 600;
}

/* Nút bấm xem chi tiết */
.mini-property-card .btn-detail {
  display: block;
  text-align: center;
  color: #fff;
  padding: 8px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  transition: 0.2s;
}

/* Đổi màu nút bấm theo Tier */
.mini-property-card .btn-detail.diamond {
  background: #432f80;
}
.mini-property-card .btn-detail.gold {
  background: #cfc925;
  color: #111;
}
.mini-property-card .btn-detail.silver {
  background: #009194;
}
.mini-property-card .btn-detail.normal {
  background: #003c47;
}

.mini-property-card .btn-detail:hover {
  opacity: 0.85;
}
