.catalog-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.catalog-toolbar--sort-only {
  justify-content: flex-end;
}

.catalog-toolbar p {
  margin: 0;
  color: #667085;
}

.catalog-toolbar strong {
  color: #191c1e;
}

.catalog-toolbar__right {
  display: flex;
  align-items: center;
}

.catalog-toolbar select {
  border: 1px solid #d0d5dd;
  background: #fff;
  font-weight: 700;
  border-radius: 8px;
  padding: 8px 12px;
  min-width: 220px;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.product-card {
  background: #ffffff;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.product-card__image {
  display: block;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #e0e3e6;
}

.product-card__image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.product-card__body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
}

.sku {
  display: inline-block;
  font-size: 0.7rem;
  color: #98a2b3;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.product-card h3 {
  margin: 10px 0 16px;
  font-size: 0.95rem;
  min-height: 42px;
}

.product-card h3 a {
  color: inherit;
  text-decoration: none;
}

.product-card .price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: auto;
  padding-top: 8px;
}

.price-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.old-price {
  display: block;
  color: #98a2b3;
  text-decoration: line-through;
  font-size: 0.78rem;
}

.product-card strong {
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}

.buy-btn {
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: #e11d48;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  flex: 0 0 auto;
}

.catalog-empty {
  background: #fff;
  border-radius: 12px;
  padding: 32px;
  color: #667085;
  text-align: center;
}

.pagination {
  margin-top: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.pagination a {
  border: none;
  background: #ffffff;
  min-width: 40px;
  height: 40px;
  border-radius: 8px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #191c1e;
  text-decoration: none;
}

.pagination a.is-active {
  background: #0f172a;
  color: #fff;
}

.pagination span {
  color: #667085;
  font-weight: 700;
}

.pagination a:hover {
  background: #f2f4f7;
}

.pagination a.is-active:hover {
  background: #0f172a;
}

/* Стрелки «назад/вперёд» — svg из спрайта в header.php. Без явных размеров
   браузер растянул бы <svg> до 300x150 и разорвал строку пагинации. */
.pagination .icon {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (min-width: 1200px) {
  .products-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .products-grid {
    gap: 10px;
  }

  .product-card__body {
    padding: 10px;
  }

  .sku {
    font-size: 0.62rem;
  }

  .product-card h3 {
    margin: 6px 0 10px;
    font-size: 0.82rem;
    min-height: 36px;
  }

  .product-card strong {
    font-size: 1rem;
  }

  .old-price {
    font-size: 0.68rem;
  }

  .buy-btn {
    width: 34px;
    height: 34px;
  }

  .buy-btn svg {
    width: 16px;
    height: 16px;
  }
}
