
/* ==================================
  CUSTOM MODAL
================================== */

.cmodal, .cmodal_overlay, .cmodal_main {
    top: 0;
    left: 0;
}
.cmodal, .cmodal_overlay {
    width: 100vw;
    height: 100vh;
}
.cmodal {
    position: fixed;
    display: none;
    overflow: hidden;
    z-index: 140;
    transition: all 0.3s ease-out;
}
.cmodal_overlay {
    position: absolute;
    display: flex;
    background-color: rgba(0,0,0,0.6);
    cursor: pointer;
}
/*.cmodal_main, .cmodal_scroll {
    pointer-events: none;
}*/
.cmodal_main {
    position: relative;
    width: 460px;
    max-width: 100%;
    margin: 0 auto;
    transition: all 0.4s ease-out;
}
.cmodal_scroll {
    display: block;
    height: fit-content;
    max-height: calc(100vh - 1rem);
    overflow-y: auto;
    filter: drop-shadow(0 4px 5px rgba(0,0,0,0.3));
}
.cmodal_content {
    position: relative;
    width: 100%;
    height: fit-content;
    background-color: white;

    &, .cm_footer {
        border-bottom-left-radius: 1.4rem;
        border-bottom-right-radius: 1.4rem;
    }

    .cm_header {
        padding: 1.5rem 0 1rem;

        h4 {
            display: block;
            font-family: var(--font-display);
            font-size: 1.4rem;
            line-height: 1.2;
            color: var(--color-green-80);
            font-weight: 600;
            letter-spacing: -1px;
            text-transform: uppercase;
            text-align: center;
        }
    }
    .cm_content {
        position: relative;
        display: block;
        height: fit-content;
        max-height: 555px;
        overflow-y: auto;
        padding: 0 2rem;
        text-align: center;
    }
    .cm_footer {
        position: sticky;
        bottom: 0;
        left: 0;
        display: flex;
        flex-direction: row;
        justify-content: center;
        gap: 0.5rem;
        padding: 2rem 0 1.5rem;
        height: fit-content;
        background-color: white;
    }
}
.cmodal_button {
    display: block;
    padding: 0.8rem 1.2rem;
    border: solid 1px var(--color-green-15);
    width: fit-content;
    border-radius: 3rem;
    background-color: white;
    cursor: pointer;
    font-family: var(--font-display);
    font-size: 1rem;
    line-height: 1;
    color: white;
    text-transform: uppercase;
    text-align: center;
    font-weight: 600;

    &.cmbtn_primary {
        background-color: var(--color-green-80);
        border-color: var(--color-green-80);
        color: white;
    }
    &.cmbtn_secondary {
        border-color: var(--color-green-60);
        color: var(--color-green-80);
    }
    &:active {
        background-color: var(--color-green-30);
        border-color: var(--color-green-30);
        color: black;
    }
}
@media (max-height: 680px) {
    .cmodal_main {
        width: 100vw !important;
        max-width: 560px !important;
        margin: 0 auto;
        transition: all 0.5s ease-out;
    }
    .cmodal_scroll {
        height: fit-content !important;
        max-height: calc(100vh - 25px) !important;
        overflow-y: inherit;
    }
    .cmodal_content {
        &, .cm_footer {
            border-bottom-left-radius: 0;
            border-bottom-right-radius: 0;
        }
        .cm_content {
            max-height: calc(100vh - 25px) !important;
        }
    }
}
@media (max-width: 460px) {
    .cmodal_content {
        .cm_footer {
            flex-direction: column;
            align-items: center;
        }
    }
    .cmodal_button {
        width: 100%;
        max-width: 180px;
    }
}

body.cmodal_isopen {
    overflow: hidden;
}

.modal_custom_message {
    margin-bottom: 0;

    p {
        margin-bottom: 0.6rem;
        padding: 0 3%;
        font-family: var(--font-sans);
        font-size: 1rem;
        line-height: 1.4;

        &:last-child {
            margin-bottom: 0;
        }
    }
}

/* ==================================
  DIALOG FOR HORIZONTAL POSITION
================================== */

.msg_vertical {
    position: fixed;
    display: none;
    justify-content: center;
    align-items: center;
    width: 100vw;
    height: 100vh;
    background-color: rgba(255,255,255,0.8);
    backdrop-filter: blur(0.8rem);
    z-index: 150;

    & > div {
        width: fit-content;
        padding: 1.5rem 1.7rem;
        background-color: white;
        filter: drop-shadow(0 4px 5px rgba(0,0,0,0.2));
        border-radius: 1rem;
    }
    p {
        font-family: var(--font-display);
        font-size: 1.2rem;
        line-height: 1.3;
        text-transform: uppercase;
        text-align: center;
        font-weight: 600;
    }
}
@media (max-height: 480px) {
    .msg_vertical {
        display: flex;
    }
}
