/* Button hover: the button fills like a cup, water rising from the bottom
   with one long, gentle wave on its surface that sloshes back and forth and
   settles at the brim; it drains on leave. The fill is a ::before layer
   under the label (isolation keeps it inside the button); the wave is a mask
   tile one wavelength wide. The html prefix outranks the Breakdance :hover
   rules, which would otherwise swap the background. */
html .btn {
  --gm-wave: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 160 12'%3E%3Cpath d='M0 6Q40 0 80 6T160 6V12H0z'/%3E%3C/svg%3E");
  position: relative;
  isolation: isolate;
  overflow: hidden;
  transition: color 250ms ease 200ms, border-color 250ms ease 200ms, box-shadow 300ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

html .btn::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(100% + 12px);
  z-index: -1;
  pointer-events: none;
  background-color: var(--gm-btn-fill, var(--gm-text));
  -webkit-mask: var(--gm-wave) repeat-x 0 0 / 160px 12px, linear-gradient(#000, #000) no-repeat 0 11px / 100% 100%;
  mask: var(--gm-wave) repeat-x 0 0 / 160px 12px, linear-gradient(#000, #000) no-repeat 0 11px / 100% 100%;
  transform: translateY(100%);
  transition: transform 450ms cubic-bezier(0.5, 0, 0.75, 0);
  animation: gm-wave-slosh 1.6s ease-in-out infinite alternate paused;
}

/* Rising: steady like a pour, easing as it nears the brim, where the wave
   troughs just show along the top edge. */
html .btn:hover::before,
html .btn:focus-visible::before {
  transform: translateY(8px);
  transition: transform 900ms cubic-bezier(0.25, 0.6, 0.3, 1);
  animation-play-state: running;
}

html .btn-primary,
html .btn-primary:hover {
  --gm-btn-fill: var(--gm-text);
  background-color: var(--gm-action);
  color: var(--gm-action-ink);
}

html .btn-primary:hover {
  box-shadow: 0 10px 24px -10px color-mix(in srgb, var(--gm-action) 70%, transparent);
}

/* The checkout's place order button: Breakdance swaps its background to a
   light blue on hover, which would show behind the water. */
html #place_order.btn-primary {
  --bde-button-primary-background-color-hover: var(--gm-action);
}

html .btn-outline {
  --gm-btn-fill: var(--gm-action);
}

html .btn-outline:hover,
html .btn-outline:focus-visible {
  background-color: transparent;
  border-color: var(--gm-action);
  color: var(--gm-action-ink);
  box-shadow: 0 10px 24px -12px rgba(0, 0, 0, 0.6);
}

/* Sloshing: the surface tilts half a wavelength one way, then back. */
@keyframes gm-wave-slosh {
  from {
    -webkit-mask-position: 0 0, 0 11px;
    mask-position: 0 0, 0 11px;
  }

  to {
    -webkit-mask-position: -80px 0, 0 11px;
    mask-position: -80px 0, 0 11px;
  }
}

/* Shimmer: a light streak crosses a blue start button whenever shimmer.js
   adds is-shimmering, at random gaps per button so they never sweep together
   or in rhythm. It stays hidden while the water is up. */
html .btn-primary::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, 0.6) 50%, transparent 70%) no-repeat;
  background-size: 60% 100%;
  background-position: -150% 0;
}

html .btn-primary.is-shimmering::after {
  animation: gm-shimmer 0.9s ease-in-out;
}

html .btn-primary:hover::after {
  opacity: 0;
}

@keyframes gm-shimmer {
  from {
    background-position: -150% 0;
  }

  to {
    background-position: 250% 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html .btn,
  html .btn:hover {
    transform: none;
    transition: color 200ms, border-color 200ms;
  }

  html .btn::before {
    transition: none;
    animation: none;
  }

  html .btn-primary::after {
    display: none;
  }
}
