/* ==========================================================================
   BMW Haus — внутренние страницы: услуги и контакты
   Подключается после styles.css: шапка, кнопки, прайс, этапы, финальный
   призыв и подвал берутся оттуда. Здесь — только блоки внутренних страниц.
   Макет: «Service Page — Регламентное ТО» (1440) и его мобильная пара (390).
   ========================================================================== */

/* Текст для скринридера: подпись колонки, которую глазами видно и так */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* -------------------------------------------------------- Первый экран -- */

.service-hero { background: var(--ink); }

/* Сверху — высота шапки (26 + 39 + 26), она висит над экраном */
.service-hero__inner {
  display: grid;
  grid-template-columns: 1fr 620px;
  align-items: center;
  gap: 72px;
  padding-top: calc(91px + 36px);
  padding-bottom: 88px;
}

.service-hero__text {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
  color: var(--on-dark-muted);
}

.breadcrumbs li + li::before {
  content: '/';
  margin-right: 10px;
  color: var(--ink-line);
}

.breadcrumbs a { transition: color .2s ease; }
.breadcrumbs a:hover { color: var(--on-dark); }
.breadcrumbs [aria-current] { color: #E6E7EA; }

.service-hero__title {
  font-family: var(--font-head);
  font-size: 60px;
  font-weight: 700;
  letter-spacing: -1.8px;
  line-height: 63px;
  color: var(--on-dark);
}

.service-hero__lead {
  max-width: 560px;
  font-size: 17px;
  line-height: 26px;
  color: var(--on-dark-soft);
}

.service-hero .hero__buttons { padding-top: 6px; }

.facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  margin: 0;
  padding-top: 20px;
}

.fact {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 18px;
  border-top: 1px solid var(--ink-line);
}

.fact__value {
  font-family: var(--font-head);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -.6px;
  color: var(--on-dark);
}

.fact__label {
  margin: 0;
  font-size: 13px;
  color: var(--on-dark-muted);
}

