.nd-map-search {
  --map-brand: #00b14f;
  --map-brand-dark: #009940;
  --map-text: #111827;
  --map-muted: #6b7280;
  --map-line: #e5e7eb;
  --map-shell-top: 98px;
  --map-filter-height: 148px;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - var(--map-shell-top));
  max-height: calc(100vh - var(--map-shell-top));
  overflow: hidden;
  background: #f3f6f8;
}
.nd-map-search__top {
  flex: 0 0 auto;
  border-bottom: 1px solid var(--map-line);
  background: radial-gradient(circle at 16% 18%, rgba(0, 180, 92, 0.08), transparent 30%),
              radial-gradient(circle at 88% 8%, rgba(16, 24, 39, 0.05), transparent 28%),
              linear-gradient(135deg, #f5fbf7 0%, #eef8f3 52%, #f8fbf9 100%);
  box-shadow: 0 10px 28px rgba(15, 23, 42, .07);
  z-index: 40;
}
.nd-map-search__body {
  display: grid;
  grid-template-columns: minmax(390px, 34vw) minmax(0, 1fr);
  flex: 1;
  min-height: 0;
  overflow: hidden;        /* ← chặn grid row tự mở rộng */
  align-items: stretch;   /* ← list + map cao bằng nhau */
}
.nd-map-search__list {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border-right: 1px solid var(--map-line);
  background: #fff;
  box-shadow: 10px 0 30px rgba(15, 23, 42, .06);
  z-index: 20;
  height: 100%;            /* ← fill grid cell */
  overflow: hidden;        /* ← không tràn ra ngoài */
  min-height: 0;           /* ← quan trọng với flex */
}
.nd-map-search__head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 8px 18px 6px;
  background: transparent;
}
.nd-map-search__eyebrow {
  display: none;
}
.nd-map-search__title-group {
  flex: 0 0 auto;
}
.nd-map-search__head h1 {
  margin: 0;
  color: var(--map-text);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
}
.nd-map-search__switch {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  padding: 4px 9px;
  border: 1px solid var(--map-line);
  border-radius: 10px;
  color: var(--map-text);
  font-size: 11px;
  font-weight: 800;
  text-decoration: none;
  background: #fff;
  margin-left: auto; /* Push to the far right */
  white-space: nowrap;
}
.nd-map-filters {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 7px 18px 9px;
  background: rgba(0, 0, 0, 0.025);
  border-top: 1px solid var(--map-line);
  overflow-x: auto;
  white-space: nowrap;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.nd-map-filters::-webkit-scrollbar {
  display: none;
}

.nd-map-toggle-group {
  display: flex;
  background: #fff;
  border: 1px solid var(--map-line);
  border-radius: 999px;
  padding: 3px;
  flex-shrink: 0;
  height: 36px;
  box-sizing: border-box;
}
.nd-map-toggle-btn {
  border: none;
  background: transparent;
  color: var(--map-muted);
  font-size: 13px;
  font-weight: 700;
  padding: 0 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: all .18s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}
.nd-map-toggle-btn.active {
  background: var(--map-brand);
  color: #fff !important;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(0, 177, 79, .35);
}
.nd-map-toggle-btn:hover:not(.active) {
  color: var(--map-text);
  background: rgba(0, 0, 0, .04);
}

.nd-map-search-input-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--map-line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
  height: 36px;
  flex: 1 1 0;
  min-width: 140px;
  max-width: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.nd-map-search-input-wrapper:focus-within {
  border-color: var(--map-brand);
  box-shadow: 0 0 0 3px rgba(0, 177, 79, .12);
}
.nd-map-search-input-wrapper i {
  color: var(--map-muted);
  font-size: 13px;
}
.nd-map-search-input-wrapper input {
  border: none;
  outline: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--map-text);
  width: 100%;
  background: transparent;
}

