/* Trust banner (single product pages): tile layout and tile motion. Everything is scoped to .pp-trust. The section, its gear
 * train and its scroll progress (--pp-p) come from motion.css and motion.js (snippets/motion.php). Without JS, or with
 * reduced motion, the tiles and gears stay in their final layout. */

/* The About page's surface: warm ivory that fades to white at the top and bottom, with no box or section edge. The section is
 * full width so its gears can draw past the top and bottom, as on About (see motion.css). The ivory is a band around the
 * cards only (the card grid is 68rem wide, so the band is 72rem), and it fades out at its sides as the About page does. */
.pp-trust.pp-motion {
  --pp-gear: clamp(12rem, 40cqi, 36rem);
  position: relative;
  width: 100vw;
  left: calc(50% - 50vw);
  padding: 5rem 0;
  border-radius: 0;
  background: transparent;
}

.pp-trust.pp-motion::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: max(0px, calc(50% - 36rem));
  right: max(0px, calc(50% - 36rem));
  background: linear-gradient(to bottom, #fff 0%, #F9F7F3 14%, #F9F7F3 86%, #fff 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 4rem, #000 calc(100% - 4rem), transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, #000 4rem, #000 calc(100% - 4rem), transparent 100%);
  pointer-events: none;
}

.pp-trust .pp-motion__bg {
  overflow-y: visible;
}

.pp-trust__grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
  max-width: 68rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.pp-trust__tile {
  margin: 0;
  padding: 2.5rem 2rem;
  border-radius: 10px;
  background: #fff;
  border: 1px solid #e8e8e4;
  text-align: center;
}

.pp-trust__icon {
  display: block;
  width: 2rem;
  height: 2rem;
  margin: 0 auto 1.25rem;
  color: #7d7d7d;
}

.pp-trust__icon svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pp-trust__title {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.3;
  color: inherit;
}

.pp-trust__text {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.65;
  color: #4d4d4d;
}

.pp-trust__text a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Tile motion. Side tiles travel a quadratic curve from below and outside (start point S, control point C, end at rest),
 * so x = 2p(1-p)Cx + (1-p)^2 Sx, and likewise for y. The centre tile rises. All tiles fade in with p. The tiles use --pp-c,
 * the card progress from motion.js: it stays at 1 once the load entrance is done, so the cards never move or fade again. */
.pp-trust.is-animated .pp-trust__tile {
  opacity: var(--pp-c);
}

.pp-trust.is-animated .pp-trust__tile--left {
  transform: translate3d(
    calc((1 - var(--pp-c)) * (1 - var(--pp-c)) * -28% + 2 * var(--pp-c) * (1 - var(--pp-c)) * -4%),
    calc((1 - var(--pp-c)) * (1 - var(--pp-c)) * 22% + 2 * var(--pp-c) * (1 - var(--pp-c)) * 30%),
    0
  );
}

.pp-trust.is-animated .pp-trust__tile--right {
  transform: translate3d(
    calc((1 - var(--pp-c)) * (1 - var(--pp-c)) * 28% + 2 * var(--pp-c) * (1 - var(--pp-c)) * 4%),
    calc((1 - var(--pp-c)) * (1 - var(--pp-c)) * 22% + 2 * var(--pp-c) * (1 - var(--pp-c)) * 30%),
    0
  );
}

.pp-trust.is-animated .pp-trust__tile--center {
  transform: translate3d(0, calc((1 - var(--pp-c)) * 2.5rem), 0);
}

@media (max-width: 1024px) {
  .pp-trust__tile {
    padding: 2rem 1.25rem;
  }
}

@media (max-width: 720px) {
  .pp-trust.pp-motion {
    --pp-gear: 16rem;
    padding: 3.5rem 0;
  }

  .pp-trust.pp-motion::before {
    left: 0.5rem;
    right: 0.5rem;
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 1rem, #000 calc(100% - 1rem), transparent 100%);
    mask-image: linear-gradient(to right, transparent 0, #000 1rem, #000 calc(100% - 1rem), transparent 100%);
  }

  .pp-trust .pp-trust__gear--left { left: calc(var(--pp-gear) * -0.5); }
  .pp-trust .pp-trust__gear--right { left: auto; right: calc(var(--pp-gear) * -0.5); }
  .pp-trust .pp-trust__gear--pinion,
  .pp-trust .pp-trust__gear--mid {
    display: none;
  }

  .pp-trust__grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
    padding: 0 1.25rem;
  }

  .pp-trust__tile {
    padding: 1.75rem 1.5rem;
  }

  .pp-trust__icon {
    margin-bottom: 1rem;
  }
}
