/* ============================================================
   ЕДИНАЯ СИСТЕМА ОТСТУПОВ
   Применяется на всех страницах сайта
   Desktop / Mobile значения по рекомендациям
   ============================================================ */

:root {
  /* Между крупными секциями */
  --sp-section: 72px;
  --sp-section-sm: 28px;

  /* Перед заголовком H2 от предыдущего блока */
  --sp-before-h2: 40px;
  --sp-before-h2-sm: 28px;

  /* Перед заголовком H3 */
  --sp-before-h3: 28px;
  --sp-before-h3-sm: 20px;

  /* После H1/H2/H3 до текста */
  --sp-after-h1: 20px;
  --sp-after-h1-sm: 14px;
  --sp-after-h2: 14px;
  --sp-after-h2-sm: 10px;
  --sp-after-h3: 10px;
  --sp-after-h3-sm: 8px;

  /* Между абзацами */
  --sp-p: 14px;
  --sp-p-sm: 12px;

  /* Между карточками */
  --sp-cards: 20px;
  --sp-cards-sm: 14px;

  /* Внутри карточки */
  --sp-card-pad: 20px;
  --sp-card-pad-sm: 14px;

  /* Поля формы */
  --sp-field: 16px;
  --sp-field-sm: 14px;

  /* Кнопки */
  --sp-btn: 14px;
  --sp-btn-sm: 10px;

  /* Иконка–текст */
  --sp-icon: 8px;

  /* Заголовок–подзаголовок */
  --sp-title-sub: 6px;
  --sp-title-sub-sm: 4px;
}

/* ============================================================
   1. МЕЖДУ КРУПНЫМИ СЕКЦИЯМИ
   ============================================================ */
html body section.section,
html body section.consult {
  padding-top: var(--sp-section) !important;
  padding-bottom: var(--sp-section) !important;
}
html body section.section[style*="padding-top:0"],
html body section.section[style*="padding-top: 0"] {
  padding-top: 0 !important;
}

/* ============================================================
   2. ЗАГОЛОВКИ → ТЕКСТ
   ============================================================ */
html body h1 + p { margin-top: var(--sp-after-h1) !important; }
html body h2 + p { margin-top: var(--sp-after-h2) !important; }
html body h3 + p { margin-top: var(--sp-after-h3) !important; }

/* ============================================================
   3. МЕЖДУ АБЗАЦАМИ
   ============================================================ */
html body p + p { margin-top: var(--sp-p) !important; }

/* ============================================================
   4. ПЕРЕД ЗАГОЛОВКАМИ H2/H3
   ============================================================ */
html body .section__title,
html body .block-head__title,
html body .kit-main__title,
html body .cert-head__title,
html body .contacts-head__title,
html body .steps-how__title,
html body .catalog-title-block__title,
html body .confg__head-title {
  margin-top: 0 !important;
}

/* ============================================================
   5. МЕЖДУ КАРТОЧКАМИ
   ============================================================ */
html body .specs-grid,
html body .engineering-grid,
html body .contacts-grid,
html body .cert-facts,
html body .kit-main__series,
html body .project-grid,
html body .steps-row,
html body .build-grid,
html body .intro-cols,
html body .footer__grid {
  gap: var(--sp-cards) !important;
}

/* ============================================================
   6. ВНУТРИ КАРТОЧКИ
   ============================================================ */
html body .specs-card,
html body .engineering-card,
html body .contact-card,
html body .cert-facts__item,
html body .kit-series,
html body .project-card__body {
  padding: var(--sp-card-pad) !important;
}

/* ============================================================
   7. ФОРМА — поля между собой
   ============================================================ */
html body .consult-form__row {
  gap: var(--sp-field) !important;
  margin-bottom: var(--sp-field) !important;
}
html body .consult-form .field + .field,
html body .consult-form__row + .checkbox {
  margin-top: var(--sp-field) !important;
}
html body .field input,
html body .field textarea,
html body .field select {
  margin-top: var(--sp-icon) !important;
}

/* ============================================================
   8. МЕЖДУ КНОПКАМИ
   ============================================================ */
html body .hero-full__actions,
html body .consult__actions,
html body .kit-main__cta,
html body .confg__actions,
html body .footer__buttons,
html body .steps-how__actions,
html body .project-actions {
  gap: var(--sp-btn) !important;
}

/* ============================================================
   9. ИКОНКА → ТЕКСТ
   ============================================================ */
html body .adv,
html body .contact-card__ico,
html body .cert-facts__item,
html body .specs-card__ico,
html body .engineering-card__ico,
html body .nav a,
html body .footer__social {
  gap: var(--sp-icon) !important;
}

/* ============================================================
   10. ЗАГОЛОВОК → ПОДЗАГОЛОВОК
   ============================================================ */
html body .block-head__title + .block-head__lead,
html body .kit-main__title + .kit-main__lead,
html body .cert-head__title + .cert-head__lead,
html body .contacts-head__title + .contacts-head__lead,
html body .steps-how__title + .steps-how__lead,
html body .confg__head-title + .confg__head-lead {
  margin-top: var(--sp-title-sub) !important;
}

/* ============================================================
   МОБИЛЬНАЯ ВЕРСИЯ (≤900px / ≤700px)
   ============================================================ */
@media (max-width: 900px) {
  html body section.section,
  html body section.consult {
    padding-top: var(--sp-section-sm) !important;
    padding-bottom: var(--sp-section-sm) !important;
  }
  html body section.section[style*="padding-top:0"],
  html body section.section[style*="padding-top: 0"] {
    padding-top: 0 !important;
  }

  html body h1 + p { margin-top: var(--sp-after-h1-sm) !important; }
  html body h2 + p { margin-top: var(--sp-after-h2-sm) !important; }
  html body h3 + p { margin-top: var(--sp-after-h3-sm) !important; }
  html body p + p { margin-top: var(--sp-p-sm) !important; }

  html body .specs-grid,
  html body .engineering-grid,
  html body .contacts-grid,
  html body .cert-facts,
  html body .kit-main__series,
  html body .project-grid,
  html body .steps-row,
  html body .build-grid,
  html body .intro-cols,
  html body .footer__grid {
    gap: var(--sp-cards-sm) !important;
  }

  html body .specs-card,
  html body .engineering-card,
  html body .contact-card,
  html body .cert-facts__item,
  html body .kit-series,
  html body .project-card__body {
    padding: var(--sp-card-pad-sm) !important;
  }

  html body .consult-form__row {
    gap: var(--sp-field-sm) !important;
    margin-bottom: var(--sp-field-sm) !important;
  }

  html body .hero-full__actions,
  html body .consult__actions,
  html body .kit-main__cta,
  html body .confg__actions,
  html body .footer__buttons,
  html body .steps-how__actions,
  html body .project-actions {
    gap: var(--sp-btn-sm) !important;
  }

  html body .block-head__title + .block-head__lead,
  html body .kit-main__title + .kit-main__lead,
  html body .cert-head__title + .cert-head__lead,
  html body .contacts-head__title + .contacts-head__lead,
  html body .steps-how__title + .steps-how__lead,
  html body .confg__head-title + .confg__head-lead {
    margin-top: var(--sp-title-sub-sm) !important;
  }
}