.fixedheader {
  background: #000;
}
.map-page {
  overflow: hidden;
}

/* =====================
   BREADCRUMBS
   ===================== */
.mobile-breadcrumb-bar {
  display: none; /* hidden on desktop */
  background: #222;
  color: #aaa;
  padding: 4px 12px;
  font-size: 1.2rem;
  margin-top: 0;
}
.breadcrumbs a {
  color: #aaa;
  text-decoration: none;
}
.breadcrumbs a:hover {
  color: #c69963;
}
.breadcrumbs span {
  color: #c69963;
}
.controls-breadcrumbs {
  font-size: 1.2rem;
  color: #aaa;
  white-space: nowrap;
  flex-shrink: 0;
}
.controls-breadcrumbs a {
  color: #aaa;
  text-decoration: none;
}
.controls-breadcrumbs a:hover {
  color: #c69963;
}
.controls-breadcrumbs span {
  color: #c69963;
}

/* =====================
   STICKY CONTROLS BAR
   ===================== */
.map-sticky-controls {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #222;
  padding: 0 16px;
  width: 100%;
  max-width: inherit;
}

.controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 50px; /* fixed height keeps bar compact */
  width: 100%;
}

/* =====================
   TOGGLES - desktop inline
   ===================== */
.controls-toggles {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: nowrap;
  flex: 1;
  justify-content: center;
}

.toggle-container {
  margin: 0;
  flex-shrink: 0;
}

.toggle-switch {
  display: flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.toggle-switch input, .controls-legend {
  display: none;
}

.toggle-slider {
  position: relative;
  width: 36px;
  height: 18px;
  background-color: #555;
  border-radius: 18px;
  transition: background-color 0.3s;
  margin-right: 6px;
  flex-shrink: 0;
}

.toggle-slider:before {
  content: "";
  position: absolute;
  height: 12px;
  width: 12px;
  left: 3px;
  bottom: 3px;
  background-color: #fff;
  border-radius: 50%;
  transition: transform 0.3s;
}

.toggle-switch input:checked + .toggle-slider {
  background-color: #c69963;
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(18px);
}

.toggle-label {
  font-size: 12px;
  font-weight: 500;
  color: #c69963;
  white-space: nowrap;
}

/* =====================
   PRICE SLIDER
   ===================== */
.price-slider-container {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 200px;
}

#price-slider {
  flex: 1;
  min-width: 120px;
  height: 6px;
  margin: 0;
}

#price-max-display,
#price-min-display {
  font-size: 12px;
  font-weight: 500;
  color: #c69963;
  white-space: nowrap;
}

#price-slider .noUi-connect {
  background: #c69963;
}

#price-slider .noUi-handle {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  border: 1px solid #c69963;
  background: #ccc;
  transform: translateX(-50%);
}

#price-slider .noUi-handle:hover {
  background: #c69963;
}

#price-slider .noUi-handle:after,
#price-slider .noUi-handle:before {
  display: none;
}

/* =====================
   MOBILE SEARCH (inside panel)
   ===================== */
.mobile-search-wrap {
  display: none; /* shown on mobile via media query */
  width: 100%;
  position: relative;
}

.mobile-search-wrap input {
  width: 100%;
  padding: 8px 12px;
  border: none;
  border-radius: 5px;
  font-size: 14px;
  outline: 0;
  box-sizing: border-box;
}

/* =====================
   DESKTOP SEARCH (icon + expand)
   ===================== */
.controls-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 200px;
}

.desktop-search {
  position: relative;
  display: flex;
  align-items: center;
}

.search-toggle-btn {
  background: none;
  border: none;
  color: #c69963;
  font-size: 18px;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 4px;
  transition: color 0.2s;
}

.search-toggle-btn:hover {
  color: #fff;
}

.search-expand {
  display: none;
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  background: #333;
  border-radius: 5px;
  padding: 4px 8px;
  align-items: center;
  gap: 6px;
  width: 280px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  z-index: 10;
}

.search-expand.open {
  display: flex;
}

.search-expand input {
  flex: 1;
  padding: 6px 10px;
  border: none;
  border-radius: 4px;
  font-size: 13px;
  outline: 0;
  background: #fff;
}

.search-close-btn {
  background: none;
  border: none;
  color: #aaa;
  font-size: 14px;
  cursor: pointer;
  padding: 2px 4px;
  flex-shrink: 0;
}

.search-close-btn:hover {
  color: #fff;
}

.search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: #fff;
  border-radius: 5px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  max-height: 300px;
  overflow-y: auto;
  display: none;
  z-index: 1001;
}