.service-hero__photo {
  height: 600px;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

.service-hero__photo--to { background-image: url('../images/service-to.jpg'); }
.service-hero__photo--diagnostics { background-image: url('../images/service-diagnostics.jpg'); }
.service-hero__photo--engine { background-image: url('../images/service-engine.jpg'); }
.service-hero__photo--chassis { background-image: url('../images/service-chassis.jpg'); }
.service-hero__photo--body { background-image: url('../images/service-body.jpg'); }

/* ---------------------------------------------- Заголовок секции с лидом -- */

.section-head {
  display: flex;
  align-items: flex-end;
  gap: 72px;
}

.section-head__heading {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 14px;
}

.section-title {
  font-family: var(--font-head);
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -1.2px;
  line-height: 45px;
}

.section-lead {
  flex: 0 0 460px;
  font-size: 16px;
  line-height: 26px;
  color: var(--on-light-muted);
}

/* ---------------------------------------------------------- Что входит -- */

.scope { background: var(--paper); }

.scope__inner {
  display: flex;
  flex-direction: column;
  gap: 48px;
  padding-block: 104px;
}

.scope__columns {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.scope-card {
  padding: 36px 40px 20px;
  background: var(--paper-soft);
}

.scope-card__head {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 22px;
}

.scope-card__title {
  font-family: var(--font-head);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -.5px;
}

.scope-card__note {
  font-size: 14px;
  color: var(--on-light-muted);
}

.scope-card__list li {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 17px 0;
  border-top: 1px solid var(--paper-line);
}

.icon--check {
  width: 18px;
  height: 18px;
  color: var(--accent);
}

.scope-card__item {
  flex: 1;
  font-size: 15px;
  font-weight: 500;
}

.scope-card__interval {
  font-size: 13px;
  font-weight: 600;
  color: var(--on-light-muted);
}

.scope-card--dark {
  background: var(--ink);
  color: var(--on-dark);
}

.scope-card--dark .scope-card__note { color: var(--on-dark-muted); }
.scope-card--dark .scope-card__list li { border-top-color: var(--ink-line); }
.scope-card--dark .scope-card__interval { color: #C9CBD1; }

/* ------------------------------------------------------ Карта регламента -- */

/* Тёмная секция с графиком (ТО) или таблицей симптомов (ремонт) */
.schedule,
.symptoms {
  background: var(--ink);
  color: var(--on-dark);
}

.schedule__inner,
.symptoms__inner {
  display: flex;
  flex-direction: column;
  gap: 56px;
  padding-top: 104px;
  padding-bottom: 96px;
}

.schedule .section-lead,
.symptoms .section-lead {
  flex-basis: 500px;
  color: var(--on-dark-muted);
}

/* Высота столбика — доля от самого дорогого ТО-8 (--k = 2,8) */
.chart {
  display: grid;
  grid-template-columns: repeat(11, 1fr);
  align-items: end;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.chart__item {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.chart__price {
  white-space: nowrap;
  font-size: 14px;
  font-weight: 600;
  color: #C9CBD1;
}

.chart__bar {
  height: calc(var(--k) / 2.8 * 240px);
  border-radius: 2px 2px 0 0;
  background: #2A2B31;
}

.chart__label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--ink-line);
}

.chart__level {
  font-family: var(--font-head);
  font-size: 18px;
  font-weight: 700;
}

.chart__km {
  font-size: 13px;
  color: var(--on-dark-muted);
}

.chart__item--mid .chart__price { color: #E6E7EA; }
.chart__item--mid .chart__bar,
.legend__item--mid .legend__swatch { background: #5A5E6B; }

.chart__item--major .chart__price { color: var(--on-dark); }
.chart__item--major .chart__bar,
.legend__item--major .legend__swatch { background: var(--accent); }

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
}

.legend__item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--on-dark-muted);
}

.legend__swatch {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  background: #2A2B31;
}

/* ---------------------------------------------------- Таблица симптомов -- */

.symptom-table {
  width: 100%;
  border-collapse: collapse;
  border-bottom: 1px solid var(--ink-line);
  text-align: left;
}

.symptom-table thead th {
  padding: 0 32px 14px 0;
  border-bottom: 2px solid var(--ink-line);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  color: var(--on-dark-muted);
}

.symptom-table tbody td,
.symptom-table tbody th {
  padding: 26px 32px 26px 0;
  border-top: 1px solid var(--ink-line);
  vertical-align: middle;
}

.symptom-table .cell-num { width: 72px; }
.symptom-table .cell-symptom { width: 492px; }
.symptom-table .cell-cause { padding-right: 0; }

.symptom-table td.cell-num {
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 700;
  color: var(--accent);
}

.symptom-table tbody th.cell-symptom {
  font-family: var(--font-head);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.4px;
  line-height: 27px;
  color: var(--on-dark);
}

.symptom-table td.cell-cause {
  font-size: 16px;
  line-height: 25px;
  color: #C9CBD1;
}

/* -------------------------------------------------------- Как проходит -- */

.process--service { background: var(--paper-soft); }

.process__header {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 96px;
  padding-bottom: 48px;
}

.process--service .process__steps { padding-top: 0; }

/* ------------------------------------------------------------- Вопросы -- */

.faq { background: var(--paper); }

.faq__inner {
  display: grid;
  grid-template-columns: 460px 1fr;
  grid-template-rows: auto 1fr;
  grid-template-areas:
    'head list'
    'hint list';
  gap: 14px 72px;
  padding-block: 104px;
}

.faq__head {
  display: flex;
  flex-direction: column;
  gap: 14px;
  grid-area: head;
}

.faq__hint {
  grid-area: hint;
  font-size: 16px;
  line-height: 26px;
  color: var(--on-light-muted);
}

.faq__list {
  grid-area: list;
  border-bottom: 1px solid var(--paper-line);
}

.faq__item {
  padding: 26px 0;
  border-top: 1px solid var(--paper-line);
}

.faq__question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  font-family: var(--font-head);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.3px;
  list-style: none;
  cursor: pointer;
}

.faq__question::-webkit-details-marker { display: none; }

/* Плюс и минус — те же линии lucide, что в макете */
.faq__question::after {
  content: '';
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230A0A0B' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M5 12h14M12 5v14'/%3E%3C/svg%3E") center / contain no-repeat;
}

.faq__item[open] .faq__question::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231C69D4' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M5 12h14'/%3E%3C/svg%3E");
}

