/* ============================================================
   Home Enhance — дополнительный слой поверх home.css
   Подключается ПОСЛЕ home.css. Полностью обратим:
   удалить <link> на этот файл — и дизайн вернётся к прежнему.
   ============================================================ */

:root {
  --he-blue: #007AFF;
  --he-blue-deep: #0055CC;
  --he-ink: #0F172A;
  --he-muted: #64748B;
  --he-ring: rgba(0, 122, 255, 0.16);
}

/* ---------- 1. Пустое состояние блока «Свежие закупки» ---------- */
.home-page .purchases-empty {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
  padding: 64px 32px;
  background:
    radial-gradient(circle at 50% 0%, rgba(0, 122, 255, 0.05) 0%, transparent 60%),
    #FFFFFF;
  border: 1.5px dashed rgba(0, 122, 255, 0.25);
  border-radius: 28px;
}

.home-page .purchases-empty-icon {
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  border-radius: 22px;
  font-size: 30px;
  color: var(--he-blue);
  background: linear-gradient(135deg, rgba(0, 122, 255, 0.12), rgba(90, 200, 250, 0.12));
  box-shadow: inset 0 0 0 1px rgba(0, 122, 255, 0.08);
}

.home-page .purchases-empty h3 {
  font-size: 22px;
  font-weight: 700;
  color: var(--he-ink);
  margin: 6px 0 0;
}

.home-page .purchases-empty p {
  max-width: 460px;
  color: var(--he-muted);
  font-size: 15px;
  line-height: 1.6;
  margin: 0;
}

.home-page .purchases-empty-btn {
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

/* ---------- 2. Заголовки секций: акцентная подложка ---------- */
.home-page .section-header h2 {
  position: relative;
}

.home-page .home-h2,
.home-page .section-header h2 {
  letter-spacing: -0.6px;
}

/* мягкое перо-подчёркивание под заголовком блоков с «Смотреть все» */
.home-page .home-head {
  align-items: flex-end;
}

/* ---------- 3. Карточки закупок: чуть больше «воздуха» и разделители ---------- */
.home-page .purchase-details {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 4px 20px !important;
  position: relative;
}

.home-page .purchase-details::before {
  content: '';
  position: absolute;
  top: 14px;
  bottom: 14px;
  left: 50%;
  width: 1px;
  background: rgba(0, 0, 0, 0.07);
}

.home-page .purchase-detail-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.home-page .purchase-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 6px;
}

.home-page .purchase-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  transition: transform .25s ease, box-shadow .25s ease, background .25s ease;
}

.home-page .purchase-btn:hover {
  transform: translateY(-2px);
  background: var(--he-blue-deep) !important;
  box-shadow: 0 10px 24px rgba(0, 122, 255, 0.28) !important;
}

/* ---------- 4. Единый «лифт» карточек ---------- */
.home-page .testimonial-card,
.home-page .step-item {
  transition: transform .35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow .35s ease, border-color .35s ease;
}

.home-page .testimonial-card:hover,
.home-page .step-item:hover {
  transform: translateY(-6px);
  box-shadow: 0 22px 44px rgba(15, 23, 42, 0.08);
}

/* ---------- 5. Поиск в hero: чуть крупнее и выразительный фокус ---------- */
.home-page .search-input {
  padding-top: 22px !important;
  padding-bottom: 22px !important;
}

.home-page .search-input:focus {
  box-shadow:
    0 24px 48px rgba(0, 122, 255, 0.28),
    0 0 0 4px var(--he-ring) !important;
}

/* Рабочая кнопка поиска (inline-SVG — не зависит от шрифта иконок) */
.home-page .search-wrapper { position: relative; }

.home-page .search-input { padding-right: 70px !important; }

.home-page .search-submit {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 14px;
  background: var(--he-blue);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(0, 122, 255, 0.35);
  transition: background .18s ease, transform .15s ease, box-shadow .2s ease;
}

.home-page .search-submit svg { display: block; }

