/* ВЕРХНИЙ ОТСТУП - 80px, КАК НА ВСЕХ СТРАНИЦАХ.
   Здесь стояло 90px, и крошки на каталоге/категории висели на 10px ниже, чем
   на карточке товара, в новостях и корзине: при переходе между разделами
   шапка заметно «прыгала».
   */
main {
  padding-top: 80px;
  min-height: calc(100vh - 80px);
}

/* Лента брендов */
.catalog-brand-wrapper {
  position: relative;
  width: 100%;
  padding: 0 35px;
}

.catalog-brand {
  display: flex;
  align-items: center;
  gap: clamp(16px, 3vw, 36px);
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
}

.catalog-brand::-webkit-scrollbar {
  display: none;
}

/* Общая ячейка вместо общей высоты — разбор в css/main.css, там же правило
   для тех же логотипов (файлы дублируют ленту брендов, оба подключены на
   страницах разделов; значения обязаны совпадать). */
.catalog-brand img {
  height: 36px;
  width: 140px;
  object-fit: contain;
  object-position: center;
  cursor: pointer;
}

@media (max-width: 1024px) {
  .catalog-brand img{
    height: 30px;
    width: 110px;
  }
}

.brand-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 25px;
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.brand-arrow::before {
  content: "";
  width: 10px;
  height: 10px;
  border-top: 2px solid #01A572;
  border-right: 2px solid #01A572;
  transform: rotate(45deg);
}

.brand-arrow.left::before {
  transform: rotate(225deg);
}

.brand-arrow.left {
  left: 0;
}

.brand-arrow.right {
  right: 0;
}

/* === ХЛЕБНЫЕ КРОШКИ === */

/* Для мобильных устройств */
/* =========================
   КАТАЛОГ КАТЕГОРИЙ
========================= */

.catalog-page {
  padding-bottom: 50px;
  background: #fff;
}

.catalog-title {
  font-size: 25px;
  font-weight: 700;
  margin-bottom: 16px;
  margin-top: 0;
  color: #1a1a1a;
}

/* GRID */
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

/* CARD */
.category-card {
  position: relative;
  background: #F0F0F0;
  border-radius: 16px;
  padding: 16px;
  min-height: 160px;
  text-decoration: none;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform .2s ease;
}

/* TITLE */
.category-name {
  font-size: 18px;
  font-weight: 600;
  color: #1a1a1a;
  line-height: 1.2;
  max-width: 80%;
  z-index: 2;
}

/* IMAGE */
.category-card img {
  position: absolute;
  right: 0px;
  bottom: -5px;
  object-fit: contain;
  max-width: 150px;
  color: #01A572;
  transform: rotate(-7deg);
  z-index: 1;
}

@media (max-width: 768px) {
  .category-name {
    font-size: 16px;
  }
  .catalog-title {
    font-size: 22px;
  }
}

@media (max-width: 480px) {
  .category-card img {
    max-width: 120px;
  }
}

/* TABLET */
@media (min-width: 768px) {
  .catalog-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .category-card {
    min-height: 180px;
  }
}

/* DESKTOP */
@media (min-width: 1200px) {
  .catalog-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Пагинация страницы подкатегории (category.php, B-05) */

.cat-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 32px 0;
}

.cat-pagination__link {
  padding: 12px 20px;
  border-radius: 8px;
  background: #01A572;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
}

.cat-pagination__link:hover {
  background: #018a5f;
}

.cat-pagination__status {
  color: #767676;
  font-size: 14px;
}

/* Плитки категорий на узком экране: название и картинка не накладываются. */
@media (max-width: 400px) {
  .category-card { min-height: 150px; padding: 12px; }
  .category-name { font-size: 15px; max-width: 100%; }
  .category-card img { max-width: 92px; max-height: 92px; }
}
