.popup-affiliate-container {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    pointer-events: auto;
}

.popup-affiliate {
    width: 150px;
    height: 150px;
    overflow: visible;
    animation: popupFadeIn 0.3s ease-out;
    position: absolute;
    background-color: transparent;
    border: none;
    box-shadow: none;
    z-index: 1001;
}

.popup-affiliate.popup-affiliate-size-small {
    width: 120px;
    height: 120px;
}

.popup-affiliate.popup-affiliate-size-medium {
    width: 240px;
    height: 240px;
}

.popup-affiliate.popup-affiliate-size-large {
    width: 480px;
    height: 480px;
}

.popup-affiliate.popup-affiliate-size-custom {
    width: 150px;
    height: 150px;
}

.popup-affiliate-position-top-left {
    top: 20px;
    left: 20px;
    transform: translate(0, 0);
}

.popup-affiliate-position-top-center {
    top: 20px;
    left: 50%;
    transform: translate(-50%, 0);
}

.popup-affiliate-position-top-right {
    top: 20px;
    right: 20px;
    transform: translate(0, 0);
}

.popup-affiliate-position-middle-left {
    top: 50%;
    left: 20px;
    transform: translate(0, -50%);
}

.popup-affiliate-position-middle-center {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.popup-affiliate-position-middle-right {
    top: 50%;
    right: 20px;
    transform: translate(0, -50%);
}

.popup-affiliate-position-bottom-left {
    bottom: 20px;
    left: 20px;
    transform: translate(0, 0);
}

.popup-affiliate-position-bottom-center {
    bottom: 20px;
    left: 50%;
    transform: translate(-50%, 0);
}

.popup-affiliate-position-bottom-right {
    bottom: 20px;
    right: 20px;
    transform: translate(0, 0);
}

@keyframes popupFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.close-btn {
    position: absolute;
    top: -5px;
    right: 0;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s, transform 0.2s;
    color: #e74c3c;
    z-index: 10;
    line-height: 0.8;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

.close-btn:hover {
    color: #f1c40f;
    transform: scale(1.1);
}

.popup-affiliate-content {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}


.popup-affiliate-content a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.popup-affiliate-fit-stretch .popup-affiliate-content img {
    width: 100%;
    height: 100%;
    object-fit: fill;
}

.popup-affiliate-fit-fit-width .popup-affiliate-content img {
    width: 100%;
    height: auto;
    max-height: 100%;
    object-fit: contain;
}

.popup-affiliate-fit-fit-height .popup-affiliate-content img {
    height: 100%;
    width: auto;
    max-width: 100%;
    object-fit: contain;
}


.popup-affiliate-container.show {
    display: block;
}

/* Popup Effects */
.popup-effect-shake {
    animation: popupShake 1s cubic-bezier(.36, .07, .19, .97) both infinite;
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    perspective: 1000px;
}

@keyframes popupShake {

    10%,
    90% {
        transform: translate3d(-1px, 0, 0);
    }

    20%,
    80% {
        transform: translate3d(2px, 0, 0);
    }

    30%,
    50%,
    70% {
        transform: translate3d(-4px, 0, 0);
    }

    40%,
    60% {
        transform: translate3d(4px, 0, 0);
    }
}

.popup-effect-heartbeat {
    animation: popupHeartbeat 1.5s ease-in-out infinite both;
}

@keyframes popupHeartbeat {
    from {
        transform: scale(1);
        transform-origin: center center;
        animation-timing-function: ease-out;
    }

    10% {
        transform: scale(0.91);
        animation-timing-function: ease-in;
    }

    17% {
        transform: scale(0.98);
        animation-timing-function: ease-out;
    }

    33% {
        transform: scale(0.87);
        animation-timing-function: ease-in;
    }

    45% {
        transform: scale(1);
        animation-timing-function: ease-out;
    }
}

.popup-effect-zoom {
    animation: popupZoom 2s infinite;
}

@keyframes popupZoom {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

.popup-effect-wobble {
    animation: popupWobble 1s infinite both;
}

@keyframes popupWobble {

    0%,
    100% {
        transform: translateX(0%);
        transform-origin: 50% 50%;
    }

    15% {
        transform: translateX(-6px) rotate(-6deg);
    }

    30% {
        transform: translateX(3px) rotate(6deg);
    }

    45% {
        transform: translateX(-3px) rotate(-3.6deg);
    }

    60% {
        transform: translateX(2px) rotate(2.4deg);
    }

    75% {
        transform: translateX(-1px) rotate(-1.2deg);
    }
}

.popup-effect-tada {
    animation: popupTada 1s infinite both;
}

@keyframes popupTada {
    0% {
        transform: scale(1);
    }

    10%,
    20% {
        transform: scale(0.9) rotate(-3deg);
    }

    30%,
    50%,
    70%,
    90% {
        transform: scale(1.1) rotate(3deg);
    }

    40%,
    60%,
    80% {
        transform: scale(1.1) rotate(-3deg);
    }

    100% {
        transform: scale(1) rotate(0);
    }
}

.popup-effect-swing {
    transform-origin: top center;
    animation: popupSwing 2s infinite both;
}

@keyframes popupSwing {
    20% {
        transform: rotate3d(0, 0, 1, 15deg);
    }

    40% {
        transform: rotate3d(0, 0, 1, -10deg);
    }

    60% {
        transform: rotate3d(0, 0, 1, 5deg);
    }

    80% {
        transform: rotate3d(0, 0, 1, -5deg);
    }

    to {
        transform: rotate3d(0, 0, 1, 0deg);
    }
}

.popup-effect-flash {
    animation: popupFlash 2s infinite both;
}

@keyframes popupFlash {

    0%,
    50%,
    100% {
        opacity: 1;
    }

    25%,
    75% {
        opacity: 0;
    }
}