.nd-map-select {
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--map-line);
  border-radius: 8px;
  background-color: #fff;
  color: var(--map-text);
  font-size: 13px;
  font-weight: 700;
  outline: none;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color .15s ease, box-shadow .15s ease;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 12px;
  padding-right: 28px;
}
.nd-map-select:focus {
  border-color: var(--map-brand);
  box-shadow: 0 0 0 3px rgba(0, 177, 79, .12);
}

.nd-map-reset-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: none;
  color: var(--map-muted);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0 10px;
  transition: color .15s ease;
}
.nd-map-reset-link:hover {
  color: #ef4444;
}
.nd-map-results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 22px;
  border-bottom: 1px solid var(--map-line);
  color: var(--map-muted);
  font-size: 13px;
  font-weight: 500;
  flex: 0 0 auto;          /* ← header không co lại */
  background: #fff;
}
.nd-map-results-head b {
  color: var(--map-text);
  font-weight: 700;
  font-size: 14px;
}
.nd-map-results-head select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234b5563' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px;
  background-color: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 6px 28px 6px 12px;
  color: #374151;
  font-size: 12px;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  max-width: 180px;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.nd-map-results-head select:hover {
  border-color: var(--map-brand);
  background-color: #f0fdf4;
  color: var(--map-brand);
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2300b14f' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
}
.nd-map-results-head select:focus {
  border-color: var(--map-brand);
  box-shadow: 0 0 0 3px rgba(0, 177, 79, 0.12);
}
.nd-map-results {
  flex: 1 1 0;             /* ← fill phần còn lại trong list */
  min-height: 0;
  overflow-y: auto;        /* ← scroll trong đây */
  padding: 12px;
}
.nd-map-card {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 11px;
  padding: 9px;
  border: 1px solid var(--map-line);
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.nd-map-card + .nd-map-card {
  margin-top: 10px;
}
.nd-map-card:hover,
.nd-map-card.is-active {
  border-color: var(--map-brand);
  box-shadow: 0 12px 28px rgba(17, 24, 39, .08), 0 0 0 4px rgba(0, 177, 79, .1);
}
.nd-map-card__media {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  background: #eef2f7;
  min-height: 106px;
}
.nd-map-card__media img {
  width: 100%;
  height: 100%;
  min-height: 106px;
  object-fit: cover;
  display: block;
}
.nd-map-card__badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 4px 8px;
  border-radius: 999px;
  color: #fff;
  background: var(--map-brand);
  font-size: 10px;
  font-weight: 900;
}
.nd-map-card__body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.nd-map-card__price {
  color: var(--map-brand);
  font-size: 16px;
  font-weight: 950;
}
.nd-map-card__title {
  margin: 4px 0 0;
  color: var(--map-text);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.35;
}
.nd-map-card__meta,
.nd-map-card__addr {
  margin-top: 6px;
  color: var(--map-muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
}
.nd-map-card__addr {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nd-map-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 6px;
  border-top: 1px solid var(--map-line);
}
.nd-map-card__time {
  color: var(--map-muted);
  font-size: 11px;
  font-weight: 750;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-right: 8px;
  min-width: 0;
}
.nd-map-card__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 5px 12px;
  border-radius: 99px;
  color: #fff;
  background: var(--map-brand);
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
  transition: background .15s ease, transform .15s ease;
  flex-shrink: 0;
}
.nd-map-card__cta:hover {
  background: var(--map-brand-dark);
  transform: translateY(-1px);
}
.nd-map-card__heart {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 10;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, .9);
  color: var(--map-muted);
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
  transition: transform .12s ease, background .12s ease, color .12s ease;
}
.nd-map-card__heart:hover {
  transform: scale(1.1);
  background: #fff;
  color: #ef4444;
}
.nd-map-card__heart.is-saved {
  background: #ef4444 !important;
  color: #fff !important;
}
.nd-map-empty,
.nd-map-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 260px;
  color: var(--map-muted);
  text-align: center;
  font-size: 13px;
  font-weight: 750;
}
.nd-map-empty b,
.nd-map-loading b {
  display: block;
  color: var(--map-text);
  font-size: 16px;
  margin-bottom: 5px;
}
.nd-map-search__map-wrap {
  position: relative;
  min-width: 0;
  min-height: 0;
}
.nd-map-canvas {
  width: 100%;
  height: 100%;
  min-height: 520px;
  background: #e5e7eb;
}
.nd-map-tools {
  position: absolute;
  z-index: 700;
  top: 18px;
  left: 18px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.nd-map-tool {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--map-line);
  border-radius: 12px;
  color: var(--map-text);
  background: #fff;
  box-shadow: 0 12px 28px rgba(17, 24, 39, .14);
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}
.nd-map-hint {
  position: absolute;
  z-index: 700;
  left: 16px;
  right: 16px;
  bottom: 16px;
  max-width: 520px;
  padding: 12px 16px;
  border: 1.5px solid #ffe8cc;
  border-radius: 12px;
  color: #b25e00;
  background: #fffcf5;
  box-shadow: 0 10px 30px rgba(178, 94, 0, .08);
  font-size: 13px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}
