/* improvements-2026.css
 * Точечные визуальные улучшения поверх существующих стилей.
 * Подключается ПОСЛЕ всех остальных CSS, чтобы переопределять где надо.
 * Цель: сделать ощущения от сайта современнее, не меняя layout.
 * Все изменения — реверсибельны (можно убрать этот файл и вернуться к исходнику).
 */

/* === Типографика === */
html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

body {
  font-feature-settings: "kern" 1, "liga" 1;
}

/* === Универсальные плавные переходы на интерактивных элементах === */
a,
button,
.btn,
input[type="button"],
input[type="submit"],
.brands-item,
.catalog-slide,
.swiper-slide,
.menu-item > a,
.submenu-icon,
.form-control,
select {
  transition:
    color 0.18s ease,
    background-color 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

/* === Кнопки: лёгкий "lift" на hover, осадка на active === */
.btn:hover,
button:not(:disabled):hover {
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}

.btn:active,
button:not(:disabled):active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

/* === Карточки и логотипы брендов: hover-lift === */
.brands-item:hover,
.catalog-slide:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

/* === Поля форм: фокус с фирменным жёлтым кольцом === */
.form-control:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="search"]:focus,
input[type="password"]:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: #FBCD5C;
  box-shadow: 0 0 0 3px rgba(251, 205, 92, 0.25);
}

/* === Видимый focus для клавиатурной навигации (a11y) === */
*:focus-visible {
  outline: 2px solid #FBCD5C;
  outline-offset: 2px;
  border-radius: 2px;
}

/* Не показывать outline при mouse-фокусе (только клавиатура) */
*:focus:not(:focus-visible) {
  outline: none;
}

/* === Ссылки: подчёркивание появляется плавно === */
a:not(.btn):not(.menu-item):not(.brands-item) {
  text-decoration-skip-ink: auto;
  text-underline-offset: 2px;
}

/* === Мобильная адаптация === */
@media (max-width: 767.98px) {
  /* Минимум 16px — иначе iOS зумит при фокусе на input */
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="search"],
  input[type="password"],
  textarea,
  select {
    font-size: 16px;
  }

  /* Минимальный touch target 44px (Apple HIG / WCAG) */
  .btn,
  button,
  .menu-item > a,
  .brands-item,
  .socials-item {
    min-height: 44px;
  }

  /* Чуть больше воздуха между блоками на мобиле */
  .container {
    padding-left: 16px;
    padding-right: 16px;
  }

  /* Hero-заголовок поменьше — иначе ломает на узких экранах */
  .hero-heading {
    font-size: clamp(24px, 6vw, 40px);
    line-height: 1.2;
  }

  /* Описание под hero — компактнее */
  .hero-desc {
    font-size: 14px;
    line-height: 1.5;
  }

  /* Бренд-сетка: убираем горизонтальный скролл, делаем wrap */
  .brands-list {
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
  }

  .brands-item {
    flex: 0 0 calc(33.333% - 8px);
    max-width: calc(33.333% - 8px);
    margin: 0;
  }
}

/* === Sticky шапка на скролле (опционально, если структура позволяет) === */
/* Нерискованно: position: sticky если родитель не overflow:hidden */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
  transition: box-shadow 0.2s ease;
}

/* Тень добавляется когда страница пролистана — но это требует JS,
 * без JS просто статичная лёгкая тень. */
.header {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

/* === Улучшенный отступ под якорные ссылки (для anchor-jump) === */
[id]:not(html):not(body) {
  scroll-margin-top: 80px;
}

/* === Lazy-image fade-in (когда добавим loading="lazy" на картинки) === */
img {
  /* Защита от layout shift, если у картинки нет width/height — браузер
   * хотя бы зарезервирует слот по соотношению из CSS. */
  height: auto;
}

/* === Тонкая полировка скроллбара (только webkit/blink) === */
@media (pointer: fine) {
  ::-webkit-scrollbar {
    width: 10px;
    height: 10px;
  }
  ::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.02);
  }
  ::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 5px;
    border: 2px solid #fff;
  }
  ::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.35);
  }
}

/* === Уважение к prefers-reduced-motion (a11y) === */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
