/* Sync2Sys site v2: правки мобильной версии по проверке 22.11.2026 (103 страницы, iPhone 390, Android 360, 320).
   Правило Саши 22.11: десктоп не меняется. Поэтому всё ниже лежит в медиазапросах до 860px
   (десктоп в site.js и стилях начинается с 861px). Единственное общее правило: тень закрытой
   панели настроек cookie (она лишняя и на десктопе, Саша 22.11).
   Файл подключается последним на всех страницах (tools/build_site.py), поэтому при равной
   специфичности его правила сильнее. Стили cookie-баннера и чата EGA живут в релизной сборке
   (cookie-consent.css, chat.css с сервера EGA): здесь только поправки поверх них. */

/* 4. Закрытая панель настроек cookie стоит за правым краем (translateX(100%)), но её тень
   (-16px 0 48px) заходила на страницу серой полосой у правого края. Тень только у открытой. */
.cc-panel:not(.is-visible) { box-shadow: none; }

@media (max-width: 860px) {
  /* 3, 5. Шапка: логотип и бургер не сжимаются, кнопка уступает место первой */
  .nav__in > .logo { flex-shrink: 0; }
  .nav__right { min-width: 0; flex-shrink: 1; }
  .nav__right .burger { flex-shrink: 0; }
  .nav__right .btn--dark { min-width: 0; flex-shrink: 1; overflow: hidden; white-space: nowrap; }

  /* 13. Полоса над шапкой всегда в одну строку: длинное название гида обрезается многоточием */
  .topbar a { flex-wrap: nowrap; white-space: nowrap; }
  .topbar b { flex-shrink: 0; }
  .topbar em { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .topbar u { flex-shrink: 0; }

  /* 6. Языки в мобильном меню (ряд ссылок собирает pages.js из переключателя шапки) */
  .nav__langs { display: flex; flex-wrap: wrap; gap: 6px; width: 100%; margin-top: 8px; padding-top: 16px; border-top: 1px solid var(--line); }
  .nav__langs a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; font-size: 15px; color: var(--ink-2); }
  .nav__langs a.is-on { border-color: var(--ink); color: var(--ink); font-weight: 500; }

  /* 14. Подвал: высота нажатия ссылок не меньше 44px */
  .foot__legal { gap: 0 18px; }
  .foot__legal a { display: inline-flex; align-items: center; min-height: 44px; }
  .foot__mid .langsel summary { height: 44px; }
  .langsel__list a { display: flex; align-items: center; min-height: 44px; }

  /* 15. Мелкие кнопки внутри окон (Before/After, вкладки ниш, вкладки AI): вид прежний,
     область нажатия расширена прозрачной рамкой до 44px */
  :is(.isd__ba button, .isd__niches button, .home-aiw__a, .home-aiw__b, .pcat-ai__tab, .q__site, .q__more, .lib__kinds a, .hub__more) { position: relative; }
  :is(.isd__ba button, .home-aiw__a, .home-aiw__b)::after { content: ""; position: absolute; left: -2px; right: -2px; top: -9px; bottom: -9px; }
  :is(.isd__niches button, .pcat-ai__tab)::after { content: ""; position: absolute; left: -6px; right: -6px; top: -8px; bottom: -6px; }
  :is(.q__site, .q__more, .lib__kinds a, .hub__more)::after { content: ""; position: absolute; left: 0; right: 0; top: -10px; bottom: -10px; }

  /* 16. Мелкий текст не меньше 12px */
  .hero__stage .flow small, .flow small { font-size: 12px; }
  .ui .mk, span.mk { font-size: 12px; }
  .pcat-ai__tab span { font-size: 12px; }
  .pcat-ph--none { font-size: 11px; }
  .plat-new { font-size: 12px; padding: 1px 6px; }
  /* 16, добавка 23.11 после прогона по 103 страницам: остатки меньше 12px */
  html .pg .flow.int-flow5 small { font-size: 12px; }
  .pan-bars > div, .pan-bars em, .pan-ring b small { font-size: 12px; }
  .psc-mp__tag { font-size: 12px; }
  .form label small { font-size: 12px; }

  /* 17. Окна в сценах и рядах не шире экрана: у ячеек сетки min-width auto растягивал их по самой
     длинной строке (pl, lt на 320-360px), край окна обрезался. Теперь строки переносятся */
  .scene > .scene__vis, .scene > .scene__text, .split > *, .hero__grid > *, .hero__stage, .hero__text { min-width: 0; }
  .scene__vis .ui, .split__vis .ui, .hero__stage .ui { max-width: 100%; }

  /* Кнопки в тексте страницы не шире экрана: длинный перевод (pl «Skontaktuj się z zespołem» на 320px)
     переносится на вторую строку, однострочная кнопка той же высоты 46px */
  main .btn:not(.btn--sm) { max-width: 100%; height: auto; min-height: 46px; padding-top: 6px; padding-bottom: 6px; white-space: normal; line-height: 1.25; }

  /* 18. Логотипы: знак Erli и Kaufland в карточках каталога крупнее, Shopify в окне первого экрана читается */
  .icard__logo img[src*="int-logo-erli"], .icard__logo img[src*="int-logo-kaufland"] { max-height: 44px; }
  .hero__stage .int-pair img:not(:first-child) { height: 22px; max-width: 110px; }

  /* 7. Кнопка чата EGA: меньше и ближе к углу, пока виден cookie-баннер не показывается.
     У chat.css специфичность #id, здесь сильнее (html body #id) */
  html body #uxas-chat-widget { right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
  html body #uxas-chat-widget .uxas-chat-toggle { width: 48px; height: 48px; }
  html body #uxas-chat-widget .uxas-chat-toggle svg { width: 22px; height: 22px; }
  html body #uxas-chat-widget .uxas-chat-window { bottom: 60px; }
  html body:has(#cc-banner.is-visible) #uxas-chat-widget, html body:has(.nav.is-mob) #uxas-chat-widget { visibility: hidden; }
  /* под кнопкой чата в конце страницы остаётся поле, нижние ссылки подвала не закрыты */
  .foot__bot { padding-bottom: 76px; }
}

@media (max-width: 400px) {
  /* 3, 5. Узкий телефон: кнопка шапки компактнее, без стрелки (переводы длиннее английского) */
  .nav__right .btn--dark.btn--sm { padding: 0 12px; font-size: 13px; height: 34px; }
  .nav__right .btn--dark.btn--sm::after { display: none; }
  .nav__in > .logo { font-size: 19px; gap: 7px; }
  .nav__in > .logo img { width: 26px; }
  .topbar a { font-size: 12.5px; gap: 6px; padding-left: 12px; padding-right: 12px; }
}

@media (max-width: 359px) {
  /* 3. 320px: кнопки «Start for free» в шапке нет, она первая в меню и в первом экране */
  .nav__right .btn--dark.btn--sm { display: none; }
}

@media (max-width: 640px) {
  /* 1. Cookie-баннер на телефоне: был 600px (75% экрана), потому что у текста flex-basis 400px
     в колонке становился высотой. Теперь текст по содержимому, кнопки «принять / отклонить» в ряд,
     настройки строкой ниже. Без размытия под баннером (тяжело для телефона). */
  .cc-banner { padding: 14px 16px calc(14px + env(safe-area-inset-bottom, 0px)); background: #0c0c0c; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .cc-banner__inner { gap: 12px; }
  .cc-banner__text { flex: none; min-width: 0; }
  .cc-banner__title { font-size: 15px; margin-bottom: 4px; }
  .cc-banner__desc { font-size: 13px; line-height: 1.45; }
  .cc-banner__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .cc-banner .cc-btn { width: auto; min-height: 44px; padding: 8px 10px; white-space: normal; text-align: center; line-height: 1.25; }
  .cc-banner .cc-btn--settings { grid-column: 1 / -1; min-height: 40px; }
  .cc-overlay { backdrop-filter: none; -webkit-backdrop-filter: none; }
}
