/* Homepage POI browse map: full-height map + category filter sidebar + hover popup card. */

.poi-map-section {
  position: relative;             /* anchor for the overlaid sidebar */
  isolation: isolate;
  height: calc(100vh - 56px);
}
.poi-map-sidebar {
  position: absolute;             /* float over the map */
  top: 50%;
  left: 14px;
  transform: translateY(-50%);    /* vertically centred on the map */
  z-index: 1100;                  /* above the Leaflet panes/controls (z 1000) */
  width: 260px;
  max-height: calc(100% - 140px); /* shorter than the map; clears the top-left zoom control */
  overflow-y: auto;
  padding: 14px 16px;
  background: rgba(247, 247, 247, .95);
  border: 1px solid #e2e2e2;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .18);
  font-size: 12px;                /* smaller */
}
.poi-map-sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.poi-map-sidebar li {
  margin-bottom: 5px;
}
.poi-map-sidebar label {
  font-weight: normal;
  cursor: pointer;
}
.poi-toggle-all-label {
  display: block;
  font-weight: bold;
  font-size: 13px;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e2e2e2;
}
.poi-popup .leaflet-popup-content-wrapper {
  border-radius: 8px;
}
.poi-popup .leaflet-popup-content {
  margin: 10px;
}
.poi-popup-card {
  max-width: 220px;
  cursor: pointer;
}
.poi-popup-card img {
  float: left;
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 4px;
  margin: 0 10px 6px 0;
}
.poi-popup-card h5 {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: bold;
}
.poi-popup-card p {
  font-size: 12px;
  color: #555;
  margin: 0;
}
.poi-popup-elevation {
  clear: both;
  font-size: 11px;
  color: #888;
  padding-top: 4px;
}
.poi-map-section #map {
  width: 100%;
  height: 100%;          /* full-width map; the sidebar overlays it */
}

/* The snap aligns the map top flush under the fixed site header, so the map's
   top controls (layers switcher, zoom) sit near the top of the map. */
.poi-map-section .leaflet-top {
  top: 6px;
}

/* Mobile toggle button — hidden on desktop (sidebar is always shown there). */
.poi-sidebar-toggle {
  display: none;
}

@media (max-width: 767px) {
  /* Collapse the sidebar behind a toggle so it doesn't cover the map. */
  .poi-map-sidebar {
    display: none;
    width: auto;
    left: 12px;
    right: 12px;          /* full-width card when opened */
  }
  .poi-map-sidebar.open {
    display: block;
  }
  .poi-sidebar-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    position: absolute;
    top: 12px;
    left: 52px;           /* clear of the top-left zoom control */
    z-index: 1100;
    background: #fff;
    border: 1px solid #cdd6df;
    border-radius: 6px;
    padding: 7px 12px;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    box-shadow: 0 1px 5px rgba(0, 0, 0, .25);
    cursor: pointer;
  }
}

/* Top-center POI search over the map */
.poi-map-search {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1100;                  /* above the Leaflet panes/controls, like the sidebar */
  width: 460px;
  max-width: calc(100% - 130px);  /* clear of the corner controls */
}
.poi-map-search .poi-search-pin {
  position: absolute;
  top: 17px;
  left: 18px;
  font-size: 16px;
  color: #3498db;
  pointer-events: none;
}
.poi-map-search input {
  width: 100%;
  height: 50px;
  padding: 0 56px 0 44px;
  border: 1px solid #e2e2e2;
  border-radius: 25px;
  background: rgba(255, 255, 255, .95);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .18);
  font-size: 15px;
  outline: none;
}
/* round submit button, same as the hero search box */
.poi-map-search .poi-search-btn {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: #3498db;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s ease-in-out, color 0.2s ease-in-out;
}
.poi-map-search .poi-search-btn:hover {
  color: #3498db;
  background: #eaf4fb;
}
.poi-map-search input:focus {
  border-color: #3498db;
}
.poi-map-search ul {
  position: absolute;
  top: 56px;
  left: 0;
  right: 0;
  margin: 0;
  padding: 6px 0;
  list-style: none;
  background: #fff;
  border: 1px solid #e2e2e2;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .18);
  max-height: 260px;
  overflow-y: auto;
}
.poi-map-search li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px;
  font-size: 14px;
  cursor: pointer;
}
.poi-map-search .poi-search-avatar {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background: #f0f0f0;
  border: 1px solid #e2e2e2;
}
.poi-map-search li:hover,
.poi-map-search li.is-active {
  background: #f0f7fc;
  color: #3498db;
}

@media (max-width: 767px) {
  /* Sit below the Categories toggle row, full width. */
  .poi-map-search {
    top: 58px;
    left: 12px;
    right: 12px;
    width: auto;
    max-width: none;
    transform: none;
  }
}

/* Mouse-wheel zoom opt-in checkbox (top-right, under the zoom buttons) */
.poi-wheel-toggle {
  background: rgba(255, 255, 255, .95);
  border: 1px solid #e2e2e2;
  border-radius: 6px;
  padding: 6px 10px;
  box-shadow: 0 1px 5px rgba(0, 0, 0, .2);
  font-size: 12px;
}
.poi-wheel-toggle label {
  margin: 0;
  font-weight: normal;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}
.poi-wheel-toggle input {
  margin: 0;
}
.poi-wheel-toggle img {
  height: 20px;
  width: auto;
  display: block;
}
