/* 20.10.2026: раздел «Услуги», версия 2 по ТЗ. Шрифты и размеры как на остальных страницах сайта (ипотека, рассрочка):
   здесь только раскладка (карточки, описание, этапы, вопросы). Стили страницы подключаются раньше style.css шаблона,
   поэтому селекторы сделаны точнее (два-три класса). */

/* Плашка предпросмотра (видна только администраторам) */
.zb-preview-bar { position: fixed; left: 16px; bottom: 16px; z-index: 9999; max-width: calc(100% - 32px); padding: 10px 16px; border-radius: 10px; background: #22211B; color: #fff; font-size: 14px; line-height: 1.3; box-shadow: 0 4px 16px rgba(0, 0, 0, .25); }
.zb-preview-bar a { color: #AADB1E; text-decoration: underline; margin-left: 6px; }

/* Липкая шапка страниц поселков (якоря «Описание, Планировка...», кнопки «Забронировать») на страницах услуг не нужна (ТЗ 3.4) */
.header2, .sub-header2 { display: none !important; }

/* Хлебные крошки в шапке переносятся на телефоне, а не уходят за край */
.zb-services-head .info-text__banner-breadcrumbs, .zb-service-head .info-text__banner-breadcrumbs { flex-wrap: wrap; row-gap: 4px; }
/* Отступ под мобильными кнопками под шапкой */
@media (max-width: 617px) {
    .container.services-btn-hidden { margin-bottom: 28px; }
}

/* Шапка списка: текст из включаемой области без лишних отступов, плашки в шапке оформлены как на других страницах */
.zb-services-head .services-about__items-info-text p { margin: 0; }

/* Карточки (ТЗ 2.6–2.8): одинаковая высота в ряду, цена и кнопка внизу, вся карточка ведет на услугу. Шрифты карточек как на сайте. */
.services-section__items.zb-services-grid { align-items: stretch; }
.service-card.zb-service-card { position: relative; height: 100%; box-sizing: border-box; }
.service-card.zb-service-card .service-card__bottom { margin-top: auto; }
.zb-service-card .zb-service-card__title { display: block; text-decoration: none; }
.zb-service-card .zb-service-card__title::after { content: ""; position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: 1; border-radius: 12px; }
.zb-service-card:hover .zb-service-card__title { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 5px; }
.zb-service-card .zb-service-card__btn { position: relative; z-index: 2; }
.service-card.zb-service-card .zb-service-card__time { display: flex; align-items: center; gap: 8px; margin: 0; }
.zb-service-card .zb-service-card__time .zb-icon { flex: 0 0 auto; width: .9em; height: .9em; }

/* Описание под карточками (ТЗ 2.10): разделы как на страницах ипотеки и рассрочки, заголовок слева, текст справа */
.zb-services-content .zb-services-description { margin-top: 80px; }
.zb-services-description .zb-desc-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 40px; margin-bottom: 60px; }
.zb-services-description .zb-desc-row:last-child { margin-bottom: 0; }
.zb-services-description .zb-desc-row > h2.title-product { margin: 0; line-height: normal; text-transform: none; }
.zb-services-description .zb-desc-row .zb-desc-body { color: #2F2F2F; font-size: 24px; font-weight: 400; line-height: 1.4; }
.zb-services-description .zb-desc-body h3 { margin: 28px 0 8px; color: #2F2F2F; font-size: 24px; font-weight: 500; line-height: 1.4; }
.zb-services-description .zb-desc-body h3:first-child { margin-top: 0; }
.zb-services-content .zb-services-empty { margin: 8px 0 0; color: #2F2F2F; font-size: 24px; line-height: 1.4; }
.zb-rich-text .zb-table-wrap { margin: 20px 0 0; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.zb-rich-text table.zb-start-table { width: 100%; border: 1px solid #E3E3E3; border-collapse: separate; border-spacing: 0; border-radius: 12px; overflow: hidden; font-size: 22px; line-height: 1.4; }
.zb-rich-text .zb-start-table th { padding: 16px 20px; background: #335525; color: #fff; font-weight: 600; text-align: left; }
.zb-rich-text .zb-start-table td { padding: 16px 20px; border-top: 1px solid #E3E3E3; vertical-align: top; }
.zb-rich-text .zb-start-table td:first-child { width: 36%; color: #335525; font-weight: 600; }
.zb-rich-text ol.zb-owner-path li { margin-bottom: 16px; padding-left: 4px; }

/* Отступы между блоками и перед подвалом (ТЗ 2.12, 3.9, 3.11) */
.services-content.zb-services-content { margin-bottom: 80px; }
.find-form.zb-find-form { margin-bottom: 40px; }
section.zb-svc-section, section.process.zb-svc-process, section.reviews.zb-svc-reviews, section.services-section.zb-svc-other { margin-bottom: 80px; }

/* HTML из админки: ссылки подчеркнуты стилем шаблона (ТЗ 3.12) */
.zb-rich-text a { text-decoration: underline; text-underline-offset: 3px; }
.zb-rich-text p { margin: 0 0 16px; }
.zb-rich-text p:last-child, .zb-rich-text ul:last-child, .zb-rich-text ol:last-child { margin-bottom: 0; }
.zb-rich-text ul, .zb-rich-text ol { margin: 0 0 16px; padding-left: 28px; }
.zb-rich-text ul li { list-style: disc; margin-bottom: 8px; }
.zb-rich-text ol li { list-style: decimal; margin-bottom: 8px; }
.zb-rich-text h2, .zb-rich-text h3, .zb-rich-text h4 { margin: 24px 0 12px; font-weight: 600; line-height: 1.3; }

/* Страница услуги: заголовок блока слева, текст справа, как на страницах ипотеки и рассрочки */
h2.title-product.zb-svc-h2 { margin: 0; text-transform: none; }
.zb-svc-section .zb-svc-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 40px; }
.zb-svc-section .zb-svc-text { color: #2F2F2F; font-size: 24px; font-weight: 400; line-height: 1.4; }
.zb-svc-other .services-section__top { margin-bottom: 39px; }

/* Этапы работы: 5 и меньше на компьютере в один ряд без прокрутки (ТЗ 3.7) */
.process-body .zb-stages { display: grid; gap: 40px; margin: 0; padding: 0; counter-reset: item; }
.process-body .zb-stages--1 { grid-template-columns: minmax(0, 1fr); }
.process-body .zb-stages--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.process-body .zb-stages--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.process-body .zb-stages--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.process-body .zb-stages--5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.zb-stages .process-body__list-item { min-width: 0; max-width: none; margin-left: 0; padding-left: 78px; min-height: 59px; box-sizing: border-box; }
.zb-stages .process-body__list-item::before { left: 0; }
.zb-stages .process-body__list-item:not(:first-child)::after { top: 29px; left: -34px; width: 28px; }
.zb-stages .process-body__list-item-title, .zb-stages .process-body__list-item-text { overflow-wrap: break-word; hyphens: auto; }

/* Вопросы и ответы на странице услуги (ТЗ 3.8): вопрос H3, ответ раскрывается по клику */
.zb-faq .zb-faq__list { display: flex; flex-direction: column; gap: 12px; margin-top: 32px; }
.zb-faq .zb-faq__item { border-radius: 12px; background: #F1F1F1; }
.zb-faq .zb-faq__question { position: relative; display: block; padding: 24px 64px 24px 28px; cursor: pointer; list-style: none; }
.zb-faq .zb-faq__question::-webkit-details-marker { display: none; }
.zb-faq .zb-faq__question::marker { content: ""; }
.zb-faq .zb-faq__question h3 { margin: 0; color: #22211B; font-size: 24px; font-weight: 500; line-height: 1.4; }
.zb-faq .zb-faq__question::after { content: ""; position: absolute; top: 50%; right: 28px; width: 12px; height: 12px; border-right: 2px solid #335525; border-bottom: 2px solid #335525; transform: translateY(-70%) rotate(45deg); transition: transform .2s; }
.zb-faq .zb-faq__item[open] .zb-faq__question::after { transform: translateY(-30%) rotate(-135deg); }
.zb-faq .zb-faq__answer { padding: 0 28px 24px; color: #2F2F2F; font-size: 24px; font-weight: 400; line-height: 1.4; }

@media (max-width: 1583px) {
    .zb-stages .process-body__list-item { padding-left: 55px; min-height: 39px; }
    .zb-stages .process-body__list-item:not(:first-child)::after { top: 19px; left: -32px; width: 24px; }
}
@media (max-width: 1400px) {
    .zb-svc-section .zb-svc-text, .zb-services-description .zb-desc-row .zb-desc-body, .zb-faq .zb-faq__answer { font-size: 20px; }
    .zb-services-description .zb-desc-body h3, .zb-faq .zb-faq__question h3 { font-size: 20px; }
    .zb-rich-text table.zb-start-table { font-size: 18px; }
}
/* Планшет и телефон: описание и страница услуги в одну колонку, этапы листаются вбок */
@media (max-width: 991px) {
    .services-content.zb-services-content, section.zb-svc-section, section.process.zb-svc-process, section.reviews.zb-svc-reviews, section.services-section.zb-svc-other { margin-bottom: 40px; }
    .find-form.zb-find-form { margin-bottom: 24px; }
    .zb-services-content .zb-services-description { margin-top: 48px; }
    .zb-services-description .zb-desc-row { grid-template-columns: minmax(0, 1fr); gap: 16px; margin-bottom: 40px; }
    .zb-svc-section .zb-svc-text, .zb-services-description .zb-desc-row .zb-desc-body, .zb-faq .zb-faq__answer, .zb-services-content .zb-services-empty { font-size: 14px; }
    .zb-services-description .zb-desc-body h3, .zb-faq .zb-faq__question h3 { font-size: 16px; }
    .zb-rich-text table.zb-start-table { font-size: 14px; }
    .zb-rich-text .zb-start-table th, .zb-rich-text .zb-start-table td { padding: 10px 12px; }
    .process-body .zb-stages { display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; padding-bottom: 8px; scrollbar-width: none; }
    .process-body .zb-stages::-webkit-scrollbar { display: none; }
    .zb-stages .process-body__list-item { flex: 0 0 45%; padding-left: 42px; min-height: 31px; scroll-snap-align: start; }
    .zb-stages--1 .process-body__list-item { flex-basis: 100%; }
    .zb-stages .process-body__list-item:not(:first-child)::after { display: none; }
    .zb-faq .zb-faq__list { margin-top: 20px; gap: 8px; }
    .zb-faq .zb-faq__question { padding: 18px 48px 18px 20px; }
    .zb-faq .zb-faq__question::after { right: 20px; }
    .zb-faq .zb-faq__answer { padding: 0 20px 18px; }
}
@media (max-width: 767px) {
    .zb-stages .process-body__list-item { flex-basis: 78%; }
}
@media (max-width: 680px) {
    .zb-svc-section .zb-svc-row { grid-template-columns: minmax(0, 1fr); gap: 12px; }
}
@media (max-width: 483px) {
    .zb-stages .process-body__list-item { padding-left: 52px; min-height: 39px; }
}