.nd-map-hint i {
  color: #f59e0b;
  font-size: 15px;
}

/* ============================================
   PRICE MARKER — Google Maps AdvancedMarkerElement
   Anchor mặc định = bottom-center của element
   ============================================ */

.nd-map-price-marker {
  display: inline-block;
  margin-bottom: 4px;
  padding: 4px 10px;
  border: 2px solid #fff;
  border-radius: 10px;
  color: #fff;
  background: var(--map-brand);
  box-shadow: 0 2px 8px rgba(0, 177, 79, .35);
  font-size: 11px;
  font-weight: 950;
  white-space: nowrap;
  cursor: pointer;
  transition: background .12s ease, transform .12s ease;
}

.nd-map-price-marker:hover {
  background: #007a35;
  transform: scale(1.12);
  box-shadow: 0 4px 12px rgba(0, 177, 79, .45);
}

.nd-map-price-marker.is-active {
  background: #111827 !important;
  color: #fff !important;
  border-color: #fff !important;
  box-shadow: 0 4px 12px rgba(17, 24, 39, 0.45) !important;
  transform: scale(1.12);
}

/* ============================================
   CENTER MARKER — crosshair tâm tìm kiếm
   ============================================ */

.nd-map-center-marker {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-bottom: 18px;
  pointer-events: none;
  user-select: none;
}

.nd-map-center-label {
  display: inline-block;
  margin-top: 2px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(220, 38, 38, .95);
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .18);
}

/* ============================================
   GOOGLE MAPS INFOWINDOW — override mặc định
   ============================================ */

.gm-style .gm-style-iw-c {
  padding: 0 !important;
  border-radius: 14px !important;
  box-shadow: 0 12px 32px rgba(17, 24, 39, .18) !important;
  overflow: hidden !important;
}

.gm-style .gm-style-iw-d {
  padding: 0 !important;
  overflow: hidden !important;
  max-height: none !important;
}

.gm-style button.gm-ui-hover-effect {
  display: none !important;
}

