/* ============================================================
   FIX: Подавление дублирующих нативных окон успеха Тильды
   при отправке через кастомные формы и модальные окна
   ============================================================ */
.t-form__successbox,
.r .js-successbox:not(#drMSuccess):not(#lgLeadSuccess):not(#lsFormSuccess) {
  display: none !important;
}

/* Скрываем нативные всплывающие окна Тильды, привязанные к техническим попап-формам моста */
.t-popup[data-tooltip-hook*="myform"],
.t-popup[data-tooltip-hook*="leadform"],
.r[data-record-type="702"] .t-popup,
.r[data-record-type="BF502N"] .t-popup {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}
/* ============================================================
   FIX: Ускорение LCP и устранение NO_LCP (Google PageSpeed)
   Мгновенное отображение контента первого экрана без задержек
   ============================================================ */
.t-records_animated {
  opacity: 1 !important;
}


/* ============================================================
   CRO ENHANCEMENTS: Mobile Sticky Bar, Channel Selector, Microcopy
   ============================================================ */

/* 1. Mobile Sticky Bar (Только на мобильных <= 768px) */
.dr-mobile-sticky-bar {
  display: none;
}
@media (max-width: 768px) {
  .dr-mobile-sticky-bar {
    display: flex;
    align-items: center;
    justify-content: space-around;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px));
    z-index: 999999;
    gap: 8px;
    box-sizing: border-box;
  }
  body {
    padding-bottom: 74px !important;
  }
  .dr-sticky-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    text-decoration: none;
    font-size: 11px;
    font-weight: 600;
    color: #4a4a4a;
    padding: 6px 4px;
    border-radius: 10px;
    transition: all 0.2s ease;
    border: none;
    background: transparent;
    cursor: pointer;
    line-height: 1.1;
  }
  .dr-sticky-btn svg {
    width: 22px;
    height: 22px;
  }
  .dr-sticky-btn--tg {
    color: #229ED9;
  }
  .dr-sticky-btn--phone {
    color: #2b825b;
  }
  .dr-sticky-btn--cta {
    flex: 1.5;
    background: #7A9B7E;
    color: #ffffff !important;
    padding: 10px 10px;
    border-radius: 12px;
    box-shadow: 0 3px 12px rgba(122, 155, 126, 0.35);
  }
  .dr-sticky-btn--cta span {
    font-size: 12.5px;
    font-weight: 700;
    color: #ffffff;
  }
}

/* 2. Channel Selector в модальных окнах */
.dr-channel-select {
  margin: 10px 0 14px 0;
  background: #f7f6f4;
  border-radius: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(0,0,0,0.06);
}
.dr-channel-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #6e6e73;
  margin-bottom: 8px;
  text-align: left;
}
.dr-channel-chips {
  display: flex;
  gap: 8px;
}
.dr-channel-chip {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
  border: 1.5px solid #e5e5ea;
  background: #ffffff;
  color: #2c2c2e;
  cursor: pointer;
  transition: all 0.2s ease;
}
.dr-channel-chip svg {
  width: 17px;
  height: 17px;
}
.dr-channel-chip.active {
  border-color: #229ED9;
  background: #eef7fc;
  color: #176f99;
}
.dr-channel-chip--phone.active {
  border-color: #34c759;
  background: #eefbf1;
  color: #1c7430;
}

/* 3. Микрокопирайтинг под кнопками */
.dr-form-microcopy {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 11.5px;
  color: #8e8e93;
  margin-top: 10px;
  text-align: center;
  line-height: 1.4;
}
.dr-form-microcopy svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  fill: currentColor;
}


/* ============================================================
   RESPONSIVE & VIEWPORT ADAPTATION SUITE (DESKTOP, TABLET, MOBILE)
   ============================================================ */

/* б. Тело сайта не меньше экрана (min-height: 100vh) и базовый бокс-сайзинг */
html {
  box-sizing: border-box;
  -webkit-text-size-adjust: 100%;
  width: 100%;
  min-height: 100%;
  overflow-x: clip !important;
}

*, *::before, *::after {
  box-sizing: inherit;
}

body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: clip !important;
  position: relative;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#allrecords {
  flex: 1 0 auto;
  width: 100%;
  max-width: 100%;
  overflow-x: clip !important;
}

/* а. Ничего не вылезает за границы экрана (no horizontal overflow) */
img, picture, video, canvas, svg, iframe, table {
  max-width: 100% !important;
  height: auto;
}

table {
  display: block;
  max-width: 100% !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
}

/* Контейнеры и сетки */
.container,
.t-container,
.r,
.t-rec {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

/* г. Корректировка адаптации для планшетов и смартфонов */

/* Планшеты (<= 1024px) */
@media screen and (max-width: 1024px) {
  .dr-services-grid,
  .repair-pricing__grid,
  .partners-grid,
  .bl-works__grid,
  .bl-feat__grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 16px !important;
  }
}

/* Смартфоны и малые экраны (<= 768px) */
@media screen and (max-width: 768px) {
  /* Перевод всех сеток тарифов и карточек в 1 колонку */
  .dr-services-grid,
  .repair-pricing__grid,
  .partners-grid,
  .footer-grid,
  .bl-works__grid,
  .bl-feat__grid,
  .bl-hero__inner,
  .bl-const,
  div[style*="grid-template-columns: repeat(3"],
  div[style*="grid-template-columns:repeat(3"],
  div[style*="grid-template-columns: repeat(4"],
  div[style*="grid-template-columns:repeat(4"] {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  /* Безопасные внутренние отступы секций */
  .section,
  .bl-sec,
  .container,
  .t-container {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  /* Оптимизация кнопок и тач-таргетов: высота >= 44px */
  button,
  .btn,
  .bl-btn,
  .dr-btn,
  a[class*="btn"],
  input[type="submit"],
  input[type="button"] {
    min-height: 44px !important;
    touch-action: manipulation;
  }

  /* Заголовки на мобильных: перенос длинных слов и читаемый размер */
  h1, .hero__title, .bl-hero h1 {
    font-size: clamp(26px, 7vw, 36px) !important;
    line-height: 1.15 !important;
    word-break: normal !important;
    overflow-wrap: break-word !important;
  }

  h2, .sec-title, .bl-sec__title {
    font-size: clamp(22px, 5.5vw, 28px) !important;
    line-height: 1.2 !important;
    word-break: normal !important;
    overflow-wrap: break-word !important;
  }
}

/* Микро-экраны (<= 380px) */
@media screen and (max-width: 380px) {
  .section,
  .bl-sec,
  .container,
  .t-container {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
}