.home-page .search-submit:hover {
  background: var(--he-blue-deep, #0a63d6);
  transform: translateY(-50%) scale(1.05);
  box-shadow: 0 8px 20px rgba(0, 122, 255, 0.45);
}

.home-page .search-submit:active {
  transform: translateY(-50%) scale(.97);
}

.home-page .search-submit:focus-visible {
  outline: 3px solid var(--he-ring, rgba(0, 122, 255, .4));
  outline-offset: 2px;
}

/* ---------- 6. Ссылки «Смотреть все →» ---------- */
.home-page .home-link {
  transition: color .25s ease, gap .25s ease;
}

.home-page .home-link:hover {
  color: var(--he-blue-deep) !important;
}

/* ---------- 7. Доступность фокуса ---------- */
.home-page a:focus-visible,
.home-page button:focus-visible,
.home-page .search-input:focus-visible {
  outline: 3px solid var(--he-ring);
  outline-offset: 2px;
}

/* ---------- 8. Лёгкое появление hero (с уважением к reduced-motion) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .home-page .hero-title,
  .home-page .hero-subtitle,
  .home-page .search-form,
  .home-page .hero-cta-buttons,
  .home-page .hero-social-proof {
    animation: heRise .7s cubic-bezier(0.16, 1, 0.3, 1) both;
  }
  .home-page .hero-subtitle    { animation-delay: .07s; }
  .home-page .search-form      { animation-delay: .14s; }
  .home-page .hero-cta-buttons { animation-delay: .21s; }
  .home-page .hero-social-proof{ animation-delay: .28s; }

  @keyframes heRise {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
  }
}

/* ---------- 10. Полоса статистики (живые данные) ---------- */
.home-page .stats-bar-inner {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  align-items: stretch !important;
}

.home-page .stats-bar-item {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: flex-start !important;
  text-align: center !important;
  gap: 6px !important;
  padding: 4px 16px !important;
}

.home-page .stats-ic {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  margin-bottom: 6px;
  border-radius: 16px;
  font-size: 22px;
  color: var(--he-blue);
  background: linear-gradient(135deg, rgba(0, 122, 255, 0.10), rgba(90, 200, 250, 0.12));
  box-shadow: inset 0 0 0 1px rgba(0, 122, 255, 0.08);
  transition: transform .35s cubic-bezier(0.16, 1, 0.3, 1);
}

.home-page .stats-bar-item:hover .stats-ic {
  transform: translateY(-3px) scale(1.06);
}

.home-page .stats-bar-lbl {
  color: var(--he-muted) !important;
  font-size: 13px !important;
  font-weight: 600 !important;
}

/* ---------- 11. Категории: однотипная сетка с реальными данными ---------- */
.home-page .categories-grid--real {
  grid-auto-rows: auto !important;
}

.home-page .cat-card {
  flex-direction: column !important;
  justify-content: flex-start !important;
  align-items: flex-start !important;
  gap: 14px;
  min-height: 0 !important;
  padding: 26px !important;
}

.home-page .cat-card .category-icon-wrapper {
  margin-bottom: 0 !important;
  color: var(--he-blue);
  background: linear-gradient(135deg, rgba(0, 122, 255, 0.10), rgba(90, 200, 250, 0.14));
}

.home-page .cat-card:hover {
  border-color: rgba(0, 122, 255, 0.22) !important;
  box-shadow: 0 22px 44px rgba(0, 122, 255, 0.10) !important;
}

.home-page .cat-card:hover h4 {
  color: var(--he-blue) !important;
}

.home-page .cat-card-arrow {
  position: absolute;
  top: 28px;
  right: 26px;
  font-size: 14px;
  color: #C7CDD6;
  transition: transform .3s ease, color .3s ease;
}

.home-page .cat-card:hover .cat-card-arrow {
  color: var(--he-blue);
  transform: translateX(4px);
}

/* Карточка «Все категории» — акцентная */
.home-page .cat-card--all {
  background: linear-gradient(135deg, var(--he-blue) 0%, #0098FF 100%) !important;
  border-color: transparent !important;
  box-shadow: 0 16px 36px rgba(0, 122, 255, 0.30) !important;
}

.home-page .cat-card--all .category-icon-wrapper {
  background: rgba(255, 255, 255, 0.18) !important;
  color: #fff !important;
}

.home-page .cat-card--all h4,
.home-page .cat-card--all .category-count,
.home-page .cat-card--all .cat-card-arrow {
  color: #fff !important;
}

.home-page .cat-card--all .category-count { opacity: .85; }

.home-page .cat-card--all:hover {
  transform: translateY(-6px);
  box-shadow: 0 22px 46px rgba(0, 122, 255, 0.40) !important;
}

.home-page .categories-empty {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  padding: 48px 24px;
  color: var(--he-muted);
  border: 1.5px dashed rgba(0, 122, 255, 0.22);
  border-radius: 24px;
  background: #fff;
}

.home-page .categories-empty i { font-size: 28px; color: var(--he-blue); }

/* ---------- 12. Блок «Поставщики / Покупатели» ---------- */
.home-page .audience-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 40px;
}

.home-page .audience-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 36px;
  border-radius: 28px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.02);
  overflow: hidden;
  transition: transform .35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow .35s ease;
}

