@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&display=swap');

body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: "DM Sans", sans-serif;
    font-optical-sizing: auto;
}

#container {
    display: flex;
    height: 100%;
    max-width: 1400px;
    margin: 0 auto 50px;
}

#left-panel {
    width: 350px;
    box-sizing: border-box;
    background-color: #f9f9f9;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.search-form {
    padding: 20px;
    background-color: #222222;
    color: #ffffff;
    width: 100%;
    box-sizing: border-box;
    flex-shrink: 0;
}

h1, h2, h3 {
    font-family: "DM Sans", sans-serif;
    font-optical-sizing: auto;
    margin-top: 0px;
}

#left-panel h1 {
    margin-top: 0;
}

#left-panel label {
    color: #999;
}

#left-panel input,
#left-panel select {
    font-family: "DM Sans", sans-serif;
    font-optical-sizing: auto;
    width: 100%;
    padding: 12px 15px;
    box-sizing: border-box;
    background-color: transparent;
    color: #FFF;
    border-radius: 5px;
    margin-top: 8px;
    margin-bottom: 25px;
    border: 1px solid #666;
    font-size: 15px;
}

#left-panel select option{
    color: #151515;
}

button#search-btn {
    width: 100%;
    background: #CC0000;
    color: #FFF;
    border: 0px;
    font-family: 'DM Sans', sans-serif;
    font-optical-sizing: auto;
    font-size: 18px;
    padding: 15px;
    border-radius: 50px;
    cursor: pointer;
}

#store-result {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.no-result {
    padding: 20px;
}

#location-count {
    margin: 20px 20px 0px;
    padding: 5px 10px 3px;
    background-color: #CC0000;
    color: #FFF;
    border-radius: 5px;
    font-size: 13px;
    flex-shrink: 0;
    display: none;
}

#store-list {
    flex: 1;
    overflow-y: auto;
}

.store-item {
    padding: 20px;
    border-bottom: 1px solid #DDD;
}

.store-name {
    font-family: 'DM Sans', sans-serif;
    font-optical-sizing: auto;
    font-size: 18px;
    margin-bottom: 5px;
    font-weight: 600;
}

.store-address {
    color: #777;
    font-size: 14px;
    line-height: 120%;
}

.store-item a {
    color: #cc0000;
    font-size: 13px;
}

#map {
    flex-grow: 1;
    height: 100%;
    height: 100%;
    background-color: #f9f9f9;
    overflow-y: auto;
}

/* Assicura che gli iframe di Google Maps si adattino al contenitore */
#map iframe {
    width: 100% !important;
    height: 100% !important;
}

.custom-marker {
    /*
    background-color: #ffffff;
    border: 1px solid #ccc;
    padding: 5px;
    border-radius: 5px;
    font-size: 12px;
    color: #333;
    */
    text-align: center;
    max-width: 150px;
}

.custom-marker .pin-info {
    background-color: #FFFFFF;
    padding: 5px 10px;
    border-radius: 4px;
    border: 1px solid #ccc;
}

/* Stili per quando la mappa non è disponibile */
.no-map #container {
    display: flex;
}

.no-map #left-panel {
    width: 350px;
    flex-shrink: 0;
}

.no-map #map {
    flex-grow: 1;
    height: auto;
    min-height: 200px;
}

@media screen and (max-width: 480px) {
    body, html {
        margin: 0;
        padding: 0;
        width: 100%;
        overflow-x: hidden;
    }

    div#container {
        display: flex;
        flex-direction: column;
        overflow: hidden;
        height: 100vh;
        width: 100%;
        margin: 0;
        padding: 0;
    }

    div#map {
        position: relative;
        display: block;
        order: 1;
        height: min(50vh, 450px);
        max-height: 450px;
        flex-shrink: 0;
        width: 100%;
        margin: 0;
        padding: 0;
    }

    /* Forza l'altezza degli iframe generati da Google Maps su mobile */
    div#map iframe {
        height: 100% !important;
        max-height: 450px !important;
    }

    div#left-panel {
        width: 100%;
        order: 2;
        display: flex;
        flex-direction: column;
        flex: 1;
        overflow: hidden;
    }

    .search-form {
        width: 100%;
        flex-shrink: 0;
    }

    div#store-result {
        flex: 1;
        overflow: hidden;
    }

    div#store-list {
        height: 100%;
        overflow-y: auto;
    }
}