/* =========================================================
   Мерседес Сервис — стили
   Тёмная премиум-палитра (чёрный / графит / серебро).
   Mobile-first, брейкпоинты 768 / 1024.
   ========================================================= */

:root {
  /* Палитра */
  --bg:        #0b0c0e;   /* почти чёрный */
  --bg-alt:    #121419;   /* графит для чередующихся секций */
  --surface:   #181b21;   /* карточки */
  --surface-2: #1f232b;
  --line:      #2a2f38;   /* границы */
  --text:      #eef1f5;   /* основной текст (серебро) */
  --text-dim:  #9aa3b0;   /* приглушённый */
  --silver:    #c8ccd2;
  --accent:    #d7dce3;   /* «звёздный» серебристый акцент */
  --whatsapp:  #25d366;

  /* Шрифты: Google Fonts с fallback на system-ui — оффлайн не ломает вёрстку */
  --font-head: "Montserrat", system-ui, "Segoe UI", Roboto, Arial, sans-serif;
  --font-body: "Inter", system-ui, "Segoe UI", Roboto, Arial, sans-serif;

  --radius: 14px;
  --radius-sm: 10px;
  --maxw: 1140px;
  --shadow: 0 10px 30px rgba(0,0,0,.45);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--font-head); line-height: 1.15; margin: 0 0 .5em; }
p { margin: 0 0 1em; }
a { color: inherit; text-decoration: none; }

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

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: .95rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform .2s ease, background .2s ease, border-color .2s ease, color .2s ease, box-shadow .25s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px) scale(1.03); }
.btn:active { transform: translateY(0) scale(.99); }
.btn .ico { width: 18px; height: 18px; }

