/* ──────────────────────────────────────────────
   Leaflet Map Component — Bow Tie Plumbing
   Replaces Google Static Maps API with free
   OpenStreetMap tiles via Leaflet.js
   v3.70.0
   ────────────────────────────────────────────── */

.bt-map-wrap {
  position: relative;
  width: 100%;
  height: 150px;
  border-radius: var(--bt-radius, 12px) var(--bt-radius, 12px) 0 0;
  overflow: hidden;
  background: var(--bt-bg, #f4f7fb);
}

.bt-map-wrap .leaflet-container {
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* hide default controls — these are thumbnail maps */
.bt-map-wrap .leaflet-control-zoom {
  display: none !important;
}
.bt-map-wrap .leaflet-control-attribution {
  background: rgba(255,255,255,.75) !important;
  font-size: 9px !important;
  line-height: 1.3 !important;
  padding: 0 4px;
}

/* distance badge overlay */
.bt-map-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 500;
  background: rgba(30, 58, 95, 0.88);
  color: #fff;
  font: 600 11px/1 var(--bt-font, Inter, sans-serif);
  padding: 5px 10px;
  border-radius: 6px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  gap: 4px;
}

.bt-map-badge svg {
  width: 12px;
  height: 12px;
  fill: currentColor;
}

/* satellite toggle button */
.bt-map-sat-toggle {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 500;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(0, 0, 0, 0.12);
  color: var(--bt-text, #12233f);
  font: 600 11px/1 var(--bt-font, Inter, sans-serif);
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.bt-map-sat-toggle:hover {
  background: rgba(255, 255, 255, 1);
}

/* loading / error states */
.bt-map-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--bt-text-tertiary, #8d9ab0);
  font-size: 13px;
}

.bt-map-error {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  background: var(--bt-bg, #f4f7fb);
  color: var(--bt-text-secondary, #5d6b82);
  font-size: 13px;
  gap: 6px;
}

/* ── Responsive ── */

@media (max-width: 600px) {
  .bt-map-wrap {
    height: 120px;
  }
}

/* when used inside the My Day timeline cards */
.myday-job-card .bt-map-wrap {
  border-radius: var(--bt-radius, 12px) var(--bt-radius, 12px) 0 0;
}

/* when used on the job detail page — larger map */
.job-detail-map .bt-map-wrap {
  height: 220px;
  border-radius: var(--bt-radius, 12px);
}

/* when used on the route/schedule view — compact strip */
.route-map-strip .bt-map-wrap {
  height: 100px;
  border-radius: var(--bt-radius-sm, 8px);
}