/* ============================================================
   vin-parts-mvp — дизайн-система v2
   Палитра, переопределения Bootstrap, компоненты каркаса,
   главной страницы, подборки, карточки детали и плавающей заявки.
   ============================================================ */

:root {
  --brand-900: #10233f;   /* шапка/футер/тёмные бейджи */
  --brand-700: #185a9d;   /* акцент/кнопки/ссылки */
  --brand-600: #1e6fc4;   /* hover */
  --brand-050: #eef4fb;   /* подложки */
  --price: #157347;       /* цены */
  --surface: #f5f7fa;     /* фон страницы */
  --card-border: #e6eaf0;
  --danger-soft: #fdf0ef;
}

/* ---------- База ---------- */
body {
  font-family: -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 0.95rem;
  background-color: var(--surface);
}

:focus-visible { outline: 3px solid #9ec2ea; outline-offset: 2px; }

a { color: var(--brand-700); }
a:hover { color: var(--brand-600); }

/* ---------- Переопределения Bootstrap ---------- */
.btn-primary {
  --bs-btn-bg: var(--brand-700);
  --bs-btn-border-color: var(--brand-700);
  --bs-btn-hover-bg: var(--brand-600);
  --bs-btn-hover-border-color: var(--brand-600);
  --bs-btn-active-bg: var(--brand-700);
  --bs-btn-active-border-color: var(--brand-700);
  --bs-btn-disabled-bg: var(--brand-700);
  --bs-btn-disabled-border-color: var(--brand-700);
}
.btn-outline-primary {
  --bs-btn-color: var(--brand-700);
  --bs-btn-border-color: var(--brand-700);
  --bs-btn-hover-bg: var(--brand-700);
  --bs-btn-hover-border-color: var(--brand-700);
  --bs-btn-hover-color: #fff;
  --bs-btn-active-bg: var(--brand-700);
  --bs-btn-active-border-color: var(--brand-700);
  --bs-btn-active-color: #fff;
  --bs-btn-disabled-color: var(--brand-700);
}
.bg-primary { background-color: var(--brand-700) !important; }
.bg-dark { background-color: var(--brand-900) !important; }

/* Вертикальное выравнивание в таблицах (используется админкой) */
.table td, .table th { vertical-align: middle; }

/* ---------- Шапка ---------- */
.app-header { background-color: var(--brand-900); }
@media (min-width: 992px) {
  .app-header { position: sticky; top: 0; z-index: 1030; }
}
.app-header .navbar-brand { color: #fff; font-weight: 700; }
.app-header .navbar-brand:hover { color: #fff; }
.app-header .navbar-nav {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: .25rem .5rem;
}
@media (max-width: 991.98px) {
  /* на мобиле блок ссылок занимает всю ширину под брендом — 1–2 аккуратных ряда */
  .app-header .navbar-nav { flex-basis: 100%; }
}
.app-header .nav-link {
  color: #cfe0f5;
  border-radius: 999px;
  padding: .35rem .8rem;
}
.app-header .nav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, .08);
}
.brand-emoji {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6em;
  height: 1.6em;
  background: rgba(255, 255, 255, .12);
  border-radius: 8px;
  margin-right: .2rem;
}
.top-phone {
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}
.top-phone:hover, .top-phone:focus {
  color: #fff;
  text-decoration: none;
}

/* ---------- Футер ---------- */
.site-footer {
  background: var(--brand-900);
  color: #b8c7dc;
  padding: 1.5rem 0 5.5rem; /* снизу больше — там плавающая кнопка заявки */
}
.site-footer a { color: #dbe7f5; text-decoration: none; }
.site-footer a:hover { color: #fff; }
.site-footer .foot-muted { color: #8fa3bd; font-size: .85rem; }

/* ---------- Контент ---------- */
main.container { padding-bottom: 96px; } /* чтобы контент не прятался под FAB */
@media (max-width: 767.98px) {
  main.container { padding-top: 1rem; }
}

/* ---------- Главная: hero-карточка ---------- */
.hero-card {
  position: relative;
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(16, 35, 63, .08);
}
.hero-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  border-radius: 16px 16px 0 0;
  background: linear-gradient(90deg, var(--brand-700), #2f8f5b);
}

/* ---------- Чипы доверия ---------- */
.trust-chip {
  display: inline-flex;
  align-items: center;
  gap: .4em;
  background: var(--brand-050);
  color: var(--brand-700);
  border: 1px solid #d7e4f5;
  border-radius: 999px;
  padding: .35em .85em;
  font-size: .85rem;
  white-space: normal;
}

/* ---------- Карточки преимуществ ---------- */
.feature-card {
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 1.1rem;
  height: 100%;
  transition: transform .15s ease, box-shadow .15s ease;
}
.feature-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(16, 35, 63, .09);
}
.feature-card .ico { font-size: 1.7rem; }

/* ---------- Заголовки секций каталога ---------- */
.section-cat {
  font-weight: 700;
  color: var(--brand-900);
  padding-bottom: .4rem;
  border-bottom: 2px solid #dbe7f5;
}

/* ---------- Фасетные фильтры ---------- */
.facet a.badge {
  border-radius: 999px;
  padding: .35em .8em;
}

/* ---------- Таблица подборки ---------- */
.results-table { font-size: .9rem; }
.results-table thead th {
  font-size: .74rem;
  text-transform: uppercase;
  letter-spacing: .03em;
  white-space: nowrap;
}
.results-table thead.table-dark { --bs-table-bg: var(--brand-900); }
.results-table.table-hover { --bs-table-hover-bg: var(--brand-050); }
.results-table tbody tr:hover { background: var(--brand-050); }

/* ---------- Ссылка-артикул ---------- */
.sku-link { font-weight: 600; text-decoration: none; }
.sku-link:hover { text-decoration: underline; }

/* ---------- Карточки складов (part) ---------- */
.stock-card {
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 1rem;
  background: #fff;
  height: 100%;
}
.stock-card.stock-empty {
  background: var(--danger-soft);
  border-color: #f3c9c4;
}
.stock-empty .empty-text {
  color: #b02a37;
  font-weight: 600;
}

/* ---------- Крупные количество/цена ---------- */
.qty-big { font-size: 1.9rem; font-weight: 700; line-height: 1.15; }
.price-big { font-size: 1.35rem; font-weight: 700; color: var(--price); }

/* ---------- Изображение детали / заглушка ---------- */
.img-placeholder-wrap { position: relative; min-height: 220px; }
.img-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  border: 1.5px dashed #c4cfdd;
  border-radius: 12px;
  color: #8a97a8;
  font-size: .9rem;
  background: #fbfcfe;
}
.img-placeholder .ph-ico { font-size: 2rem; }
.img-placeholder-wrap img {
  position: relative;
  z-index: 1;
  background: #fff;
}

/* ---------- Плавающая заявка ---------- */
.req-fab {
  position: fixed;
  right: 14px;
  bottom: calc(14px + env(safe-area-inset-bottom));
  z-index: 1080;
  border-radius: 999px;
  padding: .65rem 1.15rem;
  box-shadow: 0 6px 20px rgba(16, 35, 63, .35);
}
.req-panel {
  position: fixed;
  right: 14px;
  bottom: calc(70px + env(safe-area-inset-bottom));
  z-index: 1080;
  width: min(480px, 94vw);
  max-height: 80vh;
  overflow: auto;
}
