#map { 
  height: 1000px; 
  touch-action: manipulation;
}



.leaflet-popup-content-wrapper {
background: #fffbea;
color: #333;
font-family: 'Segoe UI', sans-serif;
border-radius: 12px;
box-shadow: 0 4px 10px rgba(0,0,0,0.2);
max-width: 220px !important;  /* Limits the overall popup size */
padding: 0 !important;   
}

.leaflet-popup-tip {
background: #fffbea;
}

.custom-popup h3 {
margin: 0 0 4px;
font-size: 16px;
color: #b7410e;
padding: 10px;
  box-sizing: border-box;
  font-family: sans-serif;
}

/* Constrain the inner content */
.leaflet-popup-content {
  margin: 0 !important;
  padding: 0 !important;
  width: 170px; /* controls overall width of popup */
}

/* Constrain the image */
.custom-popup img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
}

.custom-popup p {
margin: 0;
font-size: 14px;
}
/* Filter Dropdown Styles */
#filter-dropdown {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 401;
  background: rgba(44, 32, 20, 0.97);
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  padding: 0;
  pointer-events: auto;
}
#filter-dropdown-toggle {
  background: #2c2014;
  color: #fff;
  border: none;
  border-radius: 10px 10px 0 0;
  padding: 10px 18px;
  font-size: 16px;
  cursor: pointer;
  width: 100%;
}
#filter-dropdown-menu {
  background: #3a2a18;
  border-radius: 0 0 10px 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  padding: 12px 16px;
  min-width: 220px;
}
.hidden {
  display: none !important;
  pointer-events: none !important;
}
.filter-menu-btn {
  background: #b7410e;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 8px 14px;
  margin: 4px 0;
  font-size: 15px;
  cursor: pointer;
  width: 100%;
  transition: background 0.2s;
}
.filter-menu-btn:hover {
  background: #d65c1a;
}
#manual-filters {
  margin-top: 10px;
  background: #2c2014;
  border-radius: 8px;
  padding: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.13);
  font-family: 'Segoe UI', sans-serif;
}
.filter-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  color: #fff;
  font-family: 'Segoe UI', sans-serif;
}
#manual-filters h4 {
  margin: 0 0 8px 0;
  font-size: 15px;
  color: #fff;
}
#manual-filters button {
  background: #b7410e;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 7px 14px;
  margin-top: 10px;
  font-size: 15px;
  cursor: pointer;
  width: 100%;
}
#manual-filters button:hover {
  background: #d65c1a;
}

/* Sidebar custom styles */
#sidebar {
  z-index: 100;
  pointer-events: none;
}

#sidebar.active {
  pointer-events: auto;
}

/* Cafe Marker Styles */
.cafe-marker {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: none;
  border-radius: 12px;
  box-shadow: none;
  padding: 2px 6px 4px 6px;
  min-width: 40px;
  min-height: 40px;
  position: relative;
}
.cafe-marker.grey {
  opacity: 0.5;
}
.cafe-icon-img {
  width: 28px;
  height: 28px;
  margin-bottom: 2px;
}
.cafe-label {
  font-size: 13px;
  color: #e0d6c3;
  font-weight: 400;
  background: rgba(44,32,20);
  border-radius: 6px;
  padding: 2px 6px;
  margin-top: 2px;
  box-shadow: none;
  text-align: center;
  white-space: nowrap;
  opacity: 1;
}

/* Legazpi Village Map Label */
.legazpi-map-label {
  background: none !important;
  border: none !important;
  box-shadow: none !important;
}
.legazpi-label-main {
  font-size: 18px;
  color: #fff;
  font-weight: bold;
  text-align: center;
  background: #2c2014;
  border-radius: 8px 8px 0 0;
  padding: 6px 0 2px 0;
}
.legazpi-label-desc {
  font-size: 13px;
  color: #fff;
  text-align: center;
  background: #3a2a18;
  border-radius: 0 0 8px 8px;
  padding: 0 0 6px 0;
}

/* ...existing code... */

