.auto {
	width: 100%;
	overflow: auto;
}
/* === Стили для шапки сайта === */

/* Фиксированная шапка для десктопа */
#header {
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    min-height: auto;
}

body {
    padding-top: 0;
}

.header-content {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    width: 100%;
}

.logo-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 10px;
    width: auto;
    max-width: 300px;
    flex-shrink: 0;
}

.company-description {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
    line-height: 1.3;
    width: 100%;
    max-width: none;
    word-wrap: normal;
}

/* === ПРАВАЯ СЕКЦИЯ С КНОПКОЙ И КОНТАКТАМИ === */
.header-right-section {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    flex: 1;
}

/* Строка с кнопкой обратного звонка и поиском */
.search-callback-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 15px;
    margin-bottom: 10px;
    width: 100%;
    padding-right: 30px;
    min-height: 40px; /* Фиксированная высота для выравнивания */
}

.callback-button-container {
    flex-shrink: 0;
    margin-right: 15px;
    height: 40px; /* Фиксированная высота */
    display: flex;
    align-items: center;
    justify-content: center;
}

.callback-button {
    background: #00C3EB;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
    text-transform: none;
    letter-spacing: 0;
    white-space: nowrap;
    line-height: 1;
    height: 32px; /* Фиксированная высота кнопки */
    display: flex;
    align-items: center;
    justify-content: center;
}
.callback-button:hover { background: #00C3EB; }
.callback-button:active { background: #00C3EB; }

/* Контейнер для поиска */
.search-container {
    flex-shrink: 0;
    height: 40px; /* Фиксированная высота */
    display: flex;
    align-items: center;
}

/* Дополнительные стили для выравнивания поиска */
.search-container #title-search {
    display: flex;
    align-items: center;
}

.search-container input[type="text"] {
    vertical-align: middle;
    line-height: 1;
}

.info_module {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    width: 100%;
    justify-content: flex-end;
}

.block {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Выравнивание контактных данных на одном уровне */
.block.block1 p,
.block.block2 p {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 15px;
    white-space: nowrap;
    min-height: 20px;
}

.working-hours {
    display: inline-block;
    font-size: 11px;
    color: #888;
    margin-left: 15px;
    min-width: 260px;
    max-width: 100%;
    line-height: 1.35;
    vertical-align: middle;
    word-wrap: break-word;
    white-space: nowrap;
    flex-shrink: 0;
}

.block.block2 {
    width: 100%;
    max-width: none;
    min-width: 500px;
}

/* ==== Модальное окно ==== */
.callback-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none;
}
.callback-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.5);
}
.callback-modal__dialog {
    position: relative;
    margin: 6vh auto;
    max-width: 640px;
    width: calc(100% - 32px);
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,.35);
    z-index: 1;
}
.callback-modal__close {
    position: absolute;
    right: 10px;
    top: 6px;
    border: none;
    background: transparent;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

/* Блокировка скролла */
body.modal-open { overflow: hidden; }

/* === Стили формы (как в вашем примере) === */
span.mf-req {
    color: red;
}

/* Цвет для стандартных ошибок Bitrix */
.form_block font.errortext,
.form_block .errortext {
    color: red !important;
}

/* Ошибки под полем, со смещением вправо как в исходной форме */
.error-message {
    color: red;
    font-size: 12px;
    display: block;
    margin-top: 5px;
    margin-left: 50%;
}

div.mf-ok-text {
    color: green;
    font-weight: bold;
    padding-bottom: 1em;
}

.captcha-img {
    float: left;
    height: 65px;
    width: 200px;
    overflow: hidden;
    margin-bottom: 10px;
}

#captcha_word {
    height: 36px;
    padding-left: 5px;
    width: 170px;
    font-size: 18px;
    border: 1px solid #DEDEDE;
}

/* Скрываем колесо загрузки Битрикс */
div[id^="wait_comp_"] {
    display: none !important;
}

/* Всплывающее окно (успешная отправка) */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.popup-content {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
    position: relative;
}

.popup-content h3 {
    margin-top: 0;
    color: #28a745;
    font-size: 24px;
    margin-bottom: 20px;
}

.popup-content p {
    margin-bottom: 15px;
    line-height: 1.5;
    color: #333;
}