.nd-map-popup {
  width: 240px;
  padding: 12px 12px 0 12px;
  box-sizing: border-box;
}
.nd-map-popup img {
  width: 100%;
  height: 116px;
  object-fit: cover;
  display: block;
  border-radius: 8px;
}
.nd-map-popup__body {
  padding: 10px 0 12px 0;
}
.nd-map-popup__price {
  color: var(--map-brand);
  font-size: 15px;
  font-weight: 950;
}
.nd-map-popup__title {
  margin-top: 4px;
  color: var(--map-text);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.35;
}
.nd-map-popup__meta {
  margin-top: 5px;
  color: var(--map-muted);
  font-size: 11px;
  font-weight: 700;
}
.nd-map-popup a {
  display: block;
  margin-top: 8px;
  padding: 8px;
  border-radius: 8px;
  color: #fff;
  background: var(--map-brand);
  font-size: 12px;
  font-weight: 900;
  text-align: center;
  text-decoration: none;
}
@media (max-width: 900px) {
  .nd-map-search {
    max-height: calc(100vh - var(--map-shell-top));
    overflow: hidden;
  }
  .nd-map-search__body {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
  }
  .nd-map-search__map-wrap {
    flex: 1 1 50%;
    min-height: 220px; /* FIX: bảo đảm bản đồ luôn hiển thị trên mobile */
    position: relative;
    order: -1;
  }
  .nd-map-canvas {
    height: 100%;
    min-height: 220px; /* FIX: override min-height:0 khiến canvas biến mất */
  }
  .nd-map-search__list {
    flex: 1 1 50%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: #fff;
    box-shadow: none;
    border-right: none;
    border-top: 1px solid var(--map-line);
    max-height: none;
  }
  .nd-map-hint {
    display: none !important;
  }
  .nd-map-tools {
    gap: 6px;
    flex-wrap: wrap;
    top: 10px;
    left: 10px;
    right: 10px;
  }
  .nd-map-tool {
    flex: 1 1 auto;
    justify-content: center;
    font-size: 11px !important;
    padding: 0 8px !important;
    min-height: 32px !important;
  }
}
@media (max-width: 720px) {
  .nd-map-search {
    --map-shell-top: 82px;
  }
  .nd-map-search__head {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px 6px !important;
    gap: 8px 12px !important;
  }
  .nd-map-search__title-group {
    display: block !important;
    flex: 1 1 auto;
  }
  .nd-map-search__head h1 {
    font-size: 13px !important;
    margin: 0;
  }
  .nd-map-search__eyebrow {
    display: none !important;
  }
  .nd-map-search__switch {
    margin: 0;
    padding: 4px 10px;
    font-size: 10px;
    border-radius: 8px;
    margin-left: auto;
  }
  .nd-map-search__head .nd-map-toggle-group {
    flex: 0 0 auto;
  }
  .nd-map-search__head .nd-map-search-input-wrapper {
    flex: 1 1 100%;
    max-width: none !important;
  }
  .nd-map-filters {
    padding: 6px 12px 8px !important;
    gap: 6px;
  }
  .nd-map-results-head {
    padding: 8px 12px;
  }
  .nd-map-card {
    grid-template-columns: 118px minmax(0, 1fr);
    padding: 8px;
    gap: 8px;
    border-radius: 12px;
  }
  .nd-map-card__media, .nd-map-card__media img {
    min-height: 100px;
  }
  .nd-map-card__price {
    font-size: 14px;
  }
  .nd-map-card__title {
    font-size: 12px;
    margin: 2px 0 0;
  }
  .nd-map-card__meta, .nd-map-card__addr {
    font-size: 11px;
    margin-top: 4px;
  }
  .nd-map-card__cta {
    padding: 4px 10px;
    font-size: 10px;
  }
}

/* ============================================
   LIVE TICKER BAR (TRỰC TIẾP)
   ============================================ */
.nd-ticker {
  position: relative;
  z-index: 190;
  height: 36px;
  overflow: hidden;
  background: #101827;
  display: flex;
  align-items: center;
}
.nd-ticker__live {
  flex-shrink: 0;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 18px;
  color: #fff;
  background: #ef4444;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.nd-ticker__dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #fff;
  animation: ndPulse 1.4s ease-in-out infinite;
}
@keyframes ndPulse {
  50% { opacity: .45; transform: scale(.72); }
}
.nd-ticker__scroll {
  flex: 1;
  overflow: hidden;
}
.nd-ticker__track {
  display: flex;
  white-space: nowrap;
  animation: ndTicker 36s linear infinite;
}
@keyframes ndTicker {
  to { transform: translateX(-50%); }
}
.nd-ticker__item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-right: 34px;
  color: rgba(255, 255, 255, .72);
  font-size: 12px;
  font-weight: 750;
  text-decoration: none;
}
.nd-ticker__item::before {
  content: "·";
  color: #00B14F;
  font-size: 20px;
}
.nd-ticker__item b {
  color: #fff;
  font-weight: 900;
}
.nd-ticker__item em {
  color: #00B14F;
  font-style: normal;
  font-weight: 900;
}
.nd-ticker__close {
  width: 36px;
  height: 36px;
  color: rgba(255, 255, 255, .45);
  border: none;
  background: none;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}
