/* ==========================================================================
   Sanaky hero slider — clean-water carousel animation
   ========================================================================== */
.sanaky-hero-slider {
  --hx-blue: #3272BA;
  --hx-aqua: #5cc8ff;
  --hx-wave-h: clamp(8px, 1.8vw, 26px);
  --fx-x: 70%;
  --fx-y: 50%;
  --fx-r: 1600px;
  --fx-scale: 10;
  isolation: isolate;
}

/* --------------------------------------------------------------------------
   Slide transition — ripple reveal (Owl Animate hook)
   Animations live on .owl-item only: Owl clears on the first bubbling
   animationend, so descendants must use transitions.
   -------------------------------------------------------------------------- */
.sanaky-hero-slider .owl-carousel .owl-item.animated {
  animation-duration: 1.25s;
  animation-fill-mode: both;
  will-change: transform, clip-path;
}

.sanaky-hero-slider .owl-carousel .owl-item.owl-animated-out {
  z-index: 2;
}

.sanaky-hero-slider .owl-carousel .owl-item.owl-animated-in {
  z-index: 3;
}

.sanaky-hero-slider .owl-carousel .sanaky-hero-in {
  animation-name: sanakyHeroRippleIn;
  animation-timing-function: cubic-bezier(0.33, 0.7, 0.25, 1);
}

.sanaky-hero-slider .owl-carousel .sanaky-hero-out {
  animation-name: sanakyHeroDrift;
  animation-timing-function: cubic-bezier(0.45, 0, 0.55, 1);
}

@keyframes sanakyHeroRippleIn {
  0% {
    clip-path: circle(0px at var(--fx-x) var(--fx-y));
    transform: scale(1.07);
  }
  100% {
    clip-path: circle(var(--fx-r) at var(--fx-x) var(--fx-y));
    transform: scale(1);
  }
}

@keyframes sanakyHeroDrift {
  0% {
    transform: scale(1);
  }
  100% {
    transform: scale(1.05);
  }
}

/* Soft Ken Burns — keep scale tiny so banners stay sharp */
.sanaky-hero-slider .owl-item .hero-slide__img,
.sanaky-hero-slider .owl-item .hero-slide__video {
  transform: scale(1);
  transform-origin: 50% 50%;
  transition: transform 1.2s ease;
  backface-visibility: hidden;
  image-rendering: auto;
}

.sanaky-hero-slider.is-fx-ready .owl-item.active .hero-slide__img,
.sanaky-hero-slider.is-fx-ready .owl-item.active .hero-slide__video {
  transform: scale(1.012);
  transition: transform 9s cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* --------------------------------------------------------------------------
   Ambient water layer (decorative, never blocks clicks/swipes)
   -------------------------------------------------------------------------- */
.sanaky-hero-fx {
  position: absolute;
  inset: 0;
  z-index: 6;
  overflow: hidden;
  pointer-events: none;
}

.sanaky-hero-fx > * {
  position: absolute;
  pointer-events: none;
}

/* Sunlight through water */
.sanaky-hero-fx__rays {
  inset: -20% -10% 0;
  background:
    repeating-linear-gradient(
      102deg,
      rgba(255, 255, 255, 0) 0,
      rgba(255, 255, 255, 0) 70px,
      rgba(190, 232, 255, 0.09) 110px,
      rgba(255, 255, 255, 0) 160px
    );
  -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.45) 45%, transparent 78%);
  mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.45) 45%, transparent 78%);
  mix-blend-mode: screen;
  opacity: 0.8;
  transform-origin: 50% 0;
  animation: sanakyHeroRays 14s ease-in-out infinite alternate;
}

@keyframes sanakyHeroRays {
  0% {
    transform: translate3d(-3%, 0, 0) skewX(-4deg);
    opacity: 0.55;
  }
  50% {
    opacity: 0.9;
  }
  100% {
    transform: translate3d(3%, 0, 0) skewX(4deg);
    opacity: 0.6;
  }
}

/* Glass shine sweep after each slide change */
.sanaky-hero-fx__shine {
  inset: 0;
  overflow: hidden;
}

