/* General reset */

.brands-section {
  position: relative;
  padding: 42px 0 34px;
  background: #f8f9fb;
}

.brands-section__header {
  display: grid;
  gap: 12px;
  margin-bottom: 28px;
}

.brands-section__description {
  max-width: 760px;
  margin: 0;
  color: var(--gray);
  font-size: 0.98rem;
  line-height: 1.7;
}

.brands-section__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
  margin-top: 10px;
  width: 100%;
}

.brands-section__button {
  margin-top: 0;
  width: fit-content;
  border-color: rgba(204, 0, 0, 0.18);
  background: #ffffff;
  color: var(--red);
}

.brands-section__button:hover {
  border-color: var(--red);
  background: var(--red);
  color: #ffffff;
}

.brands-section__button:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
}

.brands-carousel {
  position: relative;
  padding: 6px 0;
}

.brands-carousel__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-left: auto;
  border-radius: 12px;
  border: 1px solid var(--border-soft);
  background: #ffffff;
  color: var(--red);
  cursor: pointer;
  font-size: 1rem;
  transition: background-color var(--motion-fast) var(--ease-standard), border-color var(--motion-fast) var(--ease-standard), color var(--motion-fast) var(--ease-standard);
}

.brands-carousel__toggle:hover {
  border-color: var(--red);
  background: #fff5f5;
}

.brands-carousel__toggle:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
}

.brands-carousel__viewport {
  overflow: hidden;
}

.brands-carousel__track {
  display: flex;
  align-items: stretch;
  gap: 24px;
  width: max-content;
  will-change: transform;
}

.brand-logo-card {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 232px;
  min-height: 118px;
  padding: 20px 18px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-card);
  background: #ffffff;
  box-shadow: var(--elev-card);
  transition: transform var(--motion-base) var(--ease-standard), box-shadow var(--motion-base) var(--ease-standard), border-color var(--motion-base) var(--ease-standard);
}

.brand-logo-card:hover {
  transform: translateY(-4px);
  border-color: rgba(204, 0, 0, 0.18);
  box-shadow: var(--elev-card-hover);
}

.brand-logo-card__media {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 58px;
}

.brand-logo-card img {
  width: auto;
  max-width: 86%;
  max-height: 44px;
  object-fit: contain;
  object-position: center;
  display: block;
  transition: transform var(--motion-base) var(--ease-standard);
}

.brand-logo-card:hover img {
  transform: scale(1.05);
}

.brands-carousel__fade {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 2;
  width: 90px;
  pointer-events: none;
}

.brands-carousel__fade--left {
  left: 0;
  background: linear-gradient(90deg, #fafafa 0%, rgba(250, 250, 250, 0) 100%);
}

.brands-carousel__fade--right {
  right: 0;
  background: linear-gradient(270deg, #fafafa 0%, rgba(250, 250, 250, 0) 100%);
}

@media (prefers-reduced-motion: reduce) {
  .brands-carousel__track {
    transform: none !important;
  }

  .brands-carousel__toggle {
    display: none;
  }
}

@media (max-width: 1024px) {
  .brands-section {
    padding: 34px 0 26px;
  }

  .brand-logo-card {
    flex-basis: 208px;
    min-height: 104px;
  }

  .brand-logo-card__media {
    height: 54px;
  }

  .brand-logo-card img {
    max-height: 40px;
  }
}

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

  .brands-section__description {
    font-size: 0.9rem;
  }

  .brands-carousel__track {
    gap: 16px;
  }

  .brand-logo-card {
    flex-basis: 188px;
    min-height: 96px;
    padding: 18px 16px;
    border-radius: 18px;
  }

  .brand-logo-card__media {
    height: 48px;
  }

  .brand-logo-card img {
    max-height: 36px;
  }

  .brands-carousel__fade {
    width: 48px;
  }
}

@media (max-width: 480px) {
  .brands-section {
    padding: 22px 0 14px;
  }

  .brand-logo-card {
    flex-basis: 164px;
    min-height: 88px;
    padding: 16px 14px;
  }

  .brand-logo-card__media {
    height: 42px;
  }

  .brand-logo-card img {
    max-height: 30px;
  }
}
