/* Trust bar under the homepage banner — ratings left, rolling logos right.
   Loaded only on the front page (functions.php: elixirpackaging_trustbar_assets). */

.trustbar {
  background: #f7f7f7;
  border-top: 1px solid #ececec;
  border-bottom: 1px solid #ececec;
}

.trustbar__inner {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  min-height: 58px;
  padding: .5rem 0;
}

/* ── Ratings ─────────────────────────────────────────────── */
.trustbar__proof {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.trustbar__claim {
  font-size: .88rem;
  font-weight: 700;
  color: #191919;
  letter-spacing: -.01em;
}

.trustbar__rating {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  text-decoration: none;
  color: #191919;
  font-size: .85rem;
  line-height: 1;
}

a.trustbar__rating:hover .trustbar__src {
  text-decoration: underline;
}

.trustbar__score {
  font-weight: 700;
}

.trustbar__src {
  font-weight: 600;
  color: #191919;
}

.trustbar__src--tp .bi {
  color: #00b67a;
}

/* Trustpilot's square tiles. The last one is part-filled to the real score
   via --tb-fill, so 4.7 reads as 4.7 and not as a rounded five. */
.trustbar__stars {
  display: inline-flex;
  gap: 2px;
}

.trustbar__star {
  position: relative;
  width: 19px;
  height: 19px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #00b67a;
  color: #fff;
  font-size: 10px;
  overflow: hidden;
}

.trustbar__star[style*="--tb-fill"] {
  background: #dcdce6;
}

.trustbar__star[style*="--tb-fill"]::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--tb-fill, 0%);
  background: #00b67a;
}

.trustbar__star .bi {
  position: relative;
  z-index: 1;
}

/* ── Rolling logos ───────────────────────────────────────── */
.trustbar__logos {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 56px, #000 calc(100% - 56px), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 56px, #000 calc(100% - 56px), transparent);
}

.trustbar__track {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  width: max-content;
  animation: trustbar-roll 60s linear infinite;
}

.trustbar__logos:hover .trustbar__track,
.trustbar__logos:focus-within .trustbar__track {
  animation-play-state: paused;
}

.trustbar__logo {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}

a.trustbar__logo--link {
  cursor: pointer;
  border-radius: .3rem;
}

a.trustbar__logo--link:focus-visible {
  outline: 2px solid #6bbc44;
  outline-offset: 3px;
}

.trustbar__logo img {
  display: block;
  height: 26px;
  width: auto;
  max-width: none;
  filter: grayscale(1);
  opacity: .55;
  transition: filter .2s ease, opacity .2s ease;
}

/* Hovering a logo brings its own colours back. The strip has already stopped
   rolling by then, so the logo holds still while it lights up. */
.trustbar__logo:hover img,
.trustbar__logo:focus-visible img {
  filter: none;
  opacity: 1;
}

/* Half the track is one full copy of the logos, so stopping there is seamless. */
@keyframes trustbar-roll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ── Small screens ───────────────────────────────────────── */
@media (max-width: 991.98px) {
  .trustbar__inner {
    flex-direction: column;
    align-items: stretch;
    gap: .65rem;
    padding: .75rem 0;
  }

  .trustbar__proof {
    justify-content: center;
    gap: .75rem;
    row-gap: .4rem;
  }

  .trustbar__logos {
    width: 100%;
  }
}

@media (max-width: 575.98px) {
  .trustbar__claim { font-size: .82rem; }
  .trustbar__rating { font-size: .8rem; }
  .trustbar__star { width: 16px; height: 16px; font-size: 9px; }
  .trustbar__logo img { height: 22px; }
  .trustbar__track { gap: 1.75rem; }
}

/* Anyone who asked for less motion gets a strip they scroll themselves. */
@media (prefers-reduced-motion: reduce) {
  .trustbar__track {
    animation: none;
  }

  .trustbar__logos {
    overflow-x: auto;
    -webkit-mask-image: none;
    mask-image: none;
  }
}
