/* =====================================================
   CATALOG.CSS — Стили страницы каталога
   ===================================================== */

/* ===== ОБЁРТКА СТРАНИЦЫ ===== */
.catalog-page {
  max-width: 1200px;
  margin: 30px auto 100px;
  padding: 0 20px;
  font-family: 'Segoe UI', sans-serif;
  box-sizing: border-box;
}

/* ===== ЗАГОЛОВОК ===== */
.catalog-page-header {
  margin-bottom: 30px;
}

.catalog-page-title {
  font-size: 34px;
  font-weight: 700;
  color: #111;
  margin: 10px 0 0;
}

/* ===== ХЛЕБНЫЕ КРОШКИ ===== */
#pageBreadcrumbs {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  font-size: 14px;
  color: #999;
  margin-bottom: 8px;
}

#pageBreadcrumbs a {
  color: #999;
  text-decoration: none;
  transition: color 0.2s;
}

#pageBreadcrumbs a:hover {
  color: #e10075;
}

#pageBreadcrumbs strong {
  color: #111;
  font-weight: 500;
}

.bc-sep {
  margin: 0 4px;
  color: #ccc;
}

/* =====================================================
   СЕТКА БРЕНДОВ
   ===================================================== */
.catalog-brands-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

/* ===== КАРТОЧКА БРЕНДА ===== */
.brand-card {
  display: block;
  background: var(--brand-bg, #f5f5f7);
  border-radius: 18px;
  text-decoration: none;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.05);
}

.brand-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}

.brand-card-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px 28px;
}

/* Лого */
.brand-logo-wrap {
  flex-shrink: 0;
  width: 80px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  padding: 8px;
  box-sizing: border-box;
}

.brand-logo {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

.brand-logo-fallback {
  font-size: 18px;
  font-weight: 700;
  color: var(--brand-accent, #111);
  align-items: center;
  justify-content: center;
}

/* Текст */
.brand-info {
  flex: 1;
  min-width: 0;
}

.brand-name {
  font-size: 20px;
  font-weight: 700;
  color: #111;
  margin-bottom: 4px;
}

.brand-desc {
  font-size: 13px;
  color: #777;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Стрелка */
.brand-arrow {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #bbb;
  transition: color 0.2s ease, transform 0.2s ease;
}

.brand-arrow svg {
  width: 18px;
  height: 18px;
}

.brand-card:hover .brand-arrow {
  color: #e10075;
  transform: translateX(3px);
}

/* =====================================================
   СЕТКА КАТЕГОРИЙ БРЕНДА
   ===================================================== */
.catalog-categories-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

/* ===== КАРТОЧКА КАТЕГОРИИ ===== */
.category-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 18px;
  overflow: hidden;
  text-decoration: none;
  border: 1px solid #e8e8e8;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.category-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12);
  border-color: #e10075;
}

/* Изображение — contain чтобы не обрезалось */
.category-card-img-wrap {
  width: 100%;
  height: 140px;
  background: #f5f5f7;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  box-sizing: border-box;
  overflow: hidden;
}

.category-card-img-wrap.img-error::after {
  content: '📦';
  font-size: 50px;
  opacity: 0.3;
}

.category-card-img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  transition: transform 0.35s ease;
}

.category-card:hover .category-card-img {
  transform: scale(1.06);
}

/* Тело */
.category-card-body {
  padding: 16px 18px 20px;
}

.category-card-name {
  font-size: 18px;
  font-weight: 700;
  color: #111;
  margin-bottom: 5px;
}

.category-card-sub {
  font-size: 12px;
  color: #888;
  line-height: 1.5;
  margin-bottom: 12px;
}

.category-card-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
  color: #e10075;
  transition: gap 0.2s ease;
}

.category-card:hover .category-card-link {
  gap: 8px;
}

/* =====================================================
   КНОПКА «НАЗАД В КАТАЛОГ»
   ===================================================== */
.catalog-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: #999;
  text-decoration: none;
  margin-bottom: 20px;
  transition: color 0.2s;
}

.catalog-back-btn svg {
  width: 16px;
  height: 16px;
}

.catalog-back-btn:hover {
  color: #e10075;
}
/* =====================================================
   МОБИЛЬНАЯ АДАПТАЦИЯ КАТАЛОГА
   ===================================================== */
@media (max-width: 900px) {
  .catalog-brands-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .brand-card-inner {
    padding: 14px 12px;
    gap: 10px;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .brand-logo-wrap {
    width: 90px;
    height: 50px;
    padding: 8px;
    border-radius: 12px;
  }

  .brand-info {
    min-width: 0;
    width: 100%;
  }

  .brand-name {
    font-size: 15px;
    margin-bottom: 2px;
  }

  .brand-desc {
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    font-size: 11px;
    line-height: 1.4;
  }

  .brand-arrow {
    display: none;
  }

  .catalog-categories-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .category-card-img-wrap {
    height: 100px;
    padding: 10px;
  }

  .category-card-body {
    padding: 12px 14px 16px;
  }

  .category-card-name {
    font-size: 15px;
  }

  .category-card-sub {
    font-size: 11px;
  }
}

@media (max-width: 480px) {
  .catalog-brands-grid {
    gap: 8px;
  }

  .brand-logo-wrap {
    width: 80px;
    height: 44px;
    padding: 6px;
  }

  .brand-name {
    font-size: 14px;
  }

  .brand-desc {
    font-size: 10px;
  }

  .catalog-categories-grid {
    gap: 8px;
  }

  .category-card-img-wrap {
    height: 85px;
    padding: 8px;
  }
}