/* Mobile Responsive Styles */
@media (max-width: 600px) {
  #map {
    height: 100vh;
    min-height: 100vh;
    padding-bottom: 70px;
    box-sizing: border-box;
    touch-action: manipulation;
    position: relative;
  }

  #filter-dropdown {
    top: 10px;
    right: 10px;
    left: 10px;
    width: auto;
    max-width: 95vw;
    border-radius: 10px;
    padding: 0;
  }

  #filter-dropdown-toggle {
    font-size: 15px;
    padding: 10px 10px;
    border-radius: 10px 10px 0 0;
  }

  #filter-dropdown-menu {
    min-width: unset;
    width: 100%;
    padding: 10px 8px;
    font-size: 15px;
    border-radius: 0 0 10px 10px;
  }

  .filter-menu-btn,
  #manual-filters button {
    font-size: 14px;
    padding: 8px 10px;
  }

  #sidebar {
    position: fixed !important;
    top: 0;
    right: 0;
    width: 10vw !important;
    max-width: 100vw;
    height: 100vh !important;
    z-index: 100;
    border-radius: 0;
    pointer-events: auto;
  }

  .leaflet-popup {
    background: transparent !important;
    box-shadow: none !important;
    max-width: 85vw !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    bottom: auto !important;
  }

  .leaflet-popup-content-wrapper {
    background: rgba(44,32,20,0.97) !important; /* dark, matches your theme */
    color: #fff !important;
    max-width: 85vw !important;
    font-size: 15px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    padding: 0 !important;
  }

  .leaflet-popup-content {
    width: 80vw !important;
    font-size: 15px;
    background: transparent !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .leaflet-popup-tip {
    background: rgba(44,32,20,0.97) !important;
  }
  

  .custom-popup img {
    height: 80px;
    border-radius: 8px 8px 0 0;
  }

  .custom-popup h3 {
    font-size: 15px;
    padding: 8px;
  }

  .custom-popup p {
    font-size: 13px;
  }

  .cafe-marker {
    min-width: 32px;
    min-height: 32px;
    padding: 2px 4px 3px 4px;
  }

  .cafe-icon-img {
    width: 22px;
    height: 22px;
    margin-bottom: 1px;
  }

  .cafe-label {
    font-size: 12px;
    padding: 2px 4px;
    margin-top: 1px;
  }

  .legazpi-label-main {
    font-size: 15px;
    padding: 4px 0 1px 0;
    border-radius: 6px 6px 0 0;
  }

  .legazpi-label-desc {
    font-size: 12px;
    padding: 0 0 4px 0;
    border-radius: 0 0 6px 6px;
  }

  /* Bottom Filter Bar for Mobile */
  .mobile-filter-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100vw;
    background: #2c2014;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 8px 0;
    z-index: 500;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.18);
    border-radius: 12px 12px 0 0;
    pointer-events: auto;
  }
  .mobile-filter-btn {
    background: #7a6b5f;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 18px;
    font-size: 16px;
    cursor: pointer;
    flex: 1 1 0;
    margin: 0 6px;
    transition: background 0.2s;
    pointer-events: auto;
    opacity: 0.6;
  }
  .mobile-filter-btn.active {
    background: #b7410e;
    opacity: 1;
  }

  .leaflet-popup,
  .leaflet-popup-content-wrapper,
  .leaflet-popup-content,
  .leaflet-popup-tip {
    background: rgba(44,32,20,0.97) !important;
    color: #fff !important;
    box-shadow: none !important;
  }

  .leaflet-popup-content {
    background: transparent !important;
  }

  /* Force all popup backgrounds to be transparent/dark on mobile */
  .leaflet-popup,
  .leaflet-popup * {
    background: rgba(44,32,20,0.97) !important;
    color: #fff !important;
    box-shadow: none !important;
    border: none !important;
  }

  /* Ensure the map is always above popups */
  #map {
    position: relative;
    z-index: 1;
  }

  /* Hide any empty or misplaced leaflet popups */
  .leaflet-popup:not(.leaflet-popup-open),
  .leaflet-popup-content-wrapper:empty,
  .leaflet-popup-content:empty {
    opacity: 0 !important;
    pointer-events: none !important;
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
  }
}
/* ...existing code... */


