/* ------------------------------------------------------------------
   GoHome /rent – static snapshot helpers
   The card sliders keep Swiper's original geometry (1 slide per view,
   20 px gap, 300 ms transition) but are driven by assets/js/app.js.
   ------------------------------------------------------------------ */

[data-card-slider] .swiper-wrapper {
  will-change: transform;
}

/* Swiper's `spaceBetween: 20` used to live in inline styles */
[data-card-slider] .swiper-slide {
  margin-right: 20px;
}

[data-card-slider] .swiper-pagination-bullet {
  cursor: pointer;
}

/* keep the sticky header above the cards, exactly like the live page */
.eh-header {
  isolation: isolate;
}

/* ==================================================================
   Interactive map
   ================================================================== */
#eh-map-panel {
  overflow: hidden;
}

.eh-map-canvas {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: #e9edf1;
}

/* desktop "Show map" switch turns the whole column off */
.eh-map-hidden #eh-map-panel {
  display: none !important;
}

.leaflet-container {
  background: #e9edf1;
  font-family: inherit;
  font-size: 12px;
}

.leaflet-control-attribution {
  font-size: 10px;
  opacity: 0.75;
}

.leaflet-bar a,
.leaflet-bar a:hover {
  color: #101c20;
}

/* ---- marker popup ---- */
.eh-map-popup .leaflet-popup-content-wrapper {
  border-radius: 14px;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(16, 28, 32, 0.18);
}

.eh-map-popup .leaflet-popup-content {
  margin: 0;
  width: 236px !important;
}

.eh-map-popup .leaflet-popup-close-button {
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border-radius: 9999px;
  color: #fff;
  background: rgba(0, 0, 0, 0.45);
  font: 16px/20px sans-serif;
  text-align: center;
}

.eh-map-popup .leaflet-popup-close-button:hover {
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
}

.eh-map-card__media img {
  display: block;
  width: 100%;
  height: 132px;
  object-fit: cover;
}

.eh-map-card__body {
  padding: 10px 12px 12px;
}

.eh-map-card__name {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
  color: #101c20;
}

.eh-map-card__addr {
  margin-top: 2px;
  font-size: 12px;
  color: #6b7280;
}

.eh-map-card__price {
  margin-top: 6px;
  font-size: 16px;
  font-weight: 700;
  color: #101c20;
}

.eh-map-card__price span {
  font-size: 12px;
  font-weight: 400;
  color: #6b7280;
}

.eh-map-card__station {
  margin-top: 6px;
  font-size: 11px;
  color: #6b7280;
}

/* ---- mobile full screen map ---- */
.eh-map-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  background: #fff;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

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

.eh-map-overlay.is-open {
  opacity: 1;
  transform: none;
}

.eh-map-overlay__bar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  padding: 0 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  font-size: 16px;
  font-weight: 600;
  color: #101c20;
}

.eh-map-overlay__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 9999px;
  background: #f2f2f2;
  color: #101c20;
  cursor: pointer;
}

.eh-map-overlay__close:hover {
  background: #e6e6e6;
}

.eh-map-overlay__body {
  position: relative;
  flex: 1;
  min-height: 0;
}

.eh-map-overlay__body #eh-map-panel {
  display: block !important;
  width: 100% !important;
  max-width: none !important;
  height: 100% !important;
  border-radius: 0;
}

body.eh-map-open {
  overflow: hidden;
}

/* shown when the OSM tiles cannot be reached (e.g. fully offline) */
.eh-map--offline::after {
  content: "Map tiles need an internet connection — property markers are still placed";
  position: absolute;
  left: 50%;
  bottom: 18px;
  z-index: 500;
  transform: translateX(-50%);
  padding: 6px 12px;
  border-radius: 9999px;
  background: rgba(16, 28, 32, 0.78);
  color: #fff;
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;
}

/* ------------------------------------------------------------------
   When the map column is hidden the list expands, exactly like the
   live page (3 / 4 / 5 columns depending on the viewport).
   ------------------------------------------------------------------ */
.eh-map-hidden #property-container .grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (min-width: 1280px) {
  .eh-map-hidden #property-container .grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 1920px) {
  .eh-map-hidden #property-container .grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

/* soften the OSM basemap so it sits closer to the site's neutral palette */
.eh-map-canvas .leaflet-tile {
  filter: saturate(0.82) brightness(1.03) contrast(0.97);
}

/* ==================================================================
   Bottom app-download banner  (content comes from assets/js/config.js)
   ================================================================== */
.eh-dl-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 55;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
  background: #fff;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 -8px 28px rgba(16, 28, 32, 0.1);
}

.eh-dl-banner__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.eh-dl-banner__logo {
  width: auto;
  height: 26px;
  max-width: 96px;
  object-fit: contain;
  flex: none;
}

.eh-dl-banner__text {
  min-width: 0;
}

.eh-dl-banner__title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  color: #101c20;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.eh-dl-banner__sub {
  margin-top: 2px;
  font-size: 11px;
  line-height: 1.35;
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.eh-dl-banner__btn {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 18px;
  border-radius: 9999px;
  background: var(--color-primary, #ff5d07);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(255, 93, 7, 0.28);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.eh-dl-banner__btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(255, 93, 7, 0.34);
  color: #fff;
}

.eh-dl-banner__btn:active {
  transform: none;
}

.eh-dl-banner__icon {
  flex: none;
}

.eh-dl-banner__close {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin-left: -2px;
  border-radius: 9999px;
  background: transparent;
  color: #9aa3ab;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.eh-dl-banner__close:hover {
  background: #f2f2f2;
  color: #101c20;
}

/* keep the last row of listings reachable behind the banner */
body.has-app-banner #property-container {
  padding-bottom: 96px;
}

@media (min-width: 1024px) {
  body.has-app-banner #eh-map-row {
    height: calc(100dvh - 163px - 66px) !important;
  }
}

/* compact banner on small phones */
@media (max-width: 420px) {
  .eh-dl-banner {
    gap: 10px;
    padding-left: 14px;
    padding-right: 10px;
  }

  .eh-dl-banner__logo {
    height: 24px;
    max-width: 86px;
  }

  .eh-dl-banner__btn {
    height: 38px;
    padding: 0 14px;
    font-size: 13px;
  }
}

/* fallback when the logo cannot be loaded: keep the text only */
.eh-dl-banner__logo--wide {
  width: auto;
  height: 26px;
  max-width: 96px;
}
