/* ====== ПАЛИТРА И БАЗА ====== */
:root {
  --bg: #0d0e10;
  --panel: #111317;
  --text: #ececec;
  --muted: #a4a6ab;
  --accent: #b30b24;
  --line: #22242a;
  --white: #ffffff;
  --radius: 14px;
}

* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: Inter, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto,
    sans-serif;
  line-height: 1.55;
  letter-spacing: 0.1px;
}
h1,
h2,
h3 {
  font-family: Montserrat, Inter, sans-serif;
  margin: 0 0 10px;
}
p {
  margin: 0 0 12px;
  color: #d3d5d9;
}
a {
  color: inherit;
  text-decoration: none;
}

/* ====== ШАПКА ====== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(6px);
  background: rgba(13, 14, 16, 0.75);
  border-bottom: 1px solid var(--line);
  transition: all 0.25s ease;
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 24px;
  justify-content: space-between;
}
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}
.brand img {
  width: 72px;
  height: auto;
  display: block;
}
.brand-title {
  display: flex;
  flex-direction: column;
}
.brand-title .name {
  font: 800 22px/1 Montserrat, Inter, sans-serif;
  letter-spacing: 0.5px;
}
.brand-title .bbb {
  font: 600 12px/1 Inter, sans-serif;
  color: var(--muted);
  margin-top: 6px;
}
.nav {
  display: flex;
  gap: 28px;
  align-items: center;
}
.nav a {
  font-weight: 600;
  letter-spacing: 0.2px;
  color: #cfcfcf;
}
.nav a.active,
.nav a:hover {
  color: var(--white);
}

/* компактная шапка при скролле */
.site-header--compact .brand .name {
  font-size: 18px;
}
.site-header--compact .brand img {
  width: 56px;
}

/* ====== ОБЩИЕ ОБОЛОЧКИ ====== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 16px;
}
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

/* ====== BRAND HERO (первый экран) ====== */
.brand-hero {
  min-height: 82vh;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 14px;
  text-align: center;
  position: relative;
}
.brand-hero__logo {
  width: 320px;
  height: auto;
  filter: drop-shadow(0 18px 46px rgba(0, 0, 0, 0.55));
}
.brand-hero__title {
  font: 800 72px/1.06 Montserrat, Inter, sans-serif;
  letter-spacing: 0.6px;
  margin: 10px 0 0;
}
.brand-hero__tagline {
  color: #d6d6d6;
  font-weight: 600;
  font-size: 18px;
}

/* ====== ПАНЕЛЬ ДЕЙСТВИЙ ====== */
.actions-bar {
  position: sticky;
  top: 64px;
  z-index: 900;
  background: rgba(17, 19, 23, 0.78);
  backdrop-filter: blur(6px);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.actions {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.action-btn {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #14161a;
  color: #e8e8e8;
  font-weight: 600;
  cursor: pointer;
}
.action-btn:hover {
  border-color: var(--accent);
  color: #fff;
}

/* ====== ВЫДЕЛЕННЫЙ RS6 ====== */
.featured {
  position: relative;
  margin: 24px auto;
  max-width: 1200px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.featured__img {
  width: 100%;
  height: 440px;
  object-fit: cover;
  display: block;
  filter: brightness(0.92);
}
.featured__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0) 40%,
    rgba(0, 0, 0, 0.6) 92%
  );
  padding: 20px;
}
.featured__title {
  font: 800 36px/1.1 Montserrat, Inter, sans-serif;
}
.featured__text {
  color: #e0e0e0;
  margin: 6px 0 12px;
}
.featured__actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 12px 16px;
  border-radius: 10px;
  font-weight: 800;
}
.btn-secondary {
  background: #17181b;
  color: #fff;
  border: 1px solid var(--line);
  padding: 12px 16px;
  border-radius: 10px;
  font-weight: 700;
}

/* ====== СЕТКА БРЕНДОВ ====== */
.brand-grid {
  max-width: 1200px;
  margin: 24px auto;
  padding: 0 16px;
  display: grid;
  grid-template-columns: repeat(7, minmax(120px, 1fr));
  gap: 14px;
}
.brand-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.brand-tile img {
  width: 120px;
  height: auto;
  border-radius: 12px;
}
/* если в SVG уже есть текст — скрываем подпись под бейджем */
.brand-tile span {
  display: none;
}

