/* EVBro — Live map on the home tab: expandable, «Centrar» and «Ir a».
   Standalone sheet: the load ORDER (templates/index.html) follows the original cascade; do not change it. */

.live-map-wrap { position: relative; height: 180px; }
.live-map-wrap > #liveMap { height: 100%; width: 100%; cursor: zoom-in; }

/* Floating buttons over the map (bottom-right corner; Leaflet's zoom sits top right) */
.map-fabs {
  position: absolute; right: 10px; bottom: 10px; z-index: 900;
  display: flex; flex-direction: column; align-items: flex-end; gap: 8px;
}
.map-fab, .map-close-btn {
  min-width: 44px; height: 44px; padding: 0 12px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-size: 0.85rem; font-weight: 700; cursor: pointer;
  color: var(--text-primary); background: var(--surface); border: 1px solid var(--border-color);
  border-radius: 22px; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  -webkit-tap-highlight-color: transparent;
}
.map-fab:disabled { opacity: 0.45; cursor: not-allowed; }
.map-fab-go { color: #fff; background: var(--accent-bright); border-color: transparent; }
.map-fab.is-off-center { border-color: var(--accent-bright); color: var(--accent-bright); animation: map-fab-pulse 1.6s ease-in-out infinite; }
@keyframes map-fab-pulse { 50% { box-shadow: 0 0 0 6px rgba(var(--accent-rgb), 0.22), 0 4px 14px rgba(0, 0, 0, 0.35); } }
@media (prefers-reduced-motion: reduce) { .map-fab.is-off-center { animation: none; } }

/* Close button (only with the map expanded) */
.map-close-btn {
  position: absolute; top: max(10px, env(safe-area-inset-top)); left: 10px; z-index: 900;
  width: 44px; padding: 0; border-radius: 50%;
}
.map-close-btn[hidden] { display: none; }

/* EXPANDED map: full screen above the dock and the header, below the modals */
.map-card.map-expanded {
  position: fixed; inset: 0; z-index: 1500; margin: 0 !important;
  width: 100%; height: 100%; max-height: none; border-radius: 0 !important; border: 0;
  display: flex; flex-direction: column;
}
.map-card.map-expanded .live-map-wrap { flex: 1 1 auto; height: auto; min-height: 0; }
.map-card.map-expanded .live-map-wrap > #liveMap { cursor: grab; }
.map-card.map-expanded > .live-map-wrap + .map-overlay-info {
  margin: 0; border-radius: 0; border-left: 0; border-right: 0; border-bottom: 0;
  padding: 0.8rem 1rem max(0.8rem, env(safe-area-inset-bottom));
}
.map-card.map-expanded .map-fabs { bottom: 14px; }
body.map-open { overflow: hidden; }
