/* /assets/most-pages/theme/mobile.css */
/* MOST — адаптивный слой (планшеты + телефоны).
   ВАЖНО: сервер отдаёт inline-стили БЕЗ пробела после двоеточия
   (display:grid; padding:12px 64px). Поэтому селекторы — прежде всего
   БЕЗ пробела; варианты с пробелом добавлены для реактивных узлов,
   которые рантайм (support.js) перерисовывает с пробелом.
   Классы .mnav-* навешивает mobile-nav.js (бургер-меню). */

/* базово: бургер и клон CTA скрыты (видны только на ≤1024) */
.mnav-burger { display: none; }
.mnav-cta-clone { display: none; }

/* ============ 1025–1439px: узкие ноутбуки / ландшафт-планшеты ============
   корень из фикс-1440 делаем резиновым, многоколоночные сетки оставляем. */
@media (min-width: 1025px) and (max-width: 1439px) {
  [data-screen-label] { width: 100% !important; max-width: 1440px; min-width: 0 !important; margin: 0 auto !important; }
  img, image-slot, video, canvas, svg { max-width: 100% !important; }
}

/* ============ ≤1024px: одна колонка, всё резиновое ============ */
@media (max-width: 1024px) {
  [data-screen-label] { width: 100% !important; min-width: 0 !important; margin: 0 !important; }

  /* многоколоночные сетки → одна колонка (оба варианта сериализации) */
  [style*="display:grid"], [style*="display: grid"] { grid-template-columns: 1fr !important; }
  .reel-grid[style*="display:grid"], .reel-grid { grid-template-columns: repeat(3, 1fr) !important; }
  /* видео-отзывы на главной → горизонтальный скролл */
  .home-reels { overflow-x: auto !important; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity; padding-bottom: 6px; margin-left: -2px; margin-right: -2px; }
  .home-reels > a { flex: 0 0 44% !important; min-width: 0 !important; scroll-snap-align: start; }
  [style*="grid-column"] { grid-column: auto !important; }
  [style*="grid-row"] { grid-row: auto !important; }

  /* медиа не шире экрана */
  img, image-slot, video, canvas, svg { max-width: 100% !important; height: auto; }

  /* длинные слова и «таблицы» переносим, а не скроллим */
  [style*="white-space:nowrap"], [style*="white-space: nowrap"] { white-space: normal !important; }
  h1, h2, h3 { overflow-wrap: break-word; word-break: break-word; }

  /* flex-строки «слева↔справа» переносим (кроме бегущей строки — она не space-between) */
  [style*="justify-content:space-between"], [style*="justify-content: space-between"] { flex-wrap: wrap !important; }
  /* заголовочные ряды секций (h2 + подзаголовок + ссылка) — в аккуратный столбик */
  [style*="justify-content:space-between"][style*="align-items:baseline"],
  [style*="justify-content: space-between"][style*="align-items: baseline"] {
    flex-direction: column !important; align-items: flex-start !important; gap: 6px !important;
  }
  /* ссылка «Все …→» в таком столбике — без левого отступа (иначе уезжает вправо) */
  [style*="justify-content:space-between"][style*="align-items:baseline"] > a,
  [style*="justify-content: space-between"][style*="align-items: baseline"] > a {
    margin-left: 0 !important;
  }

  /* вложенные крупные горизонтальные паддинги карточек/баров (2-е значение шортхенда) */
  [style*=" 52px"], [style*=" 64px"], [style*=" 48px"], [style*=" 44px"] {
    padding-left: 20px !important; padding-right: 20px !important;
  }

  /* горизонтальные отступы секций (прямые дети корня) */
  [data-screen-label] > div { padding-left: 24px !important; padding-right: 24px !important; }
  /* исключения: липкая шапка (свой паддинг у .mnav-row) и полноширинные полосы */
  [data-screen-label] > div[style*="position:sticky"], [data-screen-label] > div[style*="position: sticky"],
  [data-screen-label] > div[style*="overflow:hidden"], [data-screen-label] > div[style*="overflow: hidden"] {
    padding-left: 0 !important; padding-right: 0 !important;
  }

  /* ужимаем гигантский тайп */
  h1 { font-size: clamp(34px, 6.4vw, 60px) !important; line-height: 1.04 !important; }
  h2 { font-size: clamp(26px, 4.4vw, 38px) !important; line-height: 1.08 !important; }
  [style*="font-size:200px"], [style*="font-size: 200px"] { font-size: 72px !important; line-height: 1.02 !important; }
  [style*="font-size:104px"], [style*="font-size: 104px"] { font-size: 56px !important; }
  [style*="font-size:92px"],  [style*="font-size: 92px"],
  [style*="font-size:88px"],  [style*="font-size: 88px"],
  [style*="font-size:84px"],  [style*="font-size: 84px"],
  [style*="font-size:82px"],  [style*="font-size: 82px"],
  [style*="font-size:80px"],  [style*="font-size: 80px"] { font-size: 48px !important; line-height: 1.05 !important; }
  [style*="font-size:72px"],  [style*="font-size: 72px"] { font-size: 44px !important; }
  [style*="font-size:58px"],  [style*="font-size: 58px"],
  [style*="font-size:56px"],  [style*="font-size: 56px"] { font-size: 36px !important; }

  /* большие межколоночные gap ужимаем */
  [style*="gap:48px"], [style*="gap: 48px"] { gap: 24px !important; }
  [style*="gap:44px"], [style*="gap: 44px"] { gap: 22px !important; }
  [style*="gap:40px"], [style*="gap: 40px"] { gap: 20px !important; }

  /* ===== компактный подвал: бренд на всю ширину, 4 рубрики сеткой 2×2 =====
     (правило идёт ПОСЛЕ общего схлопывания сеток — перебивает его по порядку) */
  [style*="grid-template-columns:1.2fr 1fr 1fr 1fr 1fr"],
  [style*="grid-template-columns: 1.2fr 1fr 1fr 1fr 1fr"] {
    grid-template-columns: 1fr 1fr !important;
    gap: 26px 18px !important;
  }
  [style*="grid-template-columns:1.2fr 1fr 1fr 1fr 1fr"] > div:first-child,
  [style*="grid-template-columns: 1.2fr 1fr 1fr 1fr 1fr"] > div:first-child {
    grid-column: 1 / -1 !important;
  }

  /* высокие фото-слоты */
  image-slot[style*="height:360px"], image-slot[style*="height: 360px"],
  image-slot[style*="height:340px"], image-slot[style*="height: 340px"],
  image-slot[style*="height:320px"], image-slot[style*="height: 320px"],
  image-slot[style*="height:280px"], image-slot[style*="height: 280px"] { height: 230px !important; }

  /* ===== бургер-меню (классы навешивает mobile-nav.js) ===== */
  .mnav-row { padding-left: 20px !important; padding-right: 20px !important; }
  .mnav-cta { display: none !important; }              /* исходный CTA в шапке прячем */

  .mnav-burger {
    display: inline-flex !important; flex-direction: column; justify-content: center;
    gap: 5px; width: 44px; height: 44px; padding: 0; box-sizing: border-box;
    background: transparent; border: 1.5px solid #143e32; cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .mnav-burger span { display: block; width: 20px; height: 2px; margin: 0 auto; background: #143e32;
    transition: transform .2s ease, opacity .2s ease; }
  .mnav-burger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .mnav-burger.is-open span:nth-child(2) { opacity: 0; }
  .mnav-burger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .mnav-panel {
    position: absolute !important; top: 100% !important; left: 0 !important; right: 0 !important;
    display: none !important; flex-direction: column !important; align-items: stretch !important;
    gap: 0 !important; background: #f7f9f6; border-top: 1.5px solid #143e32;
    padding: 6px 20px 16px !important; z-index: 200; box-shadow: 0 14px 26px rgba(0,0,0,.10);
  }
  .mnav-open .mnav-panel { display: flex !important; }
  .mnav-panel > a { margin: 0 !important; padding: 14px 2px !important; font-size: 16px !important;
    border-bottom: 1px solid rgba(17,17,17,.12); }
  .mnav-panel .mnav-cta-clone {
    display: block !important; margin-top: 12px !important; border-bottom: none !important;
    text-align: center; background: #d2ed92 !important; color: #143e32 !important;
    border: 1.5px solid #143e32 !important; padding: 14px 18px !important; font-size: 13px !important;
  }
}

