.ap-sticky-cta {
    position: fixed;
    z-index: 999999;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.4;
    color: #1a1a1a;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.ap-sticky-cta--visible {
    opacity: 1;
    pointer-events: auto;
}

.ap-sticky-cta--surface-clickable { cursor: pointer; }
.ap-sticky-cta--surface-clickable:focus-visible { outline: 3px solid var(--ap-sticky-accent, #6366f1); outline-offset: 3px; }

.ap-sticky-cta__backdrop {
    position: fixed;
    inset: 0;
    z-index: 999998;
    background: rgba(10, 14, 26, 0.42);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.ap-sticky-cta__backdrop--visible { opacity: 1; pointer-events: auto; }

/* Внутренний контейнер — здесь живёт весь padding и контент.
   На full-width вариантах ограничивает ширину контента (как container
   в бутстрапе), сама панель при этом остаётся на всю ширину экрана. */
.ap-sticky-cta__container {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    padding: 16px 20px;
}

/* Резервируем место под крестик, если он есть — не даём тексту/кнопке
   заезжать под него ни в одном из вариантов размещения. */
.ap-sticky-cta--has-close .ap-sticky-cta__container {
    padding-right: 46px;
}

/* --- Full-width варианты (bottom / top) --- */

.ap-sticky-cta--bottom,
.ap-sticky-cta--top {
    left: 0;
    right: 0;
}

.ap-sticky-cta--bottom .ap-sticky-cta__container,
.ap-sticky-cta--top .ap-sticky-cta__container {
    max-width: 1140px;
    margin: 0 auto;
    justify-content: center;
}

.ap-sticky-cta--bottom {
    bottom: 0;
    transform: translateY(20px);
}
.ap-sticky-cta--bottom.ap-sticky-cta--visible {
    transform: translateY(0);
}

.ap-sticky-cta--top {
    top: 0;
    transform: translateY(-20px);
}
.ap-sticky-cta--top.ap-sticky-cta--visible {
    transform: translateY(0);
}

/* --- Плавающие варианты по углам --- */

.ap-sticky-cta--bottom-right-floating,
.ap-sticky-cta--bottom-left-floating,
.ap-sticky-cta--top-right-floating,
.ap-sticky-cta--top-left-floating {
    max-width: 340px;
    border-radius: 16px;
    transform: scale(0.96);
}
.ap-sticky-cta--bottom-right-floating.ap-sticky-cta--visible,
.ap-sticky-cta--bottom-left-floating.ap-sticky-cta--visible,
.ap-sticky-cta--top-right-floating.ap-sticky-cta--visible,
.ap-sticky-cta--top-left-floating.ap-sticky-cta--visible {
    transform: scale(1);
}

.ap-sticky-cta--bottom-right-floating { right: 20px; bottom: 20px; transform-origin: right bottom; }
.ap-sticky-cta--bottom-left-floating { left: 20px; bottom: 20px; transform-origin: left bottom; }
.ap-sticky-cta--top-right-floating { right: 20px; top: 20px; transform-origin: right top; }
.ap-sticky-cta--top-left-floating { left: 20px; top: 20px; transform-origin: left top; }

.ap-sticky-cta--bottom-right-floating .ap-sticky-cta__container,
.ap-sticky-cta--bottom-left-floating .ap-sticky-cta__container,
.ap-sticky-cta--top-right-floating .ap-sticky-cta__container,
.ap-sticky-cta--top-left-floating .ap-sticky-cta__container,
.ap-sticky-cta--center .ap-sticky-cta__container {
    flex-direction: column;
    align-items: flex-start;
}

/* --- Модальное размещение по центру --- */
.ap-sticky-cta--center {
    left: 50%;
    top: 50%;
    width: min(440px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
    overflow: auto;
    border-radius: 18px;
    transform: translate(-50%, -50%) scale(0.94);
}
.ap-sticky-cta--center.ap-sticky-cta--visible { transform: translate(-50%, -50%) scale(1); }

/* --- Стили оформления --- */

.ap-sticky-cta--style-glass {
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

.ap-sticky-cta--style-solid {
    background: #ffffff;
}
.ap-sticky-cta--bottom.ap-sticky-cta--style-solid {
    box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.12);
}
.ap-sticky-cta--top.ap-sticky-cta--style-solid {
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.12);
}
.ap-sticky-cta--bottom-right-floating.ap-sticky-cta--style-solid,
.ap-sticky-cta--bottom-left-floating.ap-sticky-cta--style-solid,
.ap-sticky-cta--top-right-floating.ap-sticky-cta--style-solid,
.ap-sticky-cta--top-left-floating.ap-sticky-cta--style-solid,
.ap-sticky-cta--center.ap-sticky-cta--style-solid {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

/* --- Внутренние элементы --- */

.ap-sticky-cta__text {
    flex: 1;
    min-width: 160px;
}

.ap-sticky-cta__btn {
    display: inline-block;
    flex-shrink: 0;
    padding: 10px 22px;
    background: var(--ap-sticky-accent, #6366f1);
    color: #ffffff;
    border: none;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
    transition: filter 0.15s ease, transform 0.15s ease;
}
.ap-sticky-cta__btn:hover {
    filter: brightness(0.92);
    transform: translateY(-1px);
}

/* Крестик — везде position: absolute в правом верхнем углу самого блока
   (не контейнера), поэтому не зависит от того, где именно расположена
   панель на экране (слева, справа, сверху, снизу). */
.ap-sticky-cta__close {
    position: absolute;
    top: 10px;
    right: 14px;
    background: none;
    border: none;
    font-size: 20px;
    line-height: 1;
    color: rgba(0, 0, 0, 0.45);
    cursor: pointer;
    padding: 4px;
    z-index: 1;
}
.ap-sticky-cta__close:hover {
    color: rgba(0, 0, 0, 0.75);
}

/* --- Мобильные экраны ---
   Все варианты размещения на мобильном превращаются в одинаковую
   компактную "карточку" снизу (или сверху для --top), по образу
   плавающих вариантов на десктопе. */

@media (max-width: 600px) {
    .ap-sticky-cta {
        left: 12px !important;
        right: 12px !important;
        max-width: none !important;
        border-radius: 16px;
    }

    .ap-sticky-cta--bottom,
    .ap-sticky-cta--bottom-right-floating,
    .ap-sticky-cta--bottom-left-floating {
        bottom: 12px;
        top: auto;
    }

    .ap-sticky-cta--top,
    .ap-sticky-cta--top-left-floating,
    .ap-sticky-cta--top-right-floating {
        top: 12px;
        bottom: auto;
    }

    .ap-sticky-cta--center {
        left: 50% !important;
        right: auto !important;
        top: 50%;
        bottom: auto;
        width: calc(100vw - 24px);
        max-height: calc(100vh - 24px);
    }

    .ap-sticky-cta__container {
        flex-direction: column;
        align-items: flex-start;
        max-width: none;
        margin: 0;
        padding: 14px 16px;
    }
    .ap-sticky-cta--has-close .ap-sticky-cta__container {
        padding-right: 40px;
    }

    .ap-sticky-cta__btn {
        width: 100%;
        text-align: center;
        padding: 9px 18px;
    }
}
