/* =========================================================
   site.css — overlay поверх оригинальных main.css / main_2.css
   Точечные правки: без фонового фото в hero, без прыжков
   контента на широких экранах, гарантированно рабочие
   интерактивные состояния (меню, шаги квиза, аккордеон).
   Структура/классы/раскладка блоков — из оригинала, визуал
   не переделывается — только адресные исправления багов.
   ========================================================= */

/* контейнер не должен "разъезжаться" на очень широких экранах (2K/4K) —
   в main.css у .wrapper нет max-width, только width:81.77vw */
.wrapper { max-width: 1600px; }

/* ---------- Hero: фоновая картинка ----------
   Фото и тёмная плашка — раздельными слоями (не одним background-
   шорткодом), чтобы не ловить конфликты между background-color и
   background при переопределении для мобильных. */
.first__bg { display: none; }
.first.md-dark-bg {
  position: relative;
  background-color: #1a1a1a;
  background-image: url('../hero/hero-bg.webp');
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
}
.first.md-dark-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(10,10,10,.68), rgba(10,10,10,.45));
  pointer-events: none;
}
.first.md-dark-bg .wrapper { position: relative; z-index: 1; }
/* второй колонки (формы) в hero больше нет — контент не должен
   занимать только 44.5vw с пустотой справа */
.first.md-first-with-form .wrapper { display: block; }
.first.md-first-with-form .first__content { width: 100%; }
/* у .first фиксированный min-height:56.25vw из-под фонового фото —
   без фото это лишняя пустота */
.first { min-height: 0; }

/* ---------- мобильное меню: гарантированное открытие/закрытие ---------- */
.header__nav { transition: max-height .25s ease; }
@media (max-width: 900px) {
  .header__nav { max-height: 0; overflow: hidden; }
  .header__nav.is-open { max-height: 1200px; }
}

/* ---------- Шапка на ПК: пустые служебные блоки не должны участвовать
   в раскладке и ломать выравнивание/перенос строк ---------- */
.header__text, .header__download, .header__social { display: none; }
@media (min-width: 900px) {
  .header__top .wrapper {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    justify-content: flex-start;
  }
  /* "Донецк, Макеевка" ближе к логотипу, а не растянуто по всей ширине */
  .header__address { margin-left: 24px; margin-right: 0; }
  /* телефон/часы прижаты к правому краю */
  .header__contacts { margin-left: auto; }
  /* "Меню сайта" + бургер нужны только на мобильном — на ПК меню и так
     видно отдельной строкой ниже, а на их месте остаются часы/телефон */
  .header__btn-wrap { display: none; }
}

/* ---------- шаги квиза: показываем только активный ---------- */
.quiz-question { display: none; }
.quiz-question.active { display: block; }

