.map-page{padding:6px 8px 8px;overflow:hidden}

.real-map-shell{
  position:relative;
  /*
    Fallback inicial. JavaScript calcula después la altura exacta
    hasta el borde superior real de la navegación inferior.
  */
  height:calc(100dvh - var(--nav-h) - 72px);
  min-height:0;
  max-height:none;
  overflow:hidden;
  border-radius:22px;
  border:1px solid var(--border);
  background:#f8faf9
}
.real-map{width:100%;height:100%}

@media(min-width:1024px){
  /* Sin bottom-nav en desktop: solo se reserva el alto del header. JS
     (SSV.syncMapViewportHeight) recalcula el valor exacto después. */
  html.is-desktop .real-map-shell{height:calc(100dvh - 90px)}
}

.coverage-chip{
  position:absolute;
  left:12px;
  top:12px;
  z-index:500;
  max-width:72%;
  padding:9px 12px;
  border:1px solid var(--border);
  border-radius:14px;
  background:rgba(255,255,255,.96);
  color:var(--primary);
  display:flex;
  align-items:center;
  gap:7px;
  box-shadow:0 7px 18px rgba(20,55,51,.08);
  backdrop-filter:blur(8px)
}
.coverage-chip span{
  color:var(--text);
  font-size:.66rem;
  font-weight:800
}

.map-status{
  position:absolute;
  left:50%;
  top:68px;
  z-index:520;
  transform:translateX(-50%);
  max-width:88%;
  padding:8px 12px;
  border-radius:12px;
  background:rgba(20,122,114,.95);
  color:#fff;
  font-size:.66rem;
  font-weight:800;
  box-shadow:0 7px 18px rgba(20,55,51,.12)
}
.map-status.is-hidden{display:none}
.map-status.is-error{background:rgba(191,89,77,.95)}
.map-status.is-success{background:rgba(20,122,114,.95)}

.map-legend{
  position:absolute;
  left:12px;
  bottom:12px;
  z-index:500;
  background:rgba(255,255,255,.96);
  border:1px solid var(--border);
  border-radius:13px;
  padding:10px 11px;
  display:grid;
  gap:7px;
  font-size:.62rem;
  box-shadow:0 7px 18px rgba(20,55,51,.08)
}
.map-legend div{display:flex;align-items:center;gap:7px}
.legend-animal{
  width:26px;
  height:26px;
  flex:0 0 26px;
  border-radius:50%;
  background:#fff;
  border:1px solid #dfe8e6;
  color:#34524e;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  box-shadow:0 3px 8px rgba(20,55,51,.07)
}
.legend-animal svg{
  width:18px;
  height:18px;
  fill:none;
  stroke:currentColor;
  stroke-width:2;
  stroke-linecap:round;
  stroke-linejoin:round
}
.legend-animal svg circle{
  fill:currentColor;
  stroke:none
}
.legend-halo{
  position:relative;
  width:26px;
  height:26px;
  flex:0 0 26px;
  display:inline-block
}
.legend-halo::after{
  content:"";
  position:absolute;
  left:50%;
  top:50%;
  width:10px;
  height:10px;
  transform:translate(-50%,-50%);
  border-radius:50%;
  background:#fff;
  border:2px solid var(--coral)
}
.legend-halo i{
  position:absolute;
  left:50%;
  top:50%;
  width:14px;
  height:14px;
  transform:translate(-50%,-50%);
  border-radius:50%;
  border:2px solid var(--coral);
  opacity:.45
}
.legend-halo i:last-child{
  width:24px;
  height:24px;
  opacity:.2
}

.locate-button{
  position:absolute;
  right:12px;
  bottom:12px;
  z-index:510;
  width:44px;
  height:44px;
  padding:0;
  border-radius:50%;
  border:1px solid var(--border);
  background:#fff;
  color:var(--primary);
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow:0 7px 18px rgba(20,55,51,.08)
}

/* ===== V22: marcador limpio + halo realmente visible ===== */
.ssv-leaflet-marker-wrapper{
  background:transparent !important;
  border:none !important;
  overflow:visible !important
}
.ssv-map-marker{
  position:relative;
  width:58px;
  height:66px;
  overflow:visible
}

.ssv-map-halo{
  position:absolute;
  z-index:1;
  left:50%;
  /*
    V69: el punto real del marcador está en iconAnchor [29,58].
    El halo nace exactamente en esa punta geográfica y se expande
    desde ahí, en vez de hacerlo alrededor de la cara del pin.
  */
  top:58px;
  width:24px;
  height:24px;
  border:3px solid var(--marker-color);
  border-radius:50%;
  transform:translate(-50%,-50%) scale(.28);
  opacity:.94;
  pointer-events:none;
  filter:drop-shadow(0 0 2px var(--marker-color));
  animation:ssv-visible-halo 2s cubic-bezier(.16,.65,.35,1) infinite
}
.ssv-map-halo.halo-two{
  animation-delay:.88s
}
@keyframes ssv-visible-halo{
  0%{
    transform:translate(-50%,-50%) scale(.28);
    opacity:.94
  }
  18%{
    opacity:.9
  }
  72%{
    transform:translate(-50%,-50%) scale(2.35);
    opacity:.18
  }
  100%{
    transform:translate(-50%,-50%) scale(2.7);
    opacity:0
  }
}

