/* ================================
   CTA SHORTCODE STYLES
   ================================ */

.cta-wrapper {
    margin: 20px auto;
    max-width: 720px;
    width: 720px;
}

/* ================================
   STICKY CTA СТИЛИ
   ================================ */
.cta-sticky {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 9999 !important;
    margin: 0 !important;
    max-width: none !important;
    width: 100% !important;
    padding: 0 16px !important;
    box-sizing: border-box !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease !important;
    transform: translateY(0) !important;
    opacity: 1 !important;
    will-change: transform, opacity !important;
}

.cta-sticky--bottom {
    bottom: 0 !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3) !important;
}

.cta-sticky--top {
    top: 0 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3) !important;
}

/* Скрытое состояние */
.cta-sticky.cta-hidden {
    transform: translateY(100%) !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.cta-sticky--top.cta-hidden {
    transform: translateY(-100%) !important;
}

/* Стили для sticky блока */
.cta-sticky .cta-block {
    min-height: auto !important;
    max-width: 1200px !important;
    margin: 0 auto !important;
    border-radius: 0 !important;
    position: relative !important;
    padding: 20px 24px !important;
    background: linear-gradient(135deg, rgba(59, 35, 75, 0.95) 0%, rgba(75, 45, 95, 0.95) 50%, rgba(90, 55, 115, 0.95) 100%) !important;
    backdrop-filter: blur(20px) !important;
    border: none !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.4) !important;
}

.cta-sticky--top .cta-block {
    border-top: none !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4) !important;
}

/* Кнопка закрытия */
.cta-close {
    position: absolute !important;
    top: 12px !important;
    right: 12px !important;
    background: rgba(0, 0, 0, 0.3) !important;
    border: none !important;
    border-radius: 50% !important;
    width: 32px !important;
    height: 32px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    color: rgba(255, 255, 255, 0.8) !important;
    transition: all 0.3s ease !important;
    z-index: 10 !important;
    backdrop-filter: blur(5px) !important;
    -webkit-backdrop-filter: blur(5px) !important;
    outline: none !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
}

.cta-close:hover,
.cta-close:focus {
    background: rgba(0, 0, 0, 0.5) !important;
    color: #ffffff !important;
    transform: scale(1.1) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

.cta-close:active {
    transform: scale(0.95) !important;
}

.cta-close svg {
    width: 16px !important;
    height: 16px !important;
    stroke-width: 2 !important;
}

.cta-block {
    min-height: 180px;
    padding: 32px 28px;
    border-radius: 20px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    color: white;
    background: linear-gradient(135deg, rgb(59, 35, 75) 0%, rgb(75, 45, 95) 50%, rgb(90, 55, 115) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cta-content {
    flex: 1;
    z-index: 2;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: calc(100% - 120px);
}

.cta-rating {
    margin-bottom: 12px;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 2px;
}

.cta-rating .star {
    opacity: 0.4;
    transition: all 0.3s ease;
    font-size: 16px;
}

.cta-rating .star.active {
    opacity: 1;
    filter: drop-shadow(0 0 6px rgba(255, 215, 0, 0.8));
    transform: scale(1.1);
}

.cta-title {
    font-size: 24px;
    font-weight: 800;
    margin: 0 0 12px 0;
    color: #ffffff;
    line-height: 1.2;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    letter-spacing: -0.02em;
}

.cta-description {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.95);
    margin: 0 0 24px 0 !important;
    line-height: 1.5;
    font-weight: 400;
    max-width: 90%;
}

.cta-block .cta-button {
    background: linear-gradient(135deg, rgb(184, 15, 255) 0%, rgb(211, 106, 255) 100%) !important;
    border: none !important;
    color: #ffffff !important;
    padding: 14px 32px !important;
    border-radius: 12px !important;
    text-decoration: none !important;
    font-weight: 700 !important;
    font-size: 15px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.8px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 4px 16px rgba(184, 15, 255, 0.4) !important;
    cursor: pointer !important;
    line-height: 1 !important;
    min-height: 48px !important;
    width: auto !important;
    text-align: center !important;
    position: relative !important;
    overflow: hidden !important;
    border: 2px solid rgba(255, 255, 255, 0.2) !important;
}

.cta-block .cta-button:hover,
.cta-block .cta-button:focus,
.cta-block .cta-button:active {
    background: linear-gradient(135deg, rgb(211, 106, 255) 0%, rgb(184, 15, 255) 100%) !important;
    color: #ffffff !important;
    text-decoration: none !important;
}

/* Переопределяем возможные конфликты с другими стилями */
.cta-wrapper a.cta-button,
.cta-wrapper .cta-button,
.cta-block a.cta-button,
.cta-block .cta-button {
    background: rgb(184, 15, 255) !important;
    color: #ffffff !important;
    border: none !important;
    outline: none !important;
    box-sizing: border-box !important;
    vertical-align: baseline !important;
    font-family: inherit !important;
}

/* Убираем все возможные наследуемые стили */
.cta-wrapper .cta-button:before,
.cta-wrapper .cta-button:after,
.cta-block .cta-button:before,
.cta-block .cta-button:after {
    display: none !important;
    content: none !important;
}

.cta-image {
    width: 120px;
    height: 120px;
    flex-shrink: 0;
    margin-left: 24px;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}

.cta-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    border-radius: 12px;
    transition: transform 0.3s ease, opacity 0.3s ease;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    backface-visibility: hidden;
    transform: translateZ(0);
    opacity: 0.95;
    will-change: transform;
    aspect-ratio: 1 / 1;
    display: block;
    max-width: 100%;
    max-height: 100%;
}

/* Плейсхолдер для загрузки изображений */
.cta-image::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="rgba(255,255,255,0.5)"><path d="M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2zM8.5 13.5l2.5 3.01L14.5 12l4.5 6H5l3.5-4.5z"/></svg>') center/contain no-repeat;
    opacity: 0.3;
    pointer-events: none;
    z-index: 1;
}

