.bm-home-categories {
  --bm-category-gap: clamp(0.75rem, 1.8vw, 1.25rem);
  margin-block: clamp(1.75rem, 4vw, 3.5rem);
}

.bm-home-categories__header {
  margin-bottom: clamp(1rem, 2vw, 1.5rem);
  text-align: center;
}

.bm-home-categories__title {
  margin: 0;
  color: inherit;
  font-size: clamp(1.5rem, 2.8vw, 2.15rem);
  font-weight: 700;
  line-height: 1.2;
}

.bm-home-categories__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 165px), 1fr));
  gap: var(--bm-category-gap);
  align-items: stretch;
}

.bm-home-category {
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.09);
  border-radius: 0.75rem;
  background: #fff;
  box-shadow: 0 0.2rem 0.8rem rgba(0, 0, 0, 0.045);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.bm-home-category:hover,
.bm-home-category:focus-within {
  border-color: rgba(0, 0, 0, 0.16);
  box-shadow: 0 0.65rem 1.5rem rgba(0, 0, 0, 0.1);
  transform: translateY(-3px);
}

.bm-home-category__link {
  display: flex;
  height: 100%;
  color: inherit;
  flex-direction: column;
  text-decoration: none;
}

.bm-home-category__link:hover,
.bm-home-category__link:focus {
  color: inherit;
  text-decoration: none;
}

.bm-home-category__link:focus-visible {
  outline: 3px solid currentColor;
  outline-offset: -3px;
}

.bm-home-category__media {
  display: block;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  background: #f5f5f5;
}

.bm-home-category__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 280ms ease;
}

.bm-home-category__placeholder {
  display: grid;
  width: 100%;
  height: 100%;
  color: rgba(0, 0, 0, 0.42);
  background: linear-gradient(145deg, #f7f7f7, #e9ecef);
  place-items: center;
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 750;
}

.bm-home-category:hover .bm-home-category__image {
  transform: scale(1.035);
}

.bm-home-category__content {
  display: flex;
  min-height: 5rem;
  padding: 0.9rem 0.75rem;
  align-items: center;
  justify-content: center;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 0.25rem;
  text-align: center;
}

.bm-home-category__name {
  display: -webkit-box;
  overflow: hidden;
  font-size: 1rem;
  font-weight: 650;
  line-height: 1.3;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.bm-home-category__count {
  color: #6c757d;
  font-size: 0.82rem;
  line-height: 1.25;
}

@media (max-width: 575.98px) {
  .bm-home-categories__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bm-home-category__content {
    min-height: 4.5rem;
    padding-inline: 0.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bm-home-category,
  .bm-home-category__image {
    transition: none;
  }
}
