/* Compact company rows share the same public data and actions at every width. */
.listings-grid.listings-grid--companies,
#favorite-companies-list.favorites-content-grid,
#favorite-specialists-list.favorites-content-grid {
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  width: 100%;
  max-width: 760px;
  margin-inline: auto;
}

.company-catalog-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  grid-column: 1 / -1;
  width: 100%;
  min-width: 0;
  max-width: 760px;
  margin-inline: auto;
  padding: 14px 0;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  box-shadow: none;
}

.company-catalog-row:last-child { border-bottom: 0; }

.company-catalog-row__content {
  display: flex;
  align-items: center;
  flex: 1;
  gap: 14px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.company-catalog-row__body { min-width: 0; }

.company-rating {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  white-space: nowrap;
}

.company-rating svg {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  color: #b78b42;
  fill: currentColor;
}

.company-catalog-row__rating { margin-top: 3px; }

.company-avatar {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  overflow: hidden;
  border-radius: 50%;
  background: var(--border);
  color: var(--text-secondary);
  font-size: 18px;
  font-weight: 600;
  line-height: 1;
}

.company-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.company-avatar img[hidden] { display: none; }

.company-catalog-row__title {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow-wrap: anywhere;
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
}

.company-catalog-row__location {
  display: block;
  margin-top: 3px;
  overflow-wrap: anywhere;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.5;
}

.company-catalog-row__favorite {
  display: inline-grid;
  place-items: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  padding: 10px;
  border: 0;
  border-radius: var(--radius-btn);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
}

.company-catalog-row__favorite svg { width: 24px; height: 24px; fill: none; }
.company-catalog-row__favorite.active { color: var(--accent); }
.company-catalog-row__favorite.active svg { fill: currentColor; }
.company-catalog-row__favorite:disabled { opacity: .5; cursor: wait; }

@media (hover: hover) {
  .company-catalog-row:has(.company-catalog-row__link:hover) .company-catalog-row__title { color: var(--accent); }
  .company-catalog-row__favorite:hover { background: var(--border); }
}

@media (max-width: 374px) {
  .company-catalog-row { gap: 4px; }
  .company-catalog-row__content { gap: 10px; }
  .company-catalog-row .company-avatar { width: 48px; height: 48px; font-size: 16px; }
  .company-catalog-row__title { font-size: 15px; }
}

@media (min-width: 768px) {
  .company-catalog-row { padding-block: 18px; }
  .company-catalog-row__content { gap: 18px; }
}

@media (min-width: 1024px) {
  .listings-grid.listings-grid--companies {
    margin-left: 0;
    margin-right: auto;
  }
}

.company-catalog-row__subtitle {
  margin: 3px 0 0;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.company-catalog-row__link {
  position: absolute;
  inset: 0;
  z-index: 1;
  color: inherit;
}

.company-catalog-row__favorite,
.company-rating--link {
  position: relative;
  z-index: 2;
}

.company-rating--link {
  width: fit-content;
  text-decoration: none;
}

.company-rating--link:hover { text-decoration: underline; }
.company-rating--link:focus-visible,
.company-catalog-row__link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
