/**
 * PepperLabz — Main CTA animation + hover/press states.
 *
 * SITEWIDE by design: every selector below is confirmed (2026-09-25, live
 * fetch) to have zero real matches on either homepage (page 95 or 9443) —
 * these buttons live only on product, cart and builder templates.
 *
 * REMOVED 2026-09-25 — .plz-bottom-btn, .pepper-verify-cta,
 * .pepper-info-btn: all three DO render on both homepages (they're part of
 * sections 3-6, which still share classes between page 95 and 9443 — that
 * independence rebuild hasn't happened yet). Enqueueing this file sitewide
 * with those three still in it was leaking their hover effects onto the
 * live homepage, the same failure mode as pepperlabz-hero-chrome.css. They
 * are not re-added anywhere for now — that's follow-up work once sections
 * 3-6 get the same treatment as the hero/promise rebuild
 * (pepperlabz-preview-home.css). See git history for the removed rules
 * (keyframes plzCtaChromeDrift / plzCtaEdgeGlow, and sections 3-4 of the
 * old header comment) if they need to be restored under new, independent
 * classes at that point.
 *
 * Two animations remain, chosen by surface type rather than applied
 * uniformly:
 *
 *   Dark pill buttons  -> continuous liquid-chrome sheen, accelerating on
 *                         hover. This is the motion language the hero
 *                         button already established, so the primary
 *                         actions read as one system.
 *     .plz-add-cart-btn, .checkout-button, .plz-sticky-add-btn
 *
 *   Light buttons      -> silver sheen instead of white, which would have
 *                         no contrast on a white face.
 *     .plz-builder-add-btn
 *
 * Palette is brand chrome only: #FFFFFF paper, #F1F3F5 mist, #C4CAD1 silver,
 * #79818A steel, #1C1F23 graphite.
 *
 * NOTE ON !important: several of these buttons are styled with !important in
 * additional-css.css, so overriding their declarations requires it here too.
 *
 * NOTE ON PSEUDO-ELEMENTS: every sheen layer is position:absolute, which
 * takes it out of flow. This matters because several of these buttons are
 * display:flex — an in-flow ::after would become a flex item and shift the
 * label.
 *
 * SEAMLESS LOOP: each sheen layer is 300% wide with a gradient tiled at
 * 33.3333%, and translates by exactly one tile per cycle, so the loop point
 * is identical to the start. Same technique as the hero.
 */

@keyframes plzCtaSheenFlow {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(33.3333%, 0, 0);
  }
}

/* ============================================================
   1. Dark pill buttons — continuous liquid-chrome sheen
   ============================================================ */

.plz-add-cart-btn,
body.woocommerce-cart .wc-proceed-to-checkout .checkout-button,
.plz-sticky-add-btn {
  position: relative !important;
  overflow: hidden !important;
  isolation: isolate !important;
}

/* Keep labels and icons above the sheen. */
.plz-add-cart-btn > *,
body.woocommerce-cart .wc-proceed-to-checkout .checkout-button > *,
.plz-sticky-add-btn > * {
  position: relative;
  z-index: 1;
}

.plz-add-cart-btn::after,
body.woocommerce-cart .wc-proceed-to-checkout .checkout-button::after,
.plz-sticky-add-btn::after {
  content: "" !important;
  position: absolute !important;
  top: 0 !important;
  bottom: 0 !important;
  left: -100% !important;
  width: 300% !important;
  z-index: 0 !important;
  pointer-events: none !important;
  border-radius: inherit;

  background-image: linear-gradient(
    100deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0) 28%,
    rgba(255, 255, 255, 0.14) 38%,
    rgba(241, 243, 245, 0.4) 45%,
    rgba(255, 255, 255, 0.66) 50%,
    rgba(196, 202, 209, 0.36) 55%,
    rgba(255, 255, 255, 0.12) 63%,
    rgba(255, 255, 255, 0) 74%,
    rgba(255, 255, 255, 0) 100%
  );
  background-size: 33.3333% 100%;
  background-repeat: repeat-x;

  opacity: 0.5;
  will-change: transform;
  animation: plzCtaSheenFlow 8s linear infinite;
  transition: opacity 0.3s ease;
}

