/**
 * Детальная страница услуги.
 * Self-contained, mobile-first.
 */

.article__back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  color: #1565C0;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.15s ease;
}
.article__back:hover { color: #0D47A1; }

/* Header ==================================================================== */
/* Полоса на всю ширину экрана (как на деталке конкурсов): фон вырывается из
   .container страницы через 100vw-сдвиг, контент возвращает вложенный .container */
.service-header {
  padding: 24px 0 28px;
  background: linear-gradient(135deg, #E3F2FD 0%, #FFFFFF 100%);
  border-bottom: 1px solid #E0E6ED;
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  margin-bottom: 16px;
}
/* 100vw включает ширину скроллбара — шапка выступает за окно на 7-15px.
   clip обрезает выступ без горизонтального скролла и НЕ ломает sticky-сайдбар
   (в отличие от hidden, clip не создаёт scroll-контейнер). */
.section { overflow-x: clip; }

/* Крошки страницы (из services/index.php) на деталке прячем — вместо них крошки
   ВНУТРИ полосы .service-header (как в конкурсах/объявлениях): одна полоса, не две. */
.section > .container > .breadcrumbs { display: none; }
/* Секция со (скрытыми) крошками не должна давать верхний отступ — полоса прилегает
   к шапке. Перебиваем правило pages.css .section:has(...) тем же селектором + !important. */
.section:has(> .container > .breadcrumbs) { padding-top: 0 !important; }

.service-header__crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #6B7280;
  margin-bottom: 16px;
}
.service-header__crumbs a { color: #1565C0; text-decoration: none; }
.service-header__crumbs a:hover { text-decoration: underline; }
.service-header__crumbs-sep { width: 14px; height: 14px; color: #9CA3AF; flex-shrink: 0; }
.service-header__crumbs-current { color: #6B7280; }

.service-header__top {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.service-header__icon {
  width: 56px;
  height: 56px;
  background: #ffffff;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #1565C0;
  flex-shrink: 0;
}
.service-header__icon svg {
  width: 32px;
  height: 32px;
}
.service-header__org {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #6B7280;
  margin-bottom: 8px;
}
.service-header__title {
  font-size: clamp(20px, 4vw, 32px);
  font-weight: 700;
  line-height: 1.2;
  color: #1A1A1A;
  margin: 0 0 12px 0;
}
.service-header__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  font-size: 13px;
  color: #6B7280;
}
.service-header__meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.service-card__badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: #E3F2FD;
  color: #1565C0;
}
.service-card__badge--free {
  background: #E3F9EC;
  color: #1B7A3E;
}

/* Layout ==================================================================== */
.service-content {
  margin-bottom: 24px;
}
.service-layout {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Aside ===================================================================== */
.service-aside {
  width: 100%;
}
.app-card {
  background: #ffffff;
  border: 1px solid #E0E6ED;
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.app-card__badge {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: #E3F9EC;
  color: #1B7A3E;
}
/* Шапка карточки — как в конкурсах (countdown): центр, подпись сверху, значение крупно. */
.countdown {
  text-align: center;
  padding: 12px 0;
  border-bottom: 1px solid #F0F2F5;
}
.countdown__label {
  font-size: 12px;
  color: #6B7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  margin-bottom: 4px;
}
.countdown__value {
  font-size: 18px;
  font-weight: 700;
  color: #1565C0;
}
.app-card__price {
  font-size: 28px;
  font-weight: 800;
  color: #1A1A1A;
  line-height: 1;
}
.app-card__meta {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid #F0F2F5;
}
.app-card__meta-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}
.app-card__meta-label {
  font-size: 13px;
  color: #6B7280;
  flex-shrink: 0;
}
.app-card__meta-value {
  font-size: 14px;
  font-weight: 700;
  color: #1A1A1A;
  text-align: right;
  word-break: break-word;
}
.app-card__note {
  font-size: 12px;
  color: #6B7280;
  margin: 0;
  text-align: center;
}

/* Buttons =================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.btn--primary {
  background: #1565C0;
  color: #ffffff;
}
.btn--primary:hover {
  background: #0D47A1;
}
.btn--lg {
  padding: 14px 20px;
  font-size: 16px;
  min-height: 48px;
}
.btn--block {
  width: 100%;
}

/* Main content ============================================================== */
.service-main {
  flex: 1;
  min-width: 0;
}
.service-block {
  background: #ffffff;
  border: 1px solid #E0E6ED;
  border-radius: 12px;
  padding: 16px;
}
.service-block + .service-block {
  margin-top: 16px;
}

/* Article body inside service-block ========================================= */
.article__body {
  font-size: 15px;
  line-height: 1.7;
  color: #1A1A1A;
}
.article__body > p { margin-bottom: 16px; }
.article__body > p:last-child { margin-bottom: 0; }
.article__body h2 {
  font-size: 20px;
  margin-top: 24px;
  margin-bottom: 12px;
  font-weight: 700;
}
.article__body h2:first-child { margin-top: 0; }
.article__body h3 {
  font-size: 17px;
  margin-top: 20px;
  margin-bottom: 10px;
  font-weight: 600;
}
.article__body ul, .article__body ol {
  padding-left: 24px;
  margin-bottom: 16px;
}
.article__body ul li, .article__body ol li {
  list-style: disc;
  margin-bottom: 6px;
}
.article__body ol li { list-style: decimal; }
.article__body a {
  color: #1565C0;
  text-decoration: underline;
}
.article__body a:hover { color: #0D47A1; }
.article__body strong { font-weight: 700; }

.article__body table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 13px;
  line-height: 1.5;
  table-layout: fixed;
  word-wrap: break-word;
}
.article__body table th,
.article__body table td {
  border: 1px solid #E0E6ED;
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.article__body table th {
  background: #F4F6F9;
  font-weight: 600;
  color: #1A1A1A;
}
.article__body table tr:nth-child(even) td {
  background: #FAFBFC;
}

.icon { width: 20px; height: 20px; }
.icon--sm { width: 16px; height: 16px; }

/* Планшет =================================================================== */
@media (min-width: 768px) {
  .service-header {
    padding: 24px;
  }
  .service-header__top {
    flex-direction: row;
    align-items: flex-start;
    gap: 20px;
  }
  .service-header__icon {
    width: 64px;
    height: 64px;
  }
  .service-header__icon svg {
    width: 36px;
    height: 36px;
  }
  .app-card {
    padding: 20px;
  }
  .service-block {
    padding: 24px;
  }
  .article__body {
    font-size: 16px;
  }
  .article__body table {
    font-size: 14px;
  }
}

/* Десктоп =================================================================== */
@media (min-width: 1024px) {
  .service-header {
    padding: 28px;
    margin-bottom: 32px;
  }
  .service-layout {
    flex-direction: row-reverse;
    gap: 28px;
    align-items: flex-start;
  }
  .service-aside {
    width: 320px;
    flex-shrink: 0;
    position: sticky;
    top: calc(var(--header-height, 72px) + 16px);
  }
  .service-main {
    flex: 1;
  }
  .service-block {
    padding: 28px;
  }
  .article__body {
    font-size: 17px;
  }
  .article__body h2 {
    font-size: 22px;
    margin-top: 32px;
    margin-bottom: 14px;
  }
}

/* ============================================================================
   Объект реновации: ТЭП / характеристики / участок / галерея.
   Цвета — только из текущей палитры. Шапку и заголовки блоков НЕ меняем.
   ============================================================================ */

/* ТЭП — адаптивная таблица БЕЗ горизонтального скролла.
   Моб./планшет: строки = карточки «подпись → значение». ПК (>=768px): обычная таблица. */
.ren-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.ren-table thead { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.ren-table tbody tr { display: block; border: 1px solid #E0E6ED; border-radius: 10px; overflow: hidden; margin-bottom: 12px; }
.ren-table tbody tr:last-child { margin-bottom: 0; }
.ren-table td { display: flex; justify-content: space-between; gap: 16px; padding: 10px 14px; border-top: 1px solid #F0F2F5; text-align: right; overflow-wrap: anywhere; }
.ren-table tbody tr td:first-child { border-top: none; }
.ren-table td::before { content: attr(data-label); text-align: left; color: #6B7280; font-weight: 600; font-size: 12px; flex: 0 0 44%; }
.ren-table td:first-child { background: #F4F8FB; color: #1565C0; font-weight: 700; }
.ren-table td:first-child::before { color: #1565C0; }
.ren-table td:last-child { font-weight: 600; }

@media (min-width: 768px) {
  .ren-table { table-layout: fixed; border: 1px solid #E0E6ED; border-radius: 10px; overflow: hidden; }
  .ren-table thead { position: static; width: auto; height: auto; clip: auto; white-space: normal; }
  .ren-table thead th { background: #F4F6F9; color: #6B7280; font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.3px; padding: 11px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid #E0E6ED; word-break: break-word; overflow-wrap: anywhere; }
  .ren-table tbody tr { display: table-row; border: none; border-radius: 0; margin: 0; }
  .ren-table tbody tr:hover td { background: #F4F8FB; }
  .ren-table td { display: table-cell; text-align: left; padding: 11px 12px; border-top: none; border-bottom: 1px solid #F0F2F5; font-size: 13px; vertical-align: top; word-break: break-word; font-weight: 500; }
  .ren-table td::before { display: none; }
  .ren-table tbody tr:last-child td { border-bottom: none; }
  .ren-table th:first-child, .ren-table td:first-child { width: 44px; background: none; color: #6B7280; font-weight: 700; text-align: center; }
}

/* Характеристики — строгая таблица «Название | Значение»: горизонтальные и
   вертикальная линии, фон у колонки названий, без маркеров-точек */
.kv-card { border: 1px solid #E0E6ED; border-radius: 10px; overflow: hidden; }
.kv-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.kv-table td { padding: 12px 16px; border-top: 1px solid #E0E6ED; vertical-align: top; overflow-wrap: anywhere; }
.kv-table tr:first-child td { border-top: none; }
.kv-table td:first-child { color: #6B7280; width: 46%; background: #FAFBFC; border-right: 1px solid #E0E6ED; font-weight: 500; }
.kv-table td:last-child { color: #1A1A1A; font-weight: 700; }

/* Галерея — вертикальный список: синяя иконка + «Изображение N» + предпросмотр + скачать */
.ren-gallery { display: flex; flex-direction: column; gap: 10px; }
.ren-gallery__item { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid #E0E6ED; border-radius: 10px; background: #fff; transition: border-color 0.15s ease; }
.ren-gallery__item:hover { border-color: #1565C0; }
.ren-gallery__view { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0; text-decoration: none; cursor: pointer; }
.ren-gallery__icon { width: 40px; height: 40px; border-radius: 8px; background: #E3F2FD; color: #1565C0; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ren-gallery__icon svg { width: 22px; height: 22px; }
.ren-gallery__name { font-size: 14px; font-weight: 600; color: #1A1A1A; }
.ren-gallery__view:hover .ren-gallery__name { color: #1565C0; }
.ren-gallery__actions { flex-shrink: 0; }

/* Лайтбокс-предпросмотр галереи (встроенный, без зависимостей) */
.ren-lightbox { position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, 0.85); padding: 24px; }
.ren-lightbox[hidden] { display: none; }
.ren-lightbox__img { max-width: 92vw; max-height: 86vh; border-radius: 8px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5); }
.ren-lightbox__close { position: absolute; top: 14px; right: 18px; width: 44px; height: 44px; border: none; background: rgba(255, 255, 255, 0.15); color: #fff; font-size: 28px; line-height: 1; border-radius: 8px; cursor: pointer; }
.ren-lightbox__close:hover { background: rgba(255, 255, 255, 0.28); }

/* «Необходимые документы»: без синей полосы слева (перекрывает border-left из pages.css) */
.requirement { border-left: none; }

/* Длинные неразрывные строки контента (имена файлов с подчёркиваниями и т.п.)
   не должны распирать страницу на узких экранах — разрешаем перенос внутри слова. */
.document-template__info { min-width: 0; }
.document-template__title,
.document-template__meta { overflow-wrap: anywhere; word-break: break-word; }
.requirement__text { overflow-wrap: anywhere; }
.ren-gallery__name { overflow-wrap: anywhere; }
.process-step__title,
.process-step__text,
.faq-item__q,
.faq-item__a { overflow-wrap: anywhere; }

/* ── Бейджи состояния в шапке услуги (как в конкурсах), 2026-07-09 ── */
.svc-state { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; white-space: nowrap; }
.svc-state::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.svc-state--open { background: #D1FAE5; color: #059669; }
.svc-state--closed { background: #F3F4F6; color: #6B7280; }

/* ── Контакты в боковой карточке (только реновация) ── */
.app-card__contacts { margin-top: 0; padding-top: 12px; border-top: 1px solid #F0F2F5; margin-bottom: 14px; }
.app-card__contacts-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: #6B7280; margin-bottom: 10px; }
.app-card__contact { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: #1A1A1A; margin-bottom: 8px; line-height: 1.45; overflow-wrap: anywhere; }
.app-card__contact svg { width: 15px; height: 15px; flex: 0 0 15px; margin-top: 2px; color: #1565C0; }
.app-card__contact a { color: #1565C0; text-decoration: none; }
.app-card__contact a:hover { text-decoration: underline; }

/* сжатие зазора над контактами */
.app-card .app-card__meta { margin-bottom: 0; padding-bottom: 10px; }
.app-card .app-card__meta-row:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }
