body {
    font-family: sans-serif;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    /* evita scroll horizontal */
}

button#openModal {
    margin: 2rem;
    padding: 0.5rem 1rem;
    font-size: 0.95rem;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: transparent !important;
    /* fuerza transparencia */
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: #ffffff;
    max-width: 700px;
    /* ancho máximo actualizado */
    width: 90%;
    padding: 1.5rem;
    border-radius: 12px;
    border: 2px solid #a3d4f7;
    position: relative;
    overflow-y: auto;
    max-height: 90vh;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-size: 0.9rem;
}

.close-button {
    position: absolute;
    top: 0.5rem;
    right: 1rem;
    font-size: 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
}

.grid-barrios {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.5rem;
    margin-top: 1rem;
}

.grid-barrios a {
    display: block;
    padding: 0.4rem;
    background-color: #e0f4ff;
    border: 1px solid #a3d4f7;
    border-radius: 8px;
    text-align: center;
    text-decoration: none;
    font-weight: bold;
    color: #333;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    word-break: break-word;
}

.grid-barrios a:hover {
    text-decoration: underline;
    background-color: #c2e6fb;
    color: #0077cc;
}

@media (max-width: 600px) {
    .grid-barrios {
        grid-template-columns: repeat(3, 1fr);
    }
}

.navbar {
    background-color: #f5f5f5;
    padding: 0.5rem 1rem;
}

.nav-list {
    list-style: none;
    display: flex;
    gap: 1rem;
    margin: 0;
    padding: 0;
    align-items: center;
}

.nav-list li {
    display: inline;
}

.nav-list a,
.nav-button {
    text-decoration: none;
    font-size: 0.95rem;
    color: #333;
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 500;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.nav-button:hover,
.nav-list a:hover {
    background-color: #e0f4ff;
}

.modal-overlay {
    background: transparent;
}