/* Hover/focus: same motion, roughly 3x faster and at full strength. */
.plz-add-cart-btn:hover::after,
.plz-add-cart-btn:focus-visible::after,
body.woocommerce-cart .wc-proceed-to-checkout .checkout-button:hover::after,
body.woocommerce-cart .wc-proceed-to-checkout .checkout-button:focus::after {
  opacity: 1;
  animation-duration: 2.4s;
}

/**
 * Hold each button's own surface steady on hover so the sheen is the only
 * thing that changes. Without these, additional-css.css's existing
 * white-inversion hovers would fire underneath and compete with it.
 */
.plz-add-cart-btn:hover,
.plz-add-cart-btn:focus-visible {
  background: #0e0e10 !important;
  color: #fff !important;
  transform: none !important;
}

body.woocommerce-cart .wc-proceed-to-checkout .checkout-button:hover,
body.woocommerce-cart .wc-proceed-to-checkout .checkout-button:focus {
  background: #111 !important;
  color: #fff !important;
}

/**
 * Mobile sticky Add — the sheen runs, but touch has no hover, so the
 * press state is what confirms the tap.
 */
@media (max-width: 767px) {
  .plz-sticky-add-btn {
    transition:
      transform 0.12s ease,
      box-shadow 0.12s ease !important;
  }

  .plz-sticky-add-btn:active {
    transform: scale(0.94) !important;
    box-shadow: 0 2px 8px rgba(28, 31, 35, 0.3) !important;
  }
}

/* ============================================================
   2. Build Your Pepper Pack add button — silver sheen
   ============================================================

   This button has a white face (#FFFFFF), so it gets a silver/steel sheen
   rather than the white one above, which would be invisible on it.
*/
.plz-builder-add-btn {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.plz-builder-add-btn > * {
  position: relative;
  z-index: 1;
}

.plz-builder-add-btn::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -100%;
  width: 300%;
  z-index: 0;
  pointer-events: none;
  border-radius: inherit;

  background-image: linear-gradient(
    100deg,
    rgba(196, 202, 209, 0) 0%,
    rgba(196, 202, 209, 0) 30%,
    rgba(196, 202, 209, 0.3) 42%,
    rgba(121, 129, 138, 0.22) 50%,
    rgba(196, 202, 209, 0.3) 58%,
    rgba(196, 202, 209, 0) 70%,
    rgba(196, 202, 209, 0) 100%
  );
  background-size: 33.3333% 100%;
  background-repeat: repeat-x;

  opacity: 0.55;
  will-change: transform;
  animation: plzCtaSheenFlow 8s linear infinite;
  transition: opacity 0.3s ease;
}

.plz-builder-add-btn:hover:not(:disabled)::after,
.plz-builder-add-btn:focus-visible:not(:disabled)::after {
  opacity: 1;
  animation-duration: 2.4s;
}

/* The spinner state owns the button's motion — no sheen competing with it. */
.plz-builder-add-btn:disabled::after,
.plz-builder-add-btn.plz-builder-add-btn-loading::after {
  display: none;
}

/* ============================================================
   Reduced motion
   ============================================================

   All continuous motion stops. Hover still produces a visible response —
   the sheen appears rather than travelling — so every button keeps
   confirming interaction.
*/
@media (prefers-reduced-motion: reduce) {
  .plz-add-cart-btn::after,
  body.woocommerce-cart .wc-proceed-to-checkout .checkout-button::after,
  .plz-sticky-add-btn::after,
  .plz-builder-add-btn::after {
    animation: none !important;
    opacity: 0 !important;
    transform: translate3d(16%, 0, 0) !important;
  }

  .plz-add-cart-btn:hover::after,
  body.woocommerce-cart .wc-proceed-to-checkout .checkout-button:hover::after,
  .plz-builder-add-btn:hover:not(:disabled)::after {
    opacity: 1 !important;
  }

  .plz-sticky-add-btn:active {
    transform: none !important;
  }
}