/* ============ ≤720px: телефоны — плотнее ============ */
@media (max-width: 720px) {
  [data-screen-label] > div { padding-left: 18px !important; padding-right: 18px !important; }
  [data-screen-label] > div[style*="position:sticky"], [data-screen-label] > div[style*="position: sticky"],
  [data-screen-label] > div[style*="overflow:hidden"], [data-screen-label] > div[style*="overflow: hidden"] {
    padding-left: 0 !important; padding-right: 0 !important;
  }
  .mnav-row { padding-left: 16px !important; padding-right: 16px !important; }
  .mnav-panel { padding-left: 16px !important; padding-right: 16px !important; }
  .reel-grid[style*="display:grid"], .reel-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .home-reels > a { flex: 0 0 60% !important; }

  h1 { font-size: clamp(30px, 10vw, 44px) !important; }
  h2 { font-size: clamp(23px, 6.6vw, 30px) !important; }
  [style*="font-size:200px"], [style*="font-size: 200px"] { font-size: 48px !important; }
  [style*="font-size:104px"], [style*="font-size: 104px"] { font-size: 42px !important; }
  [style*="font-size:92px"],  [style*="font-size: 92px"],
  [style*="font-size:88px"],  [style*="font-size: 88px"],
  [style*="font-size:84px"],  [style*="font-size: 84px"],
  [style*="font-size:82px"],  [style*="font-size: 82px"],
  [style*="font-size:80px"],  [style*="font-size: 80px"] { font-size: 38px !important; }
  [style*="font-size:72px"],  [style*="font-size: 72px"] { font-size: 34px !important; }
  [style*="font-size:58px"],  [style*="font-size: 58px"],
  [style*="font-size:56px"],  [style*="font-size: 56px"] { font-size: 30px !important; }

  /* бегущая строка логотипов — мельче */
  [style*="animation:most-marquee"], [style*="animation: most-marquee"] { font-size: 13px !important; }

  /* ряды чипов-эйброу (display:flex;gap:8px) переносим, а не скроллим на узких телефонах */
  [style*="display:flex"][style*="gap:8px"], [style*="display: flex"][style*="gap: 8px"] { flex-wrap: wrap !important; }

  image-slot[style*="height:360px"], image-slot[style*="height: 360px"],
  image-slot[style*="height:340px"], image-slot[style*="height: 340px"],
  image-slot[style*="height:320px"], image-slot[style*="height: 320px"],
  image-slot[style*="height:280px"], image-slot[style*="height: 280px"] { height: 200px !important; }
}

