/* =========================================================
   UEPS Masterclass Popup
   ========================================================= */

.ueps-popup {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.ueps-popup.is-visible {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.ueps-popup__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    cursor: pointer;
}

.ueps-popup__dialog {
    position: relative;
    z-index: 2;
    width: min(900px, 100%);
    max-height: calc(100vh - 40px);
    border-radius: 4px;
    overflow: visible;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.ueps-popup__link {
    display: block;
    line-height: 0;
}

.ueps-popup__image {
    display: block;
    width: 100%;
    height: auto;
    max-height: calc(100vh - 40px);
    object-fit: contain;
    border-radius: 4px;
}

.ueps-popup__close {
    position: absolute;
    top: -16px;
    right: -16px;
    z-index: 3;

    width: 38px;
    height: 38px;
    padding: 0;

    border: 0;
    border-radius: 50%;

    background: #ffffff;
    color: #2f2f2f;

    font-family: Arial, sans-serif;
    font-size: 28px;
    line-height: 38px;
    text-align: center;

    cursor: pointer;

    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.25);

    transition:
        background-color 0.15s ease,
        transform 0.15s ease;
}

.ueps-popup__close:hover {
    background: #f4f4ec;
    transform: scale(1.05);
}

.ueps-popup__close:focus {
    outline: 2px solid #2babe1;
    outline-offset: 2px;
}

/* Prevent page scrolling while popup is open */
body.ueps-popup-open {
    overflow: hidden;
}


/* =========================================================
   Mobile
   ========================================================= */

@media (max-width: 767px) {

    .ueps-popup {
        padding: 15px;
    }

    .ueps-popup__dialog {
        width: 100%;
        max-height: calc(100vh - 30px);
    }

    .ueps-popup__image {
        max-height: calc(100vh - 30px);
    }

    .ueps-popup__close {
        top: -12px;
        right: -8px;

        width: 34px;
        height: 34px;

        font-size: 25px;
        line-height: 34px;
    }
}