@media (max-width: 760px) {
  .nd-ticker__live {
    padding: 0 12px;
    font-size: 10px;
    letter-spacing: .08em;
  }
  .nd-ticker__close {
    width: 32px;
    flex: 0 0 32px;
  }
}

/* Fullscreen mode dashboard layout */
.nd-map-search.is-fullscreen {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  max-height: 100vh !important;
  z-index: 99999 !important;
  --map-shell-top: 0px !important;
}
.nd-map-search.is-fullscreen .nd-map-search__body {
  grid-template-columns: minmax(320px, 28vw) minmax(0, 1fr);
}

/* ============================================================
   PATCH: Unified Single Row + Expand Panel
   Dán vào CUỐI file: css/map-search.css
   (trước @media block cuối cùng hoặc append vào EOF)
   Ngày: 2026-05-23
============================================================ */

/* --- Gộp 2 row thành 1, ẩn row cũ --- */
.nd-map-search__head {
  position: relative !important;
  flex-wrap: nowrap !important;
  overflow: hidden !important;
  gap: 5px !important;
  padding: 5px 12px !important;
}
@media (max-width: 900px) {
  .nd-map-search__head {
    padding-right: 44px !important;
  }
}
.nd-map-filters {
  display: none !important;
}
.nd-map-search__title-group {
  display: none !important;
}
.nd-map-search__switch {
  display: none !important;
}

/* --- Unified row container --- */
#nd-unified-row {
  display: flex;
  align-items: center;
  gap: 5px;
  width: 100%;
  overflow: hidden;
  flex-shrink: 1;
  min-width: 0;
}

/* --- Listing type toggle (Mua / Thuê / DA) --- */
#listingTypeToggle {
  flex-shrink: 0 !important;
  gap: 2px !important;
  height: 30px !important;
  border-right: 1px solid var(--map-line);
  padding-right: 8px;
  margin-right: 2px;
}
#listingTypeToggle .nd-map-toggle-btn {
  font-size: 11px !important;
  padding: 0 8px !important;
}

/* --- Search input thu hẹp --- */
#nd-unified-row .nd-map-search-input-wrapper {
  flex: 1 1 90px !important;
  min-width: 90px !important;
  max-width: 200px !important;
  height: 28px !important;
}
#nd-unified-row .nd-map-search-input-wrapper input {
  font-size: 11px !important;
}

/* --- Selects: Loại BĐS, Giá, Tỉnh/TP, Quận/Huyện --- */
#mapPropertyType,
#mapPriceRange,
#mapRadius,
#mapProvince,
#mapDistrict,
#mapOwnerTypeSelect {
  font-size: 11px !important;
  height: 28px !important;
  padding: 0 22px 0 7px !important;
  flex-shrink: 0 !important;
  max-width: 110px !important;
}

/* --- Owner toggle (Chính chủ / Môi giới) --- */
#ownerTypeToggle {
  display: flex !important;
  flex-shrink: 0 !important;
  gap: 2px !important;
  height: 30px !important;
  border-left: 1px solid var(--map-line);
  padding-left: 8px;
  margin-left: 2px;
}
#ownerTypeToggle .nd-map-toggle-btn {
  font-size: 11px !important;
  padding: 0 8px !important;
}
#mapOwnerTypeSelect {
  display: none !important;
  flex: 0 0 auto !important;
  max-width: 118px !important;
  order: 2 !important;
}

