.brands-page {
  --brands-border-color: #ececec;
  --brands-card-border-color: #f7f7f7;
  --brands-card-radius: 0;
  --brands-card-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
  --brands-card-height: 80px;
  --brands-card-padding-y: 5px;
  --brands-card-padding-x: 10px;
  --brands-card-gap: 5px;
  --brands-card-logo-height: 44px;
}

.brands-page [hidden] {
  display: none !important;
}

.brands-page__header {
  margin-bottom: 28px;
}

.brands-page__directory {
  padding-bottom: 8px;
}

.brands-page__block {
  margin-bottom: 32px;
}

.brands-page__block-title,
.brands-page__section-title {
  margin: 0 0 18px;
  color: #1d1d1f;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.15;
}

.brands-page__alphabet {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px 12px;
  scrollbar-width: thin;
}

.brands-page__alphabet::-webkit-scrollbar {
  height: 6px;
}

.brands-page__alphabet::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.16);
  border-radius: 999px;
}

.brands-page__letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--brands-border-color);
  border-radius: 8px;
  background: #fff;
  color: #1d1d1f;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
  flex: 0 0 auto;
}

.brands-page__letter:hover {
  border-color: var(--main-accent-color);
  color: var(--main-accent-color);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
}

.brands-page__letter.is-active {
  background: var(--main-accent-color);
  border-color: var(--main-accent-color);
  color: #fff;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.12);
}

.brands-page__letter.is-disabled {
  pointer-events: none;
  opacity: 0.38;
  box-shadow: none;
}

.brands-page__search {
  margin-top: 6px;
}

.brands-page__search-field {
  display: flex;
  position: relative;
  width: 100%;
  max-width: 420px;
  margin-left: auto;
}

.brands-page__search-field:before {
  content: '\e80d';
  position: absolute;
  top: 50%;
  left: 18px;
  transform: translateY(-50%);
  font-family: "icons";
  font-size: 16px;
  color: #8b8b8b;
  line-height: 1;
  pointer-events: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.brands-page__search-input {
  width: 100%;
  height: 52px;
  padding: 0 44px 0 46px;
  border: 1px solid var(--brands-border-color);
  border-radius: 8px;
  background: #fff;
  color: #1d1d1f;
  font-size: 16px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.brands-page__search-input:focus {
  outline: none;
  border-color: var(--main-accent-color);
  box-shadow: 0 0 0 3px rgba(255, 0, 255, 0.08);
}

.brands-page__search-input::-webkit-search-cancel-button {
  display: none;
}

.brands-page__search-clear {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #7d7d7d;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s ease;
}

.brands-page__search-clear:hover {
  color: #1d1d1f;
}

.brands-page__grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0;
}

.brands-page__grid--top {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.brands-page__section {
  margin-top: 34px;
  scroll-margin-top: 130px;
}

.brands-page__card-wrap {
  min-width: 0;
}

.brands-page__card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--brands-card-gap);
  min-height: var(--brands-card-height);
  height: 100%;
  padding: var(--brands-card-padding-y) var(--brands-card-padding-x);
  border: 1px solid var(--brands-card-border-color);
  border-radius: var(--brands-card-radius);
  background: #fff;
  color: #1d1d1f;
  text-align: center;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.brands-page__card:hover {
  transform: none;
  border-color: var(--brands-card-border-color);
  box-shadow: var(--brands-card-shadow);
}

.brands-page__card:hover .brands-page__card-title {
  color: var(--main-accent-color);
}

.brands-page__card-media {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
}

.brands-page__card-image {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: var(--brands-card-logo-height);
  object-fit: contain;
}

.brands-page__card-fallback {
  display: block;
  color: #1d1d1f;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.25;
}

.brands-page__card-title {
  display: -webkit-box;
  width: 100%;
  margin-top: 0;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow-wrap: anywhere;
  word-break: break-word;
  overflow: hidden;
}

.brands-page__empty {
  margin-top: 32px;
  padding: 22px 24px;
  border: 1px dashed var(--brands-border-color);
  border-radius: 14px;
  background: #fff;
  color: #1d1d1f;
  font-size: 16px;
  text-align: center;
}

.brands-page__description {
  margin-top: 40px;
}

.brands-page__sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 1199px) {
  .brands-page__grid,
  .brands-page__grid--top {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (max-width: 991px) {
  #brands-top-title {
    text-align: center;
  }
  .brands-page__block-title,
  .brands-page__section-title {
    font-size: 20px;
    margin-bottom: 16px;
  }

  .brands-page__card {
    min-height: 108px;
    padding: 12px;
  }

  .brands-page__grid,
  .brands-page__grid--top {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .brands-page__section {
    scroll-margin-top: 110px;
  }
}

@media (max-width: 767px) {
  .brands-page__header {
    margin-bottom: 22px;
  }

  .brands-page__block {
    margin-bottom: 26px;
  }

  .brands-page__section {
    margin-top: 28px;
  }

  .brands-page__letter {
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    font-size: 13px;
  }

  .brands-page__search-field {
    max-width: none;
  }

  .brands-page__search-input {
    height: 48px;
    font-size: 15px;
  }

  .brands-page__grid,
  .brands-page__grid--top {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
  }

  .brands-page__card-media {
    min-height: 42px;
  }

  .brands-page__card-image {
    max-height: 38px;
  }
}

@media (max-width: 479px) {
  .brands-page__block-title,
  .brands-page__section-title {
    font-size: 18px;
  }

  .brands-page__card {
    min-height: 96px;
    padding: 10px;
  }

  .brands-page__card-title {
    font-size: 13px;
  }
}
