/* Best Car — mobile-first, без опечаток */

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

/* при переходе по якорям секция не уходит под фиксированную шапку */
section[id] {
  scroll-margin-top: 88px;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: #e8e8e8;
  background: #1a1a1a;
  padding-top: 88px;
}

.container {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 16px;
}

@media (min-width: 600px) {
  .container {
    padding: 0 24px;
  }
}

/* Обёртка шапки — всегда прижата к верху экрана при прокрутке (как на autolegko.ru) */
.header-wrap {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  z-index: 101;
}

/* цвет фона как у логотипа (#1a1a1a) — шапка и логотип визуально совпадают */
.header {
  background-color: #1a1a1a;
  background: #1a1a1a;
  color: #fff;
  padding: 12px 0;
}

.header__container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.logo {
  margin: 0;
  display: block;
  color: inherit;
  text-decoration: none;
  line-height: 0;
  border: none;
  outline: none;
  box-shadow: none;
  -webkit-tap-highlight-color: transparent;
}

.logo:hover,
.logo:focus {
  border: none;
  outline: none;
  box-shadow: none;
}

.logo:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.6);
  outline-offset: 4px;
}

/* Логотип: нормальный размер и пропорции (без сжатия) */
.logo__img {
  display: block;
  height: 52px;
  width: auto;
  max-width: none;
  object-fit: contain;
  vertical-align: middle;
}

@media (min-width: 600px) {
  .logo__img {
    height: 60px;
  }
}

/* Кнопка «гамбургер» — только на мобильных, без синей обводки */
.nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  background: transparent;
  border: none;
  outline: none;
  cursor: pointer;
  color: #fff;
  border-radius: 4px;
  transition: background 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.nav-toggle:focus {
  outline: none;
}

.nav-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
}

.nav-toggle::before,
.nav-toggle::after {
  content: "";
  display: block;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  transition: transform 0.25s, opacity 0.25s;
}

.nav-toggle span {
  display: block;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  opacity: 1;
  transition: opacity 0.25s;
}

.nav-toggle[aria-expanded="true"]::before {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"]::after {
  transform: translateY(-7px) rotate(-45deg);
}

.nav-toggle[aria-expanded="true"] span {
  opacity: 0;
}

@media (min-width: 768px) {
  .nav-toggle {
    display: none;
  }
}

/* Навигация */
.nav {
  position: fixed;
  top: 0;
  right: 0;
  width: 280px;
  max-width: 85vw;
  height: 100vh;
  background: #1a1a1a;
  padding: 70px 24px 24px;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  z-index: 100;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.3);
}

.nav--open {
  transform: translateX(0);
}

.nav__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav__list li {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nav__link {
  display: block;
  padding: 14px 0;
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s, background 0.2s;
}

.nav__link:hover {
  color: #FFEB3B;
}

@media (min-width: 768px) {
  .nav {
    position: static;
    width: auto;
    height: auto;
    max-width: none;
    padding: 0;
    transform: none;
    box-shadow: none;
    background: transparent;
  }

  .nav__list {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .nav__list li {
    border-bottom: none;
  }

  .nav__link {
    padding: 8px 12px;
    border-radius: 4px;
  }

  .nav__link:hover {
    background: rgba(255, 255, 255, 0.1);
  }
}

/* Занавес при открытом меню на мобильных */
.nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.nav-backdrop.is-visible {
  opacity: 1;
  visibility: visible;
}

/* Sections */
section {
  padding: 32px 0;
}

.section-title {
  margin: 0 0 24px;
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  color: #fff;
}

@media (min-width: 600px) {
  section {
    padding: 40px 0;
  }
  .section-title {
    font-size: 1.75rem;
    margin-bottom: 32px;
  }
}

/* Hero */
.hero {
  background: #252525;
  color: #fff;
  padding: 40px 0;
}

.hero__title {
  margin: 0 0 8px;
  font-size: 1.75rem;
  color: #fff;
}

.hero__subtitle {
  margin: 0 0 4px;
  font-size: 1.25rem;
  color: #FFEB3B;
  opacity: 1;
}

.hero__tagline {
  margin: 0 0 16px;
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
}

.hero__text {
  margin: 0;
  max-width: 60ch;
  color: #d0d0d0;
  opacity: 1;
}

@media (min-width: 600px) {
  .hero {
    padding: 56px 0;
  }
  .hero__title {
    font-size: 2.25rem;
  }
  .hero__subtitle {
    font-size: 1.35rem;
  }
}

/* Benefits */
.benefits {
  background: #1f1f1f;
}

.benefits .section-title {
  color: #fff;
}

.benefits__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.benefits__item {
  padding: 12px 0;
  padding-left: 28px;
  position: relative;
  color: #e0e0e0;
}

.benefits__item::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: #FFEB3B;
  font-weight: bold;
}

.benefits__item + .benefits__item {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Cars grid */
.cars {
  background: #252525;
}

.cars .section-title {
  color: #fff;
}

.cars__grid {
  display: grid;
  gap: 20px;
}

@media (min-width: 500px) {
  .cars__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 800px) {
  .cars__grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
  }
}

.car-card {
  background: #1f1f1f;
  padding: 0;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  overflow: hidden;
}

/* Блок фото: фиксированные пропорции 8:5, фото заполняет область без искажений */
.car-card__img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 8 / 5;
  background: #252525;
  overflow: hidden;
}