/* ---------- выбранный вариант ответа в квизе ---------- */
.answers-item:has(input:checked) { border-color: var(--main-color, #FF4747); }
.answers-item.active { border-color: var(--main-color, #FF4747); }
.answers-item:has(input:checked) .answers-item__icon,
.answers-item.active .answers-item__icon { background: var(--main-color, #FF4747); opacity: 1; }

.next-btn.disabled { opacity: .5; pointer-events: none; }
.prev-btn[data-target-question="0"] { visibility: hidden; pointer-events: none; }
.form-top__item.active { border-color: var(--main-color, #FF4747); }

/* ---------- Квиз: карточки ответов компактнее, чтобы шаг помещался
   на экран без прокрутки (картинки-заглушки уменьшены) ---------- */
/* только ПК — на мобильном оставляем как было (там своя, более специфичная
   верстка в main.css с height:23.125vw внутри @media max-width:768px) */
@media (min-width: 769px) {
  /* полностью забираем раскладку карточки ответа под свой контроль:
     картинка-квадрат сверху по центру, бейдж-галочка поверх её нижнего
     края, текст под картинкой — колонка, а не в ряд */
  .quiz-questions-container .answers-container .answers-item {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
  }
  /* точный px-размер выставляет JS (site.js, syncQuizImageSizes) — он
     меряет реальную ширину и одинаково задаёт её всем квадратикам.
     Тут только запасной вариант на случай, если JS ещё не отработал. */
  .answers-item__img,
  .quiz-questions-container .answers-container .answers-item__img {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    border-radius: 12px !important;
    order: 1;
    margin: 0 auto;
  }
  .quiz-questions-container .answers-container .answers-item__icon {
    order: 2;
    margin-top: -12px !important;
    z-index: 2;
    border: 2px solid #fff !important;
  }
  .quiz-questions-container .answers-container .answers-item__text {
    order: 3;
    text-align: center !important;
    margin-top: 6px;
  }
  /* Вопрос 1 (проблема) — 6 вариантов, по 3 в ряд (2 строки), а не по 2 */
  .quiz-question[data-question-id="1"] .answers-container .container-flex {
    grid-template-columns: repeat(3, 1fr);
  }
}
/* в оригинале у .answers-container фиксированная высота 26vw со скроллом —
   варианты ответов не должны требовать прокрутки внутри карточки квиза */
.quiz-questions-container .answers-container,
.calc-price__quiz .quiz-questions-container .answers-container {
  height: auto !important;
  overflow: visible !important;
  margin-right: 0 !important;
  padding-right: 0 !important;
  flex-grow: 0;
  margin-bottom: 20px !important;
}
.answers-item { padding: 0.7vw 0.9vw; min-height: 0; }
.quiz-final__content { width: 100%; }
/* варианты ответа — ровно по 2 в ряд, а не по 3 (и не "плывущей" фикс. vw-шириной) */
.quiz-questions-container .answers-container .container-flex {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 0;
}
.quiz-questions-container .answers-container .answers-wrap { margin: 0; width: 100%; }
.quiz-questions-container .answers-container .answers-item { width: 100%; }
/* последний "осиротевший" вариант ответа в неполном ряду — по центру, а не прижат влево */
.quiz-questions-container .answers-container .answers-wrap:last-child:nth-child(odd) {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
}
.quiz-questions-container .answers-container .answers-wrap:last-child:nth-child(odd) .answers-item {
  width: calc(50% - 5px);
}
.form-bottom { display: none; }
@media (max-width: 767px) {
  .answers-item__img { width: 40px; height: 40px; min-width: 40px; }
}

/* ---------- аккордеон FAQ ---------- */
.questions__item .item-content { display: none; }
.questions__item.active .item-content { display: block; }
.questions__item.active .item-btn { background: var(--main-color, #FF4747); transform: rotate(45deg); }

/* ---------- заглушки-картинки корректно вписываются в существующие слоты ---------- */
.answers-item__img img,
.item-gallery img,
.team__slide img.slide-img,
.promotions__item-img {
  object-fit: cover;
  width: 100%;
  height: 100%;
}
.team__slide img.slide-img { aspect-ratio: 1/1; }

.swiper-pagination-bullet { background: #1C1C1C; opacity: .25; }
.swiper-pagination-bullet-active { background: var(--main-color, #FF4747); opacity: 1; }

/* ---------- Специальные предложения: гарантированно одна строка из 3 на ПК
   (в main.css ширина карточки в vw от вьюпорта, а не от .wrapper — на
   широких экранах 3 карточки не помещаются и переносятся на 2-й ряд) ---------- */
@media (min-width: 769px) {
  .promotions__container .container-flex { flex-wrap: nowrap; }
  .promotions__container .promotions__item { width: 0; flex: 1 1 0; min-width: 0; }
}

/* ---------- Специальные предложения: фото на всю карточку, текст по центру
   каждой картинки в тёмной плашке — иначе терялся на светлом фоне ---------- */
.promotions__item { padding: 0 !important; align-items: center !important; justify-content: center !important; }
.promotions__item-blur { display: none !important; }
.promotions__item-img {
  position: absolute !important;
  inset: 0 !important;
  top: 0 !important;
  transform: none !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center 18% !important;
  z-index: 1 !important;
}
.promotions__item::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10,10,10,.1) 0%, rgba(10,10,10,.45) 100%);
  z-index: 1;
  border-radius: inherit;
}
.promotions__item-content {
  position: relative !important;
  z-index: 2;
  width: auto !important;
  height: auto !important;
  flex: none !important;
  text-align: center;
}
.promotions__item-content p {
  color: #fff !important;
  font-weight: 800 !important;
  background: rgba(10,10,10,.55);
  padding: 0.8vw 1.2vw;
  border-radius: 12px;
}
.promotions__item-content > span { display: none !important; }

/* ---------- Кнопка на главной: по центру заголовка ---------- */
.first__buttons { display: flex; justify-content: center; }

/* ---------- Кнопка на главной: без стрелки, текст по центру, объёмная ---------- */
.first__buttons-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-shadow: 0 10px 24px rgba(255, 71, 71, .45), inset 0 1px 0 rgba(255, 255, 255, .35), inset 0 -3px 0 rgba(0, 0, 0, .15);
  transition: transform .15s ease, box-shadow .15s ease;
}
.first__buttons-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(255, 71, 71, .55), inset 0 1px 0 rgba(255, 255, 255, .35), inset 0 -3px 0 rgba(0, 0, 0, .15);
}
.first__buttons-btn:active {
  transform: translateY(1px);
  box-shadow: 0 4px 12px rgba(255, 71, 71, .4), inset 0 1px 0 rgba(255, 255, 255, .25), inset 0 -2px 0 rgba(0, 0, 0, .15);
}

.simple-note-link { cursor: pointer; text-decoration: underline dotted; }

/* ---------- Юридический блок в футере: запрет выделения/копирования ---------- */
.no-copy {
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
}

/* ---------- Мастера: стрелки карусели только на мобильном (на ПК все карточки видны сразу) ---------- */
@media (min-width: 768px) {
  .team__slider .slider-prev-btn,
  .team__slider .slider-next-btn { display: none !important; }
}

/* ---------- Портфолио: подписи под фото ----------
   В оригинале .portfolio__item имеет фиксированную ширину (39vw / 86vw),
   а Swiper делает слайд уже — подпись вылезала за слайд и обрезалась.
   Плюс шрифт был слишком крупным и жирным. */
.portfolio__item { width: 100% !important; margin: 0 !important; }
.portfolio__item .item-title {
  font-size: 15px !important;
  line-height: 1.4 !important;
  font-weight: 600 !important;
  letter-spacing: 0 !important;
  margin: 12px 0 0 !important;
  white-space: normal;
}
.portfolio__slider .swiper-slide { height: auto; }

/* ---------- Стрелки каруселей на мобильном: портфолио, мастера, спецпредложения ---------- */
@media (max-width: 768px) {
  .portfolio__slider .slider-btn,
  .team__slider .slider-btn,
  .promotions__slider .slider-btn {
    display: flex !important;
    width: 38px !important;
    height: 38px !important;
    top: 50% !important;
    left: 6px !important;
    right: auto !important;
    transform: translateY(-50%) !important;
    z-index: 10;
    box-shadow: 0 2px 10px rgba(0,0,0,.25);
  }
  .portfolio__slider .slider-btn.slider-next-btn,
  .team__slider .slider-btn.slider-next-btn,
  .promotions__slider .slider-btn.slider-next-btn {
    left: auto !important;
    right: 6px !important;
  }
  .portfolio__slider .slider-btn img,
  .team__slider .slider-btn img,
  .promotions__slider .slider-btn img {
    width: 8px !important;
    height: 14px !important;
  }
  /* у портфолио под фото есть подпись — центрируем стрелки по фото, а не по всей карточке */
  .portfolio__slider .slider-btn { top: 36% !important; }
}

/* ---------- Портфолио: main_2.css скрывает .portfolio__slider по умолчанию
   (display:none) и показывает только на мобильном — так как у нас нет
   отдельной сетки для ПК (.portfolio__container), карусель должна быть
   видимой всегда, а не только на мобильном ---------- */
.portfolio__slider { display: block !important; }

/* ---------- Специальные предложения: одна строка на ПК без стрелок, карусель на мобильном (как портфолио в оригинале) ---------- */
.promotions__slider { display: none; }
@media (max-width: 768px) {
  .promotions.md-mobile-slider .promotions__container { display: none; }
  .promotions.md-mobile-slider .promotions__slider { display: block; }
  .promotions__slider .promotions__item { width: 86vw; min-height: 70vw; }
}

/* .btn-custom — в оригинале это inline wp-custom-css на странице, не часть main.css/main_2.css */
.btn-custom {
  font-size: 1.1vw;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--main-color);
  color: #fff;
  padding: 1.5vw 2.6041666667vw;
  border-radius: var(--brad-regular);
  width: auto;
  gap: 10px;
  text-decoration: none;
}
@media screen and (max-width: 767px) {
  .btn-custom { padding: 20px; font-size: 16px; }
}

/* ---------- Отзывы: без фонового фото у нас белый фон — title был белым (color:#fff
   из main.css) и сливался с фоном, отсюда "пустое" место; плюс срезаем vw-отступ сверху ---------- */
.reviews { padding-top: 24px; }
.reviews__title { color: #1C1C1C; margin-bottom: 24px; }

/* ---------- Отзывы: собственная сетка карточек (вместо видео/скан/скриншот-слайдеров оригинала) ---------- */
.reviews-grid { display: grid; gap: 18px; grid-template-columns: 1fr; max-width: 1180px; margin: 0 auto; }
@media (min-width: 680px) { .reviews-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1020px) { .reviews-grid { grid-template-columns: repeat(3, 1fr); } }
.review-card { background: #fff; border: 1px solid #E7EBEE; border-radius: 20px; padding: 20px; box-shadow: 0 4px 20px rgba(10,10,10,.06); display: flex; flex-direction: column; gap: 12px; }
.review-top { display: flex; align-items: center; gap: 12px; }
.review-top .avatar { width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800; color: #fff; font-size: 15px; flex: none; }
.review-name { font-size: 14.5px; font-weight: 700; color: #1C1C1C; }
.review-meta { font-size: 12px; color: #5B6470; }
.stars { color: #F2B644; font-size: 14px; letter-spacing: 1px; }
.review-text { font-size: 13.5px; color: #1C1C1C; line-height: 1.6; }

/* ---------- мобильная адаптация: подстраховка для секций, где в оригинале её недостаточно ---------- */
@media (max-width: 640px) {
  /* hero: фигуру мастера на фото не обрезает сверху/снизу так туго,
     блок не выглядит "сплюснутым" — больше воздуха и крупнее текст */
  .first.md-dark-bg {
    /* для мобильной версии — отдельное, заранее вручную обрезанное фото
       (hero-bg-mobile.webp), мастер в центре кадра. На ПК остаётся
       широкое hero-bg.webp. */
    background-image: url('../hero/hero-bg-mobile.webp');
    background-position: center center;
  }
  /* фото уже затемнено — доп. затемнение сверху минимальное, только чтобы
     белый текст оставался читаемым */
  .first.md-dark-bg::before {
    background: linear-gradient(0deg, rgba(10,10,10,.25), rgba(10,10,10,.2));
  }
  .first.md-dark-bg {
    padding-top: 60px !important;
    padding-bottom: 44px !important;
  }
  .first__title { font-size: 9vw !important; line-height: 1.25 !important; margin-bottom: 8px; }
  .first__bullets { flex-direction: column !important; align-items: stretch !important; margin: 24px 0 !important; gap: 10px !important; }
  /* main.css в мобильной медиа-запросе задаёт .bullets-item max-width:28.125vw
     и колонку (иконка над текстом) — из-за этого текст переносился в 2-3
     строки в узкой колонке. Разворачиваем в строку на всю ширину. */
  .bullets-item {
    max-width: none !important;
    width: 100% !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    padding: 12px 16px !important;
    gap: 10px;
  }
  .bullets-item img { margin: 0 !important; flex: none; }
  .bullets-item p { font-size: 15px !important; text-align: left !important; }
  .first__buttons { margin-top: 8px; }
  /* нашла настоящую причину обрезки текста: у main.css в мобильной медиа-
     запросе сам <span> с текстом кнопки жёстко зафиксирован в 42.1875vw
     (~175px) — под старый двухстрочный текст с иконкой. Наш текст в эту
     ширину не помещается в одну строку и обрезался. */
  .first__buttons-btn span { font-size: 18px !important; white-space: nowrap; width: auto !important; }
  .first__buttons-btn { padding: 18px 20px !important; min-height: 60px !important; width: 94vw !important; max-width: none !important; box-sizing: border-box !important; }

  .calc-price__title { font-size: 6vw !important; }
  .md-main-title { font-size: 6.5vw !important; line-height: 1.2 !important; }
  .quiz-final { display: flex; flex-direction: column; }
}

/* ---------- Плавное появление блоков при прокрутке ---------- */
[data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
[data-reveal].is-visible { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; transition: none; }
}

/* ПК: галочки у буллитов на главной крупнее в 1,96 раза (12x9 -> 23.52x17.64) и по центру буллита */
@media (min-width: 769px) {
  .first__bullets .bullets-item > img {
    width: 23.52px !important;
    height: 17.64px !important;
    align-self: center !important;
  }
}
