/* Small custom layer on top of Tailwind utility classes. */

.filter-select {
  font-size: 0.8125rem;
  padding: 0.375rem 0.5rem;
  border: 1px solid rgb(212 212 216);
  border-radius: 0.5rem;
  background: white;
  outline: none;
  white-space: nowrap;
}
.filter-select:focus {
  border-color: #52525b;
  box-shadow: 0 0 0 2px rgb(82 82 91 / 0.2);
}

.filter-btn {
  font-size: 0.8125rem;
  padding: 0.375rem 0.75rem;
  border: 1px solid rgb(212 212 216);
  border-radius: 0.5rem;
  background: white;
  white-space: nowrap;
}
.filter-btn:hover { background: rgb(244 244 245); }

.search-wrap {
  flex-shrink: 0;
}
.search-input {
  background: white;
}

.filter-icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid rgb(212 212 216);
  border-radius: 0.5rem;
  background: white;
  color: rgb(82 82 91);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.filter-icon-btn:hover {
  background: rgb(244 244 245);
  color: rgb(10 10 10);
}
.filter-icon-btn[aria-expanded="true"] {
  background: rgb(228 228 231);
  border-color: #52525b;
  color: #27272a;
}
.filter-icon-btn.has-active {
  border-color: #52525b;
  color: #27272a;
}

.filter-badge {
  position: absolute;
  top: -0.3rem;
  right: -0.3rem;
  min-width: 1.125rem;
  height: 1.125rem;
  padding: 0 0.25rem;
  border-radius: 9999px;
  background: #27272a;
  color: white;
  font-size: 0.625rem;
  font-weight: 700;
  line-height: 1.125rem;
  text-align: center;
}

.flbl {
  display: block;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgb(113 113 122);
  margin-bottom: 0.25rem;
}