.popup-button-container {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.popup-close {
    background-color: #00C3EB;
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease;
    min-width: 120px;
}

.popup-close:hover {
    background-color: #00C3EB;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideIn { from { opacity: 0; transform: translateY(-50px); } to { opacity: 1; transform: translateY(0); } }

/* === Стили для полей формы в модалке === */
.callback-modal .form_block {
    padding: 0 10px;
    margin: 0;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.callback-modal .form_block h3 {
    color: #00C3EB;
    font-size: 24px;
    margin: 0 0 15px 0;
    text-align: center;
    text-transform: uppercase;
    font-weight: bold;
}

/* ——— УМЕНЬШАЕМ "или" В 1,5 РАЗА ——— */
.callback-modal .form_block h3 .or-text {
    font-size: 16px; /* 24 / 1.5 = 16 */
    font-weight: normal;
    margin: 0 5px;
    vertical-align: middle;
}

/* ССЫЛКА "ПОЗВОНИТЕ НАМ" - ГОЛУБАЯ С ПРИНУДИТЕЛЬНЫМ ПЕРЕОПРЕДЕЛЕНИЕМ */
.callback-modal .form_block h3 .callback-link,
.callback-modal .form_block h3 a.callback-link,
.callback-modal .form_block h3 a[href].callback-link,
.callback-modal .form_block h3 .callback-link:link,
.callback-modal .form_block h3 .callback-link:visited,
.callback-modal .form_block h3 .callback-link:active,
.callback-modal .form_block h3 .callback-link:focus {
    all: unset !important;
    color: #00C3EB !important;
    font-size: 24px !important;
    font-weight: bold !important;
    text-decoration: underline !important;
    cursor: pointer !important;
    display: inline !important;
    font-family: 'OpenSansBold', sans-serif !important;
    text-transform: uppercase !important;
    line-height: 24px !important;
}

.callback-modal .form_block h3 .callback-link:hover {
    color: #00C3EB !important;
    text-decoration: none !important;
}

.callback-modal .form_block p {
    color: #666;
    font-size: 11px;
    line-height: 1.4;
    margin: 0 0 20px 0;
    text-align: center;
}

.callback-modal .form_row {
    margin-bottom: 15px;
    width: 100%;
    box-sizing: border-box;
    padding: 0 5px;
}

.callback-modal .form_row:last-child {
    margin-bottom: 0;
}

.callback-modal label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
    font-size: 14px;
    padding: 0 5px;
}

.callback-modal .inputbox {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
    font-family: inherit;
    max-width: 100%;
}

.callback-modal textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    min-height: 80px;
    max-height: 200px;
    resize: vertical;
    overflow-x: hidden;
    box-sizing: border-box;
    font-family: inherit;
}

.callback-modal textarea.inputbox {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    min-height: 80px;
    max-height: 200px;
    resize: vertical;
    box-sizing: border-box;
    font-family: inherit;
    overflow-x: hidden;
}

.callback-modal .button {
    background: #00C3EB;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 12px 30px;
    font-size: 16px;
    cursor: pointer;
    width: 100%;
    margin-top: 10px;
    font-weight: 500;
    box-sizing: border-box;
}

.callback-modal .button:hover {
    background: #00C3EB;
}

.callback-modal .clear {
    clear: both;
    height: 0;
    line-height: 0;
}

/* Стили для reCAPTCHA */
.callback-modal .g-recaptcha {
    margin: 15px 0;
    display: flex;
    justify-content: center;
    padding: 0 10px;
}

/* Стили для чекбокса согласия - добавляем отступы */
.callback-modal .form_row p {
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0 10px;
    box-sizing: border-box;
}

.callback-modal .form_row p input[type="checkbox"] {
    margin-right: 8px;
    transform: scale(1.2);
    flex-shrink: 0;
}

.callback-modal .form_row p span {
    font-size: 14px;
    color: #333;
    line-height: 1.4;
    word-wrap: break-word;
}

/* Стили для ссылки в согласии */
.callback-modal .form_row p span a {
    color: #00C3EB;
    text-decoration: underline;
}

.callback-modal .form_row p span a:hover {
    color: #00C3EB;
    text-decoration: none;
}

/* Стили для обязательных полей */
.callback-modal .mf-req {
    color: red;
    font-weight: bold;
}

/* Стили для ошибок */
.callback-modal .error-message {
    color: red;
    font-size: 12px;
    margin-top: 5px;
    display: block;
    padding: 0 5px;
}

/* Стили для успешного сообщения */
.callback-modal .mf-ok-text {
    color: green;
    font-weight: bold;
    padding: 10px;
    background: #f0f8f0;
    border: 1px solid #90EE90;
    border-radius: 4px;
    margin: 10px 0;
}

.mobile-contacts {
    display: none;
}

/* === Адаптивные стили для мобильных устройств === */
@media screen and (max-width: 800px) {
    /* Скрываем десктопные элементы */
    .info_module { 
        display: none !important; 
    }
    
    .company-description { 
        display: none !important; 
    }
    
    /* Показываем мобильные контакты */
    .mobile-contacts {
        display: block;
        background: #f8f8f8;
        padding: 10px 15px;
        border-top: 1px solid #eee;
    }
    
    .mobile-contact-item {
        display: flex;
        align-items: center;
        margin-bottom: 8px;
        font-size: 14px;
    }
    
    .mobile-contact-item:last-child { 
        margin-bottom: 0; 
    }
    
    .mobile-contact-item img { 
        width: 16px; 
        height: 16px; 
        margin-right: 8px; 
    }
    
    /* Структура шапки для мобильных */
    .header-content { 
        flex-direction: row !important; 
        justify-content: space-between !important; 
        align-items: center !important;
        width: 100% !important;
        gap: 10px !important;
    }
    
    .logo-container { 
        order: 1 !important;
        max-width: none !important; 
        width: auto !important; 
        flex-direction: row !important; 
        align-items: center !important; 
        gap: 10px !important;
        flex-shrink: 0 !important;
    }
    
    .logo-container .logo {
        height: 60px !important;
        width: 100px !important;
        background-size: contain !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    #header {
        position: fixed !important;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        background: #fff;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        padding: 8px 0 !important;
        min-height: 50px !important;
    }
    
    .topmenu { 
        margin-top: 0 !important; 
        position: relative; 
        z-index: 999; 
    }
    
    /* ПРИНУДИТЕЛЬНО ПОКАЗЫВАЕМ БЛОК С КНОПКОЙ И ПОИСКОМ - КАК НА ДЕСКТОПЕ */
    .search-callback-row {
        display: flex !important;
        align-items: center !important;
        justify-content: flex-end !important;
        gap: 15px !important;
        margin-top: 0 !important;
        width: 100% !important;
        padding-right: 30px !important;
        min-height: 40px !important;
        visibility: visible !important;
        opacity: 1 !important;
        order: 2 !important;
        flex: 1 !important;
        margin-left: 15px !important;
        margin-right: 15px !important;
    }
    
    .search-container {
        display: flex !important;
        align-items: right !important;
        flex-shrink: 0 !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    #title-search {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .callback-button-container {
        display: flex !important;
        align-items: center !important;
        flex-shrink: 0 !important;
        visibility: visible !important;
        opacity: 1 !important;
        margin-right: 15px !important;
        height: 40px !important;
    }
    
    .callback-button {
        background: none !important;
        border: none !important;
        padding: 0 !important;
        font-size: 14px !important;
        font-weight: 500 !important;
        color: #00C3EB !important;
        text-decoration: none !important;
        cursor: pointer !important;
        transition: color 0.2s ease !important;
        border-radius: 0 !important;
        white-space: nowrap !important;
        display: inline-block !important;
        visibility: visible !important;
        opacity: 1 !important;
        height: 32px !important;
        line-height: 32px !important;
    }
    
    .callback-button:hover {
        color: #00C3EB !important;
        background: none !important;
    }
    
    .callback-button:active {
        color: #00C3EB !important;
        background: none !important;
    }
    
    .search_button {
        position: absolute !important;
        right: 5px !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        margin: 0 !important;
        vertical-align: middle !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    /* МОДАЛЬНОЕ ОКНО ДЛЯ МОБИЛЬНЫХ - МЕНЬШЕ */
    .callback-modal__dialog {
        margin: 2vh auto !important;
        max-width: 95% !important;
        width: calc(100% - 20px) !important;
        padding: 15px !important;
    }
    
    .callback-modal .form_block h3 {
        font-size: 20px !important;
        margin: 0 0 10px 0 !important;
    }

    .callback-modal .form_block h3 .or-text {
        font-size: 13px !important; /* 20 / 1.5 &#8776; 13 */
    }
    
    /* ССЫЛКА "ПОЗВОНИТЕ НАМ" ДЛЯ МОБИЛЬНЫХ */
    .callback-modal .form_block h3 .callback-link,
    .callback-modal .form_block h3 a.callback-link {
        font-size: 20px !important;
        color: #00C3EB !important;
        line-height: 20px !important;
    }
    
    .callback-modal .form_block p {
        font-size: 10px !important;
        margin: 0 0 15px 0 !important;
        line-height: 1.3 !important;
    }
    
    .callback-modal .form_row {
        margin-bottom: 12px !important;
        padding: 0 3px !important;
    }
    
    .callback-modal label {
        font-size: 13px !important;
        margin-bottom: 3px !important;
        padding: 0 3px !important;
    }
    
    .callback-modal .inputbox {
        padding: 8px 10px !important;
        font-size: 13px !important;
    }
    
    .callback-modal textarea {
        padding: 8px 10px !important;
        font-size: 13px !important;
        min-height: 60px !important;
        max-height: 150px !important;
    }
    
    .callback-modal .button {
        padding: 10px 20px !important;
        font-size: 14px !important;
        margin-top: 8px !important;
    }
    
    .callback-modal .g-recaptcha {
        margin: 10px 0 !important;
        transform: scale(0.85) !important;
        transform-origin: center !important;
    }
    
    .callback-modal .form_row p {
        padding: 0 5px !important;
    }
    
    .callback-modal .form_row p span {
        font-size: 12px !important;
        line-height: 1.3 !important;
    }
    
    .callback-modal__close {
        right: 8px !important;
        top: 4px !important;
        font-size: 20px !important;
    }
}

@media (min-width: 768px) {
    #header {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 1000 !important;
    }
}

/* === ИСПРАВЛЕНИЕ ФОРМЫ ОБРАТНОГО ЗВОНКА В РЕЖИМЕ ПРАВКИ === */

/* Исправляем позиционирование формы в режиме правки */
body.bx-admin-panel .callback-modal {
    z-index: 10000 !important;
}

body.bx-admin-panel .callback-modal__dialog {
    margin: 2vh auto !important;
    max-width: 600px !important;
    width: calc(100% - 20px) !important;
    background: #fff !important;
    border-radius: 10px !important;
    padding: 25px !important;
    box-shadow: 0 20px 60px rgba(0,0,0,.35) !important;
    position: relative !important;
}

/* Исправляем кнопку закрытия */
body.bx-admin-panel .callback-modal__close {
    position: absolute !important;
    right: 15px !important;
    top: 15px !important;
    border: none !important;
    background: transparent !important;
    font-size: 24px !important;
    line-height: 1 !important;
    cursor: pointer !important;
    color: #999 !important;
    padding: 0 !important;
    width: 30px !important;
    height: 30px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

body.bx-admin-panel .callback-modal__close:hover {
    color: #333 !important;
}

/* Адаптивность для мобильных в режиме правки */
@media screen and (max-width: 768px) {
    body.bx-admin-panel .callback-modal__dialog {
        width: calc(100% - 10px) !important;
        padding: 20px !important;
        margin: 1vh auto !important;
    }
}

/* ДОПОЛНИТЕЛЬНОЕ ПЕРЕОПРЕДЕЛЕНИЕ ДЛЯ ССЫЛКИ "ПОЗВОНИТЕ НАМ" */
a.callback-link,
.callback-link[href],
.callback-link:any-link {
    color: #00C3EB !important;
    text-decoration: underline !important;
}

.callback-link:hover,
.callback-link:focus,
.callback-link:active {
    color: #00C3EB !important;
    text-decoration: none !important;
}
@media (max-width: 800px) {
  #mobile-contacts { display: none !important; }
  .topmenu #drop_down #mobile-contacts { display: block !important; }
}
