:root {
  --shelf-height: 120px; /* высота «полки» */
  --shelf-thickness: 10px; /* толщина верхней планки */
  --logo-max-h: 64px; /* максимум по высоте логотипа */
  --section-padding: clamp(32px, 5vw, 72px);
  --gap: clamp(16px, 3vw, 40px);
  --bg: #0b0d13;
  --fg: #e7ebf7;
}

.brands {
  position: relative;
  padding: var(--section-padding) 0;
  overflow: clip; /* безопасно обрезаем выезжающие логотипы */
  --progress: 0; /* сюда пишем прогресс скролла из JS */
}

.brands__head {
  margin: 0 var(--section-padding) var(--section-padding);
}
.brands__kicker {
  opacity: 0.7;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 12px;
}
.brands__title {
  margin: 8px 0 0;
  font-size: clamp(24px, 3.4vw, 40px);
  font-weight: 700;
}
.brands__desc {
  margin: 10px 0 0;
  opacity: 0.8;
  max-width: 58ch;
}

.shelf {
  position: relative;
  display: grid;
  align-items: end;
  margin-block: calc(var(--section-padding) * 0.7);
  padding-block-end: var(--shelf-thickness);
  isolation: isolate;
}

.shelf:not(:last-of-type)::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 2px;
  background: #0a63a6;
  box-shadow: 6px 6px 30px rgba(0, 0, 0, 0.45);
  border-radius: 4px;
}

.shelf__row {
  position: relative;
  left: -10%;
  display: flex;
  align-items: end;
  gap: var(--gap);
  translate: 0 0; /* для композита */
  will-change: transform;
}

/* Каждая полка имеет свой «скоростной коэффициент» */
.shelf[data-speed] .shelf__row {
  transform: translateX(calc(var(--progress) * (attr(data-speed number) * 1%)));
}

/* Надёжный кроссбраузерный вариант через кастомное свойство на самой полке */
.shelf {
  --speed: 0;
}
.shelf .shelf__row {
  transform: translateX(calc(var(--progress) * var(--speed)));
}

.logo_brands {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: clamp(40px, 7vw, var(--logo-max-h));
  aspect-ratio: 3 / 1; /* приблизительная пропорция */
  /*padding: clamp(8px, 1.2vw, 14px);*/
  padding: 0;
  margin: 0;
  margin-bottom: 10px;
}
.logo_brands img {
  max-height: 100%;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.35));
  display: block;
}

.shelf__row > * {
  flex: 0 0 auto;
}

.brands_mobile {
  display: none;
}

/* Адаптивность */
@media (max-width: 700px) {
  .shelf {
    display: none;
  }

  .brands_mobile {
    display: block;
    padding: var(--section-padding) 0;
    overflow: hidden;
  }

  .brands_scroll {
    display: flex;
    align-items: center;
    gap: var(--gap);
    padding-inline: var(--section-padding);
    padding-block: 0;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    padding: 15px 10px;
  }

  button#ac-trigger-0 {
    font-family: "Advent Pro", sans-serif;
    font-weight: 700;
    font-size: 16px;
  }

  .shelf_mobile {
    border: 2px solid #0a63a6;
  }

}

/* prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .shelf .shelf__row {
    transform: none !important;
  }
}
