.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: 750;
  flex: 0 0 auto;          /* ← header không co lại */
}
.nd-map-results-head b {
  color: var(--map-text);
}
.nd-map-results-head select {
  max-width: 180px;
  border: 0;
  outline: none;
  color: var(--map-text);
  font-size: 12px;
  font-weight: 850;
  background: transparent;
}
.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;
}
.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;
}
.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 14px;
  border: 1px solid rgba(229, 231, 235, .9);
  border-radius: 12px;
  color: var(--map-muted);
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 10px 26px rgba(17, 24, 39, .08);
  font-size: 12px;
  font-weight: 750;
}

/* ============================================
   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: 0;
    position: relative;
    order: -1;
  }
  .nd-map-canvas {
    height: 100%;
    min-height: 0;
  }
  .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;
}