.faq__question:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.faq__answer {
  max-width: 680px;
  padding-top: 14px;
  font-size: 15px;
  line-height: 25px;
  color: var(--on-light-muted);
}

/* ------------------------------------------------------------- Контакты -- */

.contacts {
  background: var(--ink);
  color: var(--on-dark);
}

/* Сверху — высота шапки, как у первого экрана услуги */
.contacts__inner {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  align-items: center;
  gap: 72px;
  padding-top: calc(91px + 36px);
  padding-bottom: 96px;
}

.contacts__info {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.contact-list {
  display: flex;
  flex-direction: column;
  margin: 0;
}

.contact-list__row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 0;
  border-top: 1px solid var(--ink-line);
}

.contact-list__row dt {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--on-dark-muted);
}

.contact-list__row dd {
  margin: 0;
  font-size: 16px;
  line-height: 24px;
  color: var(--on-dark-soft);
}

.contact-list__phone {
  font-family: var(--font-head);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -.4px;
  color: var(--on-dark);
}

.contacts__map {
  height: 620px;
  background: var(--ink-soft);
}

.contacts__map iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ========================================================================== */
/* Промежуточные ширины                                                       */
/* ========================================================================== */

@media (max-width: 1180px) {
  .service-hero__inner {
    grid-template-columns: 1fr 1fr;
    gap: 48px;
  }

  .service-hero__photo { height: 540px; }

  .service-hero__title {
    font-size: 50px;
    letter-spacing: -1.5px;
    line-height: 54px;
  }

  .facts { gap: 20px; }
  .fact__value { font-size: 22px; }

  .section-head { gap: 48px; }
  .section-lead,
  .schedule .section-lead,
  .symptoms .section-lead { flex-basis: 380px; }

  .symptom-table .cell-num { width: 56px; }
  .symptom-table .cell-symptom { width: 340px; }

  .scope-card { padding-inline: 28px; }

  .chart { gap: 6px; }
  .chart__price { font-size: 12px; }

  .faq__inner {
    grid-template-columns: 340px 1fr;
    column-gap: 48px;
  }

  .contacts__inner {
    grid-template-columns: 1fr 1fr;
    gap: 48px;
  }

  .contacts__map { height: 560px; }
}

/* ========================================================================== */
/* Мобильная версия — макет 390                                               */
/* ========================================================================== */

@media (max-width: 900px) {
  /* Как на главной: фото лентой под шапкой, текст — под ним на чёрном */
  .service-hero__inner {
    grid-template-columns: 1fr;
    gap: 0;
    padding-top: 64px;
    padding-bottom: 40px;
  }

  .service-hero__photo {
    order: -1;
    height: auto;
    aspect-ratio: 16 / 9;
    margin-inline: calc(var(--side) * -1);
  }

  .service-hero__text {
    gap: 16px;
    padding-top: 24px;
  }

  .breadcrumbs ol {
    gap: 8px;
    font-size: 12px;
  }

  .breadcrumbs li + li::before { margin-right: 8px; }

  .service-hero__title {
    font-size: 36px;
    letter-spacing: -1.1px;
    line-height: 38px;
  }

  .service-hero__lead {
    font-size: 15px;
    line-height: 23px;
  }

  .service-hero .hero__buttons { padding-top: 8px; }

  .facts {
    grid-template-columns: 1fr;
    gap: 0;
    padding-top: 16px;
  }

  .fact {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 0;
  }

  .fact__value {
    font-size: 20px;
    letter-spacing: -.4px;
    white-space: nowrap;
  }

  .fact__label { text-align: right; }

  /* Заголовки секций */

  .section-head {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .section-head__heading { gap: 12px; }

  .section-title {
    font-size: 28px;
    letter-spacing: -.8px;
    line-height: 31px;
  }

  .section-lead,
  .schedule .section-lead,
  .symptoms .section-lead {
    flex-basis: auto;
    font-size: 15px;
    line-height: 24px;
  }

  /* Что входит */

  .scope__inner {
    gap: 24px;
    padding-block: 56px;
  }

  .scope__columns { grid-template-columns: 1fr; }

  .scope-card { padding: 24px 20px 8px; }

  .scope-card__head {
    gap: 6px;
    padding-bottom: 16px;
  }

  .scope-card__title {
    font-size: 20px;
    letter-spacing: -.4px;
  }

  .scope-card__note { font-size: 13px; }

  /* Срок уходит под название: в строку рядом он не помещается */
  .scope-card__list li {
    display: grid;
    grid-template-columns: 18px 1fr;
    align-items: start;
    gap: 3px 12px;
    padding: 14px 0;
  }

  .scope-card__list .icon--check { margin-top: 1px; }

  .scope-card__item { line-height: 20px; }

  .scope-card__interval {
    grid-column: 2;
    font-weight: 400;
  }

  /* Карта регламента: одиннадцать столбиков в 350 пикселей не влезают,
     поэтому график ложится набок — строка на каждое ТО. */

  .schedule__inner,
  .symptoms__inner {
    gap: 28px;
    padding-block: 56px;
  }

  /* Таблица симптомов: номер и симптом строкой, причина под ними */
  .symptom-table,
  .symptom-table tbody,
  .symptom-table tr,
  .symptom-table td,
  .symptom-table th { display: block; }

  .symptom-table thead { display: none; }

  .symptom-table tbody tr {
    display: grid;
    grid-template-columns: 22px 1fr;
    gap: 6px 12px;
    padding: 18px 0;
    border-top: 1px solid var(--ink-line);
  }

  .symptom-table tbody td,
  .symptom-table tbody th {
    padding: 0;
    border: 0;
  }

  .symptom-table .cell-num,
  .symptom-table .cell-symptom { width: auto; }

  .symptom-table td.cell-num {
    font-size: 13px;
    line-height: 22px;
  }

  .symptom-table tbody th.cell-symptom {
    font-size: 17px;
    letter-spacing: -.2px;
    line-height: 22px;
  }

  .symptom-table td.cell-cause {
    grid-column: 2;
    font-size: 14px;
    line-height: 22px;
  }

  .chart {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .chart__item {
    display: grid;
    grid-template-columns: 66px 1fr 72px;
    grid-template-areas: 'label bar price';
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-top: 1px solid var(--ink-line);
  }

  .chart__label {
    grid-area: label;
    gap: 2px;
    padding-top: 0;
    border-top: 0;
  }

  .chart__level { font-size: 15px; }
  .chart__km { font-size: 11px; }

  .chart__bar {
    grid-area: bar;
    width: calc(var(--k) / 2.8 * 100%);
    height: 14px;
    border-radius: 0 2px 2px 0;
  }

  .chart__price {
    grid-area: price;
    font-size: 13px;
    text-align: right;
  }

  .legend {
    flex-direction: column;
    gap: 10px;
  }

  /* Как проходит */

  .process--service { background: var(--paper); }

  .process__header {
    gap: 12px;
    padding-top: 56px;
    padding-bottom: 16px;
  }

  /* Вопросы */

  .faq { background: var(--paper-soft); }

  .faq__inner {
    grid-template-columns: 1fr;
    grid-template-rows: none;
    grid-template-areas:
      'head'
      'list'
      'hint';
    gap: 24px;
    padding-block: 56px;
  }

  .faq__head { gap: 12px; }

  .faq__hint {
    font-size: 14px;
    line-height: 22px;
  }

  .faq__item { padding: 20px 0; }

  .faq__question {
    gap: 16px;
    font-size: 17px;
    letter-spacing: -.2px;
    line-height: 22px;
  }

  .faq__question::after {
    width: 20px;
    height: 20px;
  }

  .faq__answer {
    padding-top: 12px;
    font-size: 14px;
    line-height: 22px;
  }

  /* Контакты: сначала адрес и телефон, под ними карта во всю ширину */

  .contacts__inner {
    grid-template-columns: 1fr;
    gap: 32px;
    padding-top: calc(64px + 24px);
    padding-bottom: 0;
  }

  .contacts__info { gap: 16px; }

  .contact-list__row { padding: 14px 0; }
  .contact-list__row dd { font-size: 15px; line-height: 22px; }
  .contact-list__phone { font-size: 22px; }

  .contacts__map {
    height: 380px;
    margin-inline: calc(var(--side) * -1);
  }
}