.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* Listing card */
.card {
  border: 1px solid rgb(228 228 231);
  border-radius: 0.75rem;
  overflow: hidden;
  background: white;
  cursor: pointer;
  transition: box-shadow 0.15s, border-color 0.15s, transform 0.15s;
}
.card:hover { box-shadow: 0 8px 24px -8px rgb(10 10 10 / 0.14); border-color: #a1a1aa; }
.card.active { border-color: #52525b; box-shadow: 0 0 0 2px rgb(82 82 91 / 0.3); }

.chip {
  display: inline-flex;
  align-items: center;
  font-size: 0.6875rem;
  font-weight: 500;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  background: rgb(244 244 245);
  color: rgb(63 63 70);
}
.chip-theme {
  background: #e4e4e7;
  color: #27272a;
  font-weight: 600;
}

/* Custom map price marker */
.price-marker {
  position: absolute;
  background: #3f3f46;
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 9999px;
  border: 2px solid white;
  box-shadow: 0 2px 6px rgb(0 0 0 / 0.35);
  white-space: nowrap;
  transform: translate(-50%, -50%);
  cursor: pointer;
}
.price-marker.active { background: #0a0a0a; border-color: #d4d4d8; }

/* Cluster marker — groups nearby pins into a single count circle */
.cluster-marker {
  position: absolute;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 0.8125rem;
  border: 3px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  transform: translate(-50%, -50%);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  animation: cluster-pop 0.2s ease-out;
}
.cluster-marker:hover {
  transform: translate(-50%, -50%) scale(1.18);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
}
.cluster-sm  { width: 36px; height: 36px; background: #71717a; }
.cluster-md  { width: 44px; height: 44px; background: #52525b; font-size: 0.875rem; }
.cluster-lg  { width: 52px; height: 52px; background: #3f3f46; font-size: 0.9375rem; }

@keyframes cluster-pop {
  from { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
  to   { transform: translate(-50%, -50%) scale(1);   opacity: 1; }
}

/* Custom GMaps InfoWindow overrides to achieve edge-to-edge card layouts */
.gm-style .gm-style-iw-c {
  padding: 0 !important;
  border-radius: 0.5rem !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15) !important;
}
.gm-style .gm-style-iw-ch {
  padding: 0 !important;
}
.gm-style .gm-style-iw-chr {
  display: none !important;
}
.gm-style .gm-style-iw-d {
  overflow: hidden !important;
  max-height: none !important;
  padding: 0 !important;
  margin: 0 !important;
}
.gm-style .gm-style-iw-tc::after {
  background: white !important;
}
.gm-style .gm-style-iw-c button.gm-ui-hover-effect {
  display: none !important;
}

/* ---- Map layers panel ---------------------------------------------------- */
.layer-group { padding: 0.25rem 0.25rem 0.5rem; }
.layer-group + .layer-group { border-top: 1px solid #f4f4f5; }
.layer-group-title {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #a1a1aa;
  padding: 0.4rem 0.6rem 0.3rem;
}
.layer-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.4rem 0.6rem;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background 0.12s ease;
}
.layer-row:hover { background: #f4f4f5; }
.layer-check {
  height: 1rem;
  width: 1rem;
  flex: none;
  border-radius: 0.25rem;
  border: 1px solid #d4d4d8;
  accent-color: #3f3f46;
  cursor: pointer;
}
.layer-chip {
  height: 0.85rem;
  width: 0.85rem;
  flex: none;
  border-radius: 0.25rem;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}
.layer-name {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #3f3f46;
  line-height: 1.15;
}
.layer-sub {
  display: block;
  font-size: 0.65rem;
  font-weight: 500;
  color: #a1a1aa;
}
.layer-zoom {
  flex: none;
  font-size: 0.6rem;
  font-weight: 700;
  color: #a1a1aa;
  background: #f4f4f5;
  border-radius: 0.3rem;
  padding: 0.05rem 0.3rem;
}
.layer-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.6rem;
  padding: 0.25rem 0.65rem 0.5rem 2.1rem;
}
.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.65rem;
  color: #71717a;
}
.legend-swatch {
  height: 0.7rem;
  width: 0.7rem;
  border-radius: 0.2rem;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}

/* Opacity slider */
.layers-slider {
  -webkit-appearance: none;
  appearance: none;
  height: 0.3rem;
  border-radius: 999px;
  background: #e4e4e7;
  outline: none;
  cursor: pointer;
}
.layers-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  height: 1rem;
  width: 1rem;
  border-radius: 999px;
  background: #3f3f46;
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}
.layers-slider::-moz-range-thumb {
  height: 1rem;
  width: 1rem;
  border-radius: 999px;
  background: #3f3f46;
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Mobile: present the panel as a bottom sheet */
@media (max-width: 640px) {
  #layers-control { position: static; }
  #layers-btn { position: absolute; top: 0.75rem; right: 0.75rem; }
  #layers-panel {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    width: 100%;
    max-width: 100%;
    margin: 0;
    border-radius: 1rem 1rem 0 0;
    max-height: 80vh;
    overflow-y: auto;
    z-index: 40;
  }
  #layers-list { max-height: 50vh; }
}

/* ---------------------------------------------------------------------------
   View modes: list / split / map
   Layout is driven by main[data-view] so JS only flips one attribute.
--------------------------------------------------------------------------- */
.list-panel { width: 100%; }
.map-panel { flex: 1 1 0%; }

/* Mobile-first: a single panel fills the viewport. Listings show by default;
   the map only appears in the "map" view. */
@media (max-width: 767px) {
  .map-panel { display: none; }
  #main[data-view="map"] .list-panel { display: none; }
  #main[data-view="map"] .map-panel { display: block; }
  /* Keep the last list row clear of the floating toggle pill. */
  #pager { padding-bottom: 4.5rem; }
}

/* Desktop: split shows both side by side; list/map show one full-width. */
@media (min-width: 768px) {
  #main[data-view="split"] .list-panel {
    width: 420px;
    flex: 0 0 auto;
    border-right: 1px solid rgb(228 228 231);
  }
  #main[data-view="list"] .map-panel { display: none; }
  #main[data-view="map"] .list-panel { display: none; }
}
@media (min-width: 1024px) {
  #main[data-view="split"] .list-panel { width: 480px; }
}

/* Card list: keep the original single-column stack for the split sidebar and
   mobile. Plain block flow + margin spacing so cards are never squished. */
#cards > * + * { margin-top: 0.75rem; }

/* Only the full-width desktop "List" view becomes a responsive card grid.
   Cards size to their own content (align-items:start) so every card shows its
   full details, not just the thumbnail. */
@media (min-width: 768px) {
  #main[data-view="list"] #cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
    /* Each row sizes to its card's content and rows pack from the top, so the
       fixed-height thumbnail is never compressed into the card below. */
    grid-auto-rows: max-content;
    align-content: start;
    align-items: start;
  }
  #main[data-view="list"] #cards > * + * { margin-top: 0; }
}

/* Segmented control (desktop) */
.seg {
  align-items: center;
  gap: 2px;
  padding: 3px;
  background: rgb(244 244 245);
  border: 1px solid rgb(228 228 231);
  border-radius: 0.625rem;
}
.seg-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: rgb(113 113 122);
  padding: 0.3125rem 0.625rem;
  border-radius: 0.5rem;
  background: transparent;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.seg-btn svg { width: 1rem; height: 1rem; }
.seg-btn:hover { color: rgb(39 39 42); }
.seg-btn.is-active {
  background: white;
  color: #27272a;
  box-shadow: 0 1px 2px rgb(10 10 10 / 0.1), 0 0 0 1px rgb(0 0 0 / 0.03);
}

/* Floating toggle pill (mobile) */
.view-fab {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.125rem;
  border-radius: 9999px;
  background: #27272a;
  color: white;
  font-size: 0.875rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  box-shadow: 0 8px 24px -6px rgb(10 10 10 / 0.45);
  transition: transform 0.12s ease, background 0.15s;
}
.view-fab:hover { background: #18181b; }
.view-fab:active { transform: translateX(-50%) scale(0.95); }
.view-fab svg { width: 1.125rem; height: 1.125rem; }
.view-fab .contents { display: contents; }
.view-fab .contents.hidden { display: none; }

