/* WhatsApp button: waits below the screen until a third of the page has
   scrolled by (motion-effects.js wraps it in .xr-fab, which slides). */
body > .xr-whatsapp-fab {
  translate: -50% calc(100% + 60px);
}

.xr-fab {
  position: fixed;
  bottom: 28px;
  left: 50%;
  z-index: 50;
  filter: drop-shadow(0 6px 8px rgba(27, 26, 23, 0.3));
  translate: -50% calc(100% + 60px);
  transition: translate 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.xr-fab.is-shown {
  translate: -50% 0;
}

.xr-fab .xr-whatsapp-fab {
  position: static;
  display: inline-block;
  translate: none;
  box-shadow: none;
}

@media (max-width: 767px) {
  .xr-fab {
    bottom: 16px;
  }
}

.xr-fab.is-shaking .xr-whatsapp-fab {
  animation: xr-fab-shake 2.4s linear;
}

/* Brr brr ... brr brr: two quick buzzes, a pause, two more. */
@keyframes xr-fab-shake {
  0% { transform: translateX(0) rotate(0); }
  1.3% { transform: translateX(-3px) rotate(-5deg); }
  2.6% { transform: translateX(3px) rotate(5deg); }
  4% { transform: translateX(-3px) rotate(-5deg); }
  5.3% { transform: translateX(3px) rotate(5deg); }
  6.6% { transform: translateX(-2px) rotate(-3deg); }
  8% { transform: translateX(0) rotate(0); }
  14% { transform: translateX(0) rotate(0); }
  15.3% { transform: translateX(-3px) rotate(-5deg); }
  16.6% { transform: translateX(3px) rotate(5deg); }
  18% { transform: translateX(-3px) rotate(-5deg); }
  19.3% { transform: translateX(3px) rotate(5deg); }
  20.6% { transform: translateX(-2px) rotate(-3deg); }
  22% { transform: translateX(0) rotate(0); }
  50% { transform: translateX(0) rotate(0); }
  51.3% { transform: translateX(-3px) rotate(-5deg); }
  52.6% { transform: translateX(3px) rotate(5deg); }
  54% { transform: translateX(-3px) rotate(-5deg); }
  55.3% { transform: translateX(3px) rotate(5deg); }
  56.6% { transform: translateX(-2px) rotate(-3deg); }
  58% { transform: translateX(0) rotate(0); }
  64% { transform: translateX(0) rotate(0); }
  65.3% { transform: translateX(-3px) rotate(-5deg); }
  66.6% { transform: translateX(3px) rotate(5deg); }
  68% { transform: translateX(-3px) rotate(-5deg); }
  69.3% { transform: translateX(3px) rotate(5deg); }
  70.6% { transform: translateX(-2px) rotate(-3deg); }
  72% { transform: translateX(0) rotate(0); }
  100% { transform: translateX(0) rotate(0); }
}

@media (prefers-reduced-motion: reduce) {
  .xr-fab {
    transition: none;
  }

  .xr-fab.is-shaking .xr-whatsapp-fab {
    animation: none;
  }
}

/* Booking-button shimmer: a skewed sheen with a trailing glint. */
.xr-shimmer {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition: translate 0.18s cubic-bezier(0.3, 1.6, 0.5, 1), box-shadow 0.18s ease;
}

.xr-shimmer::after {
  content: "";
  position: absolute;
  top: -20%;
  bottom: -20%;
  left: 0;
  width: 75%;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(100deg, transparent 0 16%, rgba(255, 255, 255, 0.1) 30%, rgba(255, 240, 200, 0.7) 45%, rgba(255, 255, 255, 0.95) 50%, rgba(255, 240, 200, 0.7) 55%, rgba(255, 255, 255, 0.1) 70%, transparent 82%),
    linear-gradient(100deg, transparent 0 86%, rgba(255, 255, 255, 0.75) 88%, transparent 90%);
  transform: translateX(-200%) skewX(-18deg);
}

.xr-shimmer.is-shimmering::after {
  animation: xr-shimmer-sweep 1.15s cubic-bezier(0.4, 0.1, 0.25, 1) both;
}

.xr-shimmer.is-shimmer-hover::after {
  animation: xr-shimmer-sweep 0.95s cubic-bezier(0.4, 0.1, 0.25, 1) both;
}

.xr-shimmer:hover,
.xr-shimmer:focus-visible,
.xr-card:hover .xr-shimmer,
.xr-combo:hover .xr-shimmer {
  translate: -3px -3px;
  box-shadow: 4px 4px 0 var(--xr-c-orange, #E8762C);
}

/* Breakdance hangs an arrow icon on the cart page's checkout button
   ::after, outranking the sheen above; give the sheen back. */
body.woocommerce-cart .breakdance-woocommerce a.checkout-button.xr-shimmer::after {
  content: "";
  position: absolute;
  top: -20%;
  bottom: -20%;
  left: 0;
  display: block;
  width: 75%;
  height: auto;
  margin: 0;
  z-index: 1;
  pointer-events: none;
  background-color: transparent;
  background:
    linear-gradient(100deg, transparent 0 16%, rgba(255, 255, 255, 0.1) 30%, rgba(255, 240, 200, 0.7) 45%, rgba(255, 255, 255, 0.95) 50%, rgba(255, 240, 200, 0.7) 55%, rgba(255, 255, 255, 0.1) 70%, transparent 82%),
    linear-gradient(100deg, transparent 0 86%, rgba(255, 255, 255, 0.75) 88%, transparent 90%);
  -webkit-mask-image: none;
  mask-image: none;
  transform: translateX(-200%) skewX(-18deg);
}

/* Tour card buttons lift like the shimmer buttons without sweeping. */
.xr-card .xr-card__cta {
  transition: background-color 0.15s, color 0.15s, border-color 0.15s, translate 0.18s cubic-bezier(0.3, 1.6, 0.5, 1), box-shadow 0.18s ease;
}

.xr-card:hover .xr-card__cta,
.xr-card .xr-card__cta:focus-visible {
  translate: -3px -3px;
  box-shadow: 4px 4px 0 var(--xr-c-orange, #E8762C);
}

@keyframes xr-shimmer-sweep {
  from { transform: translateX(-200%) skewX(-18deg); }
  to { transform: translateX(260%) skewX(-18deg); }
}

/* Header cart jiggles every few seconds while it holds items. */
.xr-cart-has-items .bde-mini-cart-toggle__icon {
  display: inline-block;
  transform-origin: 50% 90%;
  animation: xr-cart-jiggle 4.5s ease-in-out 1.5s infinite;
}

.xr-cart-has-items .bde-mini-cart-toggle__counter {
  animation: xr-cart-pop 4.5s ease-in-out 1.5s infinite;
}

.xr-cart-has-items .bde-mini-cart-toggle:hover .bde-mini-cart-toggle__icon,
.xr-cart-has-items .bde-mini-cart-toggle:hover .bde-mini-cart-toggle__counter {
  animation-play-state: paused;
}

@keyframes xr-cart-jiggle {
  0%, 78%, 100% { transform: rotate(0); }
  81% { transform: rotate(-14deg) scale(1.1); }
  84% { transform: rotate(12deg) scale(1.1); }
  87% { transform: rotate(-9deg) scale(1.05); }
  90% { transform: rotate(6deg); }
  93% { transform: rotate(-3deg); }
}

@keyframes xr-cart-pop {
  0%, 78%, 94%, 100% { transform: scale(1); }
  84% { transform: scale(1.3); }
}

@media (prefers-reduced-motion: reduce) {
  .xr-shimmer::after,
  .xr-cart-has-items .bde-mini-cart-toggle__icon,
  .xr-cart-has-items .bde-mini-cart-toggle__counter {
    animation: none !important;
  }

  .xr-shimmer:hover,
  .xr-shimmer:focus-visible {
    translate: none;
  }

  .xr-header,
  .xr-header__logo-img {
    transition: none !important;
  }
}
