/* =============================================================
   Добрый мёд — МОБИЛЬНАЯ ГЛАВНАЯ, собранная заново (mobile-first)
   Подключается после style.css. Всё ограничено body.home и шириной
   ≤767.98px, чтобы не затронуть десктоп и другие страницы.
   Версия: rebuild 1.0
   ============================================================= */

@media (max-width: 767.98px) {

  /* ---- База главной ------------------------------------------- */
  body.home { --m-pad: 18px; }
  body.home #dm-page-wrap { overflow-x: clip; }
  /* отступ под липкую нижнюю панель задаётся глобально ниже (body:has(.dm-mobilebar)) */

  /* единый горизонтальный отступ для кастомных секций */
  body.home .container,
  body.home .hero__inner,
  body.home .trust-strip__inner,
  body.home .products__grid,
  body.home .products__services,
  body.home .numbers__grid,
  body.home .quality__inner,
  body.home .segments__grid,
  body.home .conditions__table,
  body.home .faq__inner,
  body.home .cases__grid,
  body.home .cta-section__inner { padding-left: var(--m-pad); padding-right: var(--m-pad); }

  /* вертикальный ритм секций */
  body.home section { padding: 40px 0; }

  /* типографика */
  body.home h1 { font-size: 32px; line-height: 1.12; }
  body.home h2 { font-size: 25px; line-height: 1.15; }
  body.home h3 { font-size: 19px; }
  body.home .section-header { margin-bottom: 26px; }
  body.home .section-header p { font-size: 15px; }

  /* любые кнопки — крупная тач-зона */
  body.home .btn { min-height: 50px; padding: 14px 22px; font-size: 15.5px; border-radius: 10px; }

  /* =============================================================
     ГЕРОЙ
     ============================================================= */
  body.home .hero,
  body.home .elementor-section:has(.hero__facts) { position: relative; }
  /* усиливаем затемнение фонового фото для читаемости */
  body.home .elementor-section:has(.hero__facts)::before { background: rgba(20,17,12,.74); }

  body.home .hero__inner { display: block; padding-top: 30px; padding-bottom: 30px; }

  body.home .hero__label { font-size: 11px; margin-bottom: 14px; }
  body.home .hero h1 { font-size: clamp(30px, 9vw, 38px); margin-bottom: 14px; }
  body.home .hero__lead { font-size: 15.5px; line-height: 1.6; margin-bottom: 22px; max-width: none; }

  /* факты → аккуратная сетка 2×2 из «чипов» */
  body.home .hero__facts {
    display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
    border: 0; margin: 0 0 24px; padding: 0;
  }
  body.home .hero__fact {
    border: 1px solid rgba(255,255,255,.14); border-radius: 12px;
    background: rgba(255,255,255,.05);
    padding: 14px 14px; margin: 0;
  }
  body.home .hero__fact strong { font-size: 22px; margin-bottom: 3px; }
  body.home .hero__fact { font-size: 12px; }

  /* действия героя — в столбик, первая кнопка во всю ширину */
  body.home .hero__actions { display: grid; gap: 10px; margin-bottom: 4px; }
  body.home .hero__actions .btn { width: 100%; justify-content: center; }

  /* ФОРМА героя — чистая полноширинная карточка */
  body.home .hero__form {
    margin-top: 26px; border-radius: 16px; padding: 22px 18px 24px;
    box-shadow: 0 10px 30px rgba(0,0,0,.18);
  }
  body.home .hero__form h3 { font-size: 19px; }
  body.home .hero__form p { font-size: 13.5px; margin-bottom: 16px; }
  /* крупные поля, 16px — без авто-зума iOS */
  body.home .hero__form .form-field input,
  body.home .hero__form .form-field select,
  body.home .hero__form .form-field textarea {
    min-height: 50px; font-size: 16px; border-radius: 10px; padding: 13px 14px;
  }
  body.home .hero__form .btn { width: 100%; justify-content: center; }

  /* =============================================================
     ПЛАШКИ ДОВЕРИЯ → сетка 2×2
     ============================================================= */
  body.home .trust-strip { padding: 22px 0; }
  body.home .trust-strip__inner {
    display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
    border: 0;
  }
  body.home .trust-item {
    border: 1px solid var(--line); border-radius: 12px;
    background: var(--white); padding: 14px 14px; gap: 10px;
    align-items: flex-start;
  }
  body.home .trust-item__icon { width: 36px; height: 36px; font-size: 18px; }
  body.home .trust-item__text strong { font-size: 13px; }
  body.home .trust-item__text span { font-size: 11.5px; }

  /* =============================================================
     ПРОДУКТЫ — карточки во всю ширину, с воздухом
     ============================================================= */
  body.home .products__grid {
    display: grid; grid-template-columns: 1fr; gap: 16px;
    border: 0; border-radius: 0; background: transparent; overflow: visible;
  }
  body.home .product-card {
    border: 1px solid var(--line); border-radius: 16px; overflow: hidden;
    background: var(--white); box-shadow: 0 4px 18px rgba(0,0,0,.06);
  }
  body.home .product-card__img,
  body.home .product-card__img .img-sw { height: 230px; }
  body.home .product-card__body { padding: 18px 18px 8px; }
  body.home .product-card__body h3 { font-size: 20px; margin-bottom: 8px; }
  body.home .product-card__body p { font-size: 14px; }
  body.home .product-card__foot {
    padding: 14px 18px 18px; border-top: 1px solid var(--line);
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
  }
  body.home .product-card__foot-price strong { font-size: 17px; }
  /* «Подробнее» → выглядит как кнопка-таблетка */
  body.home .product-card__foot a {
    display: inline-flex; align-items: center; gap: 6px;
    min-height: 42px; padding: 0 16px; border-radius: 999px;
    border: 1.5px solid var(--cta); color: var(--cta); font-weight: 600;
    white-space: nowrap;
  }

  /* услуги — тёмные карточки в столбик */
  body.home .products__services { display: grid; grid-template-columns: 1fr; gap: 14px; margin-top: 16px; }
  body.home .service-card { border-radius: 16px; padding: 24px 20px; }
  body.home .service-card h3 { font-size: 20px; }
  body.home .service-card .btn { width: 100%; justify-content: center; }

  /* =============================================================
     ЦИФРЫ (если есть отдельная секция)
     ============================================================= */
  body.home .numbers__grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 1px; border-radius: 14px; overflow: hidden;
  }
  body.home .number-item { padding: 22px 16px; }
  body.home .number-item__val { font-size: 40px; }

  /* =============================================================
     КАЧЕСТВО
     ============================================================= */
  body.home .quality__inner { display: block; }
  body.home .quality__text p { font-size: 15px; }
  body.home .quality__doc { grid-template-columns: 1fr; gap: 2px; padding: 12px 0; }
  body.home .quality__doc-num { font-size: 11.5px; }
  body.home .quality__credentials { margin-top: 22px; gap: 14px; }
  body.home .quality__cred { border-radius: 12px; padding: 18px 18px; }

  /* =============================================================
     СЕГМЕНТЫ → карточки 1 в ряд (крупно и читаемо)
     ============================================================= */
  body.home .segments__grid {
    display: grid; grid-template-columns: 1fr; gap: 10px; border: 0; background: transparent;
  }
  body.home .segment-item {
    border: 1px solid var(--line); border-radius: 14px; padding: 18px 18px;
    display: flex; gap: 14px; align-items: flex-start;
  }
  body.home .segment-item__num { font-size: 26px; margin-bottom: 0; }
  body.home .segment-item h4 { font-size: 16px; }
  body.home .segment-item p { font-size: 13.5px; }

  /* =============================================================
     УСЛОВИЯ (таблица) — компактная, без переполнения
     ============================================================= */
  body.home .conditions__table { table-layout: fixed; width: 100%; border-radius: 12px; }
  body.home .conditions__table th,
  body.home .conditions__table td { padding: 10px 9px; font-size: 12.5px; word-break: break-word; }
  body.home .conditions__table td:first-child { width: 40%; }

  /* =============================================================
     FAQ — крупные тач-зоны
     ============================================================= */
  body.home .faq__inner { display: block; }
  body.home .faq__sidebar { margin-bottom: 18px; }
  body.home .faq__question { padding: 18px 0; font-size: 16px; gap: 14px; min-height: 56px; }
  body.home .faq__answer-inner { font-size: 14.5px; }

  /* =============================================================
     КЕЙСЫ → карточки в столбик
     ============================================================= */
  body.home .cases__grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
  body.home .case-card { border-radius: 16px; padding: 22px 18px; }
  body.home .case-card h4 { font-size: 18px; }

  /* =============================================================
     CTA-СЕКЦИЯ
     ============================================================= */
  body.home .cta-section { padding: 44px 0; }
  body.home .cta-section__inner { display: block; }
  body.home .cta-section h2 { font-size: 24px; }
  body.home .cta-section p { font-size: 15.5px; }
  body.home .cta-btns { display: grid; gap: 10px; margin-bottom: 8px; }
  body.home .cta-btns .btn { width: 100%; justify-content: center; }
  body.home .cta-form { margin-top: 22px; border-radius: 16px; padding: 22px 18px; }
  body.home .cta-form .form-field input,
  body.home .cta-form .form-field select { min-height: 50px; font-size: 16px; }

  /* =============================================================
     ЛИПКАЯ НИЖНЯЯ ПАНЕЛЬ ДЕЙСТВИЙ
     ============================================================= */
  .dm-mobilebar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 600;
    display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
    background: rgba(253,250,243,.96);
    backdrop-filter: saturate(1.2) blur(8px);
    border-top: 1px solid var(--line);
    box-shadow: 0 -6px 20px rgba(0,0,0,.07);
  }
  .dm-mobilebar a {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 50px; border-radius: 12px; font-weight: 700; font-size: 15px;
    text-decoration: none; line-height: 1;
  }
  .dm-mobilebar__call { border: 1.5px solid var(--cta); color: var(--cta); background: #fff; }
  .dm-mobilebar__cta  { background: var(--cta); color: #fff; }
  .dm-mobilebar__cta:active { background: var(--cta-hover); }
  .dm-mobilebar svg { width: 18px; height: 18px; flex-shrink: 0; }
}

/* Панель — только на мобильном; на десктопе скрыта всегда */
@media (min-width: 768px) {
  .dm-mobilebar { display: none !important; }
}

/* =============================================================
   MOBILE-FIRST — остальные страницы (rebuild 1.1)
   ============================================================= */
@media (max-width: 767.98px) {

  /* ---- Глобальная база (все страницы) ----------------------- */
  /* отступ снизу под липкую панель, только когда она есть */
  body:has(.dm-mobilebar) { padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
  /* крупные тач-зоны для всех кнопок */
  .btn { min-height: 48px; }

  /* =============================================================
     ТОВАРНЫЕ / СЕРВИСНЫЕ СТРАНИЦЫ
     ============================================================= */
  /* герой товара: pills во всю ширину, цена и CTA в столбик */
  .product__hero-pills { gap: 8px; margin: 18px 0 24px; }
  .product__hero-pill { flex: 1 1 100%; padding: 12px 14px; border-radius: 10px; }
  .product__hero-cta { flex-direction: column; align-items: stretch; gap: 14px; }
  .product__hero-cta .btn { width: 100%; justify-content: center; }
  .product__hero-price strong { font-size: 26px; }

  /* фотогалерея товара */
  .hero__photo .img-sw { height: 300px; border-radius: 12px; }

  /* характеристики */
  .product__specs td { padding: 11px 12px; font-size: 13px; line-height: 1.5; }
  .product__specs td:first-child { width: 42%; padding-right: 12px; }

  /* форма товара — чистая карточка с крупными полями */
  .product__form { border-radius: 16px; padding: 22px 18px 24px; }
  .product__form h3 { font-size: 19px; }
  .product__form .form-field input,
  .product__form .form-field select,
  .product__form .form-field textarea { min-height: 50px; font-size: 16px; border-radius: 10px; }
  .product__form .btn { width: 100%; justify-content: center; }

  /* преимущества и заметка */
  .product__features li { font-size: 15px; padding: 13px 0; }
  .product__contact-note { font-size: 14px; padding: 14px 16px; }

  /* docs-strip (в столбик уже в style.css) */
  .doc-item { padding: 16px 16px; }

  /* шаги услуги */
  .service__steps { gap: 16px; margin-top: 22px; }
  .service__step { gap: 14px; }
  .service__step-num { font-size: 26px; width: 32px; }
  .service-card { border-radius: 16px; padding: 24px 20px; }
  .service-card .btn { width: 100%; justify-content: center; }

  /* =============================================================
     БЛОГ — архив
     ============================================================= */
  .blog-hero { padding: 46px 18px 38px; }
  .blog-hero__title { font-size: clamp(1.7rem, 7vw, 2.2rem); }
  .blog-posts { padding: 38px 18px 46px; }
  .blog-grid { gap: 18px; }
  .blog-card { border-radius: 14px; }
  .blog-card__img-wrap { height: 200px; }
  .blog-card__body { padding: 18px 18px 20px; }
  .blog-card__title { font-size: 1.18rem; line-height: 1.35; }
  .blog-card__excerpt { font-size: .95rem; }
  .blog-pagination .page-numbers li a,
  .blog-pagination .page-numbers li span { min-width: 44px; height: 44px; }
  .blog-cta { padding: 32px 18px; }
  .blog-cta__inner { flex-direction: column; align-items: flex-start; gap: 16px; }
  .blog-cta__text h2 { font-size: 1.4rem; }
  .blog-cta__actions { width: 100%; }
  .blog-cta__actions .btn { width: 100%; justify-content: center; }

  /* =============================================================
     БЛОГ — одиночная статья
     ============================================================= */
  .post-hero { padding: 40px 18px 30px; }
  .post-hero__title { font-size: clamp(1.55rem, 7vw, 2rem); }
  .post-featured-img { padding: 0 18px; }
  .post-featured-img__inner { transform: translateY(18px); border-radius: 12px; }
  .post-featured-img__img { max-height: 240px; }
  .post-layout { padding: 40px 18px 44px; }
  .post-content { font-size: 1.03rem; line-height: 1.75; }
  .post-content h2 { font-size: 1.32rem; margin: 1.8em 0 .7em; }
  .post-content h3 { font-size: 1.12rem; }
  .post-content ul, .post-content ol { padding-left: 1.2em; }
  .post-content table { font-size: .9rem; }
  .post-content th, .post-content td { padding: 8px 10px; }
  .post-tags { margin-top: 32px; padding-top: 24px; }
  .post-author { flex-direction: column; text-align: center; align-items: center; gap: 12px; padding: 22px 18px; }
  /* сайдбар (уже order:-1 ≤960) — крупнее тач-зоны */
  .post-sidebar { gap: 16px; }
  .post-sidebar__widget { padding: 18px 18px 20px; }
  .post-sidebar__cta input { min-height: 48px; font-size: 16px; }
  .post-sidebar__links a { padding: 12px 0; }
  .related-posts { padding: 42px 18px; }
  .related-posts__title { font-size: 1.45rem; margin-bottom: 24px; }

  /* =============================================================
     ОБЩИЕ КОНТЕНТНЫЕ КОМПОНЕНТЫ (на их отдельных страницах)
     ============================================================= */
  /* кейсы (/kejsy) */
  .cases__grid { grid-template-columns: 1fr; gap: 14px; }
  .case-card { border-radius: 16px; padding: 22px 18px; }
  .case-card h4 { font-size: 18px; }
  /* сегменты */
  .segments__grid { grid-template-columns: 1fr; gap: 10px; }
  .segment-item { border-radius: 14px; padding: 18px; display: flex; gap: 14px; align-items: flex-start; }
  /* качество */
  .quality__inner { display: block; }
  .quality__credentials { margin-top: 20px; gap: 14px; }
  .quality__cred { border-radius: 12px; }
  /* FAQ — крупные тач-зоны на любых страницах */
  .faq__question { min-height: 56px; font-size: 16px; }
}
