#container {
    display: flex;
}

#results {
    width: 320px;
    height: 800px;
    overflow-y: auto;
    border-right: 1px solid #ccc;
    padding: 10px;
    background-color: #f9f9f9;
    box-sizing: border-box;
}

#map {
    flex-grow: 1;
    min-width: 0; /* sin esto el mapa no puede encogerse dentro del flex */
    height: 800px;
}

.popup-content {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.popup-content h3 {
    margin: 0 0 10px;
    font-size: 16px;
    color: #333;
}

.popup-content p {
    margin: 5px 0;
    font-size: 14px;
    color: #555;
}

#search-container {
    margin: 20px 0;
}

#search-input {
    width: 300px;
    max-width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box;
}

#search-button, #reset-button{
    padding: 10px 20px;
    background-color: #0078d4;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

#search-button:hover {
    background-color: #005a9e;
}

#results .elementor-widget-icon-box  {
    margin-bottom: 10px;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    background-color: #f9f9f9;
    cursor: pointer;
}

#results .elementor-widget-icon-box:hover {
    background-color: #e9e9e9;
}

no-results {
    color: red;
    font-weight: bold;
    margin: 20px 0;
    text-align: center;
}

.error-message {
    color: #cc0000;
    font-weight: bold;
    margin: 20px 0;
    text-align: center;
}

/* --- Móvil / tablet -------------------------------------------------------
   El layout original era fijo (sidebar de 320 px + mapa de 800 px de alto).
   En un viewport estrecho el mapa quedaba estrujado y el encaje por bounds se
   pasaba de zoom, lo que hacía parecer el pin todavía más grande. */
@media (max-width: 768px) {
    #container {
        flex-direction: column;
    }

    #map {
        width: 100%;
        height: 60vh;
        min-height: 320px;
        order: 1;
    }

    #results {
        width: 100%;
        height: auto;
        max-height: 50vh;
        border-right: none;
        border-top: 1px solid #ccc;
        order: 2;
    }

    #search-container {
        margin: 12px 0;
    }

    #search-input {
        width: 100%;
        display: block;
        margin-bottom: 8px;
    }

    #search-button,
    #reset-button {
        width: 100%;
        display: block;
        margin-bottom: 8px;
    }

    .popup-content h3 {
        font-size: 15px;
    }

    .popup-content p {
        font-size: 13px;
    }
}