.cta-image img[src]:not([src=""])~.cta-image::before,
.cta-image:has(img[src]:not([src=""])) .cta-image::before {
    display: none;
}

/* Скрываем плейсхолдер когда изображение загружено */
.cta-image img[src]:not([src=""]) {
    z-index: 2;
}

.cta-image img:not([src]),
.cta-image img[src=""] {
    opacity: 0;
    display: none;
}

/* Поддержка высоких DPI экранов */
@media (-webkit-min-device-pixel-ratio: 2),
(min-resolution: 192dpi) {
    .cta-image img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Улучшенная производительность */
.cta-image {
    contain: layout style paint;
}

/* Поддержка современных браузеров */
@supports (aspect-ratio: 1 / 1) {
    .cta-image,
    .cta-image img {
        aspect-ratio: 1 / 1;
    }
}

/* Поддержка object-view-box для лучшего кропа */
@supports (object-view-box: inset(0)) {
    .cta-image img {
        object-view-box: inset(0);
    }
}

.cta-decoration {
    width: 120px;
    height: 120px;
    position: relative;
    flex-shrink: 0;
    margin-left: 24px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
}

.cta-animation {
    position: relative;
    width: 100%;
    height: 100%;
}

.cta-icon {
    position: absolute;
    font-size: 24px;
    animation: float 4s ease-in-out infinite;
    opacity: 0.9;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.cta-icon.coin {
    top: 15%;
    left: 25%;
    animation-delay: 0s;
}

.cta-icon.card {
    top: 65%;
    right: 15%;
    animation-delay: 1s;
}

.cta-icon.star {
    top: 25%;
    right: 25%;
    animation-delay: 2s;
}

.cta-icon.crown {
    bottom: 25%;
    left: 35%;
    animation-delay: 3s;
}

@keyframes float {
    0%,
    100% {
        transform: translateY(0px) rotate(0deg) scale(1);
    }

    25% {
        transform: translateY(-8px) rotate(3deg) scale(1.05);
    }

    50% {
        transform: translateY(-12px) rotate(6deg) scale(1.1);
    }

    75% {
        transform: translateY(-6px) rotate(-3deg) scale(1.05);
    }
}

/* ================================
   АДАПТИВНОСТЬ ДЛЯ STICKY CTA
   ================================ */
@media (max-width: 1024px) {
    .cta-sticky .cta-block {
        padding: 14px 16px !important;
    }

    .cta-sticky .cta-content {
        flex-direction: column !important;
        text-align: center !important;
    }

    .cta-sticky .cta-image,
    .cta-sticky .cta-decoration {
        margin: 8px 0 0 0 !important;
        width: 60px !important;
        height: 60px !important;
    }
}

@media (max-width: 768px) {
    .cta-wrapper {
        max-width: 100%;
        width: 100%;
        margin: 20px auto;
        padding: 0 16px;
        box-sizing: border-box;
    }

    .cta-block {
        flex-direction: column;
        text-align: center;
        min-height: 220px;
        padding: 28px 20px;
        gap: 20px;
    }

    .cta-content {
        max-width: 100%;
        order: 1;
    }

    .cta-title {
        font-size: 20px;
        margin-bottom: 8px;
    }

    .cta-description {
        font-size: 14px;
        margin-bottom: 20px !important;
        max-width: 100%;
    }

    .cta-sticky {
        padding: 0 12px !important;
    }

    .cta-sticky .cta-block {
        padding: 16px 20px !important;
        flex-direction: row !important;
        align-items: center !important;
        text-align: left !important;
        gap: 16px !important;
    }

    .cta-sticky .cta-content {
        flex: 1 !important;
        margin-right: 0 !important;
    }

    .cta-sticky .cta-title {
        font-size: 16px !important;
        margin-bottom: 6px !important;
        font-weight: 700 !important;
    }

    .cta-sticky .cta-description {
        font-size: 13px !important;
        margin-bottom: 12px !important;
        line-height: 1.4 !important;
        max-width: 100% !important;
    }

    .cta-sticky .cta-button {
        padding: 10px 20px !important;
        font-size: 12px !important;
        margin-top: 0 !important;
        min-height: 36px !important;
        border-radius: 8px !important;
    }

    .cta-sticky .cta-rating {
        margin-bottom: 6px !important;
        font-size: 14px !important;
    }

    .cta-sticky .cta-image,
    .cta-sticky .cta-decoration {
        width: 60px !important;
        height: 60px !important;
        margin: 0 !important;
        flex-shrink: 0 !important;
        border-radius: 12px !important;
    }

    .cta-sticky .cta-close {
        top: 8px !important;
        right: 8px !important;
        width: 28px !important;
        height: 28px !important;
    }

    .cta-sticky .cta-close svg {
        width: 14px !important;
        height: 14px !important;
    }

    .cta-image,
    .cta-decoration {
        width: 90px;
        height: 90px;
        margin: 0;
        order: 2;
    }

    .cta-image img {
        aspect-ratio: 1 / 1;
        object-fit: cover;
        object-position: center;
    }

    .cta-icon {
        font-size: 20px;
    }

    .cta-block .cta-button {
        padding: 12px 24px !important;
        font-size: 13px !important;
        margin-top: 0 !important;
        min-height: 44px !important;
        order: 3;
    }
}

@media (max-width: 480px) {
    .cta-wrapper {
        max-width: 100%;
        width: 100%;
        margin: 16px auto;
        padding: 0 12px;
    }

    .cta-block {
        min-height: 200px;
        padding: 24px 16px;
        gap: 16px;
    }

    .cta-image,
    .cta-decoration {
        width: 80px;
        height: 80px;
    }

    .cta-image img {
        aspect-ratio: 1 / 1;
        object-fit: cover;
        object-position: center;
    }

    .cta-title {
        font-size: 18px;
        margin-bottom: 6px;
    }

    .cta-description {
        font-size: 13px;
        margin-bottom: 16px !important;
    }

    .cta-block .cta-button {
        padding: 10px 20px !important;
        font-size: 12px !important;
        margin-top: 0 !important;
        min-height: 40px !important;
        letter-spacing: 0.5px !important;
    }

    .cta-icon {
        font-size: 18px;
    }

    .cta-sticky {
        padding: 0 8px !important;
    }

    .cta-sticky .cta-block {
        padding: 12px 16px !important;
        gap: 12px !important;
    }

    .cta-sticky .cta-title {
        font-size: 14px !important;
        margin-bottom: 4px !important;
    }

    .cta-sticky .cta-description {
        font-size: 12px !important;
        margin-bottom: 8px !important;
        line-height: 1.3 !important;
    }

    .cta-sticky .cta-button {
        padding: 8px 16px !important;
        font-size: 11px !important;
        margin-top: 0 !important;
        min-height: 32px !important;
        border-radius: 6px !important;
    }

    .cta-sticky .cta-rating {
        margin-bottom: 4px !important;
        font-size: 12px !important;
    }

    .cta-sticky .cta-image,
    .cta-sticky .cta-decoration {
        width: 48px !important;
        height: 48px !important;
        border-radius: 10px !important;
    }

    .cta-sticky .cta-close {
        width: 28px !important;
        height: 28px !important;
        top: 8px !important;
        right: 8px !important;
    }

    .cta-sticky .cta-close svg {
        width: 14px !important;
        height: 14px !important;
    }
} 