.brands-page {
  padding-top: calc(var(--header-offset) + 10px);
  padding-bottom: 72px;
}

.brands-page__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  margin-bottom: 16px;
}

.brands-page__head h1 {
  margin: 0;
  font-size: 1.75rem;
  line-height: 1.25;
}

.brands-search {
  position: relative;
  display: block;
  width: min(320px, 100%);
}

.brands-search input {
  width: 100%;
  min-height: 42px;
  padding: 8px 16px 8px 40px;
  border: 1px solid var(--color-line);
  border-radius: 999px;
  background: var(--color-white);
  color: var(--color-ink);
  font-size: 14px;
}

.brands-search input:focus {
  border-color: var(--color-brand);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(140, 111, 31, 0.15);
}

.brands-search__icon {
  position: absolute;
  top: 50%;
  left: 14px;
  color: var(--color-brand);
  font-size: 20px;
  line-height: 1;
  pointer-events: none;
  transform: translateY(-50%);
}

/* A–Z index, pinned under the header while scrolling. */
.brands-index {
  position: sticky;
  top: var(--header-offset);
  z-index: 20;
  display: flex;
  gap: 4px;
  margin: 0 0 24px;
  padding: 10px 12px;
  overflow-x: auto;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-card);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow-soft);
  scrollbar-width: none;
}

.brands-index::-webkit-scrollbar {
  display: none;
}

.brands-index__letter {
  display: grid;
  min-width: 34px;
  height: 34px;
  flex: 1 0 auto;
  place-items: center;
  border-radius: 8px;
  color: var(--color-ink);
  font-size: 13px;
  font-weight: 700;
}

a.brands-index__letter:hover {
  background: var(--color-brand-soft);
  color: var(--color-brand-dark);
}

.brands-index__letter.is-empty {
  color: #b9c4c9;
  font-weight: 500;
}

.brands-group {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 0 16px;
  padding: 22px 0;
  border-top: 1px solid var(--color-line);
  scroll-margin-top: calc(var(--header-offset) + 70px);
}

.brands-group__letter {
  margin: 0;
  color: var(--color-brand);
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1;
}

.brands-group__list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.brands-group__list li[hidden],
.brands-group[hidden] {
  display: none;
}

.brand-card {
  display: flex;
  height: 100%;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 14px 10px;
  border: 1px solid var(--color-line);
  border-radius: 12px;
  background: var(--color-white);
  text-align: center;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.brand-card:hover {
  border-color: var(--color-brand);
  box-shadow: var(--shadow-soft);
  transform: translateY(-2px);
}

.brand-card__logo {
  display: grid;
  width: 84px;
  height: 84px;
  place-items: center;
}

.brand-card__logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.brand-card__initial {
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  border-radius: 50%;
  background: var(--color-brand-soft);
  color: var(--color-brand-dark);
  font-size: 1.5rem;
  font-weight: 700;
}

.brand-card__name {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
}

.brand-card:hover .brand-card__name {
  color: var(--color-brand-dark);
}

.brands-empty {
  padding: 40px 0;
  color: var(--color-muted);
  text-align: center;
}

@media (max-width: 760px) {
  .brands-page {
    padding-bottom: 40px;
  }

  .brands-page__head h1 {
    font-size: 1.375rem;
  }

  .brands-search {
    width: 100%;
  }

  .brands-index {
    margin-bottom: 14px;
    padding: 8px;
  }

  .brands-index__letter {
    min-width: 30px;
    height: 30px;
  }

  .brands-group {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    padding: 16px 0;
    scroll-margin-top: calc(var(--header-offset) + 56px);
  }

  .brands-group__letter {
    font-size: 1.75rem;
  }

  .brands-group__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .brand-card {
    padding: 12px 8px;
  }

  .brand-card__logo {
    width: 68px;
    height: 68px;
  }
}
