/* Map search page and the nearby map on a listing (Phase 11) */
.ph-mappage { display: flex; flex-direction: column; min-height: calc(100vh - 8rem); }
.ph-mapbar-wrap { padding-top: .75rem; padding-bottom: .5rem; }
.ph-mapbar { display: flex; flex-wrap: wrap; gap: .6rem .8rem; align-items: flex-end; }
.ph-mapbar__field { display: grid; gap: .15rem; min-width: 7.5rem; flex: 1 1 7.5rem; max-width: 12rem; }
.ph-mapbar__field label { font-size: .75rem; font-weight: 700; color: var(--muted); }
.ph-mapbar__actions { display: flex; gap: .5rem; flex: 0 0 auto; }
.ph-mapbar [hidden] { display: none !important; }
.ph-maptabs { display: none; gap: .4rem; margin-top: .6rem; }
.ph-maptabs__tab { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: .35rem 1.1rem; font-weight: 700; min-height: 40px; }
.ph-maptabs__tab.is-on { background: var(--brand); border-color: var(--brand); color: #fff; }
.ph-mapbody { display: grid; grid-template-columns: minmax(18rem, 26rem) 1fr; flex: 1 1 auto; border-top: 1px solid var(--line); min-height: 34rem; }
.ph-maplist { overflow-y: auto; max-height: calc(100vh - 12rem); padding: .6rem; background: #fff; }
.ph-maplist__status { margin: 0 0 .5rem; font-size: .88rem; color: var(--muted); }
.ph-maplist__items { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.ph-maplist__item { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; position: relative; cursor: pointer; }
.ph-maplist__item.is-active { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-tint); }
.ph-maplist__link { display: flex; gap: .6rem; padding: .55rem; color: inherit; text-decoration: none; }
.ph-maplist__img { width: 5.5rem; height: 4.2rem; object-fit: cover; border-radius: 8px; background: var(--sand); flex: 0 0 auto; }
.ph-maplist__body { display: grid; gap: .1rem; min-width: 0; font-size: .85rem; }
.ph-maplist__price { color: var(--brand-dark); font-size: .98rem; }
.ph-maplist__title { font-weight: 600; overflow-wrap: anywhere; color: var(--ink); text-decoration: none; }
.ph-maplist__title:hover { text-decoration: underline; }
.ph-maplist__facts, .ph-maplist__where { color: var(--muted); font-size: .8rem; }
.ph-maplist__show { display: block; border: 0; background: transparent; color: var(--brand-dark); font-weight: 700; font-size: .8rem; padding: .2rem .55rem .5rem; }
.ph-mapview { position: relative; min-height: 28rem; }
.ph-map { position: absolute; inset: 0; z-index: 0; }
.ph-mapnote { position: absolute; left: .6rem; bottom: 1.6rem; z-index: 500; margin: 0; background: rgba(255, 255, 255, .92); padding: .2rem .5rem; border-radius: 6px; font-size: .72rem; color: var(--muted); pointer-events: none; }

/* price pins */
.ph-pin { background: transparent; border: 0; }
.ph-pin span { position: absolute; left: 0; bottom: 0; transform: translate(-50%, -7px); background: var(--brand); color: #fff; font-weight: 800; font-size: .78rem; line-height: 1; padding: .3rem .5rem; border-radius: 999px; white-space: nowrap; box-shadow: 0 2px 6px rgba(0, 0, 0, .3); border: 2px solid #fff; }
.ph-pin span::after { content: ""; position: absolute; left: 50%; bottom: -7px; transform: translateX(-50%); border: 5px solid transparent; border-top-color: #fff; border-bottom: 0; }
.ph-pin--featured span { background: #b86e00; }
.ph-pin--here span { background: var(--ink); }
.ph-pin.is-hover span, .ph-pin.is-active span { background: #fff; color: var(--brand-dark); border-color: var(--brand); transform: translate(-50%, -7px) scale(1.12); z-index: 10; }
.ph-pin:focus-visible span { outline: 3px solid #f7b500; }

/* clusters (Leaflet.markercluster supplies the layout; these set the colours) */
.marker-cluster-small, .marker-cluster-medium, .marker-cluster-large { background-color: rgba(15, 107, 87, .25); }
.marker-cluster-small div, .marker-cluster-medium div, .marker-cluster-large div { background-color: rgba(15, 107, 87, .9); color: #fff; font-weight: 800; }

/* the preview that opens when a pin is clicked */
.ph-popup { width: 14.5rem; font-family: inherit; }
.ph-popup__link { display: block; color: inherit; text-decoration: none; }
.ph-popup__img { width: 100%; height: 7.5rem; object-fit: cover; border-radius: 8px; display: block; margin-bottom: .4rem; background: var(--sand); }
.ph-popup p { margin: 0 0 .2rem; }
.ph-popup__price { font-weight: 800; color: var(--brand-dark); font-size: 1.05rem; }
.ph-popup__tag { font-weight: 600; font-size: .72rem; color: var(--muted); }
.ph-popup__title { font-weight: 600; overflow-wrap: anywhere; }
.ph-popup__facts, .ph-popup__where { font-size: .8rem; color: var(--muted); }
.ph-popup__open { margin-top: .4rem; color: #fff !important; }

/* the nearby map on a listing's page */
.ph-nearby { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: start; }
.ph-nearby__map { position: relative; height: 22rem; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.ph-nearby__list { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }

@media (max-width: 991.98px) {
  .ph-maptabs { display: flex; }
  .ph-mapbody { grid-template-columns: 1fr; }
  .ph-mapbody.is-list .ph-mapview { display: none; }
  .ph-mapbody.is-map .ph-maplist { display: none; }
  .ph-mapview { min-height: calc(100vh - 16rem); }
  .ph-maplist { max-height: none; }
  .ph-maplist__show { display: block; }
  .ph-nearby { grid-template-columns: 1fr; }
}

/* listing form: pin picker */
.ph-pickmap { height: 280px; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; z-index: 0; }
