/* ===== Brand grid uses the same product card classes ===== */

.category_grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 16px;
}

/* card frame */
.category_grid .card {
  border: 1px solid #eee;
  border-radius: 5px;
  background: #fff;
  overflow: hidden;
  transition: transform .15s ease, box-shadow .15s ease;
  box-shadow: 0 2px 5px #e1e1e1;
}

.category_grid .card:hover {
  box-shadow: 0 2px 5px 3px #e1e1e1;
}

/* image area: fixed box, centered */
.category_grid .card__img {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 140px;              /* 👈 контролираш размера на логата */
  padding: 12px;
  border-bottom: 1px solid #eee;
}

/* logo image: keep aspect ratio, never stretch */
.category_grid .card__img img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;        /* 🔥 ключовото */
  display: block;
}

/* name alignment */
.category_grid .card__name {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
  line-height: 1.2;
  text-align: center;
  color: #222;
  text-decoration: none;
  min-height: 2.6em;          /* изравнява картите при 1-2 реда текст */
}

.category_grid .card__name:hover {
  text-decoration: underline;
}

/* responsive tweak */
@media (max-width: 480px) {
  .category_grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
  }
  .category_grid .card__img {
    height: 120px;
    padding: 10px;
  }
}
