/* ============================================
   МОБИЛЬНАЯ АДАПТАЦИЯ — агрессивный вариант
   Breakpoint: до 768px
   ============================================ */

@media (max-width: 768px) {

  html, body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
  }

  body {
    min-width: 320px;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  /* ---- Override screen-lg min-width ---- */
  .area.screen-lg {
    min-width: auto !important;
    max-width: 100vw !important;
  }

  .area.screen-lg .container {
    width: 100% !important;
    max-width: 100% !important;
  }

  /* ---- Все контейнеры ---- */
  .container {
    padding-left: 12px !important;
    padding-right: 12px !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    width: 100% !important;
  }

  /* ---- Все div-контейнеры ---- */
  .cont {
    max-width: 100% !important;
    box-sizing: border-box !important;
    width: 100% !important;
  }

  /* ---- Grid: одна колонка ---- */
  .grid.xs-wrap > .gridwrap,
  .grid.sm-wrap > .gridwrap {
    display: block !important;
  }

  .grid.xs-wrap > .gridwrap > .col,
  .grid.sm-wrap > .gridwrap > .col {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 10px !important;
    padding-right: 10px !important;
    margin-bottom: 15px;
    box-sizing: border-box !important;
    min-width: 0 !important;
  }

  /* ---- s-elements (примеры поставок) ---- */
  .s-elements-grid.use-flex {
    flex-direction: column !important;
  }

  .s-elements-grid .s-elements-cell {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  /* ---- w-elements (внутренние сетки) ---- */
  .w-elements-grid.use-flex {
    flex-direction: column !important;
  }

  .w-elements-grid .w-elements-cell {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  /* ---- Zero-layers (абсолютное позиционирование) ---- */
  .zero-grid {
    height: auto !important;
    min-height: auto !important;
    position: relative !important;
  }

  .zero-layer {
    position: relative !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    bottom: auto !important;
    width: 100% !important;
    margin-bottom: 10px;
    display: block !important;
  }

  .zero-layer-axis {
    height: auto !important;
    position: relative !important;
  }

  .zero-layer-frame {
    position: relative !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    bottom: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    transform: none !important;
    display: block !important;
    box-sizing: border-box !important;
  }

  /* ---- Кнопки ---- */
  .btn-legacy {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    min-height: 48px;
  }

  .button-container.full,
  .button-wrapper {
    width: 100% !important;
    max-width: 100% !important;
  }

  /* ---- Изображения ---- */
  .widget-image img,
  .layer-image img,
  img {
    max-width: 100% !important;
    height: auto !important;
  }

  .bgimage {
    max-width: 100% !important;
    background-size: contain !important;
    background-repeat: no-repeat !important;
    box-sizing: border-box !important;
  }

  /* ---- Шрифты ---- */
  .textable.css25,
  .textable.css43,
  .textable.css100,
  .textable.css137,
  .textable.css148,
  .textable.css153,
  .textable.css154 {
    font-size: 20px !important;
    line-height: 1.2 !important;
  }

  .textable.css38,
  .textable.css74,
  .textable.css76,
  .textable.css117,
  .textable.css144 {
    font-size: 16px !important;
  }

  /* ---- Формы ---- */
  .form-control,
  input[type="text"],
  input[type="tel"],
  input[type="email"],
  textarea,
  select {
    font-size: 16px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 12px !important;
  }

  /* ---- Таблица imagedtext ---- */
  .widget-imagedtext .tbl.xs-force-center > .td {
    width: 100% !important;
    display: block !important;
    text-align: center !important;
  }

  .widget-imagedtext .tbl.xs-force-center > .td > div {
    padding-left: 0 !important;
  }

  /* ---- Swiper: перекрываем inline styles ---- */
  .swiper-container {
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
  }

  .swiper-wrapper {
    width: 100% !important;
    max-width: 100% !important;
  }

  .swiper-slide {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    box-sizing: border-box !important;
    padding: 10px 0 !important;
  }

  .swiper-slide[style*="width"] {
    width: 100% !important;
  }

  /* ---- Таблица брендов: scrollable ---- */
  .b-table {
    display: block !important;
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .b-table table {
    min-width: 600px;
  }

  /* ---- Hero секция ---- */
  .g365-hero-inner,
  .hero-inner,
  .et-hero-inner {
    padding-left: 15px !important;
    padding-right: 15px !important;
  }

  /* ---- Отступы секций ---- */
  .node > .padding_top {
    padding-top: 20px !important;
  }

  .node > .padding_bottom {
    padding-bottom: 20px !important;
  }

  /* ---- Скрыть декоративные прямоугольники ---- */
  .layer-rectangle {
    display: none !important;
  }

  /* ---- Все таблицы на мобильных ---- */
  table, thead, tbody, th, td, tr {
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  /* ---- Flex-контейнеры ---- */
  .s-elements-container {
    flex-direction: column !important;
  }

  .s-elements-panel,
  .s-elements-content {
    width: 100% !important;
    max-width: 100% !important;
  }

  /* ===== HERO секции (inline styles) ===== */
  #g365-hero .g365-grid,
  #eteka-scout .hero,
  .et-hero {
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: 1fr !important;
    gap: 16px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  #g365-hero .g365-badges,
  #g365-hero .g365-cta {
    display: flex !important;
    flex-direction: column !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    width: 100% !important;
  }

  #g365-hero .g365-badge,
  #g365-hero .g365-btn,
  #g365-hero .g365-btn--primary,
  #g365-hero .g365-btn--ghost,
  .et-hero .et-btn {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    text-align: center !important;
  }

  #g365-hero .g365-card,
  #eteka-scout .hero-card,
  #eteka-scout .hero-art {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  #g365-hero .g365-row {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
  }

  #g365-hero .g365-row > * {
    flex: none !important;
    width: 100% !important;
  }

  #eteka-scout .hero-pts {
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: 1fr !important;
  }

  #eteka-scout .grid {
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: 1fr !important;
  }

  /* ---- Все display:flex и display:grid внутри контейнера ---- */
  .container [style*="display:grid"],
  .container [style*="display: flex"] {
    display: flex !important;
    flex-direction: column !important;
  }

  /* ---- Принудительный перенос текста ---- */
  h1, h2, h3, h4, h5, h6,
  p, span, div, a, li {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
}

/* ============================================
   ПЛАНШЕТЫ: 769px – 1024px
   ============================================ */
@media (min-width: 769px) and (max-width: 1024px) {
  .grid.sm-wrap > .gridwrap > .col {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    margin-bottom: 15px;
    box-sizing: border-box !important;
  }

  .s-elements-grid .s-elements-cell {
    width: 50% !important;
  }
}

/* ============================================
   УЛУЧШЕНИЯ ДЛЯ ВСЕХ ЭКРАНОВ
   ============================================ */
html {
  scroll-behavior: smooth;
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}
