/* Generic CSS for slide-in popup*/

.mc-modal-bg {
    /* don't show modal bg for desktop */
    display: none !important;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 9995;
    height: 100%;
    width: 100%;
    background: #000000;
    background-color: #000000;
    animation: 1s opacityFade cubic-bezier(0.35, 0.57, 0.4, 0.89);
    opacity: 0.65;
}

@keyframes opacityFade {
    from { opacity: 0; }
    to { opacity: 0.65; }
}

.mc-layout__modalContent {
    height: 100%;
    box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.2);
    display: block;
    background: #ffffff;
    border-radius: 6px;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    -webkit-overflow-scrolling: touch; /* Fix iOS scrolling bug */
}

.mc-layout__modalContent iframe {
    display: block;
}

.mc-closeModal {
    width: 30px;
    height: 30px;
    background-color: #ffffff;
    border-radius: 100%;
    box-shadow: 0 2px 2px 0 rgba(0,0,0,0.2);
    cursor: pointer;
    position: absolute;
    right: -10px;
    top: -10px;
    z-index: 2;
    border: none;
}

.mc-closeModal::before,
.mc-closeModal::after {
    background-color: #414141;
    content: '';
    position: absolute;
    left: 14px;
    height: 14px;
    top: 8px;
    width: 2px;
}

.mc-closeModal::before {
    transform: rotate(45deg);
}

.mc-closeModal::after {
    transform: rotate(-45deg);
}

/* Box sizing for all elements inside mc-modal */
.mc-modal * {
    box-sizing: border-box;
}

/* Modal basic styles */
.mc-modal {
    display: none;

    /* Set higher than avg top nav index */
    z-index: 9999;
    position: fixed;
    background: transparent;

    /* Stuff for slide-in format */
    bottom: 20px;
    right: 20px;
    width: 490px;
    animation: 500ms slideIn cubic-bezier(0.35, 0.57, 0.4, 0.89);
}

@keyframes slideIn {
    from { right: -650px; }
    to { right: 20px; }
}

.mc-modal--close {
    animation: 500ms slideOut cubic-bezier(0.35, 0.57, 0.4, 0.89);
}

@keyframes slideOut {
    from { right: 20px; }
    to { right: -650px; }
}

/* Banner styles for mobile users */
.mc-banner {
    visibility: hidden;

    /* Set lower than mc-modal */
    z-index: 9998;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
    background-color: #ffffff;
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;

    /* Fix an issue in the editor preview */
    line-height: 0;
}

/* Media Queries */

/* Hide modal and show optimized banner if mobile */
@media only screen and (max-width: 768px) {
    .mc-modal,
    .mc-modal-bg {
        visibility: hidden;
    }

    .mc-modal {
        display: none;

        /* Move the modal to the back */
        z-index: 9998;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        width: 100% !important;
        height: 100%;
        background: transparent;
    }

    .mc-banner {
        visibility: visible;

        /* Move the banner to the front */
        z-index: 9999;
    }

    .mc-modal-bg {
        /* show modal bg for mobile */
        display: block !important;
    }

    .mc-layout__modalContent {
        border-radius: 0;
        max-height: 100% !important;
    }

    .mc-closeModal {
        background-color: rgba(255, 255, 255, 0.8);
        box-shadow: none;
        right: 10px;
        top: 10px;
    }

}

/* Media query when sliding in on desktop */
@media only screen and (min-width: 768px) {
    .mc-layout__modalContent {
        /* enable scrollbar beyond 480px height */
        max-height: 480px !important;
    }
}
