/* =========================================================
   1. ПЕРЕМЕННЫЕ — цвета, тени, размеры
   ========================================================= */
:root {
  --primary-blue: #ffffff;
  --accent-orange: #FF9800;
  --white: #FFFFFF;
  --light-gray: #F5F7FA;
  --graphite: #2A2A2A;
  --steel-gray: #546E7A;
  --line-gray: #E0E0E0;

  --radius-md: 12px;
  --radius-lg: 16px;

  --shadow-soft: 0 2px 8px rgba(0,0,0,0.05);
  --shadow-hover: 0 4px 14px rgba(0,0,0,0.08);

  --container-width: 1200px;

  --transition-fast: .2s ease;
  --transition-mid: .35s ease;
}

/* =========================================================
   2. БАЗА
   ========================================================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Inter', 'Roboto', sans-serif;
  color: var(--graphite);
  background: var(--white);
  line-height: 1.5;
  overflow-x: hidden;
}

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

/* Контейнер */
.container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* =========================================================
   3. ТИПОГРАФИКА
   ========================================================= */

.section-title {
  font-size: 22px;        /* уменьшили размер */
  font-weight: 700;
  color: var(--graphite);
  line-height: 1.25;      /* делаем компактнее */
  margin-bottom: 16px;
}

.section-subtitle {
  font-size: 18px;
  color: var(--steel-gray);
  margin-bottom: 40px;
}

/* =========================================================
   4. КНОПКИ
   ========================================================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 26px;
  font-size: 16px;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: var(--transition-fast);
  text-decoration: none;
}

.btn--primary {
  background: var(--accent-orange);
  color: var(--white);
}

.btn--secondary {
  background: #2f3f5f;   /* тёмно-синий фон кнопки */
  color: #ffffff;        /* белый текст */
}

.btn--ghost {
  background: transparent;
  color: var(--primary-blue);
}

.btn:hover {
  transform: scale(1.04);
  box-shadow: var(--shadow-hover);
}

/* =========================================================
   5. HEADER
   ========================================================= */

.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: var(--white);
  box-shadow: var(--shadow-soft);
  z-index: 1000;
  padding: 10px 0;
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

/* Логотип */
.header__logo-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.header__logo-img {
  width: 36px;
  height: auto;
  object-fit: contain;
}

.header__logo-text {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary-blue);
}

.header__offer-text {
  font-size: 13px;
  color: var(--steel-gray);
  max-width: 260px;
}

/* Телефон и режим работы */
.header__contacts {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.header__phone {
  font-size: 16px;
  font-weight: 700;
  color: var(--graphite);
  text-decoration: none;
}

.header__worktime {
  font-size: 12px;
  color: var(--steel-gray);
}

/* Кнопки справа (десктоп) */
.header__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Бургер */
.header__burger {
  display: none;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.header__burger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--graphite);
  border-radius: 999px;
  margin: 4px 0;
  transition: 0.2s ease;
}

/* Анимация крестика */
.header__burger--active span:nth-child(1) {
  transform: translateY(4px) rotate(45deg);
}

.header__burger--active span:nth-child(2) {
  opacity: 0;
}

.header__burger--active span:nth-child(3) {
  transform: translateY(-4px) rotate(-45deg);
}

/* ================== MOBILE NAV ================== */

nav.mobile-nav {
  display: none;
  position: fixed;
  top: 60px;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.80);          /* чуть прозрачнее */
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);                     /* размытие фона под меню */
  border-bottom: 1px solid rgba(0,0,0,0.06);
  padding: 0;
  box-shadow: 0 2px 10px rgba(0,0,0,0.15);
  z-index: 999;
}

.mobile-nav__inner {
  padding: 16px 20px 24px;
}

/* Телефон */
.mobile-nav__top {
  margin-bottom: 18px;
}

.mobile-nav__phone {
  display: block;
  font-size: 18px;
  font-weight: 700;
  color: var(--graphite);
  text-decoration: none;
  margin-bottom: 4px;
}

.mobile-nav__worktime {
  font-size: 13px;
  color: var(--steel-gray);
}

