/* Применяем клетку только к центральной части сайта */
/* Применяем клетку к центральной части сайта и готовим фон для атомов */
.site-content {
    position: relative !important; /* ВАЖНО: держим атомы внутри блока */
    background-color: #F4F7F9 !important;
    background-image: 
        linear-gradient(rgba(0, 86, 179, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 86, 179, 0.05) 1px, transparent 1px) !important;
    background-size: 30px 30px, 30px 30px !important; 
    background-attachment: scroll !important;
    overflow: hidden !important; /* Чтобы атомы не вылезали за края */
}

/* Поднимаем весь текст и задания выше анимации, чтобы атомы летали СЗАДИ */
.site-content > * {
    position: relative;
    z-index: 2;
}

.site-content > .rl-dizain-6-atoms-canvas {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 1 !important;
    pointer-events: none !important;
}

/* Принудительно очищаем фон шапки и подвала, чтобы они были чисто белыми */
.site-header, 
.site-footer, 
.main-header-bar,
header, 
footer {
    background: #ffffff !important;
    position: relative;
    z-index: 10;
}

/* 1. Запрещаем тексту разваливаться в столбик и фиксируем жирность как на главной */
.site-title, .site-title a {
    white-space: nowrap !important; /* Текст ВСЕГДА в одну строку */
    display: block !important;
    font-weight: 600 !important;    /* Фиксируем максимальную жирность */
}

/* 2. Жестко связываем логотип и текст в одну неразрывную группу */
.site-branding {
    display: flex !important;
    flex-direction: row !important; /* Только горизонтально */
    flex-wrap: nowrap !important;   /* Запрет переноса на новую строку */
    align-items: center !important;
    min-width: 300px !important;    /* Сразу бронируем место под текст */
}

/* 3. Фиксируем высоту всей полосы шапки, чтобы она не дергалась вверх-вниз */
.main-header-bar, .ast-main-header-wrap {
    min-height: 60px !important; 
}

/* 4. Если на мобильном всё равно прыгает — фиксируем и там */
@media (max-width: 921px) {
    .site-branding {
        min-width: 200px !important;
    }
}

/* ==========================================================================
   Дизайн 6: документы и подвал
   ========================================================================== */

#rl-footer-legal.rl-footer-legal {
    width: 100%;
    max-width: 1000px;
    margin: 8px auto 0 auto;
    padding: 0 15px 0 15px;
    text-align: center;
    box-sizing: border-box;
    font-family: inherit;
}

/* Крупный блок для сообщений об ошибках */
#rl-footer-legal .rl-footer-feedback {
    margin: 0;
    padding: 10px 16px;
    background: #F0F6FF;
    border-left: 4px solid #0066CD;
    border-radius: 10px;
    box-sizing: border-box;
}

/* Внутри плашки */
#rl-footer-legal .rl-footer-feedback-title,
#rl-footer-legal .rl-footer-feedback-text,
#rl-footer-legal .rl-footer-feedback-email {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
}

#rl-footer-legal .rl-footer-feedback-title,
#rl-footer-legal .rl-footer-feedback-text {
    color: #202124;
}

#rl-footer-legal .rl-footer-feedback-title {
    margin-bottom: 2px;
}

#rl-footer-legal .rl-footer-feedback-email {
    display: inline-block;
    color: #0066CD;
    text-decoration: none;
    white-space: nowrap;
}

#rl-footer-legal .rl-footer-feedback-email:hover {
    color: #00468D;
    text-decoration: underline;
}

/* Юридические ссылки */
#rl-footer-legal .rl-footer-legal-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0;
    color: #0066CD;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.5;
    margin-bottom: 3px;
    text-align: center;
}

#rl-footer-legal .rl-footer-legal-links a {
    color: #0066CD;
    text-decoration: none;
    transition: color 0.2s, opacity 0.2s;
}

#rl-footer-legal .rl-footer-legal-links a:hover {
    color: #00468D;
    text-decoration: underline;
}

#rl-footer-legal .rl-footer-legal-separator {
    color: #202124;
    margin: 0 6px;
}

/* Реквизиты самозанятого */
#rl-footer-legal .rl-footer-legal-owner {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    color: #202124;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.5;
    max-width: 100%;
    text-align: center;
}

#rl-footer-legal .rl-footer-legal-owner-item {
    color: #202124 !important;
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
    white-space: nowrap;
}

#rl-footer-legal .rl-footer-legal-owner-separator {
    color: #202124 !important;
    margin: 0 6px;
    white-space: nowrap;
}

/* На ПК: плашка сверху, ссылки и реквизиты ниже */
@media (min-width: 769px) {
    #rl-footer-legal.rl-footer-legal {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 6px;
    }

    #rl-footer-legal .rl-footer-feedback {
    width: fit-content;
    max-width: 100%;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    gap: 4px;
    white-space: nowrap;
}

    #rl-footer-legal .rl-footer-feedback-title,
    #rl-footer-legal .rl-footer-feedback-text,
    #rl-footer-legal .rl-footer-feedback-email {
        display: inline;
        margin: 0;
    }

    #rl-footer-legal .rl-footer-right {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        min-width: 0;
    }

    #rl-footer-legal .rl-footer-legal-links {
        justify-content: center;
        text-align: center;
        margin-bottom: 0;
    }

    #rl-footer-legal .rl-footer-legal-owner {
        justify-content: center;
        text-align: center;
        margin-top: 0;
    }
}

/* Убираем лишний нижний воздух футера Astra.
   Это осознанное исключение без ID: .site-footer является родительским блоком темы. */
.site-footer {
    padding-bottom: 0 !important;
}

.site-footer .ast-builder-grid-row-container,
.site-footer .ast-builder-grid-row-container-inner {
    padding-bottom: 0 !important;
}

.site-footer .footer-widget-area,
.site-footer .ast-footer-html,
.site-footer .ast-builder-html-element {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

/* Мобильная версия: структуру оставляем компактной */
@media (max-width: 768px) {
    #rl-footer-legal.rl-footer-legal {
        display: block;
        max-width: 100%;
        margin-top: 8px;
        padding: 0 8px 0 8px;
    }

    #rl-footer-legal .rl-footer-right {
        display: block;
    }

    #rl-footer-legal .rl-footer-feedback {
        margin: 0 auto 8px auto;
        padding: 10px 14px;
        max-width: 100%;
    }

    #rl-footer-legal .rl-footer-feedback-title,
    #rl-footer-legal .rl-footer-feedback-text,
    #rl-footer-legal .rl-footer-feedback-email {
        font-size: 14px;
        font-weight: 600;
        line-height: 1.4;
    }

    #rl-footer-legal .rl-footer-legal-links {
    justify-content: center;
    text-align: center;
    gap: 0;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 4px;
}

    #rl-footer-legal .rl-footer-legal-separator {
    display: inline;
    color: #202124;
    margin: 0 5px;
}

    #rl-footer-legal .rl-footer-legal-owner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    margin-top: 5px;
    color: #202124;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.35;
    letter-spacing: 0;
}

    #rl-footer-legal .rl-footer-legal-owner-item {
        color: #202124 !important;
        font-size: inherit;
        font-weight: inherit;
        line-height: inherit;
    }

    #rl-footer-legal .rl-footer-legal-owner-separator {
    display: none;
}
}