.ssv-map-pin-face{
  position:absolute;
  z-index:4;
  left:50%;
  top:8px;
  width:40px;
  height:40px;
  transform:translateX(-50%);
  border-radius:50%;
  background:#fff;
  border:3px solid var(--marker-color);
  color:#365651;
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow:
    0 7px 17px rgba(18,49,45,.2),
    0 0 0 2px rgba(255,255,255,.92)
}
.ssv-map-animal-icon{
  display:flex;
  align-items:center;
  justify-content:center;
  width:26px;
  height:26px
}
.ssv-map-animal-icon svg{
  width:25px;
  height:25px;
  fill:none;
  stroke:currentColor;
  stroke-width:1.85;
  stroke-linecap:round;
  stroke-linejoin:round
}
.ssv-map-animal-icon svg circle{
  fill:currentColor;
  stroke:none
}
.ssv-map-pin-tip{
  position:absolute;
  z-index:3;
  left:50%;
  top:39px;
  width:15px;
  height:15px;
  transform:translateX(-50%) rotate(45deg);
  background:#fff;
  border-right:3px solid var(--marker-color);
  border-bottom:3px solid var(--marker-color);
  border-bottom-right-radius:3px
}

.ssv-map-marker.lost{--marker-color:#ef745f}
.ssv-map-marker.found{--marker-color:#3e9d69}
.ssv-map-marker.abandoned{--marker-color:#d9a441}
.ssv-map-marker.adoption{--marker-color:#8265d9}
.ssv-map-marker.sighting{--marker-color:#4b92e5}
.ssv-map-marker.sheltered{--marker-color:#c17a45}
.ssv-map-marker.official{--marker-color:#147a72}

@media (prefers-reduced-motion: reduce){
  .ssv-map-halo{
    animation:none;
    transform:translate(-50%,-50%) scale(1.25);
    opacity:.5
  }
}

/* tarjeta flotante del mapa */
.map-report-card{
  position:absolute;
  left:12px;
  right:12px;
  bottom:66px;
  z-index:505;
  display:grid;
  grid-template-columns:96px 1fr;
  gap:10px;
  padding:10px;
  border-radius:18px;
  border:1px solid var(--border);
  background:#fff;
  box-shadow:0 16px 32px rgba(20,55,51,.16)
}
.map-report-card.is-hidden{display:none}
.map-card-close{
  position:absolute;
  right:8px;
  top:8px;
  width:30px;
  height:30px;
  border:1px solid var(--border);
  border-radius:10px;
  background:#fff;
  color:var(--primary);
  font-size:1rem
}
.map-card-image{
  height:104px;
  border-radius:14px;
  overflow:hidden;
  background:#edf2f1
}
.map-card-image img{
  width:100%;
  height:100%;
  object-fit:cover
}
.map-card-image-placeholder{
  width:100%;
  height:100%;
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:center
}
.map-card-image-placeholder.lost{background:var(--coral)}
.map-card-image-placeholder.found{background:var(--found)}
.map-card-image-placeholder.abandoned{background:var(--gold)}
.map-card-image-placeholder.adoption{background:var(--purple)}
.map-card-image-placeholder.sighting{background:var(--blue)}
.map-card-image-placeholder.sheltered{background:var(--sheltered)}
.map-card-image-placeholder.official{background:#147a72}

.map-card-content{
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:4px
}
.map-card-badge{
  width:fit-content;
  font-size:.56rem;
  font-weight:900;
  border-radius:999px;
  padding:4px 7px;
  color:#fff;
  letter-spacing:.03em
}
.map-card-badge.lost{background:var(--coral)}
.map-card-badge.found{background:var(--found)}
.map-card-badge.abandoned{background:var(--gold)}
.map-card-badge.adoption{background:var(--purple)}
.map-card-badge.sighting{background:var(--blue)}
.map-card-badge.sheltered{background:var(--sheltered)}
.map-card-badge.official{background:#147a72}

.map-card-title{
  font-size:.84rem;
  line-height:1.25
}
.map-card-location{
  display:flex;
  align-items:center;
  gap:4px;
  color:var(--muted);
  font-size:.64rem;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis
}
.map-card-content p{
  margin:0;
  color:#42514f;
  font-size:.67rem;
  line-height:1.38;
  display:-webkit-box;
  overflow:hidden;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical
}
.map-card-more{
  width:fit-content;
  margin-top:2px;
  padding:0;
  border:0;
  background:transparent;
  color:var(--primary);
  font-size:.64rem;
  font-weight:850
}

/* modal del reporte */
.map-report-modal.is-hidden{display:none}
.map-report-modal{
  position:absolute;
  inset:0;
  z-index:540
}
.map-modal-backdrop{
  position:absolute;
  inset:0;
  background:rgba(15,26,25,.42)
}
.map-modal-sheet{
  position:absolute;
  left:0;
  right:0;
  bottom:0;
  max-height:92%;
  overflow-y:auto;
  border-radius:26px 26px 0 0;
  background:#fff;
  padding:10px 14px 24px;
  box-shadow:0 -16px 38px rgba(20,55,51,.2)
}
.map-modal-handle{
  width:42px;
  height:5px;
  margin:0 auto 10px;
  border-radius:999px;
  background:#d7e0de
}
.map-modal-close{
  position:absolute;
  right:14px;
  top:14px;
  width:36px;
  height:36px;
  border:1px solid var(--border);
  border-radius:12px;
  background:#fff;
  color:var(--primary);
  font-size:1.1rem
}
.report-modal-image-button{
  display:block;
  width:100%;
  padding:0;
  border:0;
  background:none;
  cursor:pointer
}
.report-modal-image,
.report-modal-image-placeholder{
  width:100%;
  height:220px;
  margin-top:8px;
  border-radius:18px;
  object-fit:cover;
  overflow:hidden
}
.report-modal-image-placeholder{
  display:flex;
  align-items:center;
  justify-content:center;
  color:#fff
}
.report-modal-image-placeholder.lost{background:var(--coral)}
.report-modal-image-placeholder.found{background:var(--found)}
.report-modal-image-placeholder.abandoned{background:var(--gold)}
.report-modal-image-placeholder.adoption{background:var(--purple)}
.report-modal-image-placeholder.sighting{background:var(--blue)}
.report-modal-image-placeholder.sheltered{background:var(--sheltered)}
.report-modal-image-placeholder.official{background:#147a72}

.map-modal-body{padding-top:14px}
.map-modal-body h2{
  margin:8px 0 0;
  font-size:1rem;
  line-height:1.22
}
.map-modal-location{
  margin-top:9px;
  display:flex;
  align-items:flex-start;
  gap:6px;
  color:var(--muted);
  font-size:.67rem
}
.map-modal-privacy{
  margin-top:10px;
  padding:10px 11px;
  border-radius:14px;
  background:var(--primary-soft);
  color:var(--primary);
  display:flex;
  gap:7px;
  font-size:.64rem;
  line-height:1.4
}
.map-modal-summary{
  margin:12px 0 0;
  font-size:.72rem;
  line-height:1.46;
  color:#435350
}
.map-modal-details{
  margin-top:14px
}
.map-modal-detail-row{
  min-height:44px;
  display:grid;
  grid-template-columns:42% 1fr;
  align-items:center;
  gap:10px;
  padding:8px 0;
  border-bottom:1px solid var(--border)
}
.map-modal-detail-row span{
  color:var(--muted);
  font-size:.63rem
}
.map-modal-detail-row strong{
  text-align:right;
  font-size:.68rem;
  line-height:1.36
}
.map-modal-empty{
  color:var(--muted);
  font-size:.66rem
}

/* leaflet cleanup */
.leaflet-control-attribution{
  font-size:.55rem !important;
  background:rgba(255,255,255,.92) !important;
  border-radius:8px 0 0 0
}
.leaflet-pane,.leaflet-top,.leaflet-bottom{z-index:400}
.leaflet-marker-icon,.leaflet-marker-shadow{background:transparent;border:none}

@media(min-width:1024px){
  /*
    .map-report-card y .map-modal-sheet usan left+right para estirarse
    de borde a borde de su contenedor (#real-map-shell). En móvil eso
    da un ancho de tarjeta razonable porque #app tiene tope de 430px;
    en desktop #app ya no tiene tope, así que sin este ajuste la
    tarjeta y el modal se estiran al ancho completo de la ventana y
    se ven enormes/desproporcionados. Este bloque va al final del
    archivo para ganarle en orden de aparición a las reglas base de
    arriba (misma especificidad).
  */
  .map-report-card{
    left:16px;
    right:auto;
    width:380px;
  }

  .map-modal-sheet{
    left:50%;
    right:auto;
    bottom:24px;
    transform:translateX(-50%);
    width:min(90%,460px);
    max-height:calc(100% - 48px);
    border-radius:24px;
  }
}

@media (max-width:430px){
  .map-legend{
    max-width:220px
  }
}


/* V23: regresan los iconos perro/gato dentro del pin V22 */
.legend-animal{
  font-size: 1rem;
  line-height: 1;
}
.legend-animal .ssv-map-animal-emoji{
  font-size: 1rem;
  line-height: 1;
}

.ssv-map-animal-icon{
  width: 26px;
  height: 26px;
}

.ssv-map-animal-emoji{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  line-height: 1;
  transform: translateY(1px);
}

.ssv-map-animal-emoji.paw{
  font-size: 1.05rem;
}