/* ====== КАТАЛОГ: FLEX-ЛЕНТА 2×N (никаких дыр) ====== */
#brand-sections {
  max-width: 1200px;
  margin: 24px auto;
  padding: 0 16px;
}
/* контейнер каталога — две колонки за счёт flex-wrap */
#catalog-grid {
  display: flex !important; /* принудительно, чтобы перебить старые правила */
  flex-wrap: wrap !important;
  gap: 16px;
  align-items: flex-start;
  justify-content: flex-start;
}
/* карточка занимает половину ширины (минус зазор) */
#catalog-grid .card {
  flex: 1 1 calc(50% - 8px) !important;
  max-width: calc(50% - 8px) !important;
}
/* якорь бренда занимает всю строку, высота ноль — не ломает раскладку */
.brand-anchor {
  flex-basis: 100%;
  height: 0;
  scroll-margin-top: 120px; /* компенсируем sticky-шапку */
}

/* Карточки */
.card {
  background: #101114;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.card img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  display: block;
}
.card .card-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.card .card-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.brand-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #131519;
  color: #cfcfcf;
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 600;
}

/* ====== МОДАЛКИ ====== */
.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}
.modal.show {
  display: flex;
}
.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
}
.modal__dialog {
  position: relative;
  background: #0f1012;
  border: 1px solid var(--line);
  border-radius: 16px;
  width: min(560px, 92vw);
  padding: 18px;
}
.modal__title {
  font: 800 22px/1.2 Montserrat, Inter, sans-serif;
  margin-bottom: 10px;
}
.modal__close {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 18px;
  cursor: pointer;
  color: #cfcfcf;
}
.form-row {
  display: flex;
  gap: 12px;
}
.form-field {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}
.input,
.select,
textarea.input {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #141518;
  color: #fff;
}
.helper {
  color: #8b8b8b;
  font-size: 12px;
}
.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

/* ====== ПРОДУКТ (детальная) ====== */
.product-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 16px;
}
.price-switch {
  display: flex;
  gap: 8px;
  margin: 6px 0 12px;
  align-items: center;
}
.price-switch button {
  padding: 8px 12px;
  border: 1px solid var(--line);
  background: #141518;
  color: #fff;
  border-radius: 10px;
}
.price-switch button.active {
  border-color: var(--accent);
}
.specs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.spec {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0f0f11;
}

/* ====== КОНТАКТЫ / КАРТА ====== */
.map-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.mapbox {
  height: 420px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
}

/* ====== АДАПТИВ ====== */
@media (max-width: 1200px) {
  .brand-grid {
    grid-template-columns: repeat(5, minmax(120px, 1fr));
  }
}
@media (max-width: 980px) {
  .brand-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .map-wrap {
    grid-template-columns: 1fr;
  }
  .brand-hero__title {
    font-size: 42px;
  }
  .brand-hero__logo {
    width: 200px;
  }
  /* каталог на мобилке — по одной карточке */
  #catalog-grid .card {
    flex-basis: 100% !important;
    max-width: 100% !important;
  }
}
/* ==== ГЛАВНАЯ: КРУПНЫЕ КАРТОЧКИ В ДВЕ КОЛОНКИ ==== */
body.home #catalog-grid {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 20px !important;
}

body.home #catalog-grid .card {
  /* две колонки */
  flex: 0 0 calc(50% - 10px) !important;
  max-width: calc(50% - 10px) !important;
}

/* крупная «обложка» у карточек (по высоте как в твоём скрине) */
body.home #catalog-grid .card img {
  width: 100%;
  height: clamp(
    320px,
    34vw,
    420px
  ); /* адаптивно: ~360–420px при ширине колонки ~600px */
  aspect-ratio: auto; /* не фиксируем 16/9, чтобы держать заданную высоту */
  object-fit: cover;
  display: block;
}

/* немного крупнее текст под фото */
body.home #catalog-grid .card .card-body {
  padding: 18px 20px;
}
body.home #catalog-grid .card h3 {
  font-size: 20px;
  line-height: 1.25;
}

/* на узких экранах — одна колонка */
@media (max-width: 980px) {
  body.home #catalog-grid .card {
    flex-basis: 100% !important;
    max-width: 100% !important;
  }
  body.home #catalog-grid .card img {
    height: clamp(260px, 50vw, 360px);
  }
}
/* ==== ГЛАВНАЯ: ОДНА БОЛЬШАЯ КАРТОЧКА ПОД ДРУГОЙ ==== */
body.home #brand-sections {
  max-width: 1200px;
  margin: 24px auto;
  padding: 0 16px;
}

body.home #catalog-grid {
  display: flex !important;
  flex-direction: column; /* одна колонка */
  align-items: center; /* центрируем карточки */
  gap: 24px !important;
}

/* ширина карточки ограничена, чтобы было «дорого» и читабельно */
body.home #catalog-grid .card {
  width: min(100%, 980px); /* настрой при желании: 920–1080px */
  max-width: none !important;
  flex: 0 0 auto !important; /* отключаем старые flex-правила */
}