/* Список */
.mobile-nav__list {
  list-style: none;
  padding: 0;
  margin: 0 0 16px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mobile-nav__link {
  display: block;
  padding: 8px 0;
  font-size: 16px;
  color: var(--graphite);
  text-decoration: none;
  border-bottom: 1px solid var(--line-gray);
}

.mobile-nav__link:last-child {
  border-bottom: none;
}

.mobile-nav__link:hover {
  color: var(--primary-blue);
}

/* Кнопка в меню */
.mobile-nav__bottom .btn {
  width: 100%;
  margin-top: 10px;
}

/* Класс, который включает меню через JS */
.mobile-nav--open {
  display: block !important;
}

/* Прячем мобильное меню на десктопе */
@media (min-width: 769px) {
  nav.mobile-nav {
    display: none !important;
  }
}

/* =========================================================
   6. HERO — текст слева, картинка справа
   ========================================================= */

.hero {
  position: relative;
  display: flex;
  align-items: stretch;
  min-height: 50vh;
  background-color: #2f3f5f;   /* Обычный синий фон как раньше */
  overflow: hidden;
  margin-top: 50px; /* ровно под фиксированный хедер */
  justify-content: center;           /* <-- ДОБАВИТЬ */
}

/* Левая половина (текст) */
.hero__left {
  flex: 0 0 50%;
  display: flex;
  align-items: center;
  max-width: calc(var(--container-width) / 2);  /* <-- ДОБАВИТЬ */
}

.hero__left .container {
  padding-top: 60px;
  padding-bottom: 80px;
}

.hero__right {
  flex: 0 0 50%;
  position: relative;
  overflow: hidden;
  background-color: #ffffff; /* белый фон */
  max-width: calc(var(--container-width) / 2);  /* <-- ДОБАВИТЬ */
}

/* Градиент справа поверх картинки (ТОЛЬКО ПК) */
.hero__right::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 50%;       /* ширина затемнения справа */
  height: 100%;
  pointer-events: none;
  background: linear-gradient(to right, rgba(255,255,255,0) 0%, #ffffff 100%);
  z-index: 2;       /* выше картинки */
}


.hero__content {
  max-width: 520px;
}

.hero__title {
  font-size: 46px;
  font-weight: 800;
  color: #FFFFFF;
  line-height: 1.2;
  margin-bottom: 20px;
}

.hero__subtitle-services {
  font-size: 36px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.4;
  margin: 0 0 20px 0;
  text-transform: lowercase;

  /* чтобы ul выглядел как раньше */
  list-style: none;
  padding: 0;
}

.hero__subtitle-services li {
  margin: 0;      /* без лишних отступов */
  padding: 0;
}


/* Список преимуществ под текстом */
.hero__list {
  list-style: none;
  margin: 0 0 28px 0;
  padding: 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: 16px;
}

.hero__list li + li {
  margin-top: 6px;
}

/* Кнопка в HERO */
.hero__btn {
  margin-top: 4px;
}

/* Правая половина (картинка) */
.hero__right {
  flex: 0 0 50%;
  position: relative;
  overflow: hidden;
}

.hero__right img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* =========================================================
   7. БЛОК ПРОБЛЕМ
   ========================================================= */

.problems {
  padding: 40px 0;   /* было 80 — уменьшили в 2 раза */
}

.problems__grid {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(3, 1fr);
  margin-bottom: 40px;
}

/* === ОБНОВЛЁННЫЙ СТИЛЬ ДЛЯ КАРТОЧЕК В БЛОКЕ "ПРОБЛЕМЫ" === */
.problems__item {
  background: #2f3f5f;        /* насыщенно-синий фон карточки */
  padding: 30px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);

  color: #FFFFFF;             /* белый текст внутри */
}

/* Заголовок в карточках — уменьшаем шрифт */
.problems__item h3.problems__title {
  color: #FFFFFF;
  font-size: 20px;      /* было 20–22, делаем компактнее */
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 10px;
}

.problems__item p.problems__text {
  color: rgba(255,255,255,0.9); /* мягкий белый для текста */
}

.problems__solution {
  display: flex;
  align-items: center;
  gap: 40px;
}

/* ================================
   HOW WE WORK — блок как мы это делаем
   ================================ */

.how-we-work {
  padding: 60px 0 40px;   /* сверху 60, снизу 40 */
}

.how-we-work__inner {
  display: flex;
  align-items: stretch;
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(to right, #ffffff 50%, #2f3f5f 50%);
}

/* Картинка слева (ПК) */
.how-we-work__image {
  flex: 0 0 50%;
  position: relative;
  min-height: 320px;
  background: #ffffff;
}

.how-we-work__image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Текст справа (синий блок) */
.how-we-work__content {
  flex: 0 0 50%;
  padding: 40px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: #ffffff;
}

.how-we-work__title {
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 16px;
  color: #ffffff;
}

.how-we-work__text {
  font-size: 18px;
  line-height: 1.5;
  margin-bottom: 18px;
  color: rgba(255,255,255,0.9);
}

.how-we-work__list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 16px;
  color: rgba(255,255,255,0.9);
}

.how-we-work__list li + li {
  margin-top: 6px;
}

