.varaus-pohja {
    display: flex;
    gap: 10em;
    align-items: stretch;
    padding: 5em;
    margin-top: 0;
    max-width: 1100px !important;
    width: 100% !important;
    box-sizing: border-box;
}

/*KARTAN TYYLIT ALKAA*/

.kartta-pohja {
    flex: 0.8;
    flex-direction: column;
    max-height: clamp(500px, 80vh, 750px);
    width: 100%;
    min-width: 0;
    padding: 1em;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 1em;
    box-shadow: 5px 10px 8px #888888;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kartta-pohja svg {
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;
}

.kartta-otsikko {
    text-align: center;
    margin-bottom: 0.5em;
    font-weight: bold;
    color: #666666;
}

.svg-wrapper {
    max-width: 100%;
}

.kartta-legend {
    margin-top: 0.7em;
    display: flex;
    flex-direction: row; /* pakottaa vierekkäin */
    gap: 25px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.color-box {
    width: 16px;
    height: 16px;
    display: inline-block;
    border: 1px solid #333;
    flex-shrink: 0;
}

.color-box.green {
    background-color: green;
}

.color-box.orange {
    background-color: orange;
}

/*KARTAN TYYLIT PÄÄTTYY*/

/* Override Twenty Twenty-Four's constrained layout */
.wp-block-post-content .varaus-pohja,
.is-layout-constrained .varaus-pohja,
.wp-block-post-content-is-layout-constrained .varaus-pohja {
    max-width: 100% !important;
    width: 100% !important;
}


/*LOMAKKEEN TYYLIT ALKAA*/

.lomake-pohja {
    display: flex;
    flex-direction: column;
    flex: 1.2;
    padding: 1.5em;
    min-width: 0;
    max-height: clamp(500px, 80vh, 750px);
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 1em;
    box-shadow: 5px 10px 8px #888888;
    box-sizing: border-box;
    overflow-y: auto;
    overflow: visible;
}

#varaus-form {
    margin-top: auto;
    margin-bottom: 1em;
}


/* flex-rivi etu- ja sukunimelle */
.nimi-rivi {
    display: flex;
    gap: 1em;
    margin-bottom: 1em;
}

/* jokainen kenttä vie puolet rivistä */
.nimi-kentta {
    flex: 1;
    display: flex;
    flex-direction: column; /* label ylös, input alas */
}

/* lisätyyli inputille */
.nimi-kentta input {
    padding: 0.5em;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.email-rivi {
    display: flex;
    gap: 1em;
    margin-bottom: 1em;
}

.email-kentta {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.email-kentta input {
    padding: 0.5em;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.alin-rivi {
    display: flex;
    gap: 1em;
    align-items: center;
    width: 100%;
}

/* jokainen kenttä vie puolet rivistä */
.poyta-kentta {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.poyta-kentta input {
    padding: 0.5em;
    border: 1px solid #ccc;
    border-radius: 4px;
}

/* maksu nappi */
.maksu-kentta {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.select, .maksu-kentta button {
    height: 2.58em !important;
}

.maksu-kentta label {
    visibility: hidden;
}

#varaus-form .maksu-kentta button {
    height: 3.2em !important;
    min-height: 3.2em !important;
    width: 100% !important;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5em;
    border: none;
    background-color: #000;
    color: white;
    cursor: pointer;
    padding: 0;
}

.keskitetty-teksti {
    text-align: center;
    margin: auto;
}

.dropdown {
    min-width: 15em;
    position: relative;
}

.dropdown * {
    box-sizing: border-box;
}

.select{
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px #000000 solid;
    border-radius: 0.5em;
    padding: 0 1em;
    cursor: pointer;
    transition: background-colour 0.3s;
}

.select-clicked {
    border: 2px #000000 solid;
    box-shadow: 0 0 0.2em #000000;
}

.select:hover {
    background: whitesmoke;
}

.selected {
    color: rgb(144, 144, 144)
}

.nuoli {
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid #232323;
    transition: 0.3s;
}

.nuoli-rotate {
    transform: rotate(180deg);
}

.menu {
    list-style: none;
    padding: 0.2em 0.5em;
    background-color: white;
    outline: 1px #000000 solid;
    box-shadow: 0 0.5em 1em rgba(0, 0, 0, 0.2);
    border-radius: 0.5em;
    color: #000000;
    position:absolute;
    top: 3em;
    left: 50%;
    width: 100%;
    transform: translateX(-50%);
    opacity: 0;
    display: none;
    transition: 0.2s;
    z-index: 1;
    max-height: 200px;
    overflow-y: auto;
}

.menu li {
    padding: 0.7em 0.5em;
    margin: 0.3em 0;
    border-radius: 0.5em;
    cursor: pointer;

}

.menu li:hover {
    background: whitesmoke;
}

.active {
    background: white;
}

.menu-open {
    display: block;
    opacity: 1;
}

/*LOMAKKEEN TYYLIT PÄÄTTYY*/


/*Modalin tyylit alkaa */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    border-radius: 1em;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hidden {
    display: none !important;
}

#ilmoitus-modal .modal-content {
    text-align: center;
    background-color: white;
    padding: 3em 2em;
    max-width: 600px;
    border-radius: 1em;
}

.modal-ikoni {
    font-size: 3em;
    color: white;
    background-color: #4CAF50;
    border-radius: 50%;
    width: 1.8em;
    height: 1.8em;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.5em auto;
}

#ilmoitus-modal h3 {
    font-size: 1.5em;
    margin-bottom: 0.5em;
}

#ilmoitus-modal p {
    color: #555;
    margin-bottom: 2em;
}

#close-ilmoitus-modal {
    padding: 0.8em 2em;
    border-radius: 8px;
    border: none;
    background: #000;
    color: white;
    cursor: pointer;
    font-size: 1em;
}


/*MOBIILINÄKYMÄ*/
@media (max-width: 1600px) {

    .varaus-pohja {
        gap: 5em;
        padding: 5em;
    }
}
/* @media (max-width: 1200px) {

    .varaus-pohja {
        gap: 5em;
        padding: 5em;
    }

    .lomake-pohja {
        flex: 1;
    }

    .kartta-pohja {
        flex: 1;
    }

    .nimi-kentta {
        margin-bottom: 1em;
    }

    .nimi-rivi, .alin-rivi {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        margin-bottom: 0;
    }
} */

@media (max-width: 1200px) {
    .varaus-pohja {
        flex-direction: column;
        height: auto;
        padding: 1.5em;
    }

    .lomake-pohja {
        margin-right: 0;
        max-height: none;
    }

    .kartta-pohja {
        max-height: none;
    }

    .keskitetty-teksti {
        margin-bottom: 2em;
    }
}

@media (max-width: 650px) {
    .varaus-pohja {
        flex-direction: column;
        height: auto;
        padding: 0em;
    }

    .lomake-pohja {
        margin-right: 0;
        max-height: none;
    }

    .kartta-pohja {
        max-height: none;
    }

    .nimi-rivi, .alin-rivi {
        flex-direction: column;
    }

    .poyta-kentta {
        display: flex;
        width: 100%;
    }

    .maksu-kentta {
        display: flex;
        width: 100%;
    }

    .dropdown {
        min-width: unset;
        width: 100%;
    }

    #varaus-form .maksu-kentta button {
        width: 100% !important;
    }
    .maksu-kentta label {
        visibility: hidden;
    }
}