* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background: #eef3f8;
    color: #17324d;
}

.encabezado {
    position: relative;
    z-index: 1000;
    padding: 18px 20px;
    text-align: center;
    background: #ffffff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
}

.encabezado h1 {
    margin: 0;
    font-size: 32px;
    color: #123b63;
}

.encabezado p {
    margin: 7px 0 0;
    color: #64748b;
}

.buscador {
    position: absolute;
    z-index: 1100;
    top: 125px;
    left: 50%;
    width: min(650px, calc(100% - 30px));
    transform: translateX(-50%);
}

.buscador input {
    width: 100%;
    padding: 15px 18px;
    border: 1px solid #d9e2ec;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 7px 22px rgba(0, 0, 0, 0.22);
    font-size: 16px;
    outline: none;
}

#mapa {
    width: 100%;
    height: calc(100vh - 105px);
    min-height: 600px;
}

/* =========================================================
   BUSCADOR UNIVERSAL V103
   ========================================================= */
#resultados-buscador {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 2000;
    max-height: min(420px, 55vh);
    overflow-y: auto;
    background: #ffffff;
    border: 1px solid #d9e2ec;
    border-radius: 14px;
    box-shadow: 0 16px 35px rgba(15, 23, 42, .22);
    padding: 6px;
}

#resultados-buscador[hidden] {
    display: none !important;
}

.resultado-buscador {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    padding: 10px 12px;
    text-align: left;
    cursor: pointer;
}

.resultado-buscador:hover,
.resultado-buscador:focus {
    background: #eef6ff;
    outline: none;
}

.resultado-buscador strong {
    color: #123b63;
    font-size: 15px;
}

.resultado-buscador span {
    color: #64748b;
    font-size: 12px;
}

.resultado-vacio {
    padding: 13px;
    color: #64748b;
    text-align: center;
}

/* v5.2.63 — únicamente cuando el mapa se abre como aplicación instalada. */
@media(display-mode:standalone) and (max-width:700px){
    html,body{width:100%!important;max-width:100%!important;height:100dvh!important;overflow:hidden!important}
    .encabezado{width:100%!important;max-width:100%!important;padding:14px 8px!important}
    .encabezado h1{font-size:26px!important;line-height:1.12!important}
    .encabezado p{font-size:13px!important;margin-top:4px!important}
    .buscador{left:10px!important;right:10px!important;top:105px!important;width:auto!important;max-width:none!important;transform:none!important}
    .buscador input{width:100%!important;min-width:0!important;padding:13px 14px!important}
    #mapa{width:100%!important;max-width:100%!important;height:calc(100dvh - 85px)!important;min-height:0!important;overflow:hidden!important}
    #resultados-buscador{left:0!important;right:0!important;width:100%!important;max-width:100%!important;max-height:45dvh!important}
    .leaflet-container{max-width:100vw!important}
    .leaflet-control-zoom{display:block!important;visibility:visible!important;margin-top:76px!important}
    .leaflet-popup{max-width:calc(100vw - 20px)!important}
    .leaflet-popup-content-wrapper{max-width:calc(100vw - 20px)!important}
    .leaflet-popup-content{width:auto!important;min-width:0!important;max-width:calc(100vw - 48px)!important;margin:12px 14px!important}
}
@media(max-width:700px){
    html.egme-map-app,html.egme-map-app body{width:100%!important;max-width:100%!important;height:100dvh!important;overflow:hidden!important}
    html.egme-map-app .encabezado{width:100%!important;max-width:100%!important;padding:14px 8px!important}
    html.egme-map-app .encabezado h1{font-size:26px!important;line-height:1.12!important}
    html.egme-map-app .encabezado p{font-size:13px!important;margin-top:4px!important}
    html.egme-map-app .buscador{left:10px!important;right:10px!important;top:105px!important;width:auto!important;max-width:none!important;transform:none!important}
    html.egme-map-app .buscador input{width:100%!important;min-width:0!important;padding:13px 14px!important}
    html.egme-map-app #mapa{width:100%!important;max-width:100%!important;height:calc(100dvh - 85px)!important;min-height:0!important;overflow:hidden!important}
    html.egme-map-app #resultados-buscador{left:0!important;right:0!important;width:100%!important;max-width:100%!important;max-height:45dvh!important}
    html.egme-map-app .leaflet-container{max-width:100vw!important}
    html.egme-map-app .leaflet-control-zoom{display:block!important;visibility:visible!important;margin-top:76px!important}
    html.egme-map-app .leaflet-popup,html.egme-map-app .leaflet-popup-content-wrapper{max-width:calc(100vw - 20px)!important}
    html.egme-map-app .leaflet-popup-content{width:auto!important;min-width:0!important;max-width:calc(100vw - 48px)!important;margin:12px 14px!important}
}
