/* "Show on map" modal for the search-results page. Paired with results-map.js.
   Hidden until the sidebar "Show on map" button is pressed. Layout: results
   list on the left, live map on the right. */

.map-modal[hidden] { display: none; }

.map-modal {
  position: fixed;
  inset: 0;
  z-index: 950;
}

.map-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 18, 47, .6);
  backdrop-filter: blur(2px);
}

.map-modal__dialog {
  position: absolute;
  inset: 24px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .38);
}

.map-modal__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 62px;
  padding: 0 14px 0 24px;
  border-bottom: 1px solid #e1e6ee;
}

/* The borrowed module search bar (Location / dates / guests / Search) - pinned
   to the top of the list column, above the count/sort row, not spanning the
   map. Negative margins bleed it to the column edges past .map-modal__list's
   own padding. */
.map-modal__searchbar {
  position: sticky;
  top: 0;
  z-index: 6;
  margin: 0 -26px 14px;
  padding: 16px 26px;
  border-bottom: 1px solid #e1e6ee;
  background: #fff;
}

.map-modal__searchbar:empty { display: none; }

.map-modal__searchbar > form {
  width: 100%;
  margin-top: 0;
}

.map-modal__searchbar .bh-search-popup { z-index: 40; }

.map-modal__bar span {
  color: #315bdd;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.map-modal__bar strong {
  display: block;
  margin-top: 2px;
  color: #071538;
  font-size: 16px;
}

.map-modal__close {
  flex: none;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  color: #071538;
  background: #f1f4f8;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.map-modal__close:hover { background: #e6eaf1; }

.map-modal__body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
}

/* Results page: filters | list | map. */
.map-modal__body--filters { grid-template-columns: 260px minmax(0, 1fr) minmax(0, 1.1fr); }

/* The borrowed sidebar filters - a narrow scrolling column at the far left,
   like Booking.com's "Filter by:" rail. */
.map-modal__filters {
  min-height: 0;
  overflow-y: auto;
  padding: 18px 18px 32px;
  border-right: 1px solid #e1e6ee;
  background: #fff;
}

.map-modal__filters-title {
  margin: 0 0 6px;
  color: #071538;
  font: 600 17px/1.3 Jost, sans-serif;
}

/* Tighten the sidebar for the narrow rail; the map preview + "Show on map"
   button is pointless inside the map itself. */
.map-modal__filters .results-map-preview { display: none; }
.map-modal__filters > .sidebar > * + * { margin-top: 0 !important; }
.map-modal__filters .sidebar__item {
  padding-top: 16px !important;
  padding-bottom: 16px !important;
}
.map-modal__filters .sidebar__item h3 { font-size: 15px; margin-bottom: 8px; }
.map-modal__filters .sidebar__item .text-15 { font-size: 14px; }
.map-modal__filters [data-filter="keyword"] { height: 42px; }
.map-modal__filters [data-filter-apply] { width: 100%; height: 44px; }

.map-modal__list {
  min-height: 0;
  overflow-y: auto;
  padding: 0 26px 32px;
  border-right: 1px solid #e1e6ee;
}

/* The moved list is a Bootstrap .row - drop its negative side margins so it
   sits inside the padded column without a horizontal scrollbar. */
.map-modal__list > [data-results-list] { margin: 0; }

/* The borrowed count / sort bar. */
.map-modal__list > .results-topbar {
  margin: 0 0 6px;
  padding-bottom: 14px;
  border-bottom: 1px solid #eef1f5;
}

.map-modal__list > .results-topbar .bh-filter-open { display: none; }

/* Each card keeps a wide three-column shape driven by viewport-based Bootstrap
   classes; the modal column is far narrower, so recompose it here: a small
   thumbnail beside the details, with the price / action row full width below. */
.map-modal__list [data-result-card] > div { padding-top: 18px; }
.map-modal__list [data-result-card] .row { align-items: flex-start; }
.map-modal__list [data-result-card] .row > .col-md-auto:first-child {
  flex: 0 0 150px;
  max-width: 150px;
}
.map-modal__list [data-result-card] .row > .col-md {
  flex: 1;
  min-width: 0;
}
.map-modal__list [data-result-card] .row > .col-md-auto:last-child {
  flex: 0 0 100%;
  max-width: 100%;
}
.map-modal__list [data-result-card] .cardImage { width: 100%; }
.map-modal__list [data-result-card] .text-right { text-align: left; }
.map-modal__list [data-result-card] .justify-end { justify-content: flex-start; }
.map-modal__list [data-result-card] .mt-50 { margin-top: 12px; }
.map-modal__list [data-result-card] .mt-24 { margin-top: 12px; }