@media (max-width: 1200px) {
  #ownerTypeToggle {
    display: none !important;
  }
  #mapOwnerTypeSelect {
    display: block !important;
    order: 2 !important;
  }
  #nd-unified-row .nd-map-search-input-wrapper {
    order: 3 !important;
  }
  #nd-unified-row #mapPropertyType,
  #nd-unified-row #mapPriceRange,
  #nd-unified-row #mapRadius,
  #nd-unified-row #mapProvince,
  #nd-unified-row #mapDistrict {
    order: 4 !important;
  }
}

/* --- Results head gộp vào row --- */
#nd-unified-row .nd-map-results-head {
  display: flex !important;
  align-items: center !important;
  gap: 5px !important;
  padding: 0 0 0 8px !important;
  border-bottom: none !important;
  border-top: none !important;
  border-left: 1px solid var(--map-line) !important;
  color: var(--map-muted) !important;
  font-size: 11px !important;
  font-weight: 750 !important;
  flex: 0 0 auto !important;
  white-space: nowrap !important;
  margin-left: 2px !important;
}
#nd-unified-row .nd-map-results-head b {
  color: var(--map-text) !important;
  font-size: 12px !important;
}
#nd-unified-row .nd-map-results-head select {
  border: 0 !important;
  outline: none !important;
  color: var(--map-text) !important;
  font-size: 11px !important;
  font-weight: 850 !important;
  background: transparent !important;
  max-width: 140px !important;
  cursor: pointer !important;
}

/* --- Nút expand cố định bên phải --- */
#nd-expand-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--map-line);
  border-radius: 6px;
  background: #f9fafb;
  color: #6b7280;
  cursor: pointer;
  z-index: 10;
  padding: 0;
  transition: all 0.18s ease;
}
#nd-expand-btn:hover {
  background: #f0fdf4;
  border-color: var(--map-brand);
  color: var(--map-brand);
}
#nd-expand-btn.nd-expand-active {
  background: #dcfce7;
  border-color: var(--map-brand);
  color: var(--map-brand);
}
#nd-expand-btn svg {
  transition: transform 0.2s ease;
  display: block;
}
#nd-expand-btn.nd-expand-active svg {
  transform: rotate(90deg);
}

/* --- Expand panel (bán kính + quận/huyện) --- */
#nd-expand-panel {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  background: #f8fafc;
  border-bottom: 1px solid var(--map-line);
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.22s ease, opacity 0.18s ease, padding 0.2s ease;
  flex: 0 0 auto;
}
#nd-expand-panel.nd-panel-open {
  max-height: 52px;
  opacity: 1;
  padding: 7px 12px;
}
#nd-expand-panel label {
  font-size: 11px;
  font-weight: 700;
  color: var(--map-muted);
  white-space: nowrap;
  flex-shrink: 0;
}
#nd-expand-panel #mapRadius,
#nd-expand-panel #mapDistrict {
  display: block !important;
  font-size: 12px;
  height: 30px;
  padding: 0 22px 0 8px;
  border: 1px solid var(--map-line);
  border-radius: 6px;
  background: #fff;
  flex-shrink: 0;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 6px center;
  background-size: 11px;
  color: var(--map-text);
  font-weight: 700;
  cursor: pointer;
  outline: none;
  transition: border-color .15s ease;
}
#nd-expand-panel #mapRadius:focus,
#nd-expand-panel #mapDistrict:focus {
  border-color: var(--map-brand);
  box-shadow: 0 0 0 3px rgba(0,177,79,.12);
}
#nd-expand-panel #mapRadius   { max-width: 90px; }
#nd-expand-panel #mapDistrict { min-width: 160px; max-width: 220px; }

/* ============================================
   NhaDat888 - Filter Bar Enhancement
   Domain: nhadat888.vn
   ============================================ */