.home-page .audience-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 5px;
}

.home-page .audience-card--supplier::before {
  background: linear-gradient(90deg, #007AFF, #5AC8FA);
}

.home-page .audience-card--buyer::before {
  background: linear-gradient(90deg, #FF2D55, #FF8E72);
}

.home-page .audience-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 26px 50px rgba(15, 23, 42, 0.10);
}

.home-page .audience-head {
  display: flex;
  align-items: center;
  gap: 16px;
}

.home-page .audience-ic {
  width: 60px;
  height: 60px;
  flex: 0 0 60px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  font-size: 26px;
  color: #fff;
}

.home-page .audience-card--supplier .audience-ic {
  background: linear-gradient(135deg, #007AFF, #0098FF);
  box-shadow: 0 10px 24px rgba(0, 122, 255, 0.30);
}

.home-page .audience-card--buyer .audience-ic {
  background: linear-gradient(135deg, #FF2D55, #FF6B6B);
  box-shadow: 0 10px 24px rgba(255, 45, 85, 0.28);
}

.home-page .audience-head h3 {
  font-size: 24px;
  font-weight: 800;
  color: var(--he-ink);
  letter-spacing: -0.4px;
  margin: 0;
}

.home-page .audience-count {
  font-size: 13px;
  font-weight: 600;
  color: var(--he-muted);
}

.home-page .audience-desc {
  color: var(--he-muted);
  font-size: 15px;
  line-height: 1.6;
  margin: 0;
}

.home-page .audience-points {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.home-page .audience-points li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14.5px;
  color: var(--he-ink);
}

.home-page .audience-points li i {
  margin-top: 3px;
  font-size: 12px;
  color: #34C759;
}

/* Превью логотипов поставщиков */
.home-page .audience-preview {
  display: flex;
  align-items: center;
  gap: 0;
}

.home-page .audience-chip {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: #EEF2F7;
  color: #475569;
  font-weight: 700;
  font-size: 13px;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  margin-left: -10px;
  transition: transform .25s ease;
  text-decoration: none;
}

.home-page .audience-chip:first-child { margin-left: 0; }
.home-page .audience-chip:hover { transform: translateY(-3px); z-index: 2; }
.home-page .audience-chip img { width: 100%; height: 100%; object-fit: cover; }
.home-page .audience-preview-lbl { margin-left: 12px; font-size: 13px; color: var(--he-muted); }

/* Превью закупок */
.home-page .audience-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.home-page .audience-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  background: #F8FAFC;
  color: var(--he-ink);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: background .25s ease, transform .25s ease;
}

.home-page .audience-list-item i { color: #FF2D55; font-size: 13px; }
.home-page .audience-list-item:hover { background: #F1F5F9; transform: translateX(3px); }

.home-page .audience-actions {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  padding-top: 6px;
}

.home-page .audience-card--buyer .audience-actions .btn-primary {
  background: #FF2D55 !important;
  border-color: #FF2D55 !important;
  box-shadow: 0 10px 25px rgba(255, 45, 85, 0.30) !important;
}

.home-page .audience-link {
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  color: var(--he-blue);
  transition: gap .25s ease, color .25s ease;
}

.home-page .audience-card--buyer .audience-link { color: #FF2D55; }
.home-page .audience-link:hover { opacity: .85; }

/* ---------- 9. Адаптив ---------- */
@media (max-width: 768px) {
  .home-page .purchase-details {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  .home-page .purchase-details::before { display: none; }
  .home-page .purchases-empty { padding: 48px 20px; }
  .home-page .search-wrapper::after { display: none; }
  .home-page .stats-bar-inner { grid-template-columns: repeat(2, 1fr) !important; gap: 20px 8px !important; }
  .home-page .stats-bar-item { border-right: none !important; }
  .home-page .audience-grid { grid-template-columns: 1fr; }
  .home-page .audience-card { padding: 26px; }
}