.car-card__img-wrap img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.car-card__img-wrap {
  position: relative;
}

.car-card__img {
  transition: opacity 0.3s ease;
}

.car-card__img--hover {
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
}

.car-card:hover .car-card__img--hover {
  opacity: 1;
}

.car-card__name,
.car-card__specs,
.car-card__price {
  padding-left: 20px;
  padding-right: 20px;
}

.car-card__name {
  padding-top: 16px;
}

.car-card:hover {
  transform: scale(1.03);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  border-color: rgba(255, 235, 59, 0.4);
}

.car-card__name {
  margin: 0 0 8px;
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
}

.car-card__specs {
  margin: 0 0 12px;
  padding-top: 0;
  font-size: 0.9rem;
  color: #b0b0b0;
  line-height: 1.45;
}

.car-card__price {
  margin: 0;
  padding-bottom: 20px;
  font-size: 1.1rem;
  font-weight: 700;
  color: #FFEB3B;
}

/* Steps */
.steps {
  background: #1f1f1f;
}

.steps .section-title {
  color: #fff;
}

.steps__list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

@media (min-width: 600px) {
  .steps__list {
    flex-direction: row;
    justify-content: center;
    gap: 32px;
  }
}

.steps__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 20px 16px;
  background: #252525;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.steps__num {
  display: block;
  font-weight: 700;
  color: #FFEB3B;
  margin-bottom: 4px;
}

.steps__text {
  color: #e0e0e0;
}

.steps__link {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.steps__link:hover {
  color: #FFEB3B;
}

/* Contacts */
.contacts {
  background: #252525;
  color: #fff;
}

.contacts .section-title {
  color: #fff;
}

.contacts__content {
  text-align: left;
  max-width: 40ch;
  margin: 0 auto 24px;
}

.contacts__row {
  margin: 0 0 12px;
  color: #e0e0e0;
}

.contacts__row:last-child {
  margin-bottom: 0;
}

@media (min-width: 560px) {
  .contacts__row {
    display: flex;
    flex-wrap: nowrap;
    align-items: baseline;
    gap: 0.35em;
  }
}

.contacts__label {
  display: inline-block;
  min-width: 6.5em;
  flex-shrink: 0;
  color: #888;
  font-weight: 500;
}

.contacts__address {
  color: #FFEB3B;
}

.contacts__phones a,
.contacts__email,
.contacts__maps a {
  color: #FFEB3B;
  text-decoration: none;
  font-weight: 500;
}

.contacts__phones a:hover,
.contacts__email:hover,
.contacts__maps a:hover {
  color: #fff;
  text-decoration: underline;
}

/* На узком экране телефоны могут переноситься на новую строку */
.contacts__phones a {
  display: inline-block;
  padding: 4px 0;
  min-height: 44px;
  line-height: 36px;
}

@media (min-width: 560px) {
  .contacts__phones {
    white-space: nowrap;
  }
}

.contacts__email {
  display: inline-block;
  padding: 4px 0;
  min-height: 44px;
  line-height: 36px;
}

/* Карта Яндекса */
.contacts__map {
  width: 100%;
  height: 320px;
  margin-bottom: 16px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.contacts__maps {
  text-align: center;
  margin: 0;
}

.contacts__maps a {
  display: inline-block;
  padding: 8px 12px;
  min-height: 44px;
  line-height: 28px;
}

.contacts__sep {
  color: #888;
}

/* Footer */
.footer {
  background: #0f0f0f;
  color: #888;
  padding: 20px 0;
  text-align: center;
}

.footer__copy {
  margin: 0;
  font-size: 0.9rem;
}
