.trusted-logos {
  background: #f2f2f2;
  padding: 34px 20px;
}

.trusted-logos__inner {
  max-width: 757px;
  margin: 0 auto;
  padding: 30px 34px 32px;
  text-align: center;
  background: #fff;
  border-radius: 30px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.04);
  overflow: hidden;
}

.trusted-logos h2 {
  margin: 0;
  padding: 0;
  font-family: Ubuntu, sans-serif;
  font-style: normal;
  font-weight: normal;
  font-size: 24px;
  line-height: 28px;
  text-align: center;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #1F92D0;
}

.trusted-logos__separator {
  width: 100%;
  height: 1px;
  margin: 24px 0 26px;
  background: #e5e5e5;
}

.trusted-logos__viewport {
  position: relative;
  max-width: 100%;
  margin: 0 auto;
  overflow: hidden;
}

/* Static layout: keeps logos in one line and spaces actual image boxes evenly */
.trusted-logos__track {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: clamp(18px, 4vw, 42px);
  width: 100%;
  min-width: 0;
  margin: 0 auto;
}

.trusted-logos__item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 1 auto;
  min-width: 0;
  line-height: 0;
  text-decoration: none;
  opacity: 0.96;
  transition: opacity 0.2s ease;
}

.trusted-logos__item:hover {
  opacity: 1;
}

.trusted-logos__item img {
  display: block;
  width: auto;
  height: clamp(34px, 7vw, 58px);
  max-width: clamp(80px, 26vw, 190px);
  object-fit: contain;
}

/* Carousel mode: added by JS when there are more than 3 logos */
.trusted-logos--carousel .trusted-logos__viewport {
  overflow: hidden;
}

.trusted-logos--carousel .trusted-logos__viewport::before,
.trusted-logos--carousel .trusted-logos__viewport::after {
  position: absolute;
  top: 0;
  z-index: 2;
  width: 72px;
  height: 100%;
  content: "";
  pointer-events: none;
}

.trusted-logos--carousel .trusted-logos__viewport::before {
  left: 0;
  background: linear-gradient(to right, #fff 0%, rgba(255, 255, 255, 0) 100%);
}

.trusted-logos--carousel .trusted-logos__viewport::after {
  right: 0;
  background: linear-gradient(to left, #fff 0%, rgba(255, 255, 255, 0) 100%);
}

.trusted-logos--carousel .trusted-logos__track {
  justify-content: flex-start;
  gap: clamp(24px, 5vw, 46px);
  width: max-content;
  min-width: 0;
  animation: trustedLogosScroll 46s linear infinite;
}

.trusted-logos--carousel .trusted-logos__item {
  flex: 0 0 auto;
  margin-right: 0;
}

.trusted-logos--carousel .trusted-logos__track:hover {
  animation-play-state: paused;
}

@keyframes trustedLogosScroll {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-50%);
  }
}

/* Widget preview */
body.widget-snippet .trusted-logos {
  padding: 30px 20px;
}

/* Mobile */
@media (max-width: 575px) {
  .trusted-logos {
    padding: 24px 16px;
  }

  .trusted-logos__inner {
    padding: 24px 16px 26px;
    border-radius: 24px;
  }

  .trusted-logos h2 {
    font-size: 18px;
    line-height: 24px;
    letter-spacing: 1.5px;
  }

  .trusted-logos__separator {
    margin: 18px 0 20px;
  }

  .trusted-logos__track {
    gap: 16px;
  }

  .trusted-logos__item img {
    height: clamp(30px, 9vw, 42px);
    max-width: clamp(70px, 26vw, 125px);
  }

  .trusted-logos--carousel .trusted-logos__viewport::before,
  .trusted-logos--carousel .trusted-logos__viewport::after {
    width: 38px;
  }

  .trusted-logos--carousel .trusted-logos__track {
    justify-content: flex-start;
    gap: 24px;
    width: max-content;
    animation: trustedLogosScroll 38s linear infinite;
  }
}

/* Accessibility: respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  .trusted-logos--carousel .trusted-logos__track {
    animation: none;
  }
}