@media (max-width: 600px) {
  .how-we-work__inner {
    flex-direction: column;      /* сначала текст, потом картинка */
    background: #2f3f5f;
    border-radius: 0;
  }

  .how-we-work__content {
    order: 1;
    padding: 24px 20px 28px;
  }

  .how-we-work__image {
    order: 2;
    width: 100%;
    height: 220px;               /* фиксированная высота, чтобы картинку было видно */
    position: relative;
  }

  .how-we-work__image img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .how-we-work__title {
    font-size: 24px;
  }

  .how-we-work__text {
    font-size: 16px;
  }
  /* Мобилка: уменьшаем нижний отступ у секции "Как мы работаем" */
  .how-we-work{
    padding: 40px 0 18px; /* было 60px 0 40px — снизу меньше */
  }

  /* Мобилка: уменьшаем нижний паддинг у синего блока с текстом */
  .how-we-work__content{
    padding: 24px 20px 16px; /* было 24px 20px 28px — снизу меньше */
  }

}



/* =========================================================
   8. УСЛУГИ
   ========================================================= */

.services {
  padding: 26px 0 28px;
  background: #2f3f5f; /* синий фон блока */
}

.services .section-title {
  color: #ffffff;
}

.services .section-subtitle {
  color: rgba(255,255,255,0.85);
}


.services__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.service-card {
  background: var(--white);
  padding: 18px 20px;  /* компактная, аккуратная высота */
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  transition: var(--transition-fast);
}

.service-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.service-card__icon {
  width: 60px;
  height: 60px;
  margin-bottom: 16px;
  border-radius: 14px;
  background: #F3F8FC;
  display: flex;
  align-items: center;
  justify-content: center;
}

.service-card__icon-img {
  width: 60px;
  height: 60px;
  object-fit: contain;
}

/* =========================================================
   9. ПРЕИМУЩЕСТВА
   ========================================================= */

.advantages {
  padding: 80px 0;
}

.advantages__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px;
}

.advantages__item {
  background: var(--white);
  padding: 30px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

/* =========================================================
   10. ЦЕНЫ
   ========================================================= */

.prices {
  padding: 80px 0;
  background: var(--light-gray);
}

.prices__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.price-card {
  background: var(--white);
  padding: 30px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

/* =========================================================
   11. 3 ШАГА
   ========================================================= */

.steps {
  padding: 80px 0;
}

.steps__grid {
  display: grid;
  gap: 28px;
  grid-template-columns: repeat(3, 1fr);
}

/* =========================================================
   12. ПОРТФОЛИО — превью одной работы
   ========================================================= */

.portfolio {
  padding: 80px 0;
  background: var(--light-gray);
}

/* === ПОРТФОЛИО: сетка === */
.portfolio__grid {
  display: grid;
  gap: 28px;
  grid-template-columns: repeat(3, 1fr); /* 3 карточки в ряд на ПК */
  align-items: start;
}



.portfolio__preview {
  display: flex;
  flex-direction: column;
  gap: 24px;
  align-items: flex-start;
}

.portfolio__item {
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  max-width: 380px;

  display: flex;             /* карточка — flex-колонка */
  flex-direction: column;
  height: 100%;              /* чтобы в сетке были одинаковой высоты */
}

.portfolio__image-wrap {
  position: relative;
  width: 100%;
  padding-bottom: 75%;      /* высота карточки */
  overflow: hidden;
}

.portfolio__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.portfolio__item:hover .portfolio__image {
  transform: scale(1.03);
}

.portfolio__title {
  margin: 12px 16px 4px;
  font-size: 16px;
  font-weight: 600;
}

.portfolio__text {
  margin: 0;                 /* отступы будет задавать wrapper */
  font-size: 14px;
  color: var(--steel-gray);
}

/* Обёртка для текста — обрезаем по высоте */
.portfolio__text-wrapper {
  margin: 0 16px 8px;
  max-height: 56px;                  /* ~2 строки текста */
  overflow: hidden;
  position: relative;
  transition: max-height 0.3s ease;
}

/* Градиент, чтобы срез выглядел мягко */
.portfolio__text-wrapper::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 20px;
  background: linear-gradient(to bottom, rgba(255,255,255,0), #ffffff);
  pointer-events: none;
}

/* Когда раскрыто */
.portfolio__text-wrapper--open {
  max-height: 500px;                 /* достаточно много для полного текста */
}

.portfolio__text-wrapper--open::after {
  display: none;
}

/* Кнопка "Подробнее" / "Скрыть" */
.portfolio__more {
  margin: 0 16px 16px;
  padding: 6px 10px;
  font-size: 14px;
  border: none;
  border-radius: 6px;
  background: #2f3f5f;
  color: #ffffff;
  cursor: pointer;
  transition: background 0.25s ease, transform 0.15s ease;
}

.portfolio__more:hover {
  background: #1f314a;
  transform: translateY(-1px);
}


.portfolio__actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* На десктопе фото + кнопка в ряд */
@media (min-width: 768px) {
  .portfolio__preview {
    flex-direction: row;
    align-items: center;
  }
}



/* =========================================================
   13. BEFORE/AFTER
   ========================================================= */

.before-after {
  padding: 80px 0;
  background: #2f3f5f;      /* синий фон */
  color: #ffffff;           /* белый текст */
}

.before-after .section-header {
  text-align: center;       /* центрируем весь заголовок */
}

/* Заголовок белый */
.before-after .section-title {
  color: #ffffff;
}

/* Подзаголовок мягко-белый */
.before-after .section-subtitle {
  color: rgba(255, 255, 255, 0.85);
}

/* Обёртка слайдера */
.before-after__slider {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-soft);

  --ba-position: 50%;
}

/* Контейнер картинок, держим пропорции 16:9 */
.before-after__images {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 56.25%;
}

/* Базовый стиль картинок */
.before-after__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Левая картинка — "до" */
.before-after__image--before {
  z-index: 1;
  clip-path: polygon(0 0, var(--ba-position) 0, var(--ba-position) 100%, 0 100%);
  transition: clip-path 0.25s ease-out;
}

/* Правая картинка — "после" */
.before-after__image--after {
  z-index: 0;
}

/* Ручка-разделитель */
.before-after__handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--ba-position);
  transform: translateX(-50%);
  z-index: 2;
}

