.lgm-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 0;
    box-sizing: border-box;
    opacity: 0;
    transition: opacity 0.3s ease-out;
}

.lgm-popup-overlay.lgm-visible {
    opacity: 1;
}

/* Positioning: the overlay covers the full viewport as before, and the
   position setting only changes where the box sits within it. */
.lgm-popup-overlay.lgm-pos-top-left      { justify-content: flex-start; align-items: flex-start; }
.lgm-popup-overlay.lgm-pos-top-center    { justify-content: center;     align-items: flex-start; }
.lgm-popup-overlay.lgm-pos-top-right     { justify-content: flex-end;   align-items: flex-start; }
.lgm-popup-overlay.lgm-pos-center-left   { justify-content: flex-start; align-items: center; }
.lgm-popup-overlay.lgm-pos-center        { justify-content: center;     align-items: center; }
.lgm-popup-overlay.lgm-pos-center-right  { justify-content: flex-end;   align-items: center; }
.lgm-popup-overlay.lgm-pos-bottom-left   { justify-content: flex-start; align-items: flex-end; }
.lgm-popup-overlay.lgm-pos-bottom-center { justify-content: center;     align-items: flex-end; }
.lgm-popup-overlay.lgm-pos-bottom-right  { justify-content: flex-end;   align-items: flex-end; }

.lgm-popup {
    background: #fff;
    width: auto;
    max-width: 800px;
    border-radius: 8px;
    position: relative;
}

.lgm-popup-image {
    width: 100%;
    height: auto;
    display: block;
    cursor: pointer;
}

/* Open animations. Fade In animates opacity from 0 to 1. The four slide
   animations stay fully opaque throughout and only animate position, with
   a slight overshoot on landing. How long the popup waits before it
   opens at all is controlled in popup.js, not here. */
.lgm-popup.lgm-anim-none {
    opacity: 1;
}

.lgm-popup.lgm-anim-fade-in {
    opacity: 0;
}
.lgm-popup-overlay.lgm-visible .lgm-popup.lgm-anim-fade-in {
    animation: lgmFadeIn 0.4s ease-out forwards;
}

.lgm-popup.lgm-anim-slide-left {
    transform: translateX(-60px);
}
.lgm-popup-overlay.lgm-visible .lgm-popup.lgm-anim-slide-left {
    animation: lgmSlideLeft 1s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.lgm-popup.lgm-anim-slide-right {
    transform: translateX(60px);
}
.lgm-popup-overlay.lgm-visible .lgm-popup.lgm-anim-slide-right {
    animation: lgmSlideRight 1s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.lgm-popup.lgm-anim-slide-up {
    transform: translateY(60px);
}
.lgm-popup-overlay.lgm-visible .lgm-popup.lgm-anim-slide-up {
    animation: lgmSlideUp 1s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.lgm-popup.lgm-anim-slide-down {
    transform: translateY(-60px);
}
.lgm-popup-overlay.lgm-visible .lgm-popup.lgm-anim-slide-down {
    animation: lgmSlideDown 1s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.lgm-popup.lgm-anim-zoom-in {
    opacity: 0;
}
.lgm-popup-overlay.lgm-visible .lgm-popup.lgm-anim-zoom-in {
    animation: lgmZoomIn 0.4s ease-out forwards;
}

@keyframes lgmFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes lgmSlideLeft {
    from { transform: translateX(-60px); }
    to   { transform: translateX(0); }
}

@keyframes lgmSlideRight {
    from { transform: translateX(60px); }
    to   { transform: translateX(0); }
}

@keyframes lgmSlideUp {
    from { transform: translateY(60px); }
    to   { transform: translateY(0); }
}

@keyframes lgmSlideDown {
    from { transform: translateY(-60px); }
    to   { transform: translateY(0); }
}

@keyframes lgmZoomIn {
    from { opacity: 0; transform: scale(0.7); }
    to   { opacity: 1; transform: scale(1); }
}

.lgm-popup-countdown {
    width: 100%;
    text-align: center;
    color: #fff;
    font-weight: bold;
    font-size: 16px;
    background: none;
    padding: 15px 0px;
    position: absolute;
    bottom: -5px;
}
.lgm-popup-countdown span, .lgm-popup-countdown bdi {
    background: rgba(0, 0, 0, 0.5);
    padding: 8px 12px;
}
.lgm-popup-countdown span {
    margin-right: 7px;
}
.lgm-popup-close {
    position: absolute;
    width: 40px;
    height: 40px;
    right: 10px;
    text-align: center;
    border-radius: 100px;
    border: 2px solid transparent;
    line-height: 25px;
    padding: 0;
    top: 10px;
    -webkit-transition: all 0.3s ease-out;
    transition: all 0.3s ease-out;
    font-family: Arial, Baskerville, monospace !important;
    font-size: 28px;
    background: transparent;
    border: 2px solid #fff;
    color: #fff;
    cursor: pointer;
}
.lgm-popup-close:hover {
    -webkit-transform: scale(0.8) rotateZ(180deg);
    transform: scale(0.8) rotateZ(180deg);
    font-size: 23px;
}

@media only screen and (max-width: 768px) {
    /* Corner and edge positions don't have enough room to read as
       distinct once the popup is 90% of a phone's width, so every
       position collapses to center on small screens. */
    .lgm-popup-overlay {
        justify-content: center !important;
        align-items: center !important;
    }

    #top .lgm-popup-countdown {
        position: static;
        bottom: -5px;
        background: #0A2644;
    }
    #top .lgm-popup-countdown span {
        margin-right: 0;
    }
    #top .lgm-popup-countdown span, #top .lgm-popup-countdown bdi {
        background: none;
        display: block;
    }
    .lgm-popup {
        width: 90%;
    }
}
