.mgPopup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0,0,0,0.3);
    z-index: 1;
    overflow-x: hidden;
    overflow-y: scroll;

    /* NEW */
    text-align: center;
}

.mgPopup > div {
    position: relative;
    background-color: #FFF;
    box-sizing: border-box;

    /* NEW */
    display: inline-block;
    text-align: initial;
}

.mgPopup > div.fullscreen {
    max-width: 100%;
    width: 100%;
    height: 100%;
    margin: 0;
}

/* close */
.mgClose {
    width: 40px;
    height: 40px;
    position: absolute;
    top: 20px;
    right: 20px;
    cursor: pointer;
}

.mgClose hr {
    border: none;
    width: 24px;
    height: 1px;
    background-color: #8e8e8e;
    position: absolute;
    top: 11px;
    left: 8px;
}

.mgClose hr:first-child {
    transform: rotate(45deg);
}

.mgClose hr:last-child {
    transform: rotate(-45deg);
}

.mgClose:hover hr {
    background-color: #000;
}

/* tablet & desktop */
@media all and (min-width: 801px) {
    .mgPopup > div {
        margin: 40px;
        padding: 40px;
    }
}