/* Вертикальная линия */
.before-after__handle-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  transform: translateX(-50%);
  background-color: #ffffff;
}

/* Круглая кнопка-ползунок */
.before-after__handle::before {
  content: "↔";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: #ff9800;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
  cursor: ew-resize;
}

/* Адаптив: на очень узких экранах меньше высота */
@media (max-width: 600px) {
  .before-after__images {
    padding-bottom: 75%;
  }
}

/* =========================================================
   14. ОТЗЫВЫ
   ========================================================= */

.reviews {
  padding: 60px 0;
  background: #ffffff;
}

.reviews__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

/* Синяя карточка */
.review-card {
  background: #2f3f5f;
  padding: 26px;
  border-radius: 16px;
  box-shadow: var(--shadow-soft);
  display: flex;
  gap: 18px;
  color: #ffffff;
  align-items: flex-start;
  transition: 0.2s ease;
}

.review-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

/* Аватарка */
/* Контейнер под аватар */
.review-card__avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  overflow: hidden;   /* обрезаем всё лишнее */
  flex-shrink: 0;     /* запрещаем сжимать блок */
}

/* Картинка внутри */
.review-card__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid #ffffff33;
  display: block;
}

/* Имя */
.review-card__name {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
  color: #ffffff;
}

/* Звёзды */
.review-card__stars {
  font-size: 16px;
  color: #FFB400;   /* золотистый */
  margin-bottom: 10px;
  letter-spacing: 2px;
}

/* Текст */
.review-card__text {
  font-size: 15px;
  line-height: 1.45;
  color: rgba(255,255,255,0.9);
}

/* Скриншоты */
.reviews__screens {
  margin-top: 32px;
  display: flex;
  gap: 16px;
  justify-content: center;
}

.reviews__screen {
  width: 180px;
  border-radius: 12px;
  box-shadow: var(--shadow-soft);
}

/* Мобильная версия */
@media (max-width: 600px) {
  .reviews__grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .review-card {
    padding: 20px;
  }

  .review-card__avatar img {
    width: 54px;
    height: 54px;
  }

  .reviews__screens {
    flex-direction: column;
    align-items: center;
  }

  .reviews__screen {
    width: 70%;
  }
}


/* =========================================================
   15. КАЛЬКУЛЯТОР (КВИЗ)
   ========================================================= */

.calculator {
  padding: 80px 0;
}

.calculator__step {
  display: none;
}

.calculator__step--active {
  display: block;
}

/* =========================================================
   16. FAQ — синий фон, белые блоки, анимация
   ========================================================= */

.faq {
  padding: 80px 0;
  background: #2f3f5f; /* тот же синий, что и в hero */
}

/* Заголовок и подзаголовок на тёмном фоне */
.faq .section-title {
  color: #ffffff;
}

.faq .section-subtitle {
  color: rgba(255, 255, 255, 0.85);
  max-width: 640px;
}

