/*--------------------------------------------------------------------------
Адаптив поверх легаси common.css (≥1003px — без изменений).
Отдельным файлом: content:assets перезаписывает common.css из легаси.
CSS кешируется 7 дней (.htaccess): после правки поднять ?v= в layout/header.tpl.

  ≤1002px  планшет: без min-width, меню переносится, колонки резиновые
  ≤860px   планшет портрет: правая колонка под текстом
  ≤600px   смартфон: компактная шапка, меню плиткой, формы в столбик
  ≤400px   уменьшенная reCAPTCHA
-----------------------------------------------------------------------------*/

/* В легаси «font:13px verdana» без запасного: на Android/Linux Verdana нет → засечки */
body { font-family: Verdana, Tahoma, "DejaVu Sans", sans-serif; }
.action-list li a, #head dl dd, #head dl dd a, .cloud-tags li a, #footer { font-family: Tahoma, Verdana, "DejaVu Sans", sans-serif; }
#top h1, #nav ul li a, #nav ul li { font-family: Arial, Helvetica, "Liberation Sans", sans-serif; }

/* Контент из редактора: картинки и встраивания не шире колонки (на любой ширине) */
#content img { max-width: 100%; height: auto; }
#content iframe, #content object, #content embed { max-width: 100%; }
#content { overflow-wrap: break-word; }

@media (max-width: 1002px) {
    body, #head-wrap, #footer { min-width: 0; }

    /*--- Top bar */
    #top h1 { padding-right: 20px; font-size: 28px; }
    #name-company { padding-left: 20px; }

    /*--- Head: услуги без сдвигов под фиксированную ширину */
    #services-wrap { margin-left: 188px; }
    #head dl { width: 33.3%; margin-top: 28px; padding-left: 44px; background-position: 0 2px; box-sizing: border-box; }
    #head dl dt { left: 0; margin-right: 0; }
    #head dl dt, #head dl dt a { font-size: 16px; }
    #head dl dd { padding: 0 10px 0 0; }

    /*--- Nav: перенос вместо центрирования через left:50% */
    #nav-wrap { height: auto; overflow: visible; background-color: #f4f4f4; }
    #nav { float: none; left: 0; }
    #nav ul { left: 0; float: none; display: flex; flex-wrap: wrap; justify-content: center; }
    #nav ul li { padding: 11px 12px 0; margin: 0 2px; }
    #nav ul li a, #nav ul li { font-size: 16px; }
    #nav ul li.active { margin: 0 10px; } /* уголки lbg/rbg выступают на 9px */

    /*--- Content */
    #content { padding: 24px 24px 25px; }
    #main-left { width: calc(100% - 388px); }
    #sidebar-right { width: 364px; }

    .cloud-tags li { margin: 0 10px; line-height: 2; }
}

@media (max-width: 860px) {
    body { font-size: 14px; line-height: 1.45; }
    #name-company { display: none; }
    #usability-nav { left: 20px; }
    #nav ul li { padding: 11px 8px 0; margin: 0 1px; }
    #nav ul li a, #nav ul li { font-size: 15px; }

    #head dl dd { display: none; }
    #head dl { margin-top: 0; height: 145px; display: flex; align-items: center; background-position: 0 50%; }

    #main-left, #sidebar-right { width: auto; float: none; }
    #sidebar-right { margin-top: 20px; }

    /* блоки ротатора: в ряд по два, сжимаются до ширины экрана */
    .action-list, #sidebar-right .action-list { float: none; margin: 0 0 10px; display: flex; flex-wrap: wrap; justify-content: center; gap: 0 16px; }
    .action-list li { flex: 1 1 300px; max-width: 364px; width: auto; background-size: 100% 128px; }
    .action-list li a { width: auto; padding-right: 10px; }

    textarea, .feedback select { max-width: 100%; }
    .feedback { width: auto; }
}

@media (max-width: 600px) {
    body { font-size: 14px; line-height: 1.5; }
    p { margin-bottom: 12px; }

    /*--- Top bar: заголовок слева, иконки справа */
    #top { height: auto; min-height: 48px; display: flex; align-items: center; background-size: auto 100%; background-color: #12417F; }
    #name-company { display: none; }
    #top h1 { float: none; order: 1; flex: 1; padding: 10px 16px; font-size: 22px; line-height: 1.2; }
    #usability-nav { position: static; order: 2; display: flex; padding-right: 6px; }
    #usability-nav li { padding: 4px 12px 0; }
    #usability-nav li a { width: 22px; height: 22px; background-position: center !important; }

    /*--- Head: логотип меньше, услуги списком справа от него */
    #head { height: auto; display: flex; align-items: center; background-size: auto 100%; }
    #logo { float: none; margin: 0; flex: 0 0 auto; }
    #logo, #logo img { width: 104px; height: 80px; }
    #services-wrap { margin: 0; padding: 6px 12px 6px 4px; }
    #head dl { float: none; width: auto; height: auto; padding: 3px 0 3px 26px; background-size: 20px auto; background-position: 0 50%; }
    #head dl dt, #head dl dt a { font-size: 15px; line-height: 1.3; }

    /*--- Nav: плитка 2 колонки, крупные зоны нажатия */
    #nav ul { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; padding: 0; background: #d7d8d9; border-bottom: 1px solid #d7d8d9; }
    #nav ul li { margin: 0; padding: 0; height: auto; top: 0; background: #f4f4f4; }
    #nav ul li.active { background: #E6E6E8; }
    #nav ul li a { display: block; padding: 12px 8px; font-size: 15px; text-decoration: none; }
    #nav ul li.active a { font-weight: bold; }
    #nav ul li span.lbg, #nav ul li span.rbg { display: none; }

    /*--- Content */
    #content { padding: 16px 16px 20px; }
    h1, h2, h3 { line-height: 1.3; }
    .head-main { width: auto; }
    #main-left .head2 { width: auto; }
    blockquote { padding: 12px; }

    /* обтекаемые картинки не съедают колонку текста */
    #content img[align="left"], #content img[align="right"], #content img.f-left, #content img.f-right { max-width: 40%; }

    .services { padding: 10px 12px 5px 6px; }

    /*--- Формы: подпись над полем */
    table.feedback, table.feedback tbody, table.feedback tr, table.feedback td { display: block; width: auto !important; }
    table.feedback { padding: 10px 12px; box-sizing: border-box; }
    table.feedback tr[height] { display: none; }
    table.feedback td div[style] { text-align: left !important; padding: 8px 0 2px !important; }
    input.bigbor, input.bigbor2, input.borw, table.feedback textarea { width: 100% !important; box-sizing: border-box; font-size: 16px; height: auto; padding: 6px; }
    table.feedback textarea { height: 120px; }
    table.feedback td:empty { display: none; }
    .feedback { padding-left: 8px !important; padding-right: 8px !important; }

    /*--- Footer */
    .cloud-tags { padding-top: 20px; }
    .cloud-tags li { display: inline-block; margin: 0 6px; }
    .cloud-tags li a { font-size: 14px; }
    #footer, #fot { height: auto; }
    #fot { min-height: 63px; background-size: auto 63px; }
    #footer address { float: none; padding: 22px 100px 20px 16px; }
}

/* reCAPTCHA v2 — iframe фиксированной ширины 304px, в форму на 320–400px не помещается */
@media (max-width: 400px) {
    .g-recaptcha { transform: scale(.85); transform-origin: 0 0; margin-bottom: -12px; }
}
