/* ========== 基础重置 ========== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%; height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  color: #333;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

/* ========== 地图容器 ========== */
#map {
  width: 100%; height: 100%;
  z-index: 1;
}

/* ========== Leaflet Popup 自定义 ========== */
.leaflet-popup-content-wrapper {
  border-radius: 12px !important;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15) !important;
  padding: 0 !important;
}

.leaflet-popup-content {
  margin: 0 !important;
  padding: 14px 16px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  line-height: 1.5;
  min-width: 160px;
  max-width: 260px;
}

.leaflet-popup-tip {
  box-shadow: 0 4px 12px rgba(0,0,0,0.1) !important;
}

.map-popup-name {
  font-size: 15px;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 4px;
}

.map-popup-addr {
  font-size: 12px;
  color: #888;
  margin-bottom: 2px;
}

.map-popup-phone {
  font-size: 12px;
  color: #888;
  margin-bottom: 10px;
}

.map-popup-addr:empty,
.map-popup-phone:empty {
  display: none;
}

/* 气泡内的"前往这里"按钮 */
.map-popup-nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 8px 0;
  margin-top: 4px;
  background: linear-gradient(135deg, #4A90D9, #357ABD);
  color: #fff;
  border: none;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}

.map-popup-nav-btn:hover {
  opacity: 0.9;
}

.map-popup-nav-btn svg {
  flex-shrink: 0;
}

/* 自定义 marker 水滴图标 */
.custom-marker-icon {
  width: 32px;
  height: 40px;
  position: relative;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.35));
}

.custom-marker-icon::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 32px;
  height: 32px;
  background: #e74c3c;
  border-radius: 50%;
}

.custom-marker-icon::after {
  content: '';
  position: absolute;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 10px solid #e74c3c;
}

/* ========== 弹窗遮罩 ========== */
#nav-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.35);
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

#nav-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* ========== 导航选择弹窗 ========== */
#nav-modal {
  position: fixed;
  bottom: -100%;
  left: 0; right: 0;
  z-index: 2001;
  background: #fff;
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.12);
  transition: bottom 0.3s ease;
  max-height: 70vh;
  overflow-y: auto;
}

#nav-modal.active {
  bottom: 0;
}

#nav-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 12px;
  font-size: 16px;
  font-weight: 600;
  border-bottom: 1px solid #f0f0f0;
}

#nav-modal-close {
  background: none; border: none;
  font-size: 24px; color: #999;
  cursor: pointer; padding: 0 4px;
  line-height: 1;
}

#nav-modal-close:hover { color: #333; }

#nav-modal-list {
  padding: 8px 0 20px;
}

/* ========== 导航选项 ========== */
.nav-option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  text-decoration: none;
  color: #333;
  transition: background 0.15s;
  cursor: pointer;
}

.nav-option:hover { background: #f5f7fa; }
.nav-option:active { background: #eef1f5; }

.nav-icon {
  font-size: 28px;
  width: 44px; height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f5f7fa;
  border-radius: 12px;
  flex-shrink: 0;
}

.nav-info {
  display: flex; flex-direction: column;
}

.nav-name {
  font-size: 15px; font-weight: 500;
}

.nav-desc {
  font-size: 12px; color: #999;
  margin-top: 2px;
}

/* ========== Leaflet 控件覆盖 ========== */
.leaflet-control-attribution {
  font-size: 10px !important;
}

.leaflet-control-zoom {
  border: none !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12) !important;
}

.leaflet-control-zoom a {
  border-radius: 6px !important;
  margin-bottom: 2px;
}