/* Список вопросов */
.faq__list {
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Белые карточки */
.faq__item {
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 16px 20px;
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.faq__item:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
}

/* Кнопка-вопрос без рамки */
.faq__question {
  width: 100%;
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* Текст вопроса */
.faq__question-text {
  font-size: 16px;
  font-weight: 600;
  color: var(--graphite);
}

/* Иконка FAQ — пустой круг */
.faq__icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid #2f3f5f; /* оранжевый ободок */
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

/* При открытии — круг заливается синим */
.faq__item.active .faq__icon {
  background-color: #2f3f5f;  /* твой синий цвет */
  border-color: #2f3f5f;      /* убираем оранжевый контур */
}

/* Ответ с плавным раскрытием */
.faq__answer {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  margin-top: 0;
  transition: max-height 0.3s ease, opacity 0.3s ease, margin-top 0.3s ease;
  font-size: 14px;
  color: var(--steel-gray);
}

/* Активный ответ показываем */
.faq__item.active .faq__answer {
  max-height: 300px;   /* достаточно для краткого текста */
  opacity: 1;
  margin-top: 10px;
}

/* Адаптив: на мобиле чуть уменьшаем отступы */
@media (max-width: 600px) {
  .faq {
    padding: 60px 0;
  }

  .faq__item {
    padding: 14px 16px;
  }

  .faq__question-text {
    font-size: 15px;
  }
}


/* =========================================================
   17. КОНТАКТЫ
   ========================================================= */

/* Десктоп/планшет — в целом меньше */
.contacts{
  padding: 48px 0; /* было 80px 0 */
}

/* Мобилка — ещё компактнее */
@media (max-width: 600px){
  .contacts{
    padding: 28px 0; /* было 80px 0 */
  }

}
/* =========================================================
   18. FOOTER
   ========================================================= */

.footer {
  padding: 22px 0;
  background: var(--graphite);
  color: var(--white);
  font-size: 14px;
}

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Футер: ссылка "Наверх" (и другие footer__link) */
.footer__link{
  color: rgba(255, 255, 255, 0.78);
  text-decoration: none;
  font-weight: 600;
}

.footer__link:hover{
  color: rgba(255, 255, 255, 0.95);
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* Мобилка — ещё компактнее */
@media (max-width: 600px){
  .footer{
    padding: 16px 0; /* было 40px 0 */
  }
}


/* =========================================================
   19. ПЛАВАЮЩАЯ КНОПКА
   ========================================================= */

.floating-cta {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 999;
}
/* Уменьшаем именно плавающую кнопку (не трогая остальные .btn) */
.floating-cta.btn{
  padding: 10px 16px;     /* было 14px 26px */
  font-size: 14px;        /* было 16px */
  border-radius: 14px;
  line-height: 1.1;
}

/* На мобиле — ещё компактнее */
@media (max-width: 600px){
  .floating-cta{
    bottom: 16px;
    right: 16px;
  }

  .floating-cta.btn{
    padding: 9px 14px;
    font-size: 13px;
  }
}


/* =========================================================
   20. АНИМАЦИИ
   ========================================================= */

.fade-in {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeIn .5s forwards ease-out;
}

@keyframes fadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.slide-up {
  opacity: 0;
  transform: translateY(15px);
  animation: slideUp .4s forwards ease-out;
}

@keyframes slideUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.step-appear {
  opacity: 0;
  animation: stepAppear .5s forwards ease-out;
}

@keyframes stepAppear {
  to { opacity: 1; }
}

/* MOBILE HERO IMAGE FULL WIDTH */
.hero__image-mobile {
  display: none;
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  overflow: hidden;
}

.hero__image-mobile img {
  width: 100%;
  height: auto;
  display: block;
}


/* =========================================================
   21. АДАПТИВНОСТЬ
   ========================================================= */

/* Планшет */
@media screen and (max-width: 992px) {
  .services__grid,
  .prices__grid,
  .portfolio__grid,
  .advantages__grid,
  .steps__grid {
    grid-template-columns: repeat(2,1fr);
  }

  .header__offer {
    display: none;
  }

  .hero {
    min-height: 60vh;
  }

  .hero__title {
    font-size: 38px;
  }
}

/* Десктоп: делим фон пополам синим / белым */
@media screen and (min-width: 993px) {
  .hero {
    background: linear-gradient(to right, #2f3f5f 50%, #ffffff 50%);
  }
}


/* Мобильные */
@media screen and (max-width: 600px) {
  .hero__image-mobile {
    display: block;
  }

  .hero__right {
    display: none; /* отключаем большую картинку справа */
  }

  /* HERO: сначала текст, потом картинка */
  .hero {
    flex-direction: column;
    min-height: auto;
  }

  .hero__left {
    order: 1;
    width: 100%;
  }

  .hero__left .container {
    padding-top: 12px;
    padding-bottom: 32px;
  }

  .hero__right {
    order: 2;
    width: 100%;
    height: 260px;
  }

  .hero__right img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .hero__title {
    font-size: 32px;
  }

  .hero__subtitle-services {
    font-size: 28px;        /* на мобиле ещё компактнее */
    line-height: 1.25;
  }

  .services__grid,
  .prices__grid,
  .portfolio__grid,
  .advantages__grid,
  .steps__grid,
  .problems__grid {
    grid-template-columns: 1fr;
  }

  .header__actions {
    display: none;
  }

  .header__burger {
    display: block;
  }

  .contacts__inner {
    flex-direction: column;
  }
  /* HOW WE WORK — картинка во всю ширину на мобильной версии */
  .how-we-work__image {
      order: 2;
      width: 100vw;                              /* ширина = ширина экрана */
      height: 260px;
      margin-left: calc(50% - 50vw);             /* выносим за пределы контейнера */
      margin-right: calc(50% - 50vw);
      position: relative;
  }

  .how-we-work__image img {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100%;
      object-fit: cover;
  }

  .how-we-work__content {
      order: 1;
  }

  .problems {
    padding: 20px 0 30px;   /* супер-компактный мобильный вариант */
  }

  .section-title {
    margin-bottom: 10px;    /* уменьшить расстояние под заголовком */
  }

  .section-subtitle {
    margin-bottom: 20px;    /* тоже уменьшить */
  }

  /* Уменьшаем нижний отступ под блоком ПРОБЛЕМ на мобиле */
  .problems {
      padding-bottom: 10px !important;   /* было 40–80px → стало очень компактно */
  }

  /* Уменьшаем всю высоту секции */
  .before-after {
    padding: 14px 0 28px;    /* было 40px 0 50px → стало гораздо компактнее */
  }

  /* Заголовок ближе к картинке */
  .before-after .section-header {
    margin-bottom: 8px;      /* было ~20–40px → уменьшаем */
    text-align: center;
  }

  /* Ещё уменьшаем высоту слайдера */
  .before-after__images {
    padding-bottom: 50% !important;   /* было 50%, сейчас видео заметно ниже */
  }

  /* Оставляем маленькие скругления */
  .before-after__slider {
    border-radius: 12px;
  }
  /* HERO (мобилка): отступ между картинкой и текстом ниже
     ВАЖНО: НЕ используем margin: ... чтобы не сломать margin-left/right -50vw */
  .hero__image-mobile{
    margin-top: 12px;
    margin-bottom: 18px;
  }
/* ===== ПРОБЛЕМЫ: ещё компактнее на мобиле ===== */
.problems{
  padding: 10px 0 0px !important;   /* почти без низа */
}

.problems__grid{
  gap: 10px;
  margin-bottom: 0 !important;      /* убираем лишний низ полностью */
}

.problems__item{
  padding: 14px 14px 12px;          /* меньше внутренних отступов */
  border-radius: 18px;              /* чуть компактнее форма */
}

.problems__item h3.problems__title{
  font-size: 17px;
  line-height: 1.15;
  margin-bottom: 6px;
}

.problems__item p{
  font-size: 14px;
  line-height: 1.35;
  margin: 0;
}

/* подзаголовок секции (если есть) тоже ужимаем */
.section-subtitle{
  margin-bottom: 8px;
}



}

/* =========================================================
   ЛАЙТБОКС ДЛЯ PORTFOLIO (фото + видео)
   ========================================================= */

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  display: none;                 /* по умолчанию скрыт */
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.lightbox--open {
  display: flex;                 /* показываем */
}

.lightbox__image,
.lightbox__video {
  max-width: 94vw;
  max-height: 90vh;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.6);
  background: #000;
}

/* по умолчанию показываем только картинку, видео включаем из JS */
.lightbox__image {
  display: none;
  object-fit: contain;
}

.lightbox__video {
  display: none;
}

.lightbox__overlay {
  position: absolute;
  inset: 0;
  cursor: zoom-out;
}

.lightbox__close {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 32px;
  line-height: 1;
  color: #fff;
  background: transparent;
  border: none;
  cursor: pointer;
}

/* ================== BLUR OVERLAY ПОД МОБИЛЬНЫМ МЕНЮ ================== */
body::before {
  content: "";
  position: fixed;
  inset: 0;

  /* затемнение + размытие контента под оверлеем */
  background: rgba(15, 23, 42, 0.30);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);

  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 998; /* ниже mobile-nav (999) и ниже шапки (1000) */
}

body.menu-open::before {
  opacity: 1;
  pointer-events: auto;
}

/* =========================================================
   2-й слайдер — компактный белый блок
   ========================================================= */
#cards-slider-2{
  /* было гораздо больше — уменьшаем примерно в 2 раза */
  min-height: clamp(260px, 40vh, 420px);
  padding: 24px 0;

  background: #fff;

  display: flex;
  align-items: center; /* вертикальный центр */
}

#cards-slider-2 .container{
  width: 100%;
}

