.related-products {
  width: 100%;
  padding: 56px 0 64px;
  background-color: hsl(var(--body-bg));
  border-top: 1px solid hsl(var(--border-color) / .45);
}

.related-products__heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.related-products__heading h2 {
  margin: 0;
  color: hsl(var(--heading-color));
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.2;
  letter-spacing: 0;
}

.related-products__heading p {
  max-width: 620px;
  margin: 8px 0 0;
  color: hsl(var(--body-color));
  line-height: 1.55;
}

.related-products__heading > a {
  flex: 0 0 auto;
  color: hsl(var(--main));
  font-weight: 700;
}

.related-products__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

.related-products__item {
  min-width: 0;
}

.related-products .product-item {
  display: flex;
  height: 100%;
  flex-direction: column;
  overflow: hidden;
  border-radius: 8px;
}

.related-products .product-item__thumb,
.related-products .product-item__thumb > a {
  width: 100%;
  aspect-ratio: 1 / 1;
}

.related-products .product-item__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.related-products .product-item__content {
  display: flex;
  flex: 1;
  flex-direction: column;
}

.related-products .product-item__title {
  min-height: 46px;
}

.related-products .product-item__author {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.related-products .product-item__bottom {
  margin-top: auto;
}

@media (max-width: 991px) {
  .related-products__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .related-products {
    padding: 38px 0 96px;
  }

  .related-products__heading {
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 18px;
  }

  .related-products__heading p {
    font-size: 14px;
  }

  .related-products__heading > a {
    margin-top: 5px;
    font-size: 13px;
  }

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

@media (max-width: 420px) {
  .related-products__heading {
    display: block;
  }

  .related-products__heading > a {
    display: inline-block;
    margin-top: 10px;
  }

  .related-products .product-item__content {
    padding: 11px !important;
  }

  .related-products .product-item__title {
    min-height: 42px;
    font-size: 14px;
  }
}
