.catalog-page {
  padding: 34px 0 0px;
}

.catalog-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 34px;
}

.catalog-top h1 {
  margin-bottom: 18px;
  font-family: "inter-bold";
  font-size: 34px;
}

.catalog-breadcrumbs {
  margin-bottom: 0;
}

.catalog-sort {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 46px;
  font-size: 14px;
}

.catalog-sort select {
  width: 150px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid #d4d4d4;
  border-radius: 3px;
  background: #fff;
  font-family: "inter-regular";
  font-size: 14px;
}

.catalog-layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 50px;
  align-items: start;
}

.catalog-content {
  min-width: 0;
}

.catalog-sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.filter-block {
  overflow: hidden;
  border-radius: 6px;
  background: #fbf6f3;
}

.filter-block h2 {
  padding: 16px 18px;
  border-bottom: 1px solid #e0d9d3;
  font-size: 18px;
}

.filter-links {
  display: flex;
  flex-direction: column;
  gap: 25px;
  padding: 25px 18px;
}

.filter-links a {
  font-size: 16px;
}

.filter-links a:hover,
.filter-links .filter-active {
  color: #3f7736;
}

.filter-checks {
  display: flex;
  flex-direction: column;
  gap: 25px;
  padding: 16px 18px 22px;
}

.filter-checks label {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 16px;
  cursor: pointer;
}

.filter-checks input {
  width: 16px;
  height: 16px;
  accent-color: #3f7736;
}

.price-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 18px 18px 12px;
}

.price-inputs input {
  width: 100%;
  height: 34px;
  padding: 0 10px;
  border: 1px solid #d4d4d4;
  border-radius: 3px;
  font-family: "inter-regular";
}

.filter-submit {
  width: calc(100% - 36px);
  height: 48px;
  margin: 16px 18px 0;
  border: 0;
  border-radius: 8px;
  background: #3f7736;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
}

.filter-reset {
  display: block;
  padding: 18px;
  color: #777;
  font-size: 16px;
  text-align: center;
}

/* Карточки: на компьютере всегда 3 товара в ряд, без auto-fit на 4 колонки */
.products-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 34px 45px;
}

.product-card {
  min-height: 390px;
  display: flex;
  flex-direction: column;
  padding: 18px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.18);
}

.product-card__img {
  height: 215px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin-bottom: 18px;
  overflow: hidden;
  border-radius: 6px;
  background: #fff;
}

.product-card__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-card__title {
  min-height: 44px;
  display: block;
  margin-bottom: 22px;
  font-size: 16px;
}

.product-card__title:hover {
  color: #3f7736;
}

.product-card__bottom {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
}

.product-card__price {
  margin-bottom: 16px;
  color: #3f7736;
  font-family: "inter-bold";
  font-size: 18px;
}

.product-card__rating {
  display: flex;
  align-items: center;
  gap: 8px;
}

.product-card__rating span {
  color: #3f7736;
  font-size: 17px;
  letter-spacing: 1px;
}

.product-card__rating p {
  color: #3f7736;
  font-size: 14px;
}

.product-card__cart {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 36px;
  border: 0;
  border-radius: 5px;
  background: #3f7736;
  cursor: pointer;
}

.product-card__cart img {
  width: 20px;
  filter: brightness(0) invert(1);
}

.product-card__cart:disabled {
  background: #b8b8b8;
  opacity: 0.65;
  cursor: not-allowed;
}

.product-card--out {
  background: #f7f7f7;
}

.product-card--out .product-card__img img,
.product-card--out .product-card__title,
.product-card--out .product-card__price,
.product-card--out .product-card__rating {
  opacity: 0.55;
}

.product-card__out-label {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 2;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #777;
  font-family: "inter-bold";
  font-size: 13px;
}

.catalog-empty {
  padding: 60px;
  border-radius: 8px;
  background: #fbf6f3;
  text-align: center;
}

.catalog-empty h2 {
  margin-bottom: 12px;
  font-size: 26px;
}

.catalog-empty p {
  margin-bottom: 20px;
  color: #6b625d;
}

.catalog-empty a {
  color: #3f7736;
  font-family: "inter-bold";
}

/* Пагинация как на макете */
.catalog-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 45px;
}

.catalog-pagination .pagination__item {
  min-width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid #d4d4d4;
  border-radius: 6px;
  background: #fff;
  color: #111;
  font-size: 14px;
  transition: 0.2s;
}

.catalog-pagination a.pagination__item:hover,
.catalog-pagination .pagination__item--active {
  border-color: #3f7736;
  background: #3f7736;
  color: #fff;
}

.catalog-pagination span.pagination__item {
  cursor: default;
}

@media (max-width: 1180px) {
  .catalog-layout {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .catalog-sidebar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
  }

  .filter-form {
    display: contents;
  }

  .products-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 26px;
  }
}

@media (max-width: 760px) {
  .catalog-page {
    padding: 26px 0 60px;
  }

  .catalog-top {
    display: block;
    margin-bottom: 26px;
  }

  .catalog-top h1 {
    font-size: 29px;
  }

  .catalog-sort {
    width: 100%;
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    margin-top: 20px;
  }

  .catalog-sort select {
    width: 100%;
  }

  .catalog-sidebar {
    grid-template-columns: 1fr;
  }

  .filter-block h2 {
    padding: 14px 16px;
  }

  .filter-links,
  .filter-checks {
    gap: 15px;
    padding: 18px;
  }

  .filter-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .filter-links a,
  .filter-checks label {
    font-size: 15px;
  }

  .products-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
  }

  .product-card {
    min-height: 350px;
    padding: 14px;
  }

  .product-card__img {
    height: 180px;
  }

  .product-card__title {
    min-height: 0;
    margin-bottom: 18px;
  }
}

@media (max-width: 480px) {
  .filter-links,
  .price-inputs {
    grid-template-columns: 1fr;
  }

  .products-grid {
    grid-template-columns: 1fr;
  }

  .product-card {
    min-height: 0;
  }

  .product-card__img {
    height: 220px;
  }

  .catalog-pagination {
    gap: 8px;
  }

  .catalog-pagination .pagination__item {
    min-width: 39px;
    height: 39px;
  }

  .catalog-empty {
    padding: 42px 18px;
  }
}