#cards-slider-2 .section-header{
  margin: 0 0 12px;
}

#cards-slider-2 .section-title{
  margin: 0;
}

/* =========================================================
   1-й слайдер (#cards-slider) — меньше белого пространства ~в 2 раза
   ========================================================= */
#cards-slider{
  /* уменьшаем “воздух” вокруг блока */
  padding: 18px 0 32px; /* было больше — стало компактнее */
}

/* если у 1-го слайдера есть заголовок — убираем лишние отступы */
#cards-slider .section-header{
  margin: 0 0 12px;
}

#cards-slider .section-title{
  margin: 0;
}

/* делаем сам слайдер ниже, чтобы белого стало меньше */
#cards-slider .cards-slider{
  height: clamp(240px, 34dvh, 360px); /* было выше — стало компактнее */
}

/* =========================
   Telegram button (Контакты)
   ========================= */
.btn--tg{
  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 14px 18px;
  border-radius: 14px;

  background: #2f3f5f;          /* фирменный синий Telegram */
  color: #fff;
  text-decoration: none;
  font-weight: 700;

  border: 0;
  cursor: pointer;

  transition: transform .12s ease, opacity .12s ease;
}

.btn--tg:hover{
  opacity: 0.92;
}

.btn--tg:active{
  transform: translateY(1px);
}