/* крупная «обложка» как на скрине */
body.home #catalog-grid .card img {
  width: 100%;
  height: clamp(420px, 58vh, 620px); /* высокая, но адаптивная */
  object-fit: cover;
  aspect-ratio: auto; /* не фиксируем 16/9 */
  display: block;
}

/* чуть крупнее типографика и отступы */
body.home #catalog-grid .card .card-body {
  padding: 22px 24px;
}
body.home #catalog-grid .card h3 {
  font-size: 24px;
  line-height: 1.25;
}
body.home #catalog-grid .brand-chip {
  font-size: 13px;
}

/* на узких экранах просто 100% ширины, картинка ниже */
@media (max-width: 980px) {
  body.home #catalog-grid .card {
    width: 100%;
  }
  body.home #catalog-grid .card img {
    height: clamp(260px, 50vh, 380px);
  }
}
/* кликабельные кнопки на карточках и в модалках */
button,
.btn-primary,
.btn-secondary,
.card .card-actions button,
.action-btn {
  cursor: pointer;
}

/* чуть живости на ховере */
.btn-primary:hover,
.btn-secondary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(179, 11, 36, 0.22);
}

/* у чёрных кнопок подчёркиваем, что они активные */
.btn-secondary {
  background: #15171b;
  border: 1px solid var(--line);
  color: #fff;
}
.btn-secondary:hover {
  border-color: var(--accent);
}

/* на всякий случай поднимаем кнопки над вложенными слоями */
.card .card-actions button,
.card .card-actions a {
  position: relative;
  z-index: 2;
}
/* курсор и ховеры для кнопок, чтобы было видно, что они кликаются */
button,
.btn-primary,
.btn-secondary,
.action-btn,
.card .card-actions button {
  cursor: pointer;
}

.btn-primary:hover,
.btn-secondary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(179, 11, 36, 0.22);
}
.btn-secondary {
  background: #15171b;
  border: 1px solid var(--line);
  color: #fff;
}
.btn-secondary:hover {
  border-color: var(--accent);
}

/* Яндекс-карта */
.ymap iframe {
  border: 0;
  width: 100%;
  height: 480px;
  border-radius: 16px;
}

/* Футер */
.site-footer {
  margin-top: 40px;
  border-top: 1px solid var(--line);
  background: #0f1012;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 16px;
  display: flex;
  gap: 24px;
  justify-content: space-between;
  align-items: flex-start;
  color: #cfd2d7;
}
.footer-brand {
  display: flex;
  gap: 12px;
  align-items: center;
}
.footer-brand .name {
  font: 800 18px/1 Montserrat, Inter, sans-serif;
}
.footer-brand .slogan {
  color: #8b8f97;
  font-weight: 600;
  font-size: 12px;
}
.footer-contacts div {
  margin: 4px 0;
}
.footer-contacts a {
  color: #fff;
  text-decoration: none;
}
.footer-contacts a:hover {
  text-decoration: underline;
}
@media (max-width: 800px) {
  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}
/* ===== NAV: единый вид для меню и кнопок в шапке ===== */
.nav {
  display: flex;
  align-items: center;
  gap: 12px;
}
.nav-link,
.nav-chip {
  appearance: none;
  border: 1px solid var(--line);
  background: #14161a;
  color: #cfcfcf;
  font: 600 14px/1 Inter, sans-serif;
  padding: 10px 14px;
  border-radius: 12px;
  cursor: pointer;
  transition: 0.15s ease;
  text-decoration: none;
}
.nav-link:hover,
.nav-chip:hover {
  color: #fff;
  border-color: #2a2d33;
  background: #161a1f;
}
.nav-link.active {
  color: #fff;
  border-color: var(--accent);
}
.nav-sep {
  width: 1px;
  height: 22px;
  background: var(--line);
  margin: 0 4px;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-user__email {
  color: #b9bbc0;
  font-weight: 600;
  padding: 0 6px;
}
.nav-chip--ghost {
  background: transparent;
}

.hidden {
  display: none !important;
}
/* Toasts */
#toast-container {
  position: fixed;
  top: 84px; /* под шапкой; можно заменить на bottom:16px */
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 3000;
}
.toast {
  background: #15171b;
  color: #eaeaea;
  border: 1px solid var(--line);
  padding: 10px 14px;
  border-radius: 12px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.35);
  opacity: 0;
  transform: translateY(-6px);
  transition: 0.2s ease;
  min-width: 260px;
}
.toast.show {
  opacity: 1;
  transform: translateY(0);
}
.toast.ok {
  border-color: #1f8b4c;
}
.toast.warn {
  border-color: #b30b24;
}
.toast .row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.toast .close {
  background: transparent;
  border: 0;
  color: #aaa;
  font-size: 18px;
  cursor: pointer;
}
