/* ============================
   RESET / ESTRUCTURA PRINCIPAL
   ============================ */

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

body {
  display: flex;
  flex-direction: column;
  background: #ffffff;
  color: #000000;
  /* Igualamos tipografía al login */
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  overflow: hidden; /* Evita scroll vertical por desajustes */
}

/* ============================
   HEADER
   ============================ */

/* Soporta <header> y <div id="cabecera"> */
header,
#cabecera {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #ffffff;
  padding: 8px 14px;
  flex: 0 0 auto;
  box-sizing: border-box;
  gap: 12px;
  position: relative;  /* NECESARIO para z-index */
  z-index: 999;
  /* Sombra y borde sutil, estilo “tarjeta” como el login */
  box-shadow:
    0 6px 12px rgba(0,0,0,0.14),
    0 12px 32px rgba(0,0,0,0.12);
  border-bottom: 1px solid #e5e7eb;
}

.logo, .logo2,
#logo1, #logo2 {
  height: 70px;
  max-width: 320px;
  object-fit: contain;
}

.title,
#ayto-name {
  font-size: 24px; 
  margin: 0;
  font-weight: 600;
}

/* Enlace al ayto dentro del header */
header #ayto-link {
  text-decoration: none;
  color: inherit;
}

/* Barra azul-verde en la parte superior del header, igual que en el login */
header::before,
#cabecera::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #1978cf, #4fb348);
}

/* ============================
   MAPA (OCUPA TODO EL ESPACIO)
   ============================ */

#mapa {
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
}

/* ============================
   FOOTER
   ============================ */

.page-footer {
  font-size: 11px;
  background-color: #ffffff;
  color: #6b7280; /* gris algo más suave */
  text-align: center;
  padding: 2px 0;
  flex: 0 0 auto;
  border-top: 1px solid #e5e7eb; /* separación visual del mapa */
}

/* Ajuste específico para el nombre del ayto en el footer */
footer #ayto-name,
.page-footer #ayto-name {
  font-size: inherit;
  font-weight: inherit;
}

/* ============================
   TIPOGRAFÍA Y ENLACES
   ============================ */

a {
  color: #1978cf;
}
a:hover {
  color: #8c8c8c;
}

h2, h3, h4 {
  white-space: nowrap;
  margin: 1em 0 0 0;
}

ul {
  font-size: 0.85em;
  margin: 0;
  padding: 0;
}
li {
  margin: 0 0 2px 18px;
}

/* ============================
   LEAFLET: AJUSTE GENERAL
   ============================ */

.leaflet-bar a { 
    width: 30px; 
    height: 30px; 
    line-height: 30px; 
    
}

/* ============================
   CONTROLES DE BÚSQUEDA
   ============================ */

/* contenedores a los que les añades search-es / search-via / search-hoja */
.search-es,
.search-via,
.search-hoja {
  font-size: 12px;
}

.search-es input,
.search-via input,
.search-hoja input {
  width: 220px;
  max-width: 260px;
  font-size: 12px;
  padding: 2px 4px;
  box-sizing: border-box;
}

/* Un poco de separación respecto a otros controles */
.leaflet-top.leaflet-right .search-es,
.leaflet-top.leaflet-right .search-via,
.leaflet-top.leaflet-right .search-hoja {
  margin-top: 5px;
  margin-right: 5px;
}

/* Evitar que los controles desaparezcan en pantallas pequeñas */
.leaflet-top.leaflet-left {
  max-height: 80vh;    /* no ocupar toda la pantalla */
  overflow-y: auto;    /* scroll vertical si falta espacio */
  padding-right: 4px;  /* evita cortar la sombra */
}

/* ============================
   LEYENDA GEOSERVER (COLAPSABLE)
   ============================ */
.leyenda-geoserver {
  background: #ffffff;
  border-radius: 4px;
  /* La sombra suave que ya tenías */
  box-shadow: 0 1px 5px rgba(0,0,0,0.4); 
  border: 1px solid #e5e7eb;
  overflow: hidden; /* Mantiene las esquinas redondeadas limpias */
}

/* El botón hereda el ancho/alto de .leaflet-bar a (30x30px) */
.leyenda-btn {
  text-align: center;
  font-size: 16px;
  color: #333;
  cursor: pointer;
  background-color: #fff;
  display: block;
}

/* El contenido que se despliega */
.leyenda-content {
  padding: 12px;
  max-height: 300px;
  overflow-y: auto;
  border-top: 1px solid #e5e7eb; /* Una línea sutil para separar el botón de las imágenes */
  background: #fff;
}