/* 地图组件样式 */

/* 容器 */
.map-container {
  width: 100%;
  height: 220px;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  background: #e8eef0;
  z-index: 1;
}

.map-container.tall {
  height: 320px;
}

.map-container.fullscreen {
  height: 100vh;
  height: 100dvh;
  border-radius: 0;
}

/* Leaflet 内部尺寸自适应 */
.map-container .leaflet-container {
  width: 100%;
  height: 100%;
  background: #e8eef0;
  font-family: inherit;
}

/* 自定义标记 */
.map-marker-emoji {
  background: transparent;
  border: none;
  font-size: 28px;
  line-height: 1;
  text-align: center;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.3));
}

.map-marker-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-primary, #1a3c2e);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.map-marker-circle.rider {
  background: #ff7043;
}

.map-marker-circle.user {
  background: #1976d2;
}

.map-marker-circle.community {
  background: #2e7d32;
}

/* 骑手位置脉冲圈 */
.rider-pulse {
  position: absolute;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(255, 112, 67, 0.3);
  animation: rider-pulse-anim 1.8s ease-out infinite;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

@keyframes rider-pulse-anim {
  0%   { transform: translate(-50%, -50%) scale(0.5); opacity: 0.8; }
  100% { transform: translate(-50%, -50%) scale(2.2); opacity: 0; }
}

/* 弹出层 */
.leaflet-popup-content-wrapper {
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.leaflet-popup-content {
  margin: 10px 14px;
  font-size: 13px;
  line-height: 1.5;
  color: #333;
}

/* 地图上方浮动信息条 */
.map-floating-info {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 13px;
  color: #333;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  z-index: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

.map-floating-info .map-info-emoji {
  font-size: 18px;
}

.map-floating-info .map-info-text {
  flex: 1;
  min-width: 0;
}

.map-floating-info .map-info-eta {
  color: var(--color-primary, #1a3c2e);
  font-weight: 600;
}

/* 地图右下角定位按钮 */
.map-locate-btn {
  position: absolute;
  bottom: 14px;
  right: 14px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #fff;
  border: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  font-size: 18px;
  cursor: pointer;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
}

.map-locate-btn:active {
  transform: scale(0.92);
}

/* 地图选点模式底部确认条 */
.map-picker-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.08);
  z-index: 500;
}

.map-picker-bar .picker-addr {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  color: #333;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-picker-bar .picker-confirm {
  padding: 8px 18px;
  background: var(--color-primary, #1a3c2e);
  color: #fff;
  border: none;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
}

/* 选点中心十字 */
.map-picker-crosshair {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 32px;
  height: 32px;
  pointer-events: none;
  z-index: 400;
  font-size: 32px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
}
