/* ==========================================================================
   responsive.css — адаптивный слой сайта aedon.ru
   Этап 1 плана «Глобальный каркас» (docs/responsive-plan.md, раздел 4).

   Правила игры:
   1. Десктоп (>=992px) не меняется. Всё, что может повлиять на десктопную
      вёрстку, живёт внутри @media (max-width: ...).
   2. Файл аддитивный: main.css не переписываем (там 4423 строки с !important
      и разнородной кодировкой комментариев).
   3. Подключается последним, после main.css и lead_time.css.
   4. Брейкпоинты совместимы с Bootstrap 3:
        lg  >= 992px   — не трогаем
        md  768–991px  — планшеты/крупные телефоны
        xs  <= 767px   — телефоны
        xx  <= 575px   — узкие телефоны
   ========================================================================== */

/* --------------------------------------------------------------------------
   0. База: правила, которые не влияют на внешний вид десктопа
   -------------------------------------------------------------------------- */

html
{
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/* Телефон в шапке становится ссылкой tel: — внешне остаётся прежним текстом */
.header_phoneblock h3 a
{
    color: inherit;
    text-decoration: none;
    font-weight: inherit;
}

.header_phoneblock h3 a:hover,
.header_phoneblock h3 a:focus,
.header_phoneblock h3 a:visited
{
    color: inherit;
    text-decoration: none;
}

/* Телефон в тексте модалки «Заказать нестандартную продукцию» стал ссылкой
   tel: — внешне остаётся прежним текстом, включая hover */
.list-tire a[href^="tel:"]
{
    color: inherit;
    text-decoration: none;
}

/* Телефоны на страницах «Контакты» и «Складские излишки» были обычным
   текстом — стали ссылками tel:. Внешне остаются прежним текстом,
   иначе десктопная версия поменялась бы. */
.contacts-wrap a[href^="tel:"],
.contacts-addresses a[href^="tel:"],
.manager-list-contact a[href^="tel:"],
.contacts-support a[href^="tel:"]
{
    color: inherit;
    text-decoration: none;
}

.contacts-wrap a[href^="tel:"]:hover,
.contacts-wrap a[href^="tel:"]:focus,
.contacts-addresses a[href^="tel:"]:hover,
.contacts-addresses a[href^="tel:"]:focus,
.manager-list-contact a[href^="tel:"]:hover,
.manager-list-contact a[href^="tel:"]:focus,
.contacts-support a[href^="tel:"]:hover,
.contacts-support a[href^="tel:"]:focus
{
    color: inherit;
    text-decoration: underline;
}

/* Баг main.css: `.cookie-consent--hidden { display: none }` объявлено раньше,
   чем `@media (max-width: 767px) { .cookie-consent { display: block } }`,
   и с той же специфичностью. На мобильном «Принять»/«Отклонить» срабатывают
   (согласие сохраняется), но баннер остаётся на экране. Поднимаем
   специфичность — состояние hidden теперь выигрывает на всех ширинах. */
.cookie-consent.cookie-consent--hidden
{
    display: none;
}

/* Кнопка мобильного меню существует только на мобильном */
.navtoggle
{
    display: none;
}

/* Видимый фокус для клавиатуры внутри мобильного меню: без него по нему
   нельзя ходить с клавиатуры. На десктопе поведение фокуса не меняем —
   main.css сознательно гасит outline, это отдельное решение по доступности. */


/* ==========================================================================
   1. Планшеты и телефоны: 768–991px и уже (md + xs)
   ========================================================================== */
@media (max-width: 991px)
{
    a:focus-visible,
    button:focus-visible,
    input:focus-visible,
    select:focus-visible,
    textarea:focus-visible,
    [tabindex]:focus-visible
    {
        outline: 2px solid #199adb;
        outline-offset: 2px;
    }
    /* ----------------------------------------------------------------------
       1.1. Контейнер и типографика
       ---------------------------------------------------------------------- */
    .container,
    .headline_inside
    {
        width: auto;
        max-width: 960px;
        padding-left: 16px;
        padding-right: 16px;
    }

    .row
    {
        margin-left: -8px;
        margin-right: -8px;
    }

    [class*="col-"]
    {
        padding-left: 8px;
        padding-right: 8px;
    }

    body
    {
        font-size: 16px;
        line-height: 1.5;
        /* Длинные e-mail, артикулы и URL не должны раздвигать страницу:
           свойство наследуемое, ломает слово только если оно не влезает */
        overflow-wrap: break-word;
        word-wrap: break-word;
    }

    h1, .h1
    {
        font-size: 26px;
    }

    h2, .h2
    {
        font-size: 22px;
    }

    h3, .h3
    {
        font-size: 19px;
    }

    /* Медиа не может вылезать за экран */
    img,
    iframe,
    video,
    svg,
    table
    {
        max-width: 100%;
    }

    img
    {
        height: auto;
    }

    /* ----------------------------------------------------------------------
       1.2. Каркас страницы и «tricky footer»
       main.css:2228–2247 держит футер на отрицательном отступе и резервирует
       220px под него. На мобильном высота футера другая — отключаем приём.
       ---------------------------------------------------------------------- */
    html,
    body
    {
        height: auto;
    }

    .globalwrap
    {
        min-height: 0;
    }

    .globalwrap content .container
    {
        padding-bottom: 0;
    }

    footer
    {
        margin-top: 24px;
    }

    /* Колонки футера в один столбец */
    footer .row > [class*="col-"]
    {
        float: none;
        width: auto;
        text-align: left;
    }

    footer .row > [class*="col-"] + [class*="col-"]
    {
        margin-top: 18px;
    }

    footer p
    {
        margin: 0 0 10px;
    }

    /* Иконки соцсетей — крупнее, чтобы попадать пальцем */
    footer .soc_icon
    {
        width: 40px;
        height: 40px;
        margin-right: 10px;
    }

    footer a
    {
        display: inline-block;
    }

    /* ----------------------------------------------------------------------
       1.3. Верхняя полоса и шапка
       ---------------------------------------------------------------------- */
    .headline
    {
        height: auto;
        min-height: 0;
        padding: 0;
        font-size: 13px;
        line-height: 1.35;
    }

    .headline_inside
    {
        padding-top: 0;
    }

    .headline_link
    {
        display: inline-flex;
        align-items: center;
        min-height: 44px;
        padding: 0 2px;
    }

    .headline_links
    {
        text-align: right;
    }

    .header_logorow
    {
        padding-top: 12px;
        padding-bottom: 8px;
    }

    .header_logo
    {
        margin-top: 0;
    }

    .header_phoneblock h3
    {
        margin-top: 0;
    }

    /* ----------------------------------------------------------------------
       1.4. Мобильная навигация
       Разметка меню не дублируется: та же <ul class="nav navbar-nav">,
       меняются только CSS и класс состояния is-open.
       ---------------------------------------------------------------------- */
    .navtoggle
    {
        order: 1;
        display: inline-flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 5px;
        width: 44px;
        height: 44px;
        padding: 0;
        border: 1px solid #d6e4ed;
        border-radius: 8px;
        background: #fff;
        cursor: pointer;
    }

    .navtoggle__bar
    {
        display: block;
        width: 22px;
        height: 2px;
        background: #302e2f;
        transition: transform 0.2s ease, opacity 0.2s ease;
    }

    .navbar.is-open .navtoggle__bar:nth-child(1)
    {
        transform: translateY(7px) rotate(45deg);
    }

    .navbar.is-open .navtoggle__bar:nth-child(2)
    {
        opacity: 0;
    }

    .navbar.is-open .navtoggle__bar:nth-child(3)
    {
        transform: translateY(-7px) rotate(-45deg);
    }

    .navbar
    {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        min-height: 52px;
        padding-bottom: 8px;
    }

    .navbar-search
    {
        order: 2;
        float: none;
        top: 0;
        margin-left: auto;
    }

    .header-cart
    {
        width: 44px;
        height: 44px;
        background-size: 28px 28px;
        margin-left: 0;
    }

    .header-cart-count
    {
        left: auto;
        right: 2px;
        top: 2px;
    }

    /* Список меню: скрыт, пока не открыт */
    .navbar-nav
    {
        order: 3;
        display: none;
        float: none;
        flex: 0 0 100%;
        width: 100%;
        margin: 8px 0 4px;
    }

    .navbar.is-open .navbar-nav
    {
        display: block;
        /* Прокрутка страницы заблокирована, поэтому длинное меню должно
           прокручиваться само — иначе нижние пункты недостижимы. */
        max-height: calc(100vh - 200px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }

    .navbar-nav > li
    {
        float: none;
        margin-right: 0;
        padding-bottom: 0;
        border-bottom: 1px solid #e6eef4;
    }

    .navbar-nav > li:last-child
    {
        border-bottom: none;
    }

    .navbar-nav > li > a,
    .nested > a
    {
        display: flex;
        align-items: center;
        min-height: 48px;
        padding: 12px 0;
        font-size: 17px;
        line-height: 1.25;
    }

    .nested > a
    {
        justify-content: space-between;
        /* Родитель подменю теперь кнопка-аккордеон */
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    /* Шеврон рисуем треугольником из border: не зависит от transform
       и от SVG-фона main.css. Закрыт — «вправо», раскрыт — «вниз».
       Специфичность (0,2,2) нужна, чтобы hover-правило main.css
       `.nested:hover > a:after` (0,2,1) не возвращало width/height 7×18
       и не превращало треугольник в столб. */
    .navbar-nav > li.nested > a:after,
    .navbar-nav > li.nested:hover > a:after
    {
        position: static;
        display: block;
        width: 0;
        height: 0;
        margin-left: auto;
        vertical-align: baseline;
        background: none;
        border-style: solid;
        border-width: 5px 0 5px 6px;
        border-color: transparent transparent transparent #302e2f;
    }

    .navbar-nav > li.nested.is-open > a:after,
    .navbar-nav > li.nested.is-open:hover > a:after
    {
        border-width: 6px 5px 0 5px;
        border-color: #302e2f transparent transparent transparent;
    }

    /* Подменю — обычный аккордеон внутри колонки, не выпадашка */
    .navbar-subnav
    {
        position: static;
        display: none;
        width: 100%;
        min-width: 0;
        max-width: none;
        margin: 0 0 10px;
        padding: 4px 0 4px 10px;
        background: #f2fbff;
        border-radius: 8px;
        box-shadow: none;
        opacity: 1;
        transform: none;
        animation: none;
        backdrop-filter: none;
    }

    /* Специфичность (0,4,0) — перекрывает .navbar-nav > li:hover .navbar-subnav */
    .navbar-nav > li.nested.is-open > .navbar-subnav
    {
        display: block;
    }

    .navbar-subnav > li > a
    {
        display: flex;
        align-items: center;
        min-height: 44px;
        padding: 10px 12px;
        color: #00328c;
        font-size: 16px;
    }

    /* Подсветка по наведению на тач не нужна */
    .navbar-subnav > li:hover,
    .navbar-subnav > li:hover:last-child
    {
        background-color: transparent;
        border-radius: 0;
    }

    /* На мобильном подменю открывается только тапом, а не :hover */
    .navbar-nav > li:hover .navbar-subnav
    {
        display: none;
    }

    .navbar-nav > li.nested.is-open:hover > .navbar-subnav
    {
        display: block;
    }

    /* Блокировка прокрутки страницы при открытом меню */
    .nav-open
    {
        overflow: hidden;
    }

    /* ----------------------------------------------------------------------
       1.5. Модальные окна
       ---------------------------------------------------------------------- */
    .mfp-container
    {
        padding-left: 8px;
        padding-right: 8px;
    }

    .dialog-block,
    .big-dialog-block,
    .dialog-block.dialog-gforms,
    .mfp-content #modal,
    .mfp-content .distributor
    {
        width: auto;
        max-width: calc(100vw - 24px);
        max-height: calc(100vh - 24px);
        margin: 12px auto;
        padding: 24px 16px;
        overflow: auto;
        -webkit-overflow-scrolling: touch;
    }

    .dialog-block-caption
    {
        margin: 0 0 20px;
    }

    .big-dialog-block
    {
        margin-top: 12px;
    }

    .mfp-close,
    .notification-close
    {
        width: 44px;
        height: 44px;
        line-height: 44px;
        font-size: 30px;
    }

    /* Плашка «Оцените наш сервис» на мобильном: сбоку от текста она его
       перекрывает, поэтому превращаем вертикальную закладку в бейдж
       в правом нижнем углу. */
    .notification-block.vertical
    {
        left: auto;
        right: 12px;
        bottom: 12px;
        width: auto;
        max-width: calc(100vw - 24px);
        height: auto;
        padding: 12px 48px 12px 16px;
        border-radius: 8px;
        box-shadow: 0 6px 20px rgba(1, 33, 57, 0.25);
    }

    .notification-block.vertical a
    {
        transform: none;
        position: static;
        width: auto;
        left: auto;
        top: auto;
        display: block;
        font-size: 13px;
        line-height: 1.3;
    }

    .notification-block.vertical .notification-close
    {
        top: 50%;
        margin-top: -22px;
    }

    /* ----------------------------------------------------------------------
       1.6. Формы
       ---------------------------------------------------------------------- */
    /* Поле и подпись — друг под другом, на всю ширину */
    .form-element label > [class*="col-"],
    .form-element input[class*="col-"],
    .form-element select[class*="col-"],
    .form-element textarea[class*="col-"]
    {
        float: none;
        width: 100%;
        max-width: 100%;
        padding-left: 0;
        padding-right: 0;
    }

    /* 16px — иначе iOS зумит страницу при фокусе в поле */
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="password"],
    input[type="search"],
    input[type="number"],
    input[type="date"],
    select,
    textarea
    {
        width: 100%;
        max-width: 100%;
        min-height: 44px;
        font-size: 16px;
    }

    textarea
    {
        min-height: 100px;
    }

    /* ----------------------------------------------------------------------
       1.7. Кнопки и тап-таргеты
       ---------------------------------------------------------------------- */
    .submit-btn,
    .border-btn,
    .tab-link,
    .nav-pills li a
    {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 44px;
        padding: 10px 20px;
        white-space: normal;
        text-align: center;
    }

    .form-element-button .submit-btn,
    .form-button-fill-all .submit-btn
    {
        width: 100%;
    }

    .pagination a,
    .pagination span
    {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 44px;
        min-height: 44px;
    }

    /* Ссылки на файлы: крупная зона нажатия */
    .dload
    {
        min-height: 44px;
        padding-top: 12px;
        padding-bottom: 12px;
        background-position: left 0 top 11px;
    }

    .breadscrumb li
    {
        line-height: 1.6;
    }

    .breadscrumb a
    {
        display: inline-block;
        padding: 4px 0;
    }

    /* ----------------------------------------------------------------------
       1.8. Таблицы
       Горизонтальный скролл лучше, чем сжатие в кашу.
       .r-table — обёртка, которую добавляет responsive.js (в разметке её нет).
       ---------------------------------------------------------------------- */
    .table-container,
    .variation-table
    {
        max-width: 100%;
        max-height: none;
        overflow: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* «Прилипающая» шапка таблицы (fixMe) ниже 992px ломает скролл.
       Клон убирает responsive.js, CSS — страховка для первого кадра. */
    .table-container > table.fixed,
    .variation-table table.fixed
    {
        display: none;
    }

    .variation-table table
    {
        min-width: 940px;
    }

    /* Таблица вариаций ниже 992px не схлопывается по высоте, поэтому кнопка
       «Показать все» теряет смысл и лежит белой плашкой поверх строк. */
    .variation-table-show-all,
    .variation-table-show-all:before,
    .variation-table-show-all:after
    {
        display: none;
    }

    .r-table
    {
        max-width: 100%;
        margin-bottom: 12px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Минимальную ширину задаём только таблицам с 3+ колонками: узкую
       таблицу «на два столбца» незачем растягивать в скролл.
       Классы ставит responsive.js по числу колонок. */
    .r-table--medium > table
    {
        min-width: 480px;
    }

    .r-table--wide > table
    {
        min-width: 640px;
    }

    .r-table > table
    {
        margin-bottom: 0;
    }

    .r-table--medium > table.table-condensed
    {
        min-width: 440px;
    }

    /* Подбор по параметрам (/finder): .configurator-item и его таблица
       в main.css жёстко 697 px — на телефоне блок вылезал и кнопки
       «Сбросить»/«Печать» наезжали на текст результата. */
    .configurator-item,
    .configurator-item-table
    {
        width: auto;
        max-width: 100%;
        float: none;
    }

    .configurator-item
    {
        padding: 0 10px;
    }

    .configurator-item-table
    {
        margin-left: 0;
        margin-right: 0;
    }

    /* Первая колонка таблиц каталога «прилипает» при горизонтальной прокрутке:
       иначе вместе с таблицей уезжает название модели/характеристики. */
    .r-table--wide > table > thead > tr > th:first-child,
    .r-table--wide > table > tbody > tr > td:first-child,
    .table-container > table > thead > tr > th:first-child,
    .table-container > table > tbody > tr > td:first-child
    {
        position: sticky;
        left: 0;
        z-index: 3;
        background: #fff;
        box-shadow: 1px 0 0 0 #e3e3e3;
    }

    /* ----------------------------------------------------------------------
       1.9. Контент из CMS
       ---------------------------------------------------------------------- */
    .content iframe,
    .content video,
    .pageblock iframe,
    .pageblock video
    {
        max-width: 100%;
    }

    .download-list li
    {
        margin-bottom: 0;
    }

    /* Анкета: в main.css ширина поля зафиксирована в 320px
       (`.questionary_answer input[type=text]`, специфичность выше) —
       на узких телефонах поле вылезало за контейнер. */
    .questionary_answer input[type="text"],
    .questionary_answer input[type="email"],
    .questionary_answer input[type="tel"]
    {
        width: 100%;
        max-width: 100%;
    }

    /* ----------------------------------------------------------------------
       1.10. Главная страница (этап 2, частично)
       `div.configurator-block` в main.css имеет жёсткие width:294px и
       height:82px — на любой ширине меньше 992px он вылезал за контейнер.
       Это и был горизонтальный скролл главной.
       ---------------------------------------------------------------------- */
    div.configurator-block
    {
        width: auto;
        max-width: 100%;
        height: auto;
        min-height: 82px;
    }

    .configurator-promo-block
    {
        font-size: 22px;
        padding-right: 32px;
    }

    .configurator-content
    {
        display: block;
        margin-top: 4px;
    }

    /* Промо-плитка конфигуратора на страницах категорий (main.css:3859–3890):
       заголовок 30 px, фиксированная высота блока 190 px и шестерёнка в 50 %
       ширины карточки. На телефоне текст обрезался, а карточка была почти
       пустой. */
    div.configurator-dc-dc-block
    {
        height: auto;
        padding-bottom: 8px;
    }

    .configurator-dc-dc-text
    {
        font-size: 22px;
        padding-right: 0;
    }

    div.configurator-dc-dc div.icon-conf
    {
        width: 110px;
        max-width: 55%;
        margin: 0 auto;
    }

    div.configurator-dc-dc div.icon-conf svg
    {
        display: block;
        width: 100%;
        height: auto;
    }

    /* ----------------------------------------------------------------------
       1.11. Слайдер главной
       ---------------------------------------------------------------------- */
    /* Соотношение сторон берём от натурального 940×317: картинка резервирует
       место до загрузки (нет скачка layout), обрезки нет — object-fit: cover
       при точном совпадении пропорций ничего не режет.
       Правило ограничено .slideshow: на «Карьере» такой же Bootstrap-карусель,
       но фотографии 1500×1000 — общая пропорция 940/317 превращала их в
       полоску 343×116. */
    .slideshow .carousel-inner > .item > img,
    .slideshow .carousel-inner > .item > a > img
    {
        width: 100%;
        height: auto;
        aspect-ratio: 940 / 317;
        object-fit: cover;
    }

    /* Стрелки: в разметке нет иконок (Bootstrap рисует их только для
       .icon-prev/.icon-next), а в main.css они ещё и прозрачные до hover —
       на тач-экране стрелок просто нет. Делаем круглую кнопку 44×44
       с собственным шевроном. */
    .carousel-control
    {
        top: 50%;
        bottom: auto;
        width: 44px;
        height: 44px;
        margin-top: -22px;
        opacity: 0.75;
        background-color: rgba(43, 42, 41, 0.3);
        border-radius: 50%;
    }

    .carousel-control.left
    {
        left: 6px;
    }

    .carousel-control.right
    {
        right: 6px;
        left: auto;
    }

    .carousel-control:hover,
    .carousel-control:focus
    {
        opacity: 0.9;
    }

    .carousel-control:before
    {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 11px;
        height: 11px;
        margin: -6px 0 0 -6px;
        border-top: 2px solid #fff;
        border-left: 2px solid #fff;
    }

    .carousel-control.left:before
    {
        transform: rotate(-45deg);
    }

    .carousel-control.right:before
    {
        transform: rotate(135deg);
        margin-left: -4px;
    }

    /* Индикаторы: точки 12px и зона нажатия ~40px через псевдоэлемент.
       Только у слайдера главной: на «Карьере» индикаторы — миниатюры
       (carousel-thumbs), им точка 12×12 не подходит. */
    .slideshow .carousel-indicators
    {
        bottom: 4px;
    }

    .slideshow .carousel-indicators li
    {
        position: relative;
        width: 12px;
        height: 12px;
        margin: 0 12px;
    }

    /* Зона нажатия вокруг точки ~40×40 */
    .slideshow .carousel-indicators li:after
    {
        content: '';
        position: absolute;
        top: -14px;
        right: -14px;
        bottom: -14px;
        left: -14px;
    }

    /* ----------------------------------------------------------------------
       1.12. Страница «Продукция» (/products) — этап 3, первая карточка плана
       Карточки типов продукции стоят на col-xs-4: в Bootstrap 3 это «три
       колонки навсегда», поэтому на телефоне карточке доставалось ~113 px,
       а подпись в 23 px uppercase туда не влезает и ломается по буквам.
       ---------------------------------------------------------------------- */
    .products-tags-item
    {
        float: left;
        width: 50%;
        max-width: 50%;
    }

    /* Блок «Получите каталог продукции»: иллюстрация absolute 172×206 и
       padding-right:115px в узкой колонке оставляли под текст ноль ширины. */
    .catalog-stack-illustration
    {
        padding-right: 0;
    }

    .catalog-stack-illustration:after
    {
        position: static;
        display: block;
        width: 130px;
        height: 156px;
        margin: 12px auto 0;
        background-size: contain;
    }

    /* Тот же приём у блока «Footprint библиотека для Altium» на /documents:
       padding-right:72px и картинка :after 168×143 при right:-60px — текст
       ломался по буквам, а иллюстрация вылезала за карточку. */
    .tech-search-infoblock-text.footprint
    {
        padding-right: 0;
        min-height: 0;
    }

    .tech-search-infoblock-text.footprint:after
    {
        position: static;
        display: block;
        width: 150px;
        height: 128px;
        margin: 12px auto 0;
        background-size: contain;
    }
}


/* ==========================================================================
   2. Телефоны: <= 767px
   ========================================================================== */
@media (max-width: 767px)
{
    /* Шапка в две строки: логотип + телефон, слоган скрыт */
    .header_logorow
    {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
    }

    .header_logorow > .col-xs-4
    {
        float: none;
        flex: 1 1 55%;
        width: 55%;
        max-width: 55%;
    }

    .header_logorow > .col-xs-5
    {
        display: none;
    }

    .header_logorow > .col-xs-3
    {
        float: none;
        flex: 1 1 45%;
        width: 45%;
        max-width: 45%;
    }

    .header_logo
    {
        width: 160px;
        height: auto;
    }

    .header_logo img
    {
        width: 160px;
        height: auto;
    }

    .header_phoneblock
    {
        text-align: right;
        font-size: 12px;
        line-height: 1.3;
    }

    .header_phoneblock h3
    {
        font-size: 18px;
        margin-bottom: 2px;
    }

    /* .header_logorow получает display:flex, clearfix-псевдоэлементы .row
       стали бы лишними flex-элементами */
    .header_logorow:before,
    .header_logorow:after
    {
        display: none;
        content: none;
    }

    /* Формы: подпись над полем, воздух между элементами */
    .form-element
    {
        margin-bottom: 14px;
    }

    .form-element label > div:first-child
    {
        margin-bottom: 4px;
    }

    .small-caption,
    .big-text
    {
        font-size: 16px;
    }

    /* Компонент «Структура компании» (about.phtml): три логотипа партнёров
       были display:table-cell с шириной 33% и не сжимались — блок обрезал
       себя своим overflow:hidden. Ниже 767px раскладываем в столбец.
       Полная переработка контентных блоков — этап 4. */
    .about-structure
    {
        float: none;
        width: 100%;
        margin-top: 16px;
    }

    .about-structure-npo
    {
        height: 84px;
        background-size: 240px;
    }

    .about-structure-sub-wrap
    {
        display: block;
    }

    .about-structure-sub
    {
        display: block;
        width: 100%;
        padding: 14px;
    }

    .about-structure-sub + .about-structure-sub
    {
        border-left: none;
        border-top: 1px solid #e3e3e3;
    }

    .about-structure-logo
    {
        height: 44px;
        margin-bottom: 8px;
    }

    /* Модалки заказа (#order-form, #customorder-form): внутри две
       display:table-cell колонки 60/40 с отступами 50–70px и рамкой 30px.
       Table-cell не складывается в столбец — на телефоне оставалось
       ~70px текста в строке. Раскладываем блоки друг под друга. */
    .form-content-block-wrap
    {
        display: block;
    }

    .form-content-block,
    .form-content-block:nth-child(2)
    {
        display: block;
        width: auto;
        padding: 16px 0;
        border: none;
    }

    .form-content-block:nth-child(2)
    {
        margin-top: 16px;
        background: none;
    }

    /* Главная: блоки .c_b_content (новости, продукция, публикации,
       «О компании») складываются в один столбец. Правило ограничено прямой
       сеткой этих блоков — вложенные сетки карточек остаются как есть. */
    .c_b_content > [class*="col-"]
    {
        float: none;
        width: 100%;
        max-width: 100%;
    }

    /* «О компании»: у текстового блока в разметке задана высота 328px
       инлайновым стилем — на телефоне он обрезал бы текст. */
    .c_b_content.about .about-content
    {
        height: auto !important;
        margin-top: 16px;
    }

    /* Ссылка «Каталог изделий для ответственных сфер применения» в этом блоке
       выровнена по правому краю инлайновым стилем — на узком экране лучше
       по левому. */
    .c_b_content.about .blue-block p[style]
    {
        text-align: left !important;
    }
}


/* ==========================================================================
   3. Узкие телефоны: <= 575px
   ========================================================================== */
@media (max-width: 575px)
{
    body
    {
        font-size: 16px;
    }

    h1, .h1
    {
        font-size: 23px;
    }

    h2, .h2
    {
        font-size: 20px;
    }

    /* Верхняя полоса в одну строку: текст слева, «Вход» справа */
    .headline .row
    {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .headline .row:before,
    .headline .row:after
    {
        display: none;
        content: none;
    }

    .headline .col-xs-6
    {
        float: none;
        width: auto;
    }

    .headline .col-xs-6:first-child
    {
        flex: 1 1 auto;
        min-width: 0;
    }

    .headline_links
    {
        flex: 0 0 auto;
        margin-top: 0;
        text-align: right;
    }

    /* Контентные страницы: колонки в один столбец.
       Правило ограничено .pageblock (контентная часть страницы), а не всей
       сеткой: шапка, футер, формы и модальные окна живут по своим правилам.
       На 360–575px две колонки дают по 4–5 слов в строке — читать невозможно. */
    .pageblock .row > [class*="col-"]
    {
        float: none;
        width: 100%;
        max-width: 100%;
    }

    .navbar-nav > li > a,
    .nested > a
    {
        font-size: 16px;
    }

    .dialog-block,
    .big-dialog-block,
    .mfp-content #modal,
    .mfp-content .distributor
    {
        padding: 20px 12px;
    }

    .dialog-block-caption
    {
        font-size: 20px;
    }

    /* Карточки продукции на главной: по одной в строке, чтобы описание
       не сжималось в 170-пиксельную колонку. */
    .prod_col
    {
        float: none;
        width: 100%;
        max-width: 100%;
    }

    /* «Продукция» (/products): на телефоне карточки в одну колонку —
       подпись 23 px uppercase в две колонки не влезает. */
    .products-tags-item
    {
        float: none;
        width: 100%;
        max-width: 100%;
    }

    .products-tag
    {
        height: 180px;
    }

    /* «Техническая информация» (/documents): боковая колонка с промо-блоками
       уходит под форму выбора серии и модели. */
    .documents-layout > [class*="col-"]
    {
        float: none;
        width: 100%;
        max-width: 100%;
    }

    /* Подбор по параметрам (/finder): форма-фильтр (col-xs-3) и результаты
       (col-xs-9). В 87 px кнопки «Сбросить»/«Печать» наезжали на текст
       результата — на телефоне раскладываем в один столбец. */
    .configurator-big > [class*="col-"]
    {
        float: none;
        width: 100%;
        max-width: 100%;
    }

    .configurator-results-form
    {
        margin-bottom: 16px;
    }

    /* ----------------------------------------------------------------------
       Карточка товара: серия, модель, аксессуар, анкета (этап 3)
       .product-main — описание (col-xs-7) и фото с кнопками (col-xs-5),
       .product-info — «Особенности» и «Документация» (col-xs-6 + col-xs-6).
       На телефоне это две колонки по ~170 px: текст читается по 3–4 слова.
       ---------------------------------------------------------------------- */
    .product-main > [class*="col-"],
    .product-info > [class*="col-"]
    {
        float: none;
        width: 100%;
        max-width: 100%;
    }

    .product-main .product-card-image
    {
        margin-top: 16px;
    }

    .product-model-param-name
    {
        width: 100%;
    }
}


/* ==========================================================================
   5. Транзакционные страницы (этап 5): корзина, заказ, анкета, авторизация
   Страницы: basketPage, orderPage/orderInfo/orderSuccess, questionary,
   configurator, User*.

   Всё, что меняет вид, — внутри @media: десктоп (>=992px) остаётся прежним.
   Вне медиа — только «нейтральные» правила для элементов, которые из <div>
   стали <button> (этап 5), и скрытие новых мобильных блоков.
   ========================================================================== */

/* Кнопки количества и удаления в корзине были <div> с onclick из main.js.
   Теперь это <button type="button">: доступны с клавиатуры и скринридеру.
   Возвращаем им вид прежних <div>: без отступов и системного фона.
   (У ± рамку рисует main.css, её не трогаем.) */
.cart-item-count-less,
.cart-item-count-more,
.cart-item-delete
{
    padding: 0;
    background-color: transparent;
    -webkit-appearance: none;
    appearance: none;
    font: inherit;
    color: inherit;
    line-height: 1;
}

.cart-item-delete
{
    border: 0;
}

/* Новые мобильные блоки: на десктопе их нет */
.checkout-steps,
.questionary-progress
{
    display: none;
}


/* --------------------------------------------------------------------------
   5.1. Планшеты и телефоны: <= 991px
   -------------------------------------------------------------------------- */
@media (max-width: 991px)
{
    /* --- Корзина ---------------------------------------------------------
       В main.css строка позиции — четыре колонки col-xs-3/6/2/1, а кнопки
       «−» и «+» — квадраты 15x15 px. Ниже 992px переводим ту же разметку на
       flex: картинка фиксированной ширины, описание тянется, количество и
       удаление — крупные зоны нажатия. Разметку не дублируем. */
    .basket_page_item > .row
    {
        display: flex;
        flex-wrap: nowrap;
        align-items: flex-start;
    }

    /* У .row в Bootstrap есть clearfix-псевдоэлементы: в flex-контейнере
       они стали бы лишними элементами */
    .basket_page_item > .row:before,
    .basket_page_item > .row:after
    {
        display: none;
        content: none;
    }

    .basket_page_item > .row > [class*="col-"]
    {
        float: none;
    }

    .basket_page_item > .row > .col-xs-3
    {
        flex: 0 0 150px;
        width: 150px;
        max-width: 150px;
    }

    .basket_page_item > .row > .col-xs-6
    {
        flex: 1 1 auto;
        width: auto;
        max-width: none;
        min-width: 0;
    }

    .basket_page_item > .row > .col-xs-2
    {
        flex: 0 0 150px;
        width: 150px;
        max-width: 150px;
    }

    .basket_page_item > .row > .col-xs-1
    {
        flex: 0 0 44px;
        width: 44px;
        max-width: 44px;
    }

    /* Кнопки количества: flex без промежутков между инлайновыми элементами,
       иначе 44+44+44 не влезают в колонку с внутренними отступами */
    .cart-item-count
    {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .cart-item-count-value
    {
        flex: 0 0 44px;
    }

    .cart-item-count-less,
    .cart-item-count-more
    {
        width: 44px;
        height: 44px;
        background-size: 14px 14px;
    }

    .cart-item-count-value input
    {
        width: 44px;
        min-height: 44px;
        padding: 0 4px;
    }

    .cart-item-delete
    {
        float: none;
        width: 44px;
        height: 44px;
        margin-left: 0;
        background-size: 24px 24px;
    }

    .cart-item-controls
    {
        margin-top: 20px;
    }

    /* --- Оформление заказа ----------------------------------------------
       .row с «позициями» (col-xs-6) и «анкетой» (col-xs-6): на планшете это
       две колонки по ~370 px, на телефоне — по 170 px. Складываем в один
       столбец, подписи полей ставим над полями. */
    .order-layout > [class*="col-"]
    {
        float: none;
        width: 100%;
        max-width: 100%;
    }

    .order-layout .form-horizontal .form-group > label,
    .order-layout .form-horizontal .form-group > [class*="col-"]
    {
        float: none;
        width: 100%;
        max-width: 100%;
        padding-left: 0;
        padding-right: 0;
        text-align: left;
    }

    .order-layout .form-horizontal .control-label
    {
        margin-bottom: 4px;
        padding-top: 0;
        font-weight: 600;
    }

    .order-layout .panel-footer
    {
        text-align: left;
    }

    /* --- «Информация для заказа» ----------------------------------------
       Текст (col-xs-8) и карточка «Индивидуальные разработки» (col-xs-4):
       в 113 px заголовок ломался по буквам, кнопка вылезала за экран. */
    .order-info-layout > [class*="col-"]
    {
        float: none;
        width: 100%;
        max-width: 100%;
    }

    .order-info-layout .borderBlock
    {
        margin-top: 16px;
        padding: 16px;
    }

    .order-info-layout .border-btn
    {
        display: block;
        width: 100%;
        margin-right: 0;
        text-align: center;
    }

    /* --- Анкета: горизонтальная шкала -----------------------------------
       radio_horizontal — два подписанных края по 104 px плюс пять вариантов
       в одну строку: 522 px, страница уезжала за экран. Края шкалы ставим
       отдельными строками, варианты — крупными «чипами» 44x44. */
    .radio-horizontal-wrap
    {
        flex-wrap: wrap;
        justify-content: center;
        gap: 4px;
        margin: 14px 0;
    }

    .radio-horizontal-wrap > .answer-selector-sides
    {
        flex: 0 0 100%;
        width: 100%;
        min-width: 0;
        margin: 0;
        color: #666;
        font-size: 13px;
        line-height: 1.3;
    }

    .radio-horizontal-wrap > label
    {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        min-width: 44px;
        min-height: 44px;
        margin: 0 2px;
        padding: 2px 8px;
        border: 1px solid #d6e4ed;
        border-radius: 8px;
        text-align: center;
    }

    .radio-horizontal-wrap > label input
    {
        margin: 0;
    }

    /* --- Анкета: шкала-слайдер -------------------------------------------
       .slider.slider-horizontal в main.css — 254 px с полями по 30 px и
       подписями краёв 104 px: шире телефона. Подписи ставим над шкалой,
       шкалу центрируем (её ширину задаёт bootstrap-slider, не трогаем). */
    .interval-answer-wrap
    {
        text-align: center;
    }

    .interval-answer-wrap .answer-selector-sides
    {
        display: block;
        width: auto;
        min-width: 0;
        margin: 0;
        color: #666;
        font-size: 13px;
    }

    .slider.slider-horizontal
    {
        margin: 8px auto 12px;
    }

    /* --- Анкета: колонка формы --------------------------------------------
       В шаблоне заголовок — col-xs-12, а вопросы — col-xs-7 (58 % ширины).
       На телефоне это 218 px: текст ломается по 3–4 слова, поля получают
       200 px, а шкала-слайдер (254 px) вылезает за колонку. */
    .questionary-form > .row > [class*="col-"]
    {
        float: none;
        width: 100%;
        max-width: 100%;
    }

    /* --- Анкета: обязательные вопросы и ошибки ---------------------------
       Раньше ошибка была только красной рамкой поля и мелким текстом снизу.
       Теперь это заметная плашка под вопросом. */
    .questionary_answer label.error
    {
        margin: 6px 0 0;
        padding: 8px 10px;
        border-left: 3px solid #b3261e;
        border-radius: 4px;
        background: #fff1f0;
        color: #b3261e;
        font-size: 14px;
        line-height: 1.35;
    }

    .questionary_answer input.error,
    .questionary_answer textarea.error,
    .questionary_answer select.error
    {
        border-color: #b3261e;
        background: #fff8f7;
    }

    .questionary_answer .radio-vertical-wrap label
    {
        display: flex;
        align-items: center;
        gap: 8px;
        min-height: 44px;
        margin: 0 0 8px;
    }

    /* --- Конфигуратор ----------------------------------------------------
       /configurator и /finder — один виджет (configurator.js). Блок формы
       в main.css без ширины и в колонке 3 из 12 сжимался в 87 px. */
    .configurator-results-form
    {
        width: auto;
        max-width: 100%;
    }

    /* --- Авторизация -----------------------------------------------------
       Страницы User* собраны из «голых» input без классов. Кнопка была
       системной 74x26. */
    .auth-form input
    {
        margin-bottom: 10px;
    }

    .auth-form input[type="submit"]
    {
        display: block;
        width: 100%;
        min-height: 44px;
        margin-top: 4px;
        font-size: 16px;
    }
}


/* --------------------------------------------------------------------------
   5.2. Телефоны: <= 767px
   -------------------------------------------------------------------------- */
@media (max-width: 767px)
{
    /* --- Корзина: позиция превращается в карточку ------------------------
       Картинка 88 px слева, название и параметры справа, удаление — в углу,
       количество — отдельной строкой во всю ширину карточки. */
    .basket_page_item
    {
        padding: 20px 0;
    }

    .basket_page_item > .row
    {
        position: relative;
        flex-wrap: wrap;
        padding-right: 44px;
    }

    .basket_page_item > .row > .col-xs-3
    {
        flex: 0 0 88px;
        width: 88px;
        max-width: 88px;
    }

    .basket_page_item > .row > .col-xs-6
    {
        flex: 1 1 calc(100% - 88px);
        width: calc(100% - 88px);
        max-width: calc(100% - 88px);
        padding-left: 12px;
    }

    .basket_page_item > .row > .col-xs-2
    {
        flex: 0 0 100%;
        width: 100%;
        max-width: 100%;
        margin-top: 12px;
    }

    .basket_page_item > .row > .col-xs-1
    {
        position: absolute;
        top: 0;
        right: 0;
    }

    .cart-item-count
    {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: flex-start;
        gap: 8px;
        text-align: left;
    }

    .cart-item-count-value
    {
        flex: 1 1 auto;
    }

    .cart-item-count-value input
    {
        width: 100%;
        min-height: 44px;
        font-size: 18px;
    }

    .cart-item-count-savebut
    {
        flex: 1 1 100%;
        width: 100%;
        margin-top: 0;
    }

    .cart-item-name
    {
        margin-top: 0;
        font-size: 17px;
        line-height: 1.35;
    }

    .cart-item-type
    {
        font-size: 13px;
    }

    /* Кнопки «Распечатать» / «Оформить заказ» — липкая панель внизу экрана:
       в длинной корзине не нужно мотать страницу, чтобы оформить заказ.
       Класс has-basket-bar ставит responsive.js: он резервирует под панель
       место в конце страницы, чтобы футер не прятался за ней. */
    .basket-page .cart-item-controls
    {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1055;
        display: flex;
        gap: 8px;
        margin: 0;
        padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
        background: #fff;
        border-top: 1px solid #e3e3e3;
        box-shadow: 0 -6px 16px rgba(1, 33, 57, 0.08);
        text-align: left;
    }

    .basket-page .cart-item-controls > a
    {
        flex: 1 1 0;
        min-width: 0;
        margin: 0;
    }

    .has-basket-bar
    {
        padding-bottom: 80px;
    }

    /* Плашка «Оцените наш сервис» в правом нижнем углу перекрывает панель
       оформления заказа — на странице корзины её не показываем. Плашка
       лежит в layoutBottom, вне .container, поэтому цепляемся за body. */
    .has-basket-bar .notification-block
    {
        display: none !important;
    }

    /* --- Оформление заказа: шаги ---------------------------------------- */
    .checkout-steps
    {
        display: flex;
        gap: 6px;
        margin: 4px 0 16px;
        padding: 0;
        list-style: none;
    }

    .checkout-steps > li
    {
        display: flex;
        flex: 1 1 0;
        align-items: center;
        gap: 6px;
        min-width: 0;
        padding: 8px;
        border-radius: 8px;
        background: #f2f6f9;
        color: #6b7c8d;
        font-size: 13px;
        line-height: 1.2;
    }

    .checkout-steps > li > span
    {
        display: flex;
        flex: 0 0 20px;
        align-items: center;
        justify-content: center;
        width: 20px;
        height: 20px;
        border-radius: 50%;
        background: #c9d6e0;
        color: #fff;
        font-size: 12px;
    }

    .checkout-steps > li.is-done
    {
        background: #eef8f2;
        color: #0f7a4d;
    }

    .checkout-steps > li.is-done > span
    {
        background: #199a5e;
    }

    .checkout-steps > li.is-current
    {
        background: #eaf6fd;
        color: #0b5f86;
        font-weight: 600;
    }

    .checkout-steps > li.is-current > span
    {
        background: #199adb;
    }

    /* Кнопки заказа — на всю ширину */
    .order-layout .but
    {
        display: block;
        width: 100%;
        text-align: center;
    }

    .order-layout #place-order
    {
        display: block;
        width: 100%;
    }

    /* --- Анкета: полоса прогресса ---------------------------------------
       Полосу создаёт responsive.js и вставляет первым элементом формы.
       Держим её на виду при прокрутке длинной анкеты. */
    .questionary-progress
    {
        position: sticky;
        top: 0;
        z-index: 20;
        display: block;
        margin: 0 0 12px;
        padding: 8px 0 10px;
        background: #fff;
        border-bottom: 1px solid #e6eef4;
    }

    .questionary-progress-bar
    {
        height: 6px;
        overflow: hidden;
        border-radius: 3px;
        background: #e6eef4;
    }

    .questionary-progress-bar > span
    {
        display: block;
        width: 0;
        height: 100%;
        background: #199adb;
        transition: width 0.2s;
    }

    .questionary-progress-text
    {
        margin: 6px 0 0;
        color: #4b6690;
        font-size: 13px;
    }

    .questionary_submit
    {
        display: block;
        width: 100%;
    }

    /* --- Конфигуратор: селекты на всю ширину колонки -------------------- */
    .configurator-results-form select
    {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }
}


/* --------------------------------------------------------------------------
   5.3. Узкие телефоны: <= 575px
   -------------------------------------------------------------------------- */
@media (max-width: 575px)
{
    /* Позиция корзины: картинка меньше, описание шире */
    .basket_page_item > .row > .col-xs-3
    {
        flex: 0 0 76px;
        width: 76px;
        max-width: 76px;
    }

    .basket_page_item > .row > .col-xs-6
    {
        flex: 1 1 calc(100% - 76px);
        width: calc(100% - 76px);
        max-width: calc(100% - 76px);
    }

    .order-layout .panel-body
    {
        padding-left: 12px;
        padding-right: 12px;
    }
}


/* ==========================================================================
   6. Тач-устройства: убираем hover-зависимое поведение
   ========================================================================== */
@media (hover: none) and (max-width: 991px)
{
    .navbar-nav > li:hover > .navbar-nav-link,
    .navbar-nav > li:hover > a
    {
        color: #000000;
    }
}


/* ==========================================================================
   7. Контентные страницы (этап 4)
   Контакты, карьера и вакансии, новости/блог/статьи/презентации/события,
   FAQ/рекомендации/видео, сертификаты, дистрибьюторы, отзывы, фотогалерея,
   поиск, 404, «Каталог продукции», контент из CKEditor (.content).

   Общая причина проблем та же, что у каталога: страницы собраны на
   col-xs-* (в Bootstrap 3 это «столько колонок навсегда») и на жёстких
   высотах/абсолютном позиционировании в main.css. Всё меняется только
   внутри @media — десктоп (>=992px) остаётся прежним.
   ========================================================================== */

/* --------------------------------------------------------------------------
   7.1. Планшеты и телефоны: <= 991px
   -------------------------------------------------------------------------- */
@media (max-width: 991px)
{
    /* --- Карьера: миниатюры под фото -------------------------------------
       .carousel-thumbs в main.css — absolute, width:110%, уезжает вправо за
       экран (390 px: правый край 388 при ширине 375). Переводим миниатюры
       в поток под фотографией: 3 в ряд, остальное переносится. */
    .photorama
    {
        padding-bottom: 0;
    }

    .photorama .carousel-thumbs
    {
        position: static;
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        width: 100%;
        margin: 10px 0 0;
        padding: 0;
        background: none;
    }

    .photorama .carousel-thumbs li
    {
        width: calc(33.333% - 4px);
        margin: 0 !important;
        float: none;
    }

    .photorama .carousel-thumbs img
    {
        display: block;
        width: 100%;
        height: auto;
        border-width: 3px;
    }

    /* --- Контакты: карточки менеджеров -----------------------------------
       .manager-list.row / .manager-list-support.row в main.css растянуты
       отрицательными отступами 0 -25px под контейнер с отступами 10px.
       Внутри колонки с отступом 8px это давало переполнение на 17px с
       каждой стороны и горизонтальный скролл. */
    .manager-list.row,
    .manager-list-support.row
    {
        margin-left: -8px;
        margin-right: -8px;
    }

    .contacts-wrap .manager-list-item
    {
        padding-left: 12px;
        padding-right: 12px;
    }

    /* --- Дистрибьюторы ---------------------------------------------------
       Карточка в main.css фиксированной высоты 374px с overflow:hidden —
       длинное название и второй адрес обрезались. */
    .distributor-list > [class*="col-"]
    {
        width: 50%;
    }

    .distributor
    {
        height: auto;
        max-height: none;
        padding: 22px 18px 24px;
    }

    /* --- Сертификаты: «Скачать» без наведения ---------------------------
       В main.css кнопка absolute и display:none, появляется по :hover.
       На тач-устройстве её не существует. */
    .preview-list-image-download
    {
        position: static !important;
        display: inline-block;
        margin: 10px 0 0;
        padding: 10px 16px;
        border-radius: 6px;
        background: #199adb;
        color: #fff;
        font-size: 14px;
        line-height: 1.2;
        text-decoration: none;
    }

    /* --- Фотогалерея ------------------------------------------------------
       Плитка в main.css — фиксированные 188px с абсолютной картинкой. */
    .gallery-unit
    {
        height: auto;
        aspect-ratio: 4 / 3;
    }

    /* --- Видео в контенте: 16:9 вместо жёстких 620×345 / 405px ---------- */
    .content iframe,
    .content video,
    .pageblock iframe,
    .pageblock video,
    .news-page iframe,
    .news-page-gallery iframe,
    .vacancy-page iframe,
    .video-answer iframe
    {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
        border: 0;
    }

    /* --- Контент из CKEditor (.content, .pageblock) ---------------------
       Таблицы в статьях и юридических текстах оборачивает responsive.js,
       но общие правила типографики здесь: длинные строки, картинки и код
       не должны раздвигать страницу. */
    .content img,
    .pageblock img
    {
        max-width: 100%;
        height: auto;
    }

    .content pre,
    .pageblock pre
    {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .content blockquote,
    .pageblock blockquote
    {
        margin-left: 0;
        margin-right: 0;
        padding-left: 12px;
    }

    .content ul,
    .content ol,
    .pageblock ul,
    .pageblock ol
    {
        padding-left: 22px;
    }
}


/* --------------------------------------------------------------------------
   7.2. Телефоны: <= 767px
   -------------------------------------------------------------------------- */
@media (max-width: 767px)
{
    /* --- Контакты: карточка менеджера на всю ширину ----------------------
       Было col-xs-6 (две карточки в ряд): на 390 px тексту доставалось
       ~150 px, описание третьего менеджера выходило за карточку.
       Правило ограничено .contacts-wrap: .manager-list-item встречается ещё
       на промо-лендинге (promoLeadTime) и «Карьере» — там своя вёрстка. */
    .contacts-wrap .manager-list-item
    {
        float: none;
        width: 100%;
        max-width: 100%;
        margin-top: 20px;
        margin-bottom: 0;
    }

    /* Внутри карточки: фото 88px слева, текст тянется, описание — снизу */
    .contacts-wrap .manager-list-item > .row
    {
        display: flex;
        flex-wrap: wrap;
        align-items: flex-start;
    }

    .contacts-wrap .manager-list-item > .row:before,
    .contacts-wrap .manager-list-item > .row:after
    {
        display: none;
        content: none;
    }

    .contacts-wrap .manager-list-item > .row > .col-xs-3
    {
        flex: 0 0 88px;
        width: 88px;
        max-width: 88px;
    }

    .contacts-wrap .manager-list-item > .row > .col-xs-9
    {
        flex: 1 1 0;
        width: auto;
        max-width: none;
        min-width: 0;
        padding-left: 14px;
    }

    .contacts-wrap .manager-list-item > .row > .col-xs-12
    {
        flex: 0 0 100%;
        width: 100%;
        max-width: 100%;
    }

    .contacts-wrap .manager-list-item .img
    {
        height: 88px;
    }

    /* Разделитель, который шаблон вставляет после каждой второй карточки,
       при одной колонке не нужен */
    .contacts-wrap .manager-list > .col-xs-12
    {
        display: none;
    }

    /* Адреса и реквизиты: col-xs-8 + col-xs-4 */
    .contacts-addresses > [class*="col-"]
    {
        float: none;
        width: 100%;
        max-width: 100%;
    }

    .contacts-addresses .col-xs-4
    {
        margin-top: 20px;
    }

    .contacts-addresses .small-map
    {
        display: block;
        width: 100%;
        /* В main.css карта — ссылка с фоновой картинкой высотой 100px.
           На телефоне даём пропорцию 16:9, иначе карта читается хуже. */
        height: auto;
        aspect-ratio: 16 / 9;
        background-size: cover;
    }

    /* Декоративные колонки 1/10/1 вокруг синей линии: на телефоне линия
       должна идти во всю ширину, а пустые колонки только съедают место */
    .hr-row > .col-xs-1
    {
        display: none;
    }

    .hr-row > .col-xs-10
    {
        float: none;
        width: 100%;
        max-width: 100%;
    }

    /* --- Карьера и вакансии ---------------------------------------------
       Пары 5/1/6 (две колонки требований), 7/5 (виджет вакансий и контакты),
       4/8 (контакты HR), 3/9 — на телефоне всё в один столбец. Класс
       vacancy-page стоит на контейнере страницы (career.phtml и vacancy*.phtml). */
    .vacancy-page .row > [class*="col-"],
    .vacancy-page .col-xs-10
    {
        float: none;
        width: 100%;
        max-width: 100%;
    }

    /* Пустые колонки-отступы 1 из 12 в этих шаблонах */
    .vacancy-page .col-xs-1
    {
        display: none;
    }

    /* Фото HR-специалистов: в main.css 150px и float:left */
    .vacancy-page img.vacancy-list-hr
    {
        float: none;
        width: 120px;
        height: 120px !important;
        margin: 0 0 10px;
        object-fit: cover;
    }

    .vacancy-page .vacancy-list
    {
        height: auto;
        padding: 18px 14px;
    }

    .vacancy-page .block-vacancy-list
    {
        margin-top: 16px;
    }

    /* --- FAQ, рекомендации, видеоматериалы -------------------------------
       Вопросы (col-xs-4) и ответ (col-xs-8): на телефоне список вопросов
       уходит наверх, ответ читается во всю ширину. */
    .question-block,
    .answer,
    .video-answer
    {
        float: none;
        width: 100%;
        max-width: 100%;
    }

    .question-block
    {
        margin-top: 4px;
    }

    .question-title
    {
        padding-right: 44px;
    }

    .question-list li
    {
        padding-left: 0;
        padding-right: 0;
    }

    .question-list a
    {
        display: block;
        padding: 8px 0;
    }

    .answer .h2,
    .video-answer .h2
    {
        margin-top: 18px;
    }

    /* «Не нашли ответ?» — текст и кнопка в столбец, кнопка на всю ширину */
    .lined-block
    {
        margin: 24px 0;
        padding: 20px 0;
    }

    .lined-block .row > [class*="col-"]
    {
        float: none;
        width: 100%;
        max-width: 100%;
    }

    .lined-block .border-btn
    {
        display: block;
        width: 100%;
        margin-top: 12px;
        text-align: center;
    }

    /* --- Списки новостей, блога, статей --------------------------------
       Карточка в main.css — col-xs-7 (текст) + col-xs-1 (разделитель) +
       col-xs-4 (картинка). В одну колонку: обложка сверху, текст под ней. */
    .textblock-list-item > .row
    {
        display: flex;
        flex-direction: column;
    }

    .textblock-list-item > .row:before,
    .textblock-list-item > .row:after
    {
        display: none;
        content: none;
    }

    .textblock-list-item > .row > [class*="col-"]
    {
        float: none;
        width: 100%;
        max-width: 100%;
    }

    /* Пустая колонка-разделитель между текстом и картинкой */
    .textblock-list-item > .row > .col-xs-1:empty
    {
        display: none;
    }

    .textblock-list-img
    {
        order: -1;
        margin-bottom: 12px;
        text-align: left;
    }

    /* Только обложка карточки: селектор не должен цеплять постер плеера,
       который Playerjs вставляет внутрь .textblock-list-img */
    .textblock-list-img > img,
    .textblock-list-img > a > img
    {
        display: block;
        width: 100%;
        height: auto;
        aspect-ratio: 3 / 2;
        object-fit: cover;
    }

    /* Блог: обложка — «канвас» 193px с абсолютно центрированной картинкой */
    .textblock-list-img-canvas
    {
        min-height: 0;
        border: 0;
    }

    .textblock-list-img-canvas img
    {
        position: static;
        width: 100%;
        height: 100%;
        transform: none;
        object-fit: cover;
    }

    /* Плеер Playerjs (новость с видео) считает ширину от контейнера и
       вылезал на 4px за экран: ограничиваем его собственным блоком. */
    .textblock-list-img pjsdiv,
    .news-page pjsdiv
    {
        max-width: 100%;
        box-sizing: border-box;
    }

    /* --- События: дата над заголовком -----------------------------------
       col-xs-2 (54 px на 360) при .event-day 30px — строки «с 28 / ноября»
       рвались посередине, а заголовок уезжал вправо. */
    .event-list-item > .row > [class*="col-"]
    {
        float: none;
        width: 100%;
        max-width: 100%;
    }

    .event-date
    {
        display: flex;
        flex-wrap: wrap;
        align-items: baseline;
        gap: 4px 8px;
        margin-bottom: 8px;
        text-align: left;
    }

    .event-day
    {
        font-size: 22px;
    }

    .event-month
    {
        font-size: 14px;
    }

    .event-title
    {
        margin-top: 0;
    }

    .event-list-item
    {
        padding: 24px 0;
    }

    /* --- Сертификаты: одна карточка в строке, фото над текстом --------- */
    .preview-list-item.cert
    {
        float: none;
        width: 100%;
        max-width: 100%;
        margin-bottom: 28px;
    }

    .preview-list-item.cert > .row
    {
        display: block;
    }

    .preview-list-item.cert > .row > [class*="col-"]
    {
        float: none;
        width: 100%;
        max-width: 100%;
    }

    .cert .preview-list-image
    {
        margin-top: 0;
    }

    .close-discription
    {
        margin-top: 14px;
    }

    /* --- Дистрибьюторы: одна карточка ----------------------------------- */
    .distributor-list > [class*="col-"]
    {
        float: none;
        width: 100%;
        max-width: 100%;
    }

    .distributor-name
    {
        font-size: 17px;
    }

    /* «Показать все контакты» — единственный интерактивный элемент карточки
       дистрибьютора; на тач-экране нужна зона нажатия побольше */
    .distributor .distributor-hidden-contacts-show a
    {
        display: inline-block;
        padding: 8px 0;
    }

    /* --- Фотогалерея: 2 плитки в ряд ------------------------------------ */
    .gallery-unit
    {
        float: left;
        width: 50%;
        max-width: 50%;
    }

    /* Галерея внутри новости и на странице фото: по 2 кадра в ряд */
    .photogallery > [class*="col-"]
    {
        float: left;
        width: 50%;
        max-width: 50%;
    }

    .news-page-gallery-img img
    {
        max-height: none;
        width: 100%;
    }

    /* --- Статья/новость: текст и картинка в столбец -------------------- */
    .news-page-content > [class*="col-"],
    .news-page-content > .col-xs-2
    {
        float: none;
        width: 100%;
        max-width: 100%;
    }

    .news-page-text
    {
        margin-bottom: 16px;
    }

    .news-page-img
    {
        margin-bottom: 20px;
    }

    /* --- «Каталог продукции» и «Складские излишки» ----------------------
       .preview-list — общая обёртка страниц: col-xs-8 (текст/форма) и
       col-xs-4 (боковая карточка). */
    .preview-list > .col-xs-8,
    .preview-list > .col-xs-4
    {
        float: none;
        width: 100%;
        max-width: 100%;
    }

    .preview-list > .col-xs-4
    {
        margin-top: 20px;
    }

    /* --- Поиск: строка результата ---------------------------------------
       Общее правило .pageblock (<=575px) складывает картинку и текст в
       столбец, и миниатюра 420px занимала пол-экрана. Для результатов
       поиска оставляем карточку «миниатюра слева — описание справа». */
    .search-result
    {
        display: flex;
        align-items: flex-start;
        gap: 12px;
    }

    .search-result:before,
    .search-result:after
    {
        display: none;
        content: none;
    }

    .search-result > .col-xs-3
    {
        flex: 0 0 88px;
        width: 88px;
        max-width: 88px;
    }

    .search-result > .col-xs-9
    {
        flex: 1 1 0;
        width: auto;
        max-width: none;
        min-width: 0;
    }

    .search-result img
    {
        width: 100%;
        height: auto;
    }

    /* Плеер Playerjs считает ширину от контейнера и вылезал на 4px:
       внутренние блоки плеера шире карточки на несколько пикселей. */
    .textblock-list-img,
    .news-page-text > [id^="player_"]
    {
        overflow: hidden;
    }

    /* --- Формы контентных страниц ---------------------------------------
       «Каталог продукции»: согласие на обработку данных и кнопка лежали в
       col-xs-6 (170px) — текст согласия ломался по три слова. */
    .form-element > .col-xs-6,
    .form-element > .col-xs-12
    {
        float: none;
        width: 100%;
        max-width: 100%;
    }

    .personal-data-consent
    {
        display: flex;
        align-items: flex-start;
        gap: 8px;
        font-size: 14px;
        line-height: 1.4;
    }

    .personal-data-consent input[type="checkbox"]
    {
        flex: 0 0 auto;
        margin-top: 2px;
    }

    /* Статьи: .article-page в main.css — max-width:80% от колонки. На телефоне
       это лишние 70px пустого поля справа. */
    .article-page
    {
        max-width: 100%;
    }

    /* --- Списки файлов (документы статей, презентации) ------------------
       .control-to-btn — inline-block, а .dload — длинное имя файла одним
       словом: блок считал ширину по самому длинному слову и раздвигал
       страницу (на 360 px: scrollWidth 521 при 360). На телефоне кнопка
       занимает строку, длинные имена переносятся в любом месте. */
    .control-to-btn
    {
        display: block;
        margin: 6px 0;
        padding: 0;
    }

    .dload,
    .download-list a
    {
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    /* --- Поиск: вкладки не должны ломаться по одной букве -------------- */
    .product-tabs .tab-list
    {
        display: flex;
        gap: 8px;
        padding-bottom: 6px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
    }

    .product-tabs .tab-list > li
    {
        display: block;
        flex: 0 0 auto;
        margin-right: 0;
    }
}


/* --------------------------------------------------------------------------
   7.3. Узкие телефоны: <= 575px
   -------------------------------------------------------------------------- */
@media (max-width: 575px)
{
    /* Плитки галереи в одну колонку */
    .gallery-unit
    {
        float: none;
        width: 100%;
        max-width: 100%;
    }

    /* Заголовок карточки списка: 18px в 313px — крупно, но читаемо;
       на узком экране чуть уменьшаем */
    .textblock-list-caption
    {
        font-size: 17px;
    }

    /* Отзывы: фото над текстом */
    .otziv .preview-list-item > .row
    {
        display: block;
    }

    .otziv .preview-list-item > .row > [class*="col-"]
    {
        float: none;
        width: 100%;
        max-width: 100%;
    }

    .otziv .preview-list-image
    {
        margin-top: 0;
        margin-bottom: 14px;
    }
}


/* ==========================================================================
   8. Хвосты этапа 3: списки категорий, фильтры, конфигуратор, модельный ряд
   Всё внутри @media — десктоп не меняется.
   ========================================================================== */

/* --------------------------------------------------------------------------
   8.1. Планшеты и телефоны: <= 991px
   -------------------------------------------------------------------------- */
@media (max-width: 991px)
{
    /* --- Плитки категорий (/catalog/dcdc/, /catalog/acs, /catalog/filter,
       /products) ---------------------------------------------------------
       `.product-item-list.row` и `.products-group > .row` лежат прямо в
       `.tab-pane`/`.pageblock`, а не в колонке с отступами. Отрицательные
       отступы `.row` (-8px с каждой стороны) вылезали за край страницы:
       на 390 px scrollWidth 379–393 при 375–390. Обнуляем только у таких
       рядов — колонки внутри остаются с отступами 8px. */
    content .tab-pane > .row,
    content .pageblock > .row,
    .pageblock .product-item-list
    {
        margin-left: 0;
        margin-right: 0;
    }

    /* --- Шапка категории -------------------------------------------------
       `.heading-image` в main.css сдвинута на `translateX(20px)` (дизайн
       десктопа). На телефоне этот сдвиг выходит за экран: 390 px давали
       scrollWidth 393. На мобильном сдвиг не нужен. */
    .heading-image
    {
        transform: none;
    }

    /* --- Конфигуратор в списке серий (#configurator) ---------------------
       Всплывающий блок из main.css: absolute, width:100% от вьюпорта при
       статичном .container — правый край уезжал на 16px (контейнерный
       отступ), поля и селекты фиксированные 118px, крестик 20×20.
       Прижимаем блок к тем же отступам, что и контейнер. */
    .configurator-popup
    {
        left: 16px;
        right: 16px;
        width: auto;
        max-width: none;
        margin-top: 60px;
    }

    .configurator-popup-title
    {
        padding: 12px 60px 12px 16px;
    }

    .configurator-popup-fields
    {
        padding: 16px;
    }

    .configurator-popup .form-inline-unit,
    .configurator-popup .form-inline-unit label
    {
        display: block;
        width: 100%;
        margin: 0 0 12px;
    }

    .configurator-popup select
    {
        width: 100% !important;
        max-width: 100%;
        min-width: 0;
        min-height: 44px;
        font-size: 16px;
    }

    .configurator-popup-close
    {
        width: 44px;
        height: 44px;
        top: 8px;
        right: 8px;
        background-size: 18px 18px;
    }

    .configurator-popup-btn
    {
        padding: 12px 16px 16px;
        text-align: left;
    }

    .configurator-popup-btn .submit-btn
    {
        display: block;
        width: 100%;
        text-align: center;
    }

    /* Фильтры в шапке модельного ряда (tablesorter): селект в ячейке
       таблицы, но по нему надо попадать пальцем */
    .variation-table .tablesorter-filter
    {
        min-height: 36px;
        font-size: 13px;
    }
}