/* Иконка в кнопке Telegram */
.btn--tg{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px; /* расстояние между иконкой и текстом */
}

.btn--tg .btn__icon{
  width: 18px;
  height: 18px;
  fill: currentColor; /* иконка будет белой, т.к. текст белый */
  flex: 0 0 auto;
}

/* Ссылка на политику в калькуляторе */
.calculator__policy a{
  color: #2f3f5f;                 /* в стиле кнопок */
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 700;
}

/* =========================================================
   BLOG LATEST (главная страница) — "Полезные статьи"
   ========================================================= */

.blog-latest {
  padding: 64px 0;
}

.blog-latest__hint {
  margin: 12px 0 0;
  opacity: 0.9;
}

.blog-latest__grid {
  margin-top: 18px;

  display: grid;
  gap: 18px;

  /* 1 карточка тоже будет красиво: она не растянется на весь экран */
  max-width: 900px;
}

/* Если карточек будет больше — они сами станут в сетку */
@media (min-width: 900px) {
  .blog-latest__grid {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    max-width: none;
  }
}

.blog-latest__actions {
  margin-top: 18px;
  display: flex;
  justify-content: flex-start;
}

/* ===================== Карточка статьи ===================== */

.blog-card {
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 10px 30px rgba(0,0,0,.06);
}

.blog-card__link {
  display: grid;
  grid-template-columns: 1fr;
  text-decoration: none;
  color: inherit;
}

.blog-card__media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: rgba(0,0,0,.04);
}

.blog-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.blog-card__placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(0,0,0,.05), rgba(0,0,0,.02));
}

/* бейдж "Видео" */
.blog-card__badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1;
  font-weight: 700;
  background: rgba(0,0,0,.72);
  color: #fff;
  backdrop-filter: blur(6px);
}

.blog-card__body {
  padding: 16px 16px 18px;
}

.blog-card__title {
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
}

.blog-card__excerpt {
  margin: 10px 0 0;
  opacity: .9;

  /* аккуратное ограничение по строкам */
  display: -webkit-box;
  /* -webkit-line-clamp: 3;*/
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-card__meta {
  margin-top: 12px;
  font-size: 13px;
  opacity: .75;
}

.blog-card__date {
  display: inline-block;
}

/* Hover */
@media (hover: hover) {
  .blog-card {
    transition: transform .15s ease, box-shadow .15s ease;
  }
  .blog-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 40px rgba(0,0,0,.10);
  }
}

/* Desktop-раскладка: картинка слева, текст справа */
@media (min-width: 720px) {
  .blog-card__link {
    grid-template-columns: 320px 1fr;
    align-items: stretch;
  }
  .blog-card__media {
    aspect-ratio: auto;
    height: 100%;
    min-height: 190px;
  }
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  .blog-card {
    transition: none !important;
  }
}

