/* АНО МСК-Эксперт — собственная дизайн-система.
   Палитра, типографика и геометрия сняты с прежнего сайта на Flexbe,
   но разметка и стили здесь свои: ни одного их класса не осталось. */

:root {
  --orange:    #faa835;
  --orange-dk: #e8941f;
  --blue:      #4171af;
  --link:      #0085c7;
  --line:      #0f93ff;
  --text:      #060607;
  --muted:     #4d4d4d;
  --white:     #fff;
  --bg:        #f5f5f5;
  --bg-soft:   #f9f9f9;
  --bg-blue:   #f0f7ff;

  --container: 1150px;
  --radius:    10px;
  --pad:       150px;          /* вертикальный отступ секции */
  --pad-sm:    80px;
  --shadow:    0 2px 14px rgba(0, 0, 0, .08);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 96px; }

body {
  margin: 0;
  font-family: Rubik, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--text);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; border: 0; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}

/* ── типографика оригинала ────────────────────────────────────────── */
.t-title, .t-h1, .t-subtitle, .t-siniy, .t-content, .t-caption { margin: 0; }
.t-title    { font-size: 40px; line-height: 1.2;  font-weight: 500; }
.t-h1       { font-size: 34px; line-height: 1.0;  font-weight: 500; }
.t-subtitle { font-size: 23px; line-height: 1.5;  font-weight: 500; }
.t-siniy    { font-size: 21px; line-height: 1.2;  font-weight: 500; color: var(--blue); }
.t-content  { font-size: 16px; line-height: 1.5;  font-weight: 500; }
.t-caption  { font-size: 14px; line-height: 1.3;  font-weight: 400; }
.t-h3       { font-size: 21px; line-height: 1.3;  font-weight: 500; }
.t-h4       { font-size: 18px; line-height: 1.35; font-weight: 500; }

h1, h2, h3, h4 { margin: 0; font-weight: 500; }

/* размер, заданный теме конкретного текста; на узких экранах — мобильный */
.t-sized { font-size: var(--fs, inherit); line-height: 1.5; }
@media (max-width: 860px) { .t-sized { font-size: var(--fs-m, var(--fs, inherit)); } }

.ta-center  { text-align: center; }
.ta-right   { text-align: right; }
.ta-justify { text-align: justify; }
.caps       { text-transform: uppercase; }
.fs14 { font-size: 14px; }
.fs16 { font-size: 16px; }
.fs21 { font-size: 21px; }
.fs26 { font-size: 26px; line-height: 1.5; }

.muted  { color: var(--muted); }
.blue   { color: var(--blue); }
.orange { color: var(--orange); }
.white  { color: var(--white); }
.black  { color: #000; }
.link   { color: var(--link); }

/* ── верхняя полоса ───────────────────────────────────────────────── */
.topbar {
  background: var(--orange);
  color: var(--white);
  font-size: 14px;
  line-height: 1.3;
}
.topbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 62px;
  padding-top: 8px;
  padding-bottom: 8px;
}
.topbar-item { display: flex; align-items: center; gap: 8px; }
.topbar a { color: var(--white); }
.topbar-ico { flex: 0 0 auto; width: 18px; height: 18px; fill: currentColor; opacity: .95; }

/* ── шапка ────────────────────────────────────────────────────────── */
.header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--white);
  transition: background-color .25s ease, box-shadow .25s ease;
}
.header.is-stuck { background: var(--orange); box-shadow: 0 2px 10px rgba(0, 0, 0, .12); }
.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 72px;
}
.header-logo { display: block; flex: 0 0 auto; }
.header-logo img { display: block; width: 200px; height: auto; }
.nav { display: flex; align-items: center; gap: 22px; }
.nav a {
  color: var(--text);
  font-size: 17px;
  font-weight: 400;
  white-space: nowrap;
}
.nav a:hover { color: var(--link); text-decoration: none; }
.header.is-stuck .nav a { color: var(--white); }
.header.is-stuck .nav a:hover { color: #fff; text-decoration: underline; }

.burger {
  display: none;
  width: 44px; height: 44px;
  padding: 10px;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.burger span { display: block; height: 2px; margin: 5px 0; background: var(--text); border-radius: 2px; }
.header.is-stuck .burger span { background: var(--white); }

/* ── секции ───────────────────────────────────────────────────────── */
/* Отступы и цвет «плёнки» поверх фоновой картинки приходят из данных блока —
   так сохраняется ритм прежнего сайта. */
.section {
  position: relative;
  padding: var(--pt, 100px) 0 var(--pb, 100px);
  background-color: var(--film, transparent);
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}
.section--img { background-color: transparent; }
.section--img::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--film, transparent);
  opacity: var(--film-a, 1);
  pointer-events: none;
}
.section > .container { position: relative; z-index: 1; }
/* длинный текст читается в колонке ограниченной ширины — так было и раньше */
.section > .container > .t-content,
.section > .container > .t-sized,
.section-head > .t-content,
.section-head > .t-sized { max-width: 750px; margin-inline: auto; }
.section--light, .section--light .t-title, .section--light .t-h1,
.section--light .t-subtitle, .section--light .t-content { color: var(--white); }
.section--light .section-head .t-title { color: var(--white); }

