/* ========================================
   POPUP BANNER STYLES
   ======================================== */

/* Контейнер баннера */
.popup-banner {
    position: fixed;
    z-index: 9999;
    width: 300px;
    height: 250px;
    background-color: #f5f5f5;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);

    /* Статичный градиентный border с резким переходом - красный, фиолетовый, синий */
    background-image:
            linear-gradient(#f5f5f5, #f5f5f5),
            conic-gradient(
                    from 0deg,
                    #ff1744 0%,
                    #ff1744 12%,
                    #ff5252 12%,
                    #ff5252 24%,
                    #ff6b6b 24%,
                    #ff6b6b 33%,
                    #7c4dff 33%,
                    #7c4dff 45%,
                    #5c6bc0 45%,
                    #5c6bc0 57%,
                    #2196f3 57%,
                    #2196f3 69%,
                    #00bcd4 69%,
                    #00bcd4 81%,
                    #ff1744 81%,
                    #ff1744 100%
            );
    background-origin: padding-box, border-box;
    background-clip: padding-box, border-box;
    border: 4px solid transparent;
    background-size: 100% 100%, 200% 200%;
    background-position: 0 0, 0 0;

    animation: slideInBanner 0.6s ease-out, shiftBorder 3s linear infinite;
    overflow: visible;
}

/* Содержимое баннера */
.popup-banner-content {
    width: 100%;
    height: 100%;
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 12px;
    overflow: hidden;
}

/* Ссылка с картинкой */
.popup-banner-content a {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
    border-radius: 12px;
    overflow: hidden;
}

.popup-banner-content img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Кнопка закрытия - общие стили */
.popup-banner-close {
    position: absolute;
    width: 36px;
    height: 36px;
    border: none;
    cursor: pointer;
    font-size: 24px;
    font-weight: bold;
    background-color: rgb(186, 166, 161);
    color: rgb(255, 255, 255);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 100;
    padding: 0;
    line-height: 1;
}

.popup-banner-close:hover {
    background-color: rgb(166, 146, 141);
    transform: rotate(90deg);
}

.popup-banner-close:active {
    transform: rotate(90deg) scale(0.95);
}

/* ========================================
   DESKTOP VERSION (минимум 768px)
   ======================================== */
@media (min-width: 768px) {
    .popup-banner {
        bottom: 20vh;
        right: 20px;
        width: 300px;
        height: 250px;
    }

    /* Кнопка закрытия - справа сверху в десктопе */
    .popup-banner-close {
        top: -10px;
        right: -10px;
    }
}

/* ========================================
   MOBILE VERSION (менее 768px)
   ======================================== */
@media (max-width: 767px) {
    .popup-banner {
        top: 20vh;
        right: 10px;
        left: 10px;
        width: auto;
        height: 180px;
        max-width: none;
        margin-bottom: 50px;
    }

    /* Кнопка закрытия - снизу в мобильной версии, ниже баннера */
    .popup-banner-close {
        bottom: -50px;
        left: 50%;
        transform: translateX(-50%);
    }

    .popup-banner-close:hover {
        transform: translateX(-50%) rotate(90deg);
    }

    .popup-banner-close:active {
        transform: translateX(-50%) rotate(90deg) scale(0.95);
    }
}

/* ========================================
   АНИМАЦИИ
   ======================================== */

/* Анимация выезда баннера */
@keyframes slideInBanner {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Анимация переливания border */
@keyframes shiftBorder {
    0% {
        background-position: 0 0, 0 0;
    }
    100% {
        background-position: 0 0, 100% 0;
    }
}

/* Класс для скрытия баннера */
.popup-banner.hidden {
    display: none;
}