/* ==========================================================================
   Адаптивный слой для темы bm (bootmasterru.com)
   Подключать ПОСЛЕ style.css:
   <link rel="stylesheet" href="/templates/bm/css/mobile.css">
   ========================================================================== */

/* Кнопка-бургер создаётся JS-ом всегда — по умолчанию (десктоп) прячем её.
   Показывается только внутри мобильного медиа-запроса ниже. */
.mobile-menu-toggle {
  display: none;
}

/* Ссылка "Регистрация /+" (a.get_state) в slider-чанке — убираем везде, десктоп и мобильный */
a.get_state {
  display: none !important;
}

/* Кубик "Прогон Хрумером" (doc 11, weblink → цель id=4) — нужен зелёный,
   как раньше был на этой позиции (тот же оттенок, что у SocPlugin/me_14) */
.sl_menu li.me_4 a {
  background: rgba(0, 153, 102, 0.8);
}
/* Кубик "Прокси IPV6 для XEvil" (doc 216, weblink → цель id=206) — нужен красный,
   как раньше был у XEvil/me_12, и своя строка (как у me_3) */
.sl_menu li.me_206 {
  float: none;
  clear: both;
}
.sl_menu li.me_206 a {
  background: rgba(243, 36, 36, 0.8);
}

/* Снимаем жёсткий мин-width на десктопе, оставляем как есть выше 1150px */
@media (max-width: 1150px) {
  html, body { min-width: 0; }

  #main {
    width: 100%;
    max-width: 1110px;
    box-shadow: none;
  }
}

/* -------------------- Планшет / мобильный (<=994px) -------------------- */
@media (max-width: 994px) {

  html, body { min-width: 0; overflow-x: hidden; }

  #main { width: 100%; }

  /* ---------- Шапка ---------- */
  #header {
    height: auto;
    background: none;
    padding-bottom: 10px;
  }
  /* Дата/сборка и языки на мобильном не показываем — оставляем только лого и меню */
  #header .header_top {
    display: none;
  }

  #header .logo {
    display: block;
    position: static;
    width: 180px;
    height: 66px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    margin: 10px auto 0 auto;
  }
  #header .deviz {
    position: static;
    text-align: center;
    margin-top: 8px;
  }
  #header .deviz .cab {
    margin: 8px auto 0 auto;
  }

  /* Верхнее меню -> бургер (см. mobile.js) */
  .up_menu {
    display: none;
    margin-left: 0;
    text-align: left;
  }
  .up_menu.mobile-open {
    display: block;
  }
  .up_menu li {
    display: block;
    width: 100%;
  }
  .up_menu a {
    display: block;
    padding: 12px 15px;
  }
  .up_menu ul {
    display: none !important;
  }
  .up_menu .separator {
    display: none !important;
  }

  .mobile-menu-toggle {
    display: block;
    position: relative;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
    background: #0060CB;
    color: #fff;
    padding: 12px 0;
    font-size: 16px;
    cursor: pointer;
  }
  .mobile-menu-home {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
  }
  .mobile-menu-home svg {
    display: block;
  }

  /* ---------- Слайдер / цветные кнопки ---------- */
  .slider {
    height: auto;
    background-image: none;
    padding: 15px 10px;
  }
  .sl_menu {
    position: static;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 8px;
  }
  .sl_menu li {
    float: none;
    margin: 0;
  }
  .sl_menu li.me_3 { clear: none; }
  #wlpeLogin {
    position: static;
    width: 100%;
    margin-top: 10px;
  }
  #wlpeLoginFieldset { float: none; width: 100%; }

  /* ---------- Контент: колонки в один столбец ---------- */
  #left_col {
    float: none;
    width: 100%;
    padding: 0 15px 20px 15px;
    box-sizing: border-box;
  }
  #right_col {
    float: none;
    width: 100%;
    padding: 0 15px 20px 15px;
    margin-top: 10px;
    box-sizing: border-box;
  }

  /* Картинки резиновые */
  #left_col img, #right_col img, .news img {
    max-width: 100%;
    height: auto;
  }

  /* ---------- Футер ---------- */
  #footer {
    height: auto;
    background: #0060CB;
    padding: 15px 0;
  }
  .dn_menu {
    text-align: center;
    padding-right: 0;
  }
  .dn_menu li { display: block; width: 100%; }
  .dn_menu .separator { display: none !important; }
  .cr {
    position: static;
    display: block;
    text-align: center;
    margin-top: 10px;
  }

  /* ---------- Формы ---------- */
  #anketa input, #anketa textarea, #anketa select, #anketa input[type=submit] {
    width: 100% !important;
    box-sizing: border-box;
  }
  input.textbox, textarea.textbox {
    width: 100%;
    box-sizing: border-box;
  }

  /* ---------- Кнопка "наверх" поменьше ---------- */
  #back-top { right: 12px; bottom: 12px; }
}

/* -------------------- Узкий мобильный (<=480px) -------------------- */
@media (max-width: 480px) {
  h1 { font-size: 20px; }
  h1.title { font-size: 17px; }
  #left_col p, #left_col { font-size: 15px; }
  .sl_menu a { font-size: 14px; padding: 8px; min-width: 0; width: 100%; }
}