.sanaky-hero-fx__shine::before {
  content: "";
  position: absolute;
  top: -20%;
  bottom: -20%;
  left: 0;
  width: 22%;
  background: linear-gradient(
    100deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.16) 45%,
    rgba(214, 240, 255, 0.28) 50%,
    rgba(255, 255, 255, 0.16) 55%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: translate3d(-160%, 0, 0) skewX(-18deg);
  opacity: 0;
}

.sanaky-hero-fx.is-shining .sanaky-hero-fx__shine::before {
  animation: sanakyHeroShine 1.5s cubic-bezier(0.4, 0, 0.2, 1) 0.55s both;
}

@keyframes sanakyHeroShine {
  0% {
    transform: translate3d(-160%, 0, 0) skewX(-18deg);
    opacity: 0;
  }
  15% {
    opacity: 1;
  }
  85% {
    opacity: 1;
  }
  100% {
    transform: translate3d(620%, 0, 0) skewX(-18deg);
    opacity: 0;
  }
}

/* Droplet ripple rings */
.sanaky-hero-fx__ripple {
  left: var(--fx-x);
  top: var(--fx-y);
  width: 0;
  height: 0;
}

.sanaky-hero-fx__ripple i {
  position: absolute;
  left: -150px;
  top: -150px;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.85);
  box-shadow:
    0 0 18px rgba(92, 200, 255, 0.45),
    inset 0 0 18px rgba(92, 200, 255, 0.35);
  transform: scale(0);
  opacity: 0;
}

.sanaky-hero-fx__ripple::before {
  content: "";
  position: absolute;
  left: -9px;
  top: -9px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff 0 25%, rgba(180, 230, 255, 0.9) 45%, rgba(50, 114, 186, 0) 72%);
  transform: scale(0);
  opacity: 0;
}

.sanaky-hero-fx.is-rippling .sanaky-hero-fx__ripple::before {
  animation: sanakyHeroDrop 0.7s ease-out both;
}

.sanaky-hero-fx.is-rippling .sanaky-hero-fx__ripple i {
  animation: sanakyHeroRing 1.25s cubic-bezier(0.33, 0.7, 0.25, 1) both;
}

.sanaky-hero-fx.is-rippling .sanaky-hero-fx__ripple i:nth-child(2) {
  animation-delay: 0.16s;
  animation-duration: 1.5s;
}

.sanaky-hero-fx.is-rippling .sanaky-hero-fx__ripple i:nth-child(3) {
  animation-delay: 0.32s;
  animation-duration: 1.7s;
}

@keyframes sanakyHeroDrop {
  0% {
    transform: scale(0.2);
    opacity: 0;
  }
  25% {
    transform: scale(1.3);
    opacity: 1;
  }
  100% {
    transform: scale(3.2);
    opacity: 0;
  }
}

@keyframes sanakyHeroRing {
  0% {
    transform: scale(0.02);
    opacity: 0;
  }
  12% {
    opacity: 0.9;
  }
  70% {
    opacity: 0.25;
  }
  100% {
    transform: scale(var(--fx-scale));
    opacity: 0;
  }
}

/* Rising micro-bubbles */
.sanaky-hero-fx__bubbles {
  inset: 0;
  container-type: size;
}

.sanaky-hero-fx__bubbles i {
  position: absolute;
  bottom: -24px;
  left: var(--x, 50%);
  width: var(--s, 8px);
  height: var(--s, 8px);
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: radial-gradient(
    circle at 32% 28%,
    rgba(255, 255, 255, 0.95) 0 14%,
    rgba(255, 255, 255, 0.22) 38%,
    rgba(160, 220, 255, 0.08) 70%
  );
  box-shadow: 0 0 6px rgba(160, 220, 255, 0.35);
  opacity: 0;
  animation: sanakyHeroBubble var(--d, 10s) linear var(--t, 0s) infinite;
}

@keyframes sanakyHeroBubble {
  0% {
    transform: translate3d(0, 0, 0) scale(0.6);
    opacity: 0;
  }
  12% {
    opacity: 0.75;
  }
  35% {
    transform: translate3d(calc(var(--w, 10px) * -1), -38cqh, 0) scale(0.85);
  }
  65% {
    transform: translate3d(var(--w, 10px), -66cqh, 0) scale(1);
    opacity: 0.55;
  }
  100% {
    transform: translate3d(0, -92cqh, 0) scale(1.05);
    opacity: 0;
  }
}

