/* =========================
   RESET
   ========================= */
body {
  margin: 0;
  padding: 0;
}

/* =========================
   SEO
   ========================= */

.seo-only {
  position: absolute;
  left: -9999px;
}

#seo-content {
  position: absolute;
  left: -9999px;
}




/* =========================
   MAPA
   ========================= */
#map {
  height: 100dvh;
  width: 100vw;
}

@supports not (height: 100dvh) {
  #map {
    height: 100vh;
  }
}

/* =========================
   HEADER
   ========================= */
#header {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.75);
  padding: 8px 16px;
  border-radius: 12px;
  font-family: Arial, sans-serif;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(6px);
  z-index: 9999;
}

#icono-header {
  width: 24px;
}

#last-update {
  opacity: 0.8;
  font-size: 12px;
}

/* Botón refresh */
#refresh-btn {
  background: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 8px;
  padding: 4px 8px;
  cursor: pointer;
  font-size: 14px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

#refresh-btn:active {
  transform: scale(0.95);
}

/* =========================
   LEYENDA
   ========================= */
#legend {
  position: absolute;
  bottom: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.92);
  padding: 10px 14px;
  border-radius: 8px;
  font-family: Arial, sans-serif;
  font-size: 13px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  z-index: 9999;
  min-width: 150px;
}

#legend>div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

#legend>div:last-child {
  margin-bottom: 0;
}

#legend>div>div {
  display: flex;
  align-items: center;
  gap: 6px;
}

#count-active,
#count-lost {
  font-weight: bold;
}

/* =========================
   POPUPS LEAFLET
   ========================= */
.popup {
  font-family: Arial, sans-serif;
  font-size: 13px;
  color: #003E6B;
}

.popup-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.popup-title {
  font-size: 15px;
  font-weight: bold;
}

.popup-lost {
  color: #D9534F;
  font-weight: bold;
  margin-top: 8px;
}

.popup-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
}

.popup-source {
  font-size: 12px;
  color: #666;
}

.popup-gmaps {
  cursor: pointer;
}

/* =========================
   MOBILE BASE (SAFE)
   ========================= */
@media (max-width: 767px) {

  /* Texto base un poco más legible */
  body {
    font-size: 15px;
  }

  /* Header más compacto */
  #header {
    top: 6px;
    padding: 6px 12px;
    font-size: 13px;
  }

  #icono-header {
    width: 22px;
  }

  #refresh-btn {
    padding: 6px 8px;
  }

  /* Leyenda un poco más pequeña */
  #legend {
    bottom: 12px;
    right: 12px;
    font-size: 12px;
    padding: 8px 10px;
  }

  /* Popups: más aire */
  .popup {
    font-size: 14px;
    line-height: 1.4;
  }

  .popup-title {
    font-size: 16px;
  }

  .popup-gmaps {
    height: 44px;
    /* tamaño táctil */
  }
}

/* =========================
   LEAFLET CONTROLS (MOBILE)
   ========================= */
@media (max-width: 767px) {
  .leaflet-top.leaflet-right {
    top: 56px;
    /* baja los botones debajo del header */
  }
}

@media (max-width: 767px) {
  .leaflet-control-attribution {
    display: none !important;
  }
}

.popup-btn {
  display: inline-block;
  padding: 10px 12px;
  border-radius: 10px;
  background: #eef3f8;
  color: #003E6B;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
}


.popup-share {
  padding: 10px 12px;
  border-radius: 10px;
  border: none;
  background: #005ea5;
  color: white;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}

/*
@media (max-width: 767px) {
  .popup-footer {
    flex-wrap: wrap;
    gap: 8px;
  }
}
*/

.popup-footer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.popup-actions {
  display: flex;
  gap: 6px;
}

.popup-actions .popup-btn {
  flex: 1;
  text-align: center;
}


.popup-share {
  width: 100%;
}