/* Filter bar chính (Row 1) */
.nd-map-search__head {
  background-color: rgb(255, 255, 255) !important;
  border-radius: 10px 10px 0px 0px !important;
  padding: 5px 14px !important;
  box-shadow: none !important;
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
  border-bottom: 1px solid rgba(0, 100, 0, 0.12) !important;
  margin-bottom: 0px !important;
}

/* Phần expanded - Bán kính & Quận/huyện (Row 2) */
.nd-panel-open {
  background-color: rgb(244, 249, 246) !important;
  border-radius: 0px 0px 10px 10px !important;
  padding: 7px 14px !important;
  box-shadow: rgba(0, 0, 0, 0.13) 0px 4px 14px !important;
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
  border-top: 1px solid rgba(0, 100, 0, 0.1) !important;
  margin-top: 0px !important;
  display: flex !important;
  align-items: center !important;
  gap: 16px !important;
  justify-content: center !important;
}

/* ============================================================
  FIX MOBILE: Filter bar wrap trên màn hình < 480px
  Date: 2026-05-23
  ============================================================ */
@media (max-width: 480px) {
  .nd-map-search {
    --map-shell-top: 56px;
  }

  /* Filter row wrap xuống dòng thay vì overflow ẩn */
  #nd-unified-row {
    flex-wrap: wrap !important;
    gap: 4px !important;
    overflow: visible !important;
  }

  /* Listing toggle (Tất cả / Mua bán / Cho thuê) */
  #nd-unified-row #listingTypeToggle {
    flex: 0 0 auto;
    border-right: none;
    padding-right: 0;
    margin-right: 0;
    order: 1;
  }

  /* Owner source filter */
  #nd-unified-row #ownerTypeToggle,
  #nd-unified-row #mapOwnerTypeSelect {
    flex: 0 0 auto;
    border-left: none;
    padding-left: 0;
    margin-left: 0;
    order: 2;
  }
  #nd-unified-row #mapOwnerTypeSelect {
    height: 32px !important;
    padding: 0 18px 0 7px !important;
  }

  /* Search input chiếm full width hàng riêng */
  #nd-unified-row .nd-map-search-input-wrapper {
    flex: 1 1 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    height: 32px !important;
    order: 3;
  }

  /* 3 select (Loại BĐS / Giá / Tỉnh/TP) chia đều 1 hàng */
  #nd-unified-row #mapPropertyType,
  #nd-unified-row #mapPriceRange,
  #nd-unified-row #mapProvince {
    flex: 1 1 calc(33% - 6px) !important;
    max-width: none !important;
    min-width: 70px !important;
    font-size: 10px !important;
    padding: 0 18px 0 5px !important;
    order: 4;
  }

  /* Results count xuống hàng riêng */
  .nd-map-results-head {
    border-left: none !important;
    padding-left: 0 !important;
    margin-left: 0 !important;
    order: 5;
    width: 100%;
  }

  /* Bản đồ: chiều cao cố định để không bị co lại */
  .nd-map-search__map-wrap {
    min-height: 200px !important;
    flex: 0 0 200px !important;
  }
  .nd-map-canvas {
    min-height: 200px !important;
  }

  /* Danh sách BĐS */
  .nd-map-search__list {
    flex: 1 1 auto !important;
    min-height: 160px !important;
  }

  /* Card tin nhỏ hơn */
  .nd-map-card {
    grid-template-columns: 96px minmax(0, 1fr) !important;
    padding: 7px !important;
    gap: 7px !important;
  }
  .nd-map-card__media,
  .nd-map-card__media img {
    min-height: 82px !important;
  }
}

/* Custom premium scrollbar for results list on all platforms */
.nd-map-results::-webkit-scrollbar,
.nd-map-search__list::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
.nd-map-results::-webkit-scrollbar-track,
.nd-map-search__list::-webkit-scrollbar-track {
  background: transparent;
}
.nd-map-results::-webkit-scrollbar-thumb,
.nd-map-search__list::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 99px;
}
.nd-map-results::-webkit-scrollbar-thumb:hover,
.nd-map-search__list::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}
