/* Shared cards for categories and products. Images retain their full proportions. */
.catalog-section {
  background: #f7f6f2;
  padding-bottom: 64px;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  gap: 24px;
  margin-top: 36px;
}

.catalog-grid--categories {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.catalog-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border: 1px solid #e6e3db;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 4px 16px rgba(17, 45, 75, 0.04);
  text-align: left;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.catalog-card__media {
  position: relative;
  flex: none;
  aspect-ratio: 4 / 3;
  width: 100%;
  overflow: hidden;
  background: #f0efea;
}

.catalog-card__media img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  padding: 12px;
  object-fit: contain;
  object-position: center;
  border: 0;
  border-radius: 0;
}

/* The existing gallery zoom must not crop the contained product photos. */
.catalog-card.thumb:hover img {
  transform: none;
}

.catalog-card__body {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 16px;
  padding: 20px;
  border-top: 1px solid #efede7;
}

.catalog-card__text {
  flex: 1;
  min-width: 0;
}

.catalog-card__title {
  flex: 1;
  margin: 0;
  color: #153957;
  font-size: 18px;
  font-weight: 500;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.catalog-card__count {
  display: block;
  margin-bottom: 7px;
  color: #707774;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  line-height: 1.4;
}

.catalog-card__action {
  display: flex;
  flex: 0 0 34px;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #f4f2e9;
  color: #153957;
  font-size: 18px;
  line-height: 1;
}

.catalog-card__action.fa {
  font-size: 14px;
}

.catalog-card:focus-visible {
  outline: 3px solid #b99432;
  outline-offset: 4px;
}

@media (hover: hover) {
  .catalog-card:hover {
    transform: translateY(-4px);
    border-color: #ccb677;
    box-shadow: 0 12px 28px rgba(17, 45, 75, 0.1);
  }
}

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

@media (max-width: 575px) {
  .catalog-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
    margin-top: 28px;
  }

  .catalog-card__body {
    padding: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .catalog-card {
    transition: none;
  }

  .catalog-card:hover {
    transform: none;
  }
}