/* ============ виджет связи «Как удобнее связаться?» (v8) ============ */
.mchat{position:fixed;right:20px;bottom:20px;z-index:400;display:flex;flex-direction:column;align-items:flex-end;gap:12px;font-family:Manrope,system-ui,sans-serif}
.mchat-panel{width:322px;max-width:calc(100vw - 32px);background:#f7f9f6;border:1.5px solid #143e32;box-shadow:6px 6px 0 #143e32;display:none}
@keyframes mchatIn{from{opacity:0;transform:translateY(10px) scale(.98)}to{opacity:1;transform:none}}
.mchat.open .mchat-panel{display:block;animation:mchatIn .18s ease both}
.mchat-head{display:flex;justify-content:space-between;align-items:flex-start;gap:10px;padding:15px 16px 12px;border-bottom:1.5px solid #143e32;background:#d2ed92}
.mchat-head h4{margin:0;font-family:Manrope,sans-serif;font-weight:800;font-size:16px;text-transform:uppercase;line-height:1.08;color:#143e32}
.mchat-head p{margin:5px 0 0;font-size:10.5px;font-weight:700;letter-spacing:.03em;text-transform:uppercase;color:#2A2A26}
.mchat-close{flex:0 0 auto;width:26px;height:26px;border:1.5px solid #143e32;background:#f7f9f6;cursor:pointer;font-size:13px;line-height:1;display:flex;align-items:center;justify-content:center}
.mchat-row{display:flex;align-items:center;gap:12px;padding:12px 16px;text-decoration:none;border-bottom:1px solid rgba(17,17,17,.12);background:#fff;transition:background .12s}
.mchat-row:last-child{border-bottom:none}
.mchat-row:hover{background:#F1F4E4}
.mchat-ic{flex:0 0 auto;width:38px;height:38px;border:1.5px solid #143e32;border-radius:50%;display:flex;align-items:center;justify-content:center}
.mchat-ic svg{width:20px;height:20px;fill:#fff;display:block}
.mchat-tx{flex:1;min-width:0}
.mchat-tx b{display:block;font-family:Manrope,sans-serif;font-weight:800;font-size:14px;color:#143e32;line-height:1.15}
.mchat-tx span{display:block;font-size:10.5px;font-weight:700;text-transform:uppercase;letter-spacing:.02em;color:#50665b;margin-top:2px}
.mchat-ar{flex:0 0 auto;font-family:Manrope,sans-serif;font-weight:800;color:#143e32}
.mchat .i-wa{background:#25D366}.mchat .i-tg{background:#229ED9}.mchat .i-max{background:#1B6EF3}.mchat .i-call{background:#143e32}.mchat .i-mail{background:#50665b}
.mchat-fab{display:inline-flex;align-items:center;gap:9px;background:#d2ed92;border:1.5px solid #143e32;box-shadow:3px 3px 0 #143e32;cursor:pointer;padding:12px 17px;font-family:Manrope,sans-serif;font-weight:800;font-size:13px;text-transform:uppercase;color:#143e32;transition:transform .12s,box-shadow .12s;-webkit-tap-highlight-color:transparent}
.mchat-fab:hover{transform:translateY(-2px);box-shadow:5px 5px 0 #143e32}
.mchat-fab svg{width:20px;height:20px;fill:#143e32;display:block}
.mchat.open .mchat-fab .lbl-open{display:none}
.mchat-fab .lbl-close{display:none}
.mchat.open .mchat-fab .lbl-close{display:inline}
@media (max-width:720px){.mchat{right:12px;bottom:12px;gap:10px}.mchat-fab{padding:11px 15px;font-size:12px}.mchat-panel{width:300px}}

/* /assets/most-pages/theme/animations.css */
/* MOST — базовые переходы, нажатие, фокус и доступность.
   Сами ховер-состояния берутся из атрибутов style-hover (см. hover-styles.js),
   поэтому здесь только плавность и общие мелочи, чтобы не конфликтовать. */

/* Плавный переход для интерактивных элементов (чтобы style-hover анимировался) */
button,
a,
summary,
label,
input[type="range"],
input[type="checkbox"],
[style-hover],
[style*="cursor:pointer"],
[style*="cursor: pointer"] {
  transition: transform .16s ease, filter .16s ease, box-shadow .16s ease,
              background-color .16s ease, color .16s ease, opacity .16s ease,
              border-color .16s ease;
}

/* Тактильный отклик на нажатие (для всех кликабельных) */
button:active,
a:active,
[style-hover]:active,
[style*="cursor:pointer"]:active,
[style*="cursor: pointer"]:active {
  transform: translateY(1px) scale(.99);
}

/* Ползунки калькулятора */
input[type="range"] { accent-color: #143e32; }
input[type="range"]::-webkit-slider-thumb { transition: transform .12s ease; }
input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.25); }

/* Чекбокс согласия */
input[type="checkbox"] { accent-color: #d2ed92; cursor: pointer; }

/* Видимая обводка при навигации с клавиатуры (доступность) */
button:focus-visible,
a:focus-visible,
input:focus-visible,
summary:focus-visible,
[style*="cursor:pointer"]:focus-visible {
  outline: 2px solid #143e32;
  outline-offset: 2px;
}

/* Уважение к системной настройке «уменьшить движение» */
@media (prefers-reduced-motion: reduce) {
  button, a, summary, label, input,
  [style-hover], [style*="cursor:pointer"], [style*="cursor: pointer"] {
    transition: none !important;
  }
  button:active, a:active, [style-hover]:active { transform: none; }
}
