/*
 * Правки мобильной вёрстки поверх стилей Tilda.
 * Подключается последним, поэтому перебивает исходные правила.
 * Десктоп не затрагивается: всё внутри @media до 640px.
 *
 * Что чинится (см. SPEC.md §13):
 *  1. меню было доступно только после прокрутки — теперь видно сразу
 *  2. виджет Bitrix24 перекрывал кнопку заявки
 *  3. первый экран не вмещал кнопку призыва
 */

@media screen and (max-width: 640px) {

  /* --- 1. Навигация доступна с первого экрана --------------------------- */
  /* Tilda прячет плавающее меню до скролла: opacity 0 и сдвиг за верхний край. */
  .t280__container.t280__positionfixed,
  .t280__container.t280__small.t280__positionfixed {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
    top: 0 !important;
    background-color: rgba(0, 0, 0, .55);
    backdrop-filter: blur(6px);
  }

  /* Бургер крупнее: 22x14 — меньше рекомендованной зоны нажатия */
  .t280__container .t-menuburger {
    transform: scale(1.5);
    transform-origin: right center;
    padding: 6px;
  }

  /* --- 2. Виджет Bitrix24 не должен закрывать кнопки -------------------- */
  /* Авто-подсказка разворачивается на пол-экрана и ловит нажатия по CTA. */
  .b24-widget-button-popup,
  .b24-widget-button-popup-description,
  .b24-widget-button-popup-triangle {
    display: none !important;
  }
  /* Саму кнопку чата приподнимаем, чтобы не наезжала на нижние блоки */
  .b24-widget-button-position-bottom-right {
    bottom: 12px !important;
    right: 8px !important;
    transform: scale(.82);
    transform-origin: bottom right;
  }

  /* --- 3. Первый экран вмещает кнопку ---------------------------------- */
  .t-cover { min-height: auto !important; }
  .t-cover__carrier,
  .t-cover__filter { min-height: 560px !important; }
  .t-cover .t-cover__wrapper { padding-top: 56px; padding-bottom: 24px; }

  /* Заголовок и текст обложки плотнее — сейчас они съедают весь экран */
  .t-cover .t-title { font-size: 26px !important; line-height: 1.2 !important; }
  .t-cover .t-text  { font-size: 15px !important; line-height: 1.4 !important; }

  /* --- 4. Кнопки удобнее нажимать -------------------------------------- */
  .t-btn, .t-submit, .t-btnflex {
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}