.search-results.show {
  display: block;
}

.search-result-item {
  padding: 10px 15px;
  cursor: pointer;
  border-bottom: 1px solid #eee;
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover {
  background: #f5f5f5;
}

.search-result-item strong {
  display: block;
  color: #333;
}

.search-result-item small {
  color: #666;
}

/* =====================
   MOBILE FILTER BUTTON (hidden desktop)
   ===================== */
.mobile-filter-btn {
  display: none;
  align-items: center;
  gap: 6px;
  background: #c69963;
  border: none;
  color: #000;
  font-size: 13px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
}

/* =====================
   MOBILE legend BUTTON (hidden desktop)
   ===================== */
.mobile-legend-btn {
  display: none;
  align-items: center;
  gap: 6px;
  background: #ccc;
  border: none;
  color: #000;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 6px;
  border-radius: 4px;
  cursor: pointer;
}

/* =====================
   MAP + CONTAINER
   ===================== */
.resultspage {
  max-width: 1280px;
  margin: 0 auto;
  position: relative;
}

.resultspage.map-page {
  min-height: 0;
}

.maptabcontainer {
  position: relative;
  height: calc(100vh - 187px); /* header ~45px + controls bar 50px */
  width: 100%;
}

#map {
  height: 100%;
  width: 100%;
  z-index: 1;
}

/* =====================
   INTRO OVERLAY
   ===================== */
.map-intro-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(2px);
  z-index: 1000;
  padding: 8px;
  border-bottom: 3px solid #c69963;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: opacity 0.3s ease;
}

.intro-overlay-content {
  max-width: 800px;
  margin: 0 auto;
  position: relative;
}

.intro-overlay-content h2 {
  margin: 0 0 15px 0;
  color: #000;
  font-size: 1.8rem;
}

.intro-overlay-content p {
  margin: 0 0 20px 0;
  line-height: 1.6;
  color: #333;
  font-size: 1.4rem;
}

.close-intro {
  position: absolute;
  top: -5px;
  right: 0;
  background: none;
  border: none;
  font-size: 1.8rem;
  cursor: pointer;
  color: #666;
  line-height: 1;
  padding: 5px;
  transition: color 0.2s;
}

.close-intro:hover {
  color: #000;
}

.cta-dismiss {
  background: #c69963;
  color: #000;
  border: none;
  padding: 12px 24px;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s;
}

.cta-dismiss:hover {
  background: #b89153;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* =====================
   MARKER + LABEL STYLES
   ===================== */
.custom-marker-icon {
  background: #fff;
  border: 2px solid #333;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lake-label {
  background: none;
  border: none;
}

.lake-label span {
  color: #000;
  text-shadow: 2px 2px 4px rgba(255, 255, 255, 0.8);
  font-size: 10px;
  white-space: nowrap;
}

/* =====================
   MOBILE BREAKPOINT
   ===================== */
@media (max-width: 768px) {
  /* Show mobile breadcrumb bar above sticky controls */
  .mobile-breadcrumb-bar {
    display: block;
  }

  /* Hide desktop breadcrumbs inside controls bar */
  .controls-breadcrumbs {
    display: none;
  }

  /* Hide desktop search icon */
  .desktop-search {
    display: none;
  }

  /* Show mobile filter button */
  .mobile-filter-btn, .mobile-legend-btn {
    display: flex;
  }



  /* Controls bar is now just a slim row with filter button */
  .controls-row {
    height: 44px;
    justify-content: space-between;
  }

  /* Toggles: hidden by default, shown as dropdown panel */
  .controls-toggles,.controls-legend {
    display: none;
    position: absolute;
    top: 100%; /* drop below the controls bar */
    left: 0;
    right: 0;
    padding: 12px 16px;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    z-index: 500;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  }

  .controls-toggles {
    background: #000;
  }

  .controls-legend {
    background: #ccc;
  }

  .controls-toggles.panel-open,.controls-legend.legend-open {
    display: flex;
  }

  /* Show search inside the panel on mobile */
  .mobile-search-wrap {
    display: block;
  }

  /* Price slider full width in panel */
  .price-slider-container {
    width: 100%;
    min-width: unset;
  }

  #price-slider {
    min-width: unset;
    flex: 1;
  }

  /* Map fills nearly full viewport */
  .maptabcontainer {
    height: calc(100vh - 195px); /* mobile breadcrumb ~28px + controls ~44px + site header */
  }

  .toggle-label {
    font-size: 13px;
  }
}

@media (max-width: 550px) {
    .leaflet-legend-control {
        display: none;
    }
}