.section-head { text-align: center; margin-bottom: 48px; }
.section-head > * { margin-inline: auto; }

/* разделитель — короткая голубая черта, как в оригинале */
.rule { width: 300px; max-width: 80%; height: 1px; margin: 22px auto; background: var(--line); border: 0; }
.rule--left { margin-left: 0; }

/* ── первый экран ─────────────────────────────────────────────────── */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 444px;
  padding: 90px 0;
  background: #474747 center / cover no-repeat;
  color: var(--white);
  text-align: center;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(45, 45, 45, .45);
}
.hero .container { position: relative; z-index: 1; }
.hero h1 { font-size: 40px; line-height: 1.2; font-weight: 700; text-transform: uppercase; }

/* ── кнопки ───────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 56px;
  padding: 12px 28px;
  border: 0;
  border-radius: var(--radius);
  font: inherit;
  font-size: 18px;
  font-weight: 500;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: transform .15s ease, background-color .2s ease, color .2s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn--primary { background: var(--orange); color: var(--white); }
.btn--primary:hover { background: var(--orange-dk); color: var(--white); }
.btn--outline {
  background: transparent;
  color: var(--link);
  border: 2px solid var(--orange);
  text-transform: uppercase;
  font-size: 16px;
}
.btn--outline:hover { background: var(--orange); color: var(--white); }
.btn-row { display: flex; flex-wrap: wrap; gap: 28px; justify-content: center; }

/* ── карточки ─────────────────────────────────────────────────────── */
.cards { display: grid; gap: 28px; }
.cards > * { min-width: 0; }
.cards img { max-width: 100%; height: auto; }

/* лента с прокруткой — отзывы и всё, что не влезает в ряд */
.slider {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  padding-bottom: 14px;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
}
.slider > * { flex: 0 0 clamp(220px, 24vw, 280px); scroll-snap-align: start; }
.slider img { width: 100%; height: auto; }
.cards--2 { grid-template-columns: repeat(2, 1fr); }
.cards--3 { grid-template-columns: repeat(3, 1fr); }
.cards--4 { grid-template-columns: repeat(4, 1fr); }
.cards--5 { grid-template-columns: repeat(5, 1fr); }

.card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 28px 20px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: center;
}
.card--plain { background: transparent; box-shadow: none; }
.card__icon { display: block; width: 120px; height: auto; }
.card__title { font-size: 16px; font-weight: 500; color: var(--link); }
.card a.card__title { text-decoration: underline; }
.card__text { font-size: 15px; line-height: 1.45; color: var(--muted); }

/* плитка цен на тёмном фоне */
.price-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.price-card {
  padding: 34px 24px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: center;
}
.price-card__sum { font-size: 30px; font-weight: 500; color: var(--text); }
.price-card__label { margin-top: 14px; font-size: 16px; color: var(--muted); }
.price-card__label::before {
  content: "";
  display: block;
  width: 120px;
  height: 1px;
  margin: 0 auto 14px;
  background: var(--orange);
}

/* ── список экспертиз в три колонки ───────────────────────────────── */
.lists { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.list-col { display: flex; flex-direction: column; gap: 18px; }
.list-item { display: flex; align-items: center; gap: 14px; }
.list-item img { flex: 0 0 auto; width: 44px; height: 44px; object-fit: contain; }
.list-item a { color: var(--link); text-decoration: underline; font-size: 16px; }

/* ── таблицы цен ──────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  font-size: 16px;
}
.table th, .table td {
  padding: 14px 18px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid #ececec;
}
.table th {
  background: var(--orange);
  color: var(--white);
  font-weight: 500;
  text-transform: uppercase;
  font-size: 15px;
}
.table tr:last-child td { border-bottom: 0; }
.table td:last-child { white-space: nowrap; font-weight: 500; }

/* врезка «срок / стоимость» в первом экране страницы услуги */
.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 46px;
  justify-content: center;
  margin: 26px 0 8px;
}
.fact { display: flex; align-items: baseline; gap: 14px; }
.fact__label { font-size: 17px; text-transform: uppercase; color: var(--text); }
.fact__arrow { color: var(--orange); font-size: 20px; }
.fact__value { font-size: 17px; font-weight: 500; color: var(--text); }