/* Жёстко фиксируем скрытие элементов с hidden (иногда стили проекта это ломают) */
[hidden] { 
  display: none !important; 
}

/* =========================================================
   AD BANNER — фон СТОИТ на месте при скролле (без тряски)
   ФОЛБЭК: background-attachment: fixed на .ad-banner__media
   ОСНОВНОЙ РЕЖИМ: fixed-слой .ad-banner__bg + clip-path (JS)
   ВАЖНО: фон у .ad-banner__media отключаем ТОЛЬКО когда JS успешно включил режим
   ========================================================= */

.ad-banner{
  padding: 22px 0;
  background: #fff;
}

.ad-banner__media{
  /* подстройка кадра */
  --ad-tune-y: -160px;
  --ad-base: 50%;

  position: relative;
  width: 100%;
  min-height: 260px;
  aspect-ratio: 16 / 9;
  overflow: hidden;

  display: flex;
  flex-direction: column;
  justify-content: flex-end;

  isolation: isolate;

  /* ===== ФОЛБЭК (виден всегда, даже если JS не сработал) ===== */
  background-repeat: no-repeat;
  background-position: 50% calc(var(--ad-base) + var(--ad-tune-y));
  background-size: max(1920px, 100vw) auto;
  background-attachment: fixed;
}

/* Вариант 1 (баннер рассрочки) */
.ad-banner--installment .ad-banner__media{
  background-image: url("../img/ad-banner-desktop.webp");
}

/* Вариант 2 (баннер №2) */
.ad-banner--gift .ad-banner__media{
  background-image: url("../img/ad-banner2-desktop.webp");
  --ad-tune-y: -80px;
}

/* Затемнение под текст */
.ad-banner__overlay{
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    to top,
    rgba(0,0,0,.60),
    rgba(0,0,0,.22) 55%,
    rgba(0,0,0,0)
  );
}

/* Контент поверх оверлея */
.ad-banner__inner{
  position: relative;
  z-index: 2;
  width: 100%;
}

.ad-banner__content{
  width: min(560px, 100%);
  padding: 0 0 40px 0;
  color: #fff;
}

.ad-banner__title{
  margin: 0 0 10px;
  font-size: clamp(22px, 3.6vw, 40px);
  line-height: 1.1;
}

.ad-banner__text{
  margin: 0 0 16px;
  font-size: clamp(14px, 1.8vw, 18px);
  opacity: .95;
  max-width: 46ch;
}

.ad-banner__actions{
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.ad-banner__actions .btn{
  padding: 11px 16px;
  font-size: 14px;
  border-radius: 14px;
  transform: none;
}

/* MOBILE: разные картинки для каждого баннера */
@media (max-width: 900px){
  .ad-banner__media{
    background-size: max(1080px, 100vw) auto;
  }

  .ad-banner--installment .ad-banner__media{
    background-image: url("../img/ad-banner-mobile.webp");
    --ad-base: 50%;
    --ad-tune-y: 0px;
  }

  .ad-banner--gift .ad-banner__media{
    background-image: url("../img/ad-banner2-mobile.webp");
    --ad-base: 50%;
    --ad-tune-y: 0px;
  }

  .ad-banner__content{
    padding-bottom: 22px;
  }
}

/* =========================================================
   ОСНОВНОЙ РЕЖИМ: fixed-слой + clip-path "окно"
   ========================================================= */
@supports (clip-path: inset(0px)) {
  /* отключаем фолбэк ТОЛЬКО когда JS включил fixed-режим */
  .ad-banner__media.ad-banner__media--fixed{
    background-image: none;
    background-attachment: scroll;
  }

  .ad-banner__bg{
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;

    background-repeat: no-repeat;
    background-size: cover;
    background-position: 50% calc(var(--ad-base) + var(--ad-tune-y));

    clip-path: inset(
      var(--ad-clip-top, 9999px)
      var(--ad-clip-right, 9999px)
      var(--ad-clip-bottom, 9999px)
      var(--ad-clip-left, 9999px)
    );

    will-change: clip-path;
  }

  /* фоны fixed-слоя по вариантам */
  .ad-banner--installment .ad-banner__bg{
    background-image: url("../img/ad-banner-desktop.webp");
  }
  .ad-banner--gift .ad-banner__bg{
    background-image: url("../img/ad-banner2-desktop.webp");
  }

  @media (max-width: 900px){
    .ad-banner--installment .ad-banner__bg{
      background-image: url("../img/ad-banner-mobile.webp");
    }
    .ad-banner--gift .ad-banner__bg{
      background-image: url("../img/ad-banner2-mobile.webp");
    }
  }
}
