/* ============================================================
   mapa-real.css — Mapa estilo app (full-bleed + UI flotante glass)
============================================================ */

body { overflow: hidden; }

/* Header a todo el ancho en el mapa */
.t-nav .container { max-width: 100%; padding: 0 28px; }
.t-nav__links a.is-active { background: var(--c-azul-light); color: var(--c-azul); font-weight: 600; }

/* Lienzo del mapa a sangre completa */
.mapa-app { position: relative; height: calc(100vh - 76px); overflow: hidden; }
.mapa-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

/* --- Glass base --- */
.glass {
  background: rgba(255,255,255,0.82);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  border: 1px solid rgba(255,255,255,0.65);
  box-shadow: 0 14px 44px rgba(0,0,0,0.18);
}

/* --- Filtros principales (menú blanco, adelante) --- */
.m-filtros { display: flex; flex-wrap: wrap; gap: 6px; padding: 2px 20px 16px; }
.m-filtros .chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 12px; border-radius: var(--r-pill);
  background: #fff; border: 1px solid rgba(0,0,0,0.1); color: var(--c-gris);
  font-size: 0.78rem; font-weight: 600; box-shadow: var(--depth-1);
  transition: border-color var(--t-fast), color var(--t-fast), box-shadow var(--t-fast);
}
.m-filtros .chip:hover { border-color: var(--c-azul); color: var(--c-azul); }
.m-filtros .chip--on { color: var(--c-azul); border-color: var(--c-azul); box-shadow: 0 0 0 1.5px var(--c-azul); }
.m-filtros .chip__dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.m-filtros .chip__count { font-size: 0.68rem; font-weight: 700; opacity: 0.5; }

/* --- Sublistado de lugares (gris, recesado, "detrás") --- */
.m-sub {
  flex: 1; display: flex; flex-direction: column; overflow: hidden;
  background: #eceef1;
  border-top: 1px solid rgba(0,0,0,0.08);
  box-shadow: inset 0 8px 16px -10px rgba(0,0,0,0.35);
  border-radius: 0 0 20px 20px;
}
.m-sub__label {
  padding: 13px 20px 5px; font-size: 11px; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase; color: #9aa0a6;
}

/* --- Panel de lugares (tarjeta flotante izquierda) --- */
.m-panel {
  position: absolute; top: 18px; left: 18px; z-index: 600;
  width: 340px; max-height: calc(100% - 36px);
  display: flex; flex-direction: column; border-radius: 20px; overflow: hidden;
  background: rgba(255,255,255,0.96);
  transition: transform var(--t-slow), opacity var(--t-slow);
}
.m-panel[hidden] { display: none; }
.m-panel__head {
  padding: 22px 22px 16px; display: flex; align-items: flex-start; justify-content: space-between;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}