.btn-primary {
  background: linear-gradient(180deg, #f2f4f7, #c8ccd2);
  color: #0b0c0e;
}
/* Серебристый glow на hover главной CTA */
.btn-primary:hover {
  background: linear-gradient(180deg, #ffffff, #d7dce3);
  box-shadow: 0 8px 26px rgba(215,220,227,.30), 0 0 0 1px rgba(255,255,255,.25) inset;
}
.btn-whatsapp:hover { box-shadow: 0 8px 26px rgba(37,211,102,.30); }

.btn-whatsapp { background: var(--whatsapp); color: #07210f; }
.btn-whatsapp:hover { background: #2ee676; }

.btn-outline {
  background: transparent;
  color: var(--text);
  border-color: var(--line);
}
.btn-outline:hover { border-color: var(--silver); background: rgba(255,255,255,.04); }

.btn-lg { padding: 15px 28px; font-size: 1.02rem; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11,12,14,.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--text); }
.logo-star { width: 30px; height: 30px; color: var(--silver); }
.logo-text { font-family: var(--font-head); font-weight: 800; letter-spacing: .3px; }

.nav {
  display: flex;
  align-items: center;
  gap: 26px;
}
.nav-link { color: var(--text-dim); font-weight: 500; transition: color .2s; }
.nav-link:hover { color: var(--text); }
.nav-cta { color: #0b0c0e; }

.burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 42px; height: 42px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.burger span {
  display: block;
  width: 20px; height: 2px;
  background: var(--text);
  transition: transform .25s, opacity .2s;
}
.burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger.open span:nth-child(2) { opacity: 0; }
.burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 96px 0 84px;
  border-bottom: 1px solid var(--line);
}
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  /* Фото Mercedes-AMG GT R (Unsplash, локально, оффлайн) + тёмный градиент-overlay
     поверх для читаемости текста. Источник и лицензия — в README, раздел «Изображения». */
  background:
    linear-gradient(95deg, rgba(8,9,11,.95) 0%, rgba(8,9,11,.82) 38%, rgba(8,9,11,.50) 68%, rgba(8,9,11,.38) 100%),
    url("assets/hero-mercedes.jpg") center right / cover no-repeat,
    linear-gradient(160deg, #15181e 0%, #0b0c0e 60%);
}
/* Декоративная «звезда» крупным планом в фоне hero */
.hero-bg::after {
  content: "";
  position: absolute;
  right: -60px; top: 50%;
  transform: translateY(-50%);
  width: 460px; height: 460px;
  border-radius: 50%;
  border: 2px solid rgba(200,204,210,.12);
  background:
    radial-gradient(circle, rgba(200,204,210,.08), transparent 65%);
  -webkit-mask: radial-gradient(circle at center, #000 99%, transparent 100%);
}
.hero-inner { position: relative; z-index: 1; max-width: 760px; }
.hero-eyebrow {
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: .8rem;
  color: var(--text-dim);
  margin-bottom: 14px;
}
.hero-title {
  font-size: clamp(2.4rem, 7vw, 4.2rem);
  font-weight: 800;
  background: linear-gradient(180deg, #ffffff, #aeb4bd);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: .2em;
}
.hero-offer { font-size: clamp(1.05rem, 2.5vw, 1.4rem); color: var(--silver); font-family: var(--font-head); font-weight: 500; }
.hero-sub { color: var(--text-dim); max-width: 560px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin: 28px 0 22px; }
.hero-trust { display: flex; align-items: center; gap: 10px; color: var(--text-dim); font-size: .95rem; }
.stars { color: #e8c558; letter-spacing: 2px; }
.stars-lg { font-size: 1.6rem; }

/* ---------- Секции ---------- */
.section { padding: 80px 0; }
.section-alt { background: var(--bg-alt); }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 48px; }
.section-head h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
.section-sub { color: var(--text-dim); margin: 0; }

/* ---------- Карточки услуг ---------- */
.cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}
.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 24px;
  transition: transform .25s ease, border-color .25s ease, background .25s ease, box-shadow .25s ease;
}
.card:hover {
  transform: translateY(-6px);
  border-color: var(--silver);
  background: var(--surface-2);
  box-shadow: 0 18px 40px rgba(0,0,0,.55), 0 0 0 1px rgba(200,204,210,.18) inset;
}
.card-ico {
  width: 34px; height: 34px;
  color: var(--silver);
  margin-bottom: 14px;
  transition: transform .25s ease, color .25s ease, filter .25s ease;
}
.card:hover .card-ico {
  color: #ffffff;
  transform: scale(1.12) translateY(-2px);
  filter: drop-shadow(0 4px 10px rgba(215,220,227,.35));
}
.card h3 { font-size: 1.2rem; }
.card p { color: var(--text-dim); margin: 0; }

/* ---------- Преимущества ---------- */
.adv-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}
.adv {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 24px;
}
.adv-num {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.4rem;
  color: var(--silver);
  opacity: .5;
}
.adv h3 { margin-top: 8px; font-size: 1.15rem; }
.adv p { color: var(--text-dim); margin: 0; }

/* ---------- Отзывы ---------- */
.rating-block {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  align-items: start;
}
.rating-score {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.rating-big { font-family: var(--font-head); font-weight: 800; font-size: 4rem; line-height: 1; }
.rating-meta { color: var(--text-dim); }
.rating-score .btn { margin-top: 8px; }

.review-quotes { display: grid; gap: 16px; }
.reviews-list { display: grid; gap: 16px; }

/* Карточка отзыва (рендерится из config.js) */
.review-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--silver);
  border-radius: var(--radius-sm);
  margin: 0;
  padding: 20px 22px;
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.review-card:hover {
  transform: translateY(-3px);
  border-color: var(--silver);
  box-shadow: 0 14px 32px rgba(0,0,0,.45);
}
.review-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.review-name { font-family: var(--font-head); font-weight: 700; color: var(--text); }
.review-stars { color: #e8c558; letter-spacing: 2px; font-size: 1rem; white-space: nowrap; }
.review-text {
  margin: 0 0 10px;
  color: var(--text);
  line-height: 1.6;
  quotes: "«" "»";
}
.review-text::before { content: open-quote; color: var(--text-dim); }
.review-text::after { content: close-quote; color: var(--text-dim); }
.review-car {
  color: var(--text-dim);
  font-size: .88rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.review-car::before {
  content: "";
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--silver);
  opacity: .6;
}
.reviews-note { color: var(--text-dim); font-size: .9rem; margin: 8px 0 0; }

/* ---------- Контакты + карта ---------- */
.contacts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
}
.contact-list { list-style: none; margin: 0 0 22px; padding: 0; display: grid; gap: 18px; }
.contact-list li { display: flex; flex-direction: column; gap: 2px; }
.contact-label { color: var(--text-dim); font-size: .82rem; text-transform: uppercase; letter-spacing: 1px; }
.contact-value { font-size: 1.1rem; }
.contact-strong { font-family: var(--font-head); font-weight: 700; }
a.contact-value:hover { color: var(--silver); }
.contacts-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.map-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}
.map-frame { width: 100%; height: 340px; border: 0; display: block; filter: grayscale(.25) contrast(1.05); }
.map-fallback {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
}
.map-fallback a { color: var(--silver); }

/* ---------- CTA-band ---------- */
.cta-band {
  background:
    radial-gradient(800px 300px at 50% 0%, rgba(215,220,227,.10), transparent 70%),
    linear-gradient(180deg, #15181e, #0b0c0e);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 72px 0;
  text-align: center;
}
.cta-inner h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
.cta-inner p { color: var(--text-dim); max-width: 560px; margin: 0 auto 26px; }
.cta-actions { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }

/* ---------- Footer ---------- */
.site-footer { background: #08090b; padding: 42px 0 26px; }
.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}
.footer-brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-head); font-weight: 800; }
.footer-brand .logo-star { width: 26px; height: 26px; color: var(--silver); }
.footer-cols { display: grid; gap: 8px; }
.footer-link { color: var(--text-dim); }
a.footer-link:hover { color: var(--text); }
.footer-copy {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 20px;
  color: var(--text-dim);
  font-size: .85rem;
}
.footer-disclaimer { opacity: .7; }

