/* LivingExtra — Leaflet map skin (free OpenStreetMap maps).
   Brand pins/clusters + neutralises the decorative placeholder that
   the .map / .pd-map boxes render before the live map takes over. */

.leaflet-container { font: inherit; background: #e8e8ef; }
.leaflet-container a { color: #EC1E5C; }
.leaflet-container .leaflet-control-attribution { font-size: 11px; }

/* Price pill markers — centred on their coordinate. */
.lx-pin-b {
  position: absolute;
  transform: translate(-50%, -50%);
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 999px;
  white-space: nowrap;
  border: 2px solid #fff;
  box-shadow: 0 1px 5px rgba(21, 16, 31, .35);
  cursor: pointer;
}

/* Single precise location dot (PDP). */
.lx-dot-b {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #EC1E5C;
  border: 3px solid #fff;
  box-shadow: 0 1px 6px rgba(21, 16, 31, .4);
}

/* Recolour marker-cluster bubbles to the brand rose. */
.marker-cluster { background: rgba(236, 30, 92, .20); }
.marker-cluster div { background: rgba(236, 30, 92, .90); color: #fff; font-weight: 700; }

/* ==========================================================================
   STACKING — keep Leaflet underneath the sticky header.
   --------------------------------------------------------------------------
   Leaflet assigns its own z-index values internally: panes 400-700, controls
   800, and the .leaflet-top / .leaflet-bottom corners 1000. The site header is
   position:sticky with z-index:200.

   If a map box does not establish its OWN stacking context, all of those
   Leaflet values compete directly against the header in the ROOT stacking
   context — and every one of them beats 200, so the map paints over the menu.
   overflow:hidden alone does not prevent this: it clips, but Leaflet promotes
   .leaflet-map-pane to a composited layer (translate3d), and a composited
   layer can escape a rounded-corner clip on a GPU-accelerated browser.

   Giving the box `position:relative; z-index:0` (plus isolation for older
   engines) traps every Leaflet z-index INSIDE the box. The whole map is then a
   single layer at z-index 0, permanently below the header, no matter what
   values Leaflet uses internally now or in a future version.

   Only the Leaflet surfaces need this. The contact page's .ct-map holds a
   Google iframe, which is a replaced element and cannot leak a z-index into
   this document at all.
   ========================================================================== */
.map,
.pd-map {
  position: relative;   /* .map already had this; .pd-map was static */
  z-index: 0;
  isolation: isolate;   /* creates the context even if position is overridden */
}

/* When Leaflet takes over a .map box, kill the CSS placeholder art
   so it can't sit above the tiles. */
.map.lx-live::before { content: none !important; }
.map.lx-live { background: #e8e8ef; }
.map .leaflet-container,
.pd-map .leaflet-container { width: 100%; height: 100%; }

.pd-map-note { margin-top: 10px; font-size: 13px; color: #6b6472; }
.pd-map-note a { color: #EC1E5C; font-weight: 600; text-decoration: none; }
.pd-map-note a:hover { text-decoration: underline; }

/* ==========================================================================
   GOOGLE-MAPS LOOK — free, no API key. We keep the CARTO Voyager raster
   basemap (OpenStreetMap data) but colour-grade it toward Google Maps' palette
   and restyle every piece of Leaflet chrome (zoom control, info windows,
   attribution, fonts) so it reads like maps.google.com. Tunable via the vars
   on .leaflet-container. ========================================================= */
.leaflet-container {
  font-family: 'Inter', Roboto, 'Helvetica Neue', Arial, sans-serif; /* Google uses Roboto */
  background: #e5e3df; /* Google's land tone shows through while tiles load */
  --lx-grade: saturate(1.0) brightness(1.02) contrast(0.97) hue-rotate(-5deg);
}
/* Colour-grade only the basemap tiles (marker/popup panes sit in other panes,
   so pins & cards keep their true brand colour). Grading the whole pane avoids
   per-tile seams. */
.leaflet-container .leaflet-tile-pane { filter: var(--lx-grade); }

/* ---- Google-style zoom control (bottom-right, white rounded, +/- divider) ---- */
.leaflet-control-zoom {
  border: none !important;
  border-radius: 8px !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .3) !important;
  overflow: hidden;
}
.leaflet-control-zoom a {
  width: 40px; height: 40px; line-height: 40px;
  background: #fff; color: #666; font-size: 22px; font-weight: 400;
  border: none !important;
}
.leaflet-control-zoom a:first-child { border-bottom: 1px solid #e6e6e6 !important; }
.leaflet-control-zoom a:hover { background: #f5f5f5; color: #333; }
.leaflet-bar a.leaflet-disabled { background: #fff; color: #cfcfcf; }
.leaflet-control-zoom { margin: 0 12px 26px 0 !important; } /* clear the attribution */

/* ---- Google-style info window (popup) ---- */
.leaflet-popup-content-wrapper {
  border-radius: 8px;
  box-shadow: 0 2px 7px 1px rgba(0, 0, 0, .3);
  padding: 2px;
}
.leaflet-popup-content { margin: 12px 14px; font-size: 13px; line-height: 1.5; }
.leaflet-popup-tip { box-shadow: 0 2px 7px 1px rgba(0, 0, 0, .3); }
.leaflet-popup-close-button {
  width: 26px !important; height: 26px !important;
  font: 400 20px/24px Roboto, Arial, sans-serif !important; color: #757575 !important;
  right: 2px !important; top: 2px !important;
}
.leaflet-popup-close-button:hover { color: #222 !important; background: none !important; }

/* ---- Google-style attribution (small, subtle, still credits OSM/CARTO) ---- */
.leaflet-control-attribution {
  background: rgba(255, 255, 255, .78) !important;
  color: #5f6368 !important; font-size: 10px !important; padding: 1px 6px !important;
}
.leaflet-control-attribution a { color: #5f6368 !important; }

/* Cleaner, Google-flat cluster bubbles + slightly softer pin shadow. */
.marker-cluster { background: rgba(236, 30, 92, .18); }
.marker-cluster div { background: #EC1E5C; color: #fff; font-weight: 700; box-shadow: 0 1px 4px rgba(0, 0, 0, .3); }
.lx-pin-b { box-shadow: 0 1px 4px rgba(0, 0, 0, .35); }

/* ==========================================================================
   Buy / Rent — "search on the map" (DDproperty / PropertyHub style)
   The .map-canvas wraps the live Leaflet map plus floating overlays (a
   move-search toggle, a "redo in this area" button and a count badge). The
   split grid + .map-list styling lives in livingextra.css; this adds the
   interactive-search chrome on top. ========================================= */
.map-canvas { position: relative; height: 100%; border-radius: var(--r, 16px); overflow: hidden; }
.map-canvas .map { position: absolute; inset: 0; height: 100%; }

/* Highlighted pin (card hover / pin focus). */
.lx-pin-b.is-active {
  background: #15101f !important;
  transform: translate(-50%, -50%) scale(1.14);
  z-index: 500;
}

/* Floating controls, top-right so they clear Leaflet's top-left zoom control. */
.map-toolbar {
  position: absolute; top: 14px; right: 14px; z-index: 1000;
  display: flex; flex-direction: column; align-items: flex-end; gap: 8px;
  pointer-events: none;
}
.map-toolbar > * { pointer-events: auto; }

/* "Search as I move the map" — pill with an iOS-style switch. */
.map-move {
  display: inline-flex; align-items: center; gap: 9px;
  background: rgba(255, 255, 255, .96); backdrop-filter: blur(6px);
  border: 1px solid rgba(21, 16, 31, .08); border-radius: 100px;
  padding: 8px 14px 8px 12px; font-size: 13px; font-weight: 700; color: #15101f;
  box-shadow: 0 4px 14px -6px rgba(21, 16, 31, .35); cursor: pointer; user-select: none;
}
.map-move input { position: absolute; opacity: 0; pointer-events: none; }
.map-move .switch {
  position: relative; width: 34px; height: 19px; border-radius: 100px;
  background: #cfc9d6; transition: .2s; flex-shrink: 0;
}
.map-move .switch::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 15px; height: 15px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: .2s;
}
.map-move input:checked + .switch { background: #EC1E5C; }
.map-move input:checked + .switch::after { transform: translateX(15px); }
.map-move input:focus-visible + .switch { outline: 2px solid #EC1E5C; outline-offset: 2px; }

/* "Redo search in this area" button (shown when move-search is off). */
.map-redo {
  display: inline-flex; align-items: center; gap: 7px;
  background: #15101f; color: #fff; border: none; border-radius: 100px;
  padding: 9px 16px; font-family: inherit; font-size: 13px; font-weight: 700;
  cursor: pointer; box-shadow: 0 6px 18px -6px rgba(21, 16, 31, .5); transition: .2s;
}
.map-redo:hover { background: #EC1E5C; }
.map-redo[hidden] { display: none; }

/* Count badge sits bottom-left so it clears the zoom control. */
.map-canvas .map-badge { top: auto; bottom: 16px; left: 16px; }

/* Empty state inside the synced list. */
.map-empty {
  padding: 36px 22px; text-align: center; color: #6b6472;
  font-weight: 600; font-size: 14px; line-height: 1.5;
  border: 1px dashed rgba(21, 16, 31, .14); border-radius: 14px;
}

@media (max-width: 900px) {
  /* Map above the list on mobile; keep the map tall enough to be usable. */
  .map-canvas { height: 420px; }
  .map-toolbar { top: 10px; right: 10px; }
  .map-move { padding: 7px 12px 7px 10px; font-size: 12px; }
}