.m-eyebrow { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--c-azul); font-weight: 700; }
.m-panel__head h1 { font-size: 1.55rem; font-weight: 700; color: var(--c-dark); line-height: 1.08; margin: 7px 0 5px; letter-spacing: -0.01em; }
.m-count { font-size: 0.8rem; color: var(--c-mid); font-weight: 500; }
.m-panel__close {
  flex: 0 0 auto; width: 32px; height: 32px; border-radius: 9px;
  background: rgba(0,0,0,0.05); color: var(--c-gris); font-size: 18px; line-height: 1;
  display: flex; align-items: center; justify-content: center; transition: background var(--t-fast);
}
.m-panel__close:hover { background: rgba(0,0,0,0.1); }
.m-panel__foot { padding: 12px 22px; border-top: 1px solid rgba(0,0,0,0.06); font-size: 0.72rem; color: #8a2020; font-weight: 600; }

/* Botón para reabrir el panel */
.m-panel-open {
  position: absolute; top: 18px; left: 18px; z-index: 600;
  padding: 12px 18px; border-radius: 12px; font-size: 0.85rem; font-weight: 700;
  color: var(--c-azul); display: none; align-items: center;
}
.m-panel-open:hover { background: #fff; }
.m-panel.is-hidden ~ .m-panel-open { display: inline-flex; }

/* --- Lista de lugares (dentro del sublistado gris, atenuada) --- */
.mapa-list { flex: 1; overflow-y: auto; padding: 0 12px 8px; display: flex; flex-direction: column; gap: 1px; }
.mapa-list__it {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 11px; border-radius: 10px; cursor: pointer;
  transition: background var(--t-fast);
}
.mapa-list__it:hover { background: rgba(255,255,255,0.75); }
.mapa-list__dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; opacity: 0.8; }
.mapa-list__nm { font-size: 0.84rem; color: #6b7075; line-height: 1.25; transition: color var(--t-fast); }
.mapa-list__it:hover .mapa-list__nm { color: var(--c-dark); }

/* --- Popups Leaflet --- */
.leaflet-popup-content-wrapper { border-radius: 14px; box-shadow: 0 12px 40px rgba(0,0,0,0.2); }
.mp-pop { font-family: var(--font); }
.mp-pop__cat { display: block; font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 3px; }
.mp-pop strong { font-size: 0.98rem; color: var(--c-dark); display: block; line-height: 1.25; }
.mp-pop p { font-size: 0.8rem; color: var(--c-mid); margin: 6px 0 10px; line-height: 1.45; }
.mp-pop a { font-size: 0.82rem; font-weight: 700; color: var(--c-azul); }

/* --- Marcador DEA (cardioprotegido) --- */
.dea-icon { display: flex; align-items: center; justify-content: center; }
.dea-icon span {
  width: 22px; height: 22px; border-radius: 50%;
  background: #8a2020; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; line-height: 1;
  border: 2px solid #fff; box-shadow: 0 1px 5px rgba(0,0,0,0.45);
}

/* Controles Leaflet más suaves */
.leaflet-control-zoom a { border-radius: 8px !important; color: var(--c-gris) !important; }
.leaflet-bar { border: none !important; box-shadow: var(--depth-2) !important; }

/* Botón GPS "¿dónde estoy?" */
.m-geo {
  position: absolute; left: 50%; transform: translateX(-50%); bottom: 18px; z-index: 600;
  padding: 11px 18px; border-radius: var(--r-pill); border: none; cursor: pointer;
  font-size: 0.85rem; font-weight: 700; color: var(--c-azul);
  display: inline-flex; align-items: center; transition: background var(--t-fast);
}
.m-geo:hover { background: #fff; }
.m-geo.is-loading { opacity: 0.65; }

/* Punto de ubicación del usuario (pulsante) */
.geo-dot span {
  display: block; width: 16px; height: 16px; border-radius: 50%;
  background: #1a73e8; border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,0.4);
  animation: geopulse 1.8s ease-out infinite;
}
@keyframes geopulse {
  0%   { box-shadow: 0 0 0 0 rgba(26,115,232,0.45), 0 1px 4px rgba(0,0,0,0.4); }
  70%  { box-shadow: 0 0 0 16px rgba(26,115,232,0), 0 1px 4px rgba(0,0,0,0.4); }
  100% { box-shadow: 0 0 0 0 rgba(26,115,232,0), 0 1px 4px rgba(0,0,0,0.4); }
}

/* --- Responsive --- */
@media (max-width: 640px) {
  .m-panel { width: auto; left: 12px; right: 12px; top: auto; bottom: 12px; max-height: 44%; }
  .m-chips { top: 12px; max-width: calc(100vw - 24px); }
  .m-panel__head h1 { font-size: 1.3rem; }
}

/* ---------- MODO EMBED (?embed=1) — previsualización limpia del mapa ---------- */
.is-embed .t-nav,
.is-embed .m-panel,
.is-embed .m-panel-open,
.is-embed .m-geo { display: none !important; }
.is-embed .mapa-app { height: 100vh; }
.is-embed .leaflet-control-zoom { display: none; }