/* =========================================================
   Адаптив — брейкпоинты 768 / 1024
   ========================================================= */
@media (min-width: 768px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .adv-grid { grid-template-columns: repeat(2, 1fr); }
  .rating-block { grid-template-columns: 320px 1fr; }
  .contacts-grid { grid-template-columns: 1fr 1.1fr; }
  .footer-inner { flex-direction: row; align-items: center; justify-content: space-between; }
  .footer-cols { grid-auto-flow: column; gap: 28px; }
  .footer-copy { flex-direction: row; justify-content: space-between; }
}

@media (min-width: 1024px) {
  .cards { grid-template-columns: repeat(3, 1fr); }
}

/* Бургер-меню только на мобильном (< 768px) */
@media (max-width: 767px) {
  .burger { display: flex; }
  .nav {
    position: fixed;
    top: 68px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--line);
    padding: 8px 20px 20px;
    transform: translateY(-130%);
    transition: transform .3s ease;
    box-shadow: var(--shadow);
  }
  .nav.open { transform: translateY(0); }
  .nav-link { padding: 14px 4px; border-bottom: 1px solid var(--line); }
  .nav-cta { margin-top: 14px; text-align: center; }
}

/* =========================================================
   Параллакс-разделители (фоновые фото между секциями)
   ========================================================= */
.parallax {
  position: relative;
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #08090b;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  /* fixed = эффект параллакса; на мобильных переключается на scroll (см. медиа-запрос) */
  background-attachment: fixed;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.parallax-star   { background-image: linear-gradient(rgba(8,9,11,.55), rgba(8,9,11,.72)), url("assets/detail-star.jpg"); }
.parallax-engine { background-image: linear-gradient(rgba(8,9,11,.60), rgba(8,9,11,.78)), url("assets/service-engine.jpg"); }
.parallax-overlay { text-align: center; padding: 0 20px; }
.parallax-line {
  margin: 0;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(1.3rem, 3.2vw, 2rem);
  letter-spacing: .5px;
  color: #fff;
  text-shadow: 0 2px 18px rgba(0,0,0,.7);
}

/* =========================================================
   Анимации появления (scroll-reveal через IntersectionObserver)
   Базовое состояние — скрыто/смещено; класс .is-visible проявляет.
   Без JS-классов (нет .js на html) reveal-элементы остаются видимыми
   (graceful: если JS не сработал — контент не пропадает).
   ========================================================= */
.js .reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .7s ease, transform .7s ease;
  will-change: opacity, transform;
}
.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}
/* Стаггер дочерних элементов внутри reveal-контейнера */
.js .reveal-stagger > * {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .6s ease, transform .6s ease;
}
.js .reveal-stagger.is-visible > * { opacity: 1; transform: none; }
.js .reveal-stagger.is-visible > *:nth-child(1) { transition-delay: .05s; }
.js .reveal-stagger.is-visible > *:nth-child(2) { transition-delay: .12s; }
.js .reveal-stagger.is-visible > *:nth-child(3) { transition-delay: .19s; }
.js .reveal-stagger.is-visible > *:nth-child(4) { transition-delay: .26s; }
.js .reveal-stagger.is-visible > *:nth-child(5) { transition-delay: .33s; }
.js .reveal-stagger.is-visible > *:nth-child(6) { transition-delay: .40s; }

/* Входная анимация hero (fade-in-up со ступенчатой задержкой --d) */
.js .hero-anim {
  opacity: 0;
  transform: translateY(24px);
  animation: heroIn .8s ease forwards;
  animation-delay: var(--d, 0s);
}
@keyframes heroIn {
  to { opacity: 1; transform: none; }
}

/* =========================================================
   prefers-reduced-motion — полностью отключаем движение
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
  .parallax { background-attachment: scroll; }
  /* Гарантируем видимость контента без анимаций */
  .js .reveal,
  .js .reveal-stagger > *,
  .js .hero-anim { opacity: 1 !important; transform: none !important; }
}

/* На мобильных background-attachment: fixed часто глючит — отключаем */
@media (max-width: 767px) {
  .parallax { background-attachment: scroll; min-height: 240px; }
}
