/* MODAL */

@media only screen and (min-width: 40em) {

    .common-modal-overlay {
        display: flex;
        align-items: center;
        justify-content: center;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 1500;
        background-color: rgba(#000, 0.6);
        opacity: 0;
        visibility: hidden;
        backface-visibility: hidden;
        transition: opacity 0.5s cubic-bezier(.55,0,.1,1), visibility 0.2s cubic-bezier(.55,0,.1,1);
        overscroll-behavior: contain;
    }

    .common-modal-overlay.active {
            opacity: 1;
            visibility: visible;
    }
    
}

.common-modal {
    font: 12px "NanumSquareNeoLight" !important;
    display: block;
    align-items: center;
    justify-content: center;
    position: relative;
    margin: 0 auto;
    background-color: rgb(255, 255, 255);
    width: 90%;
    height: 90%;
    /* max-width: 75rem;
    min-height: 20rem; */
    padding: 1rem;
    border-radius: 20px;
    opacity: 0;
    overflow-y: auto;
    visibility: hidden;
    backface-visibility: hidden;
    box-shadow: 0 2px 10px rgba(#000, 0.1);
    transition: all 0.2s cubic-bezier(.55,0,.1,1);
    max-width: 772px;
    /* max-height: 1024px; */
}

.common-modal.no-padding {
    padding: 0 !important;
}

.common-modal .common-modal-header {
    width: 100%;
    height: 42px;
    display: flex;
}

.common-modal .close-common-modal {
    position: absolute;
    cursor: pointer;
    top: 14px;
    right: 10px;
    opacity: 0;    
    backface-visibility: hidden;
    /* transition: opacity 0.5s cubic-bezier(.55,0,.1,1), transform 0.5s cubic-bezier(.55,0,.1,1);
    transition-delay: (0.5s * .5); */
}

.common-modal .common-modal-title {
    position: absolute;
    top: 24px;
    left: 18px;
    font-size: 20px;
    font-weight: bold;
}

.common-modal .close-common-modal svg {
    width: 3.35em;
    height: 3.35em;
}

.common-modal .common-modal-content {
    opacity: 0;
    backface-visibility: hidden;
    transition: opacity 0.5s cubic-bezier(.55,0,.1,1);
    transition-delay: (0.5s * .5);
    overscroll-behavior: contain;
}

.common-modal.active {
    visibility: visible;
    opacity: 1;
    transform: scale(1);
}

.common-modal.active .common-modal-content {
    opacity: 1;
    /* width: -webkit-fill-available; */
    /* height: -webkit-fill-available; */
    display: inline-block;
    margin-top: 0.6em;

    width: -moz-available;
    width: -webkit-fill-available;
    width: fill-available;

    height: calc(100% - 3.3rem);
    /* height: -moz-available;
    height: -webkit-fill-available;
    height: fill-available;  */
}

.common-modal.active .close-common-modal  {
    /* transform: translateY(10px); */
    opacity: 1;
}

.common-modal-iframe {
    width: calc(100% - 2px);
    height: 100%;
    display: block;
    border: 1px solid #dfdfdf;
    overscroll-behavior: contain;
    border-radius: 15px;
}

.common-modal-iframe.no-border {
    border: 0;
}

.no-title-height {
    margin-top: 0 !important;
    height: calc(100% - 3px) !important;
}

.hidden {
    opacity: 0 !important;
    display: none !important;
}

.margin-zero {
    margin: 0 !important;
}

@media only screen and (max-width: 39.9375em) {   
    .common-modal {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 1500;
        -webkit-overflow-scrolling: touch;
        border-radius: 0;
        transform: scale(1.1);
        padding: 0 !important;
    }

    .common-modal.active .common-modal-content {
        margin-top: 1.6em;
        height: calc(100% - 3.9rem);
    }

    .common-modal .common-modal-title {
        /* top: 19px */
    }

    .common-modal .close-common-modal {
        /* top: -5px; */
    }

    .search-modal {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 1500;
        -webkit-overflow-scrolling: touch;
        border-radius: 0;
        transform: scale(1.1);
        padding: 0 !important;
    }

    .search-modal.active .search-modal-content {
        margin-top: 1.6em;
        height: calc(100% - 3.9rem);
    }

}

.modal-background {
    z-index: 1499;
    visibility: hidden;
    position: fixed;
    top:0; left: 0; bottom: 0; right: 0;
    background: rgba(0, 0, 0, 0.5);
    transition: opacity 0.5s cubic-bezier(.55,0,.1,1), transform 0.5s cubic-bezier(.55,0,.1,1);
}