/* ── аккордеон ────────────────────────────────────────────────────── */
.spoiler-cols { display: grid; gap: 0 40px; }
.spoiler-cols.cols--1 { grid-template-columns: 1fr; }
.spoiler-cols.cols--2 { grid-template-columns: 1fr 1fr; }
.spoiler__ico { flex: 0 0 auto; width: 34px; height: 34px; object-fit: contain; }
.spoiler__title { flex: 1; }
.spoiler { border-top: 1px solid #e3e3e3; }
.spoiler__item { border-bottom: 1px solid #e3e3e3; }
.spoiler__head {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 20px 0;
  background: none;
  border: 0;
  font: inherit;
  font-size: 18px;
  font-weight: 500;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.spoiler__head::after {
  content: "";
  flex: 0 0 auto;
  width: 12px; height: 12px;
  margin-left: auto;
  border-right: 2px solid var(--orange);
  border-bottom: 2px solid var(--orange);
  transform: rotate(45deg);
  transition: transform .2s ease;
}
.spoiler__item.is-open .spoiler__head::after { transform: rotate(-135deg); }
.spoiler__body { display: none; padding: 0 0 22px; color: var(--muted); }
.spoiler__item.is-open .spoiler__body { display: block; }

/* список «Дела по …» — картинка + ссылка */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.tile {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 22px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.tile img { flex: 0 0 auto; width: 64px; height: 64px; object-fit: contain; }
.tile a { font-size: 16px; color: var(--link); text-decoration: underline; }

/* ── блок со свободной раскладкой (карта судов) ───────────────────── */
.canvas {
  position: relative;
  width: 1150px;
  height: calc(var(--canvas-h, 700px) - 60px);
  margin: 0 auto;
}
.canvas__item { position: absolute; }
.canvas__item .list-item { align-items: center; gap: 8px; }
.canvas__item .list-item img { width: 28px; height: 28px; }
.canvas__item .list-item a,
.canvas__item .list-item div { font-size: 11px; line-height: 1.2; color: var(--text); white-space: nowrap; }
.canvas__item > img { display: block; width: 100%; height: 100%; object-fit: contain; }
.canvas__line { display: block; width: 100%; height: 1px; background: var(--line); }
.canvas .t-title, .canvas .t-h1 { text-align: center; }
.section--desktop-only { display: block; }

@media (max-width: 1190px) {
  .canvas { transform: scale(calc(100vw / 1230)); transform-origin: top left; }
}
@media (max-width: 860px) {
  .section--desktop-only { display: none; }
}

/* ── бегущая строка ───────────────────────────────────────────────── */
.marquee { overflow: hidden; }
.marquee__run {
  display: flex;
  gap: 60px;
  width: max-content;
  animation: marquee 32s linear infinite;
  font-size: 23px;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
}
.marquee__run span::after { content: "◆"; margin-left: 60px; color: var(--orange); font-size: 14px; vertical-align: middle; }
@keyframes marquee { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .marquee__run { animation: none; } }

/* ── галерея картинок ─────────────────────────────────────────────── */
.gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.gallery img { width: 100%; border-radius: var(--radius); box-shadow: var(--shadow); cursor: zoom-in; }

/* ── контакты ─────────────────────────────────────────────────────── */
.contacts { display: grid; grid-template-columns: 1fr 1fr; gap: 28px 40px; }
.contact { display: flex; align-items: flex-start; gap: 14px; font-size: 17px; }
.contact svg { flex: 0 0 auto; width: 22px; height: 22px; fill: var(--orange); }
.contact a { color: var(--text); }
.socials { display: flex; gap: 14px; margin-top: 8px; }
.socials a { display: flex; align-items: center; gap: 8px; color: var(--text); }
.socials svg { width: 26px; height: 26px; }
.map { margin-top: 48px; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.map iframe { display: block; width: 100%; height: 420px; border: 0; }

/* ── подвал ───────────────────────────────────────────────────────── */
.footer { padding: 60px 0 40px; background: var(--white); border-top: 1px solid #ededed; text-align: center; }
.footer-logo img { width: 240px; height: auto; }
.footer-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 28px; margin: 28px 0; }
.footer-nav a { color: var(--text); font-size: 15px; text-transform: uppercase; }
.footer-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 28px; margin: 0 auto 28px; max-width: 900px; text-align: left; }
.footer-links a { color: var(--link); font-size: 15px; }
.footer-legal { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 22px; margin-top: 18px; font-size: 13px; color: var(--muted); }
.footer-legal a { color: var(--muted); text-decoration: underline; }

/* ── модальное окно с формой ──────────────────────────────────────── */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, .55);
}
.modal.is-open { display: flex; }
.modal__box {
  position: relative;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 36px 32px;
  background: var(--white);
  border-radius: var(--radius);
}
.modal__close {
  position: absolute;
  top: 10px; right: 10px;
  width: 40px; height: 40px;
  border: 0;
  background: none;
  font-size: 28px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
}
.modal__title { margin-bottom: 20px; font-size: 22px; font-weight: 500; text-align: center; }

.field { margin-bottom: 16px; }
.field--trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.field label { display: block; margin-bottom: 6px; font-size: 14px; color: var(--muted); }
.field input, .field textarea {
  width: 100%;
  padding: 13px 16px;
  border: 1px solid #d8d8d8;
  border-radius: 8px;
  font: inherit;
  font-size: 16px;
  color: var(--text);
  background: #fff;
}
.field input:focus, .field textarea:focus { outline: 2px solid var(--orange); outline-offset: -1px; border-color: var(--orange); }
.field textarea { min-height: 92px; resize: vertical; }
.field--error input, .field--error textarea { border-color: #d94b4b; }
.form__note { margin-top: 14px; font-size: 12px; line-height: 1.4; color: var(--muted); text-align: center; }
.form__note a { color: var(--muted); text-decoration: underline; }
.form__msg { margin-top: 14px; font-size: 15px; text-align: center; }
.form__msg--ok { color: #2e7d32; }
.form__msg--err { color: #c62828; }

/* ── адаптив ──────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  :root { --pad: 90px; --pad-sm: 60px; }
  .cards--4, .cards--5 { grid-template-columns: repeat(3, 1fr); }
  .lists, .tiles { grid-template-columns: repeat(2, 1fr); }
  .gallery { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 860px) {
  .section { padding: var(--pt-m, 60px) 0 var(--pb-m, 60px); }
  .nav {
    position: fixed;
    inset: 0 0 0 auto;
    z-index: 70;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    width: min(320px, 86vw);
    padding: 90px 26px 26px;
    background: var(--white);
    box-shadow: -8px 0 24px rgba(0, 0, 0, .18);
    transform: translateX(100%);
    transition: transform .25s ease;
    overflow-y: auto;
  }
  .nav.is-open { transform: none; }
  .nav a { display: block; width: 100%; padding: 12px 0; color: var(--text); font-size: 18px; border-bottom: 1px solid #f0f0f0; }
  .header.is-stuck .nav a { color: var(--text); }
  .burger { display: block; }
  .topbar .container { flex-wrap: wrap; gap: 10px 18px; justify-content: flex-start; }
  .cards--3, .cards--4, .cards--5, .price-cards { grid-template-columns: repeat(2, 1fr); }
  .spoiler-cols.cols--2 { grid-template-columns: 1fr; }
  .contacts { grid-template-columns: 1fr; }
  .footer-links { grid-template-columns: repeat(2, 1fr); }
  .hero h1, .t-title { font-size: 30px; }
  .t-h1 { font-size: 26px; }
}

@media (max-width: 560px) {
  :root { --pad: 60px; --pad-sm: 44px; }
  .container { padding: 0 16px; }
  .cards--2, .cards--3, .cards--4, .cards--5, .price-cards, .lists, .tiles { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .hero h1, .t-title { font-size: 25px; }
  .btn-row { flex-direction: column; }
  .btn { width: 100%; }
  .map iframe { height: 320px; }

  /* таблица цен превращается в карточки */
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table thead { display: none; }
  .table tr { margin-bottom: 14px; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; background: #fff; }
  .table td { border-bottom: 1px solid #f0f0f0; }
  .table td:last-child { white-space: normal; font-weight: 500; color: var(--text); background: #fafafa; }
}
