* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body, html {
    height: 100%;
    font-family: Arial, sans-serif;
}

#mapa {
    height: 100%;
    width: 100%;
}

/* Selector de idioma */
#language-selector {
    position: absolute;
    top: 29px;
    right: 60px;
    z-index: 1000;
    background: white;
    padding: 9px 15px;
    border-radius: 2px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    display: flex;
    gap: 8px;
    align-items: center;
}

#language-selector span {
    color: #ccc;
    font-weight: normal;
}

.lang-btn {
    background: none;
    border: none;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    padding: 0px 0px;
    border-radius: 3px;
    transition: all 0.3s;
    color: #666;
}

.lang-btn:hover {
    background: #f0f0f0;
}

.lang-btn.active {
    background: #1a73e8;
    color: white;
}

#legend {
    position: absolute;
    top: 75px;          /* 29px (selector) + 38px (altura selector) + 8px separación */
    right: 60px;        /* misma posición horizontal que language-selector */
    font-family: Arial, sans-serif;
    background: #fff;
    padding: 10px;
    border-radius: 2px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    width: 130px;
    min-width: 130px;
    max-width: 130px;
    z-index: 1000;
}

#legend h3 {
    margin: 0 0 10px 0;
    font-size: 16px;
}

#legend img {
    vertical-align: middle;
    margin-right: 5px;
}

#legend a {
    text-decoration: none;
    color: #000 !important;      /* negro en lugar de azul */
    font-size: 12px !important;  /* más pequeño */
    display: block;
    padding: 4px;                /* menos padding */
    margin: 1px 0;               /* menos margen */
    border-radius: 3px;
    transition: background 0.2s;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;            /* altura de línea más compacta */
}

#legend a:hover {
    background: #f0f0f0;
}


.gm-style-iw {
    max-width: 300px !important;
}