/**
 * Стили для CTA блоков в статьях
 */

/* CTA блок в контенте статьи */
.cta-block {
    margin: 32px 0;
    padding: 32px;
    border-radius: 12px;
    background-color: #a668bf;
    color: #ffffff;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.cta-block:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.cta-block__content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

/* Без заголовка - горизонтальное расположение текста и кнопки */
.cta-block:not(.cta-block--with-title) .cta-block__content {
    flex-direction: row;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 24px;
}

.cta-block__title {
    font-size: 24px;
    font-weight: 700;
    line-height: 1.4;
    margin: 0 0 12px 0;
    color: inherit;
    text-align: center;
    width: 100%;
}

.cta-block__text-wrapper {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
    justify-content: center;
}

/* С заголовком - вертикальное расположение текста и кнопки */
.cta-block--with-title .cta-block__text-wrapper {
    flex-direction: column;
    gap: 20px;
}

.cta-block__text {
    font-size: 20px;
    font-weight: 600;
    line-height: 1.5;
    margin: 0;
    color: inherit;
    text-align: center;
}

.cta-block__button {
    flex-shrink: 0;
}

.cta-block__order-btn {
    min-width: 200px;
    background: #ffffff;
    color: inherit;
    border: 2px solid rgba(255, 255, 255, 0.3);
    font-weight: 600;
    transition: all 0.3s ease;
}

.cta-block__order-btn:hover {
    background: rgba(255, 255, 255, 0.95);
    border-color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Модальное окно для настройки CTA */
.cta-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.cta-modal.active {
    display: flex;
}

.cta-modal__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.cta-modal__content {
    position: relative;
    background: #ffffff;
    border-radius: 16px;
    padding: 32px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.3s ease;
}

.cta-modal__close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: #6c757d;
    transition: all 0.2s ease;
    z-index: 10;
}

.cta-modal__close:hover {
    background: #e9ecef;
    color: #212529;
}

.cta-modal__header {
    margin-bottom: 24px;
}

.cta-modal__title {
    font-size: 22px;
    font-weight: 700;
    color: #212529;
    margin: 0;
    line-height: 1.4;
}

.cta-modal__form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.cta-modal__field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cta-modal__label {
    font-size: 14px;
    font-weight: 600;
    color: #495057;
}

.cta-modal__input {
    width: 100%;
    padding: 12px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s ease;
}

.cta-modal__input:focus {
    outline: none;
    border-color: #a668bf;
    box-shadow: 0 0 0 3px rgba(166, 104, 191, 0.1);
}

.cta-modal__textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.2s ease;
}

.cta-modal__textarea:focus {
    outline: none;
    border-color: #a668bf;
    box-shadow: 0 0 0 3px rgba(166, 104, 191, 0.1);
}

.cta-modal__color-wrapper {
    display: flex;
    gap: 12px;
    align-items: center;
}

.cta-modal__color {
    width: 60px;
    height: 40px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    cursor: pointer;
    padding: 0;
}

.cta-modal__color-text {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-size: 14px;
    font-family: monospace;
    transition: border-color 0.2s ease;
}

.cta-modal__color-text:focus {
    outline: none;
    border-color: #a668bf;
    box-shadow: 0 0 0 3px rgba(166, 104, 191, 0.1);
}

.cta-modal__preview {
    margin-top: 8px;
}

.cta-modal__preview-label {
    font-size: 13px;
    font-weight: 600;
    color: #6c757d;
    margin-bottom: 12px;
}

.cta-block--preview {
    margin: 0;
    padding: 20px 24px;
}

.cta-modal__actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 8px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.cta-modal__btn {
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cta-modal__btn--cancel {
    background: #f8f9fa;
    color: #495057;
}

.cta-modal__btn--cancel:hover {
    background: #e9ecef;
}

.cta-modal__btn--submit {
    background: #a668bf;
    color: #ffffff;
}

.cta-modal__btn--submit:hover {
    background: #8f5ba8;
    box-shadow: 0 4px 12px rgba(166, 104, 191, 0.3);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Адаптивность */
@media (max-width: 768px) {
    .cta-modal__content {
        padding: 24px 20px;
        width: 95%;
    }
    
    .cta-modal__title {
        font-size: 20px;
    }
    
    .cta-block {
        padding: 24px 20px;
        margin: 24px 0;
    }
    
    .cta-block__content {
        gap: 16px;
    }
    
    /* На мобильных всегда вертикальное расположение */
    .cta-block:not(.cta-block--with-title) .cta-block__content {
        flex-direction: column;
    }
    
    .cta-block__title {
        font-size: 20px;
        margin-bottom: 12px;
    }
    
    .cta-block__text-wrapper {
        flex-direction: column !important;
        gap: 16px;
        width: 100%;
    }
    
    .cta-block__text {
        font-size: 18px;
    }
    
    .cta-block__order-btn {
        min-width: 100%;
        width: 100%;
    }
    
    .cta-modal__actions {
        flex-direction: column;
    }
    
    .cta-modal__btn {
        width: 100%;
    }
}

/* Стили для редактора Bitrix */
.bxhtmled-top-bar .bxhtmled-button-insert-cta {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='%23333' d='M8 0C3.6 0 0 3.6 0 8s3.6 8 8 8 8-3.6 8-8-3.6-8-8-8zm4 9H9v3H7V9H4V7h3V4h2v3h3v2z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 16px 16px;
}