.map-modal__canvas {
  min-height: 0;
  background: #e6edf5;
}

@media (max-width: 1199px) {
  .map-modal__body--filters { grid-template-columns: 230px minmax(0, 1fr) minmax(0, 1fr); }
}

/* Below lg the sidebar is a full-screen drawer (public-search.css), so the
   rail collapses and the list's own "Filters" button opens that drawer. */
@media (max-width: 991px) {
  .map-modal__body--filters { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }
  .map-modal__filters { display: contents; }
  .map-modal__filters-title { display: none; }
  .map-modal__list > .results-topbar .bh-filter-open { display: flex; }
}

@media (max-width: 860px) {
  .map-modal__dialog { inset: 0; border-radius: 0; }
  .map-modal__body {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 1fr;
  }
  .map-modal__list {
    border-right: 0;
    border-bottom: 1px solid #e1e6ee;
  }
}

/* Markers, drawn with CSS so no marker image is requested. Every module shows
   an icon + price pill; hotels also carry a name caption above it. */
.results-map-pin { background: transparent; border: 0; }

.results-map-pin__wrap {
  position: absolute;
  left: 0;
  top: 0;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  transform: translate(-50%, -100%);
  transform-origin: 50% 100%;
  transition: transform .15s ease;
}

/* Booking.com-style teardrop under the price pill; its tip marks the spot. */
.results-map-pin__drop {
  display: block;
  width: 24px;
  height: 34px;
  overflow: visible;
  filter: drop-shadow(0 2px 3px rgba(3, 18, 47, .35));
  cursor: pointer;
}
.results-map-pin__drop path { fill: #0b2a78; stroke: #fff; stroke-width: 1.5; }
.results-map-pin__drop circle { fill: #fff; }

.results-map-pin__name {
  max-width: 200px;
  padding: 3px 9px;
  overflow: hidden;
  border-radius: 6px;
  background: #071538;
  color: #fff;
  font: 600 11px/1.35 Jost, sans-serif;
  white-space: nowrap;
  text-overflow: ellipsis;
  box-shadow: 0 3px 10px rgba(3, 18, 47, .3);
}

.results-map-pin__label {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border: 1px solid #315bdd;
  border-radius: 999px;
  background: #fff;
  color: #315bdd;
  font: 600 12px/1 Jost, sans-serif;
  white-space: nowrap;
  box-shadow: 0 3px 10px rgba(3, 18, 47, .25);
  cursor: pointer;
}

.results-map-pin__icon { font-size: 12px; line-height: 1; }

.results-map-pin:hover,
.results-map-pin.is-active { z-index: 1000 !important; }

.results-map-pin:hover .results-map-pin__wrap,
.results-map-pin.is-active .results-map-pin__wrap {
  transform: translate(-50%, -100%) scale(1.08);
}

.results-map-pin:hover .results-map-pin__label,
.results-map-pin.is-active .results-map-pin__label {
  color: #fff;
  background: #315bdd;
}

.results-map-pin:hover .results-map-pin__drop path,
.results-map-pin.is-active .results-map-pin__drop path {
  fill: #315bdd;
}

/* Brief flash on the matching card when its marker is clicked. */
[data-result-card].is-map-focus {
  outline: 3px solid #315bdd;
  outline-offset: 6px;
  border-radius: 4px;
  transition: outline-color .3s ease;
}

/* Marker popup mini-card. */
.map-modal .leaflet-popup-content { margin: 0; width: auto !important; }
.map-modal .leaflet-popup-content-wrapper { padding: 0; overflow: hidden; border-radius: 10px; }

.results-map-popup { width: 232px; font-family: Jost, sans-serif; }
.results-map-popup > img {
  display: block;
  width: 100%;
  height: 118px;
  object-fit: cover;
}
.results-map-popup__body { display: grid; gap: 4px; padding: 12px 14px 14px; }
.results-map-popup__body strong { color: #071538; font-size: 14px; line-height: 1.3; }
.results-map-popup__price { color: #315bdd; font-size: 14px; font-weight: 700; }
.results-map-popup__body a {
  margin-top: 4px;
  color: #315bdd;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
.results-map-popup__body a:hover { text-decoration: underline; }

/* The single listing page opens this same panel: one property card on the left,
   the map on the right, the same two-column body as the results view. */
.single-map-pin { font-size: 22px; line-height: 1; text-align: center; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .35)); }

/* The single-page marker popup is a plain name label. The shared
   .leaflet-popup-content rule above forces width:auto, so pin it to one line
   here or the name stacks one word per row. */
.map-modal .single-map-popup {
  display: block;
  padding: 10px 14px;
  color: #071538;
  font: 600 14px/1.3 Jost, sans-serif;
  white-space: nowrap;
}