/* Flowing water surface at the bottom edge */
.sanaky-hero-fx__waves {
  left: 0;
  right: 0;
  bottom: -1px;
  width: 100%;
  height: var(--hx-wave-h);
  display: block;
}

.sanaky-hero-fx__waves use {
  animation: sanakyHeroWave 22s cubic-bezier(0.55, 0.5, 0.45, 0.5) infinite;
}

.sanaky-hero-fx__waves use:nth-child(1) {
  animation-delay: -2s;
  animation-duration: 9s;
}

.sanaky-hero-fx__waves use:nth-child(2) {
  animation-delay: -3s;
  animation-duration: 13s;
}

.sanaky-hero-fx__waves use:nth-child(3) {
  animation-delay: -4s;
  animation-duration: 17s;
}

.sanaky-hero-fx__waves use:nth-child(4) {
  animation-delay: -5s;
  animation-duration: 24s;
}

@keyframes sanakyHeroWave {
  0% {
    transform: translate3d(-90px, 0, 0);
  }
  100% {
    transform: translate3d(85px, 0, 0);
  }
}

/* Pause ambient motion while off-screen / tab hidden */
.sanaky-hero-slider.is-offscreen .sanaky-hero-fx *,
.sanaky-hero-slider.is-offscreen .sanaky-hero-fx *::before {
  animation-play-state: paused !important;
}

/* --------------------------------------------------------------------------
   Dots — water-fill progress
   -------------------------------------------------------------------------- */
.sanaky-hero-slider .sanaky-hero-dots {
  bottom: 16px;
  gap: 8px;
}

.sanaky-hero-slider .sanaky-hero-dots__dot {
  position: relative;
  width: 9px;
  height: 9px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 1px 3px rgba(4, 30, 60, 0.45);
  transition: width 0.45s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s ease;
}

.sanaky-hero-slider .sanaky-hero-dots__dot:hover {
  background: #fff;
  transform: none;
}

.sanaky-hero-slider .sanaky-hero-dots__dot.is-active {
  width: 38px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
}

.sanaky-hero-slider .sanaky-hero-dots__dot::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    linear-gradient(90deg, var(--hx-blue) 0%, #1f8fe0 60%, var(--hx-aqua) 100%);
  box-shadow: 0 0 8px rgba(92, 200, 255, 0.8);
  transform: scaleX(0);
  transform-origin: 0 50%;
}

.sanaky-hero-slider .sanaky-hero-dots__dot.is-active::before {
  transform: scaleX(1);
}

.sanaky-hero-slider.is-autoplay .sanaky-hero-dots__dot.is-active::before {
  transform: scaleX(0);
  animation: sanakyHeroFill var(--hx-interval, 6000ms) linear forwards;
}

.sanaky-hero-slider.is-paused .sanaky-hero-dots__dot.is-active::before {
  animation-play-state: paused;
}

@keyframes sanakyHeroFill {
  to {
    transform: scaleX(1);
  }
}

.sanaky-hero-slider .sanaky-hero-dots__dot:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 767px) {
  .sanaky-hero-fx__bubbles i:nth-child(n + 9) {
    display: none;
  }

  .sanaky-hero-fx__rays {
    opacity: 0.55;
  }

  .sanaky-hero-slider .sanaky-hero-dots {
    bottom: 8px;
    gap: 6px;
  }

  .sanaky-hero-slider .sanaky-hero-dots__dot {
    width: 7px;
    height: 7px;
  }

  .sanaky-hero-slider .sanaky-hero-dots__dot.is-active {
    width: 26px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sanaky-hero-fx__rays,
  .sanaky-hero-fx__bubbles,
  .sanaky-hero-fx__ripple,
  .sanaky-hero-fx__shine {
    display: none;
  }

  .sanaky-hero-fx__waves use,
  .sanaky-hero-slider .owl-item .hero-slide__img,
  .sanaky-hero-slider .owl-item .hero-slide__video,
  .sanaky-hero-slider .sanaky-hero-dots__dot::before {
    animation: none !important;
    transition: none !important;
    transform: none !important;
  }

  .sanaky-hero-slider .sanaky-hero-dots__dot.is-active::before {
    transform: scaleX(1) !important;
  }
}
