/* Sea fun — playful school/ocean motion. Respects prefers-reduced-motion. */

body.sea-body {
  --sea-fun-yellow: #ffb703;
  --sea-fun-blue: #0077b6;
  --sea-fun-cyan: #00b4d8;
  --sea-fun-coral: #ef476f;
  --sea-fun-mint: #06d6a0;
}

/* —— Hero doodles —— */
.home-app-hero__card {
  position: relative;
}

.sea-fun-doodles {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
}

.sea-fun-doodle {
  position: absolute;
  display: block;
  opacity: 0.88;
}

.sea-fun-doodle.is-star {
  inset-inline-end: 12%;
  top: 14%;
  width: 0.7rem;
  height: 0.7rem;
  background: var(--sea-fun-yellow);
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
  animation: sea-fun-twinkle 2.4s ease-in-out infinite;
}

.sea-fun-doodle.is-star.is-2 {
  inset-inline-end: 22%;
  top: 28%;
  width: 0.45rem;
  height: 0.45rem;
  animation-delay: 0.7s;
}

.sea-fun-doodle.is-star.is-3 {
  inset-inline-start: 8%;
  top: 18%;
  width: 0.55rem;
  height: 0.55rem;
  background: #fff;
  animation-delay: 1.1s;
}

.sea-fun-doodle.is-bubble {
  inset-inline-end: 8%;
  bottom: 18%;
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 999px;
  border: 2px solid rgb(255 255 255 / 55%);
  background: rgb(255 255 255 / 12%);
  animation: sea-fun-float 4.2s ease-in-out infinite;
}

.sea-fun-doodle.is-bubble.is-2 {
  inset-inline-end: 18%;
  bottom: 32%;
  width: 0.5rem;
  height: 0.5rem;
  animation-delay: 1.4s;
  animation-duration: 5s;
}

.sea-fun-doodle.is-bubble.is-3 {
  inset-inline-start: 14%;
  bottom: 22%;
  width: 0.65rem;
  height: 0.65rem;
  animation-delay: 0.5s;
}

.sea-fun-doodle.is-pencil {
  inset-inline-start: 6%;
  top: 42%;
  width: 1.35rem;
  height: 0.28rem;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--sea-fun-yellow) 70%, #ef476f 70% 82%, #fff 82%);
  transform: rotate(-28deg);
  animation: sea-fun-wiggle 3.6s ease-in-out infinite;
  box-shadow: 0 0 0 1px rgb(255 255 255 / 20%);
}

.home-app-hero__card.has-media .sea-fun-doodles {
  opacity: 0.7;
}

.home-app-hero__kicker {
  animation: sea-fun-pop-in 0.55s ease-out both;
}

.home-app-hero__cta {
  position: relative;
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.home-app-hero__cta:not(.home-app-hero__cta--ghost)::after {
  content: "";
  position: absolute;
  inset-block: 0;
  inset-inline-start: -40%;
  width: 40%;
  background: linear-gradient(90deg, transparent, rgb(255 255 255 / 45%), transparent);
  animation: sea-fun-shine 3.2s ease-in-out infinite;
}

.home-app-hero__cta:hover {
  transform: translateY(-2px) scale(1.03);
}

/* —— Categories —— */
.home-cat {
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
}

.home-cat:hover {
  transform: translateY(-4px) rotate(-2deg);
}

.home-cat:hover .home-cat__icon {
  animation: sea-fun-bob 0.7s ease-in-out 1;
}

.home-cat:nth-child(even):hover {
  transform: translateY(-4px) rotate(2deg);
}

/* —— Product cards —— */
.home-product,
.sea-wish-card,
.bb-product-item,
.product-item {
  transition: transform 0.22s cubic-bezier(0.34, 1.4, 0.64, 1), box-shadow 0.22s ease;
}

.home-product:hover {
  transform: translateY(-6px) rotate(-0.4deg);
}

.home-product:nth-child(even):hover {
  transform: translateY(-6px) rotate(0.4deg);
}

.home-product img,
.home-product__media img {
  transition: transform 0.35s ease;
}

.home-product:hover img,
.home-product:hover .home-product__media img {
  transform: scale(1.06) rotate(-1deg);
}

.home-product__badge:not(.is-new) {
  animation: sea-fun-badge 1.8s ease-in-out infinite;
}

.home-product__cart:hover {
  animation: sea-fun-cart-wiggle 0.45s ease-in-out 1;
}

.home-product__wish:hover {
  animation: sea-fun-heart 0.5s ease 1;
}

/* —— Trust / section heads —— */
.home-trust__item {
  transition: transform 0.2s ease;
}

.home-trust__item:hover {
  transform: translateY(-3px);
}

.home-trust__item:hover iconify-icon {
  animation: sea-fun-bob 0.8s ease-in-out 1;
}

.home-section-head iconify-icon {
  display: inline-block;
  animation: sea-fun-twinkle 2.8s ease-in-out infinite;
  color: var(--sea-fun-yellow);
}

/* —— Header —— */
.sea-logo__mark img {
  animation: sea-fun-logo 4.5s ease-in-out infinite;
  transform-origin: center;
}

.sea-nav__promo {
  animation: sea-fun-promo 2.4s ease-in-out infinite;
}

.sea-cart-chip:not(.is-empty).is-fun-bounce {
  animation: sea-fun-pop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.sea-icon-btn--wish.is-fun-bounce {
  animation: sea-fun-heart 0.5s ease 1;
}

.sea-points-chip.is-user .sea-points-chip__icon {
  animation: sea-fun-twinkle 2.6s ease-in-out infinite;
}

/* —— Main CTAs: order now / checkout / buy (visible motion) —— */
.sea-btn--primary,
.sea-btn--secondary,
.sea-minicart__cta,
.sea-cart-checkout,
.order-sticky__cta,
.payment-checkout-btn,
.sea-checkout-submit,
.pdp-actions__buy,
.tp-product-details-buy-now-btn,
.pdp-buy,
.single_add_to_cart_button,
.home-app-hero__cta:not(.home-app-hero__cta--ghost) {
  position: relative !important;
  overflow: hidden !important;
  isolation: isolate;
  transition:
    transform 0.2s cubic-bezier(0.34, 1.4, 0.64, 1),
    filter 0.2s ease !important;
}

/* Living glow via filter (wins over box-shadow !important) */
.sea-btn--secondary,
.sea-minicart__cta,
.sea-cart-checkout,
.order-sticky__cta,
body.page-checkout .payment-checkout-btn,
body.page-checkout .sea-checkout-submit,
.payment-checkout-btn,
.sea-checkout-submit,
.pdp-actions__buy,
.tp-product-details-buy-now-btn {
  animation: sea-cta-glow-yellow 1.8s ease-in-out infinite !important;
}

.sea-btn--primary:not(.sea-btn--ghost):not(.sea-checkout-rewards__cta),
.home-app-hero__cta:not(.home-app-hero__cta--ghost) {
  animation: sea-cta-glow-blue 2s ease-in-out infinite !important;
}

/* Bright shine sweep */
.sea-btn--secondary::after,
.sea-minicart__cta::after,
.sea-cart-checkout::after,
.order-sticky__cta::after,
.payment-checkout-btn::after,
.sea-checkout-submit::after,
.sea-btn--primary:not(.sea-btn--ghost)::after,
.pdp-actions__buy::before,
.tp-product-details-buy-now-btn::before {
  content: "" !important;
  display: block !important;
  position: absolute !important;
  inset-block: -20% !important;
  inset-inline-start: -55% !important;
  width: 48% !important;
  height: auto !important;
  z-index: 5 !important;
  pointer-events: none !important;
  background: linear-gradient(
    105deg,
    transparent 0%,
    rgb(255 255 255 / 0%) 30%,
    rgb(255 255 255 / 75%) 50%,
    rgb(255 255 255 / 0%) 70%,
    transparent 100%
  ) !important;
  transform: skewX(-18deg) translateX(0);
  animation: sea-cta-shine 2.2s ease-in-out infinite !important;
}

.sea-btn--secondary > *,
.sea-minicart__cta > *,
.sea-cart-checkout > *,
.order-sticky__cta > *,
.payment-checkout-btn > *,
.sea-checkout-submit > *,
.sea-btn--primary > *,
.pdp-actions__buy > *,
.tp-product-details-buy-now-btn > * {
  position: relative;
  z-index: 6;
}

.sea-btn--secondary:hover,
.sea-minicart__cta:hover,
.sea-cart-checkout:hover,
.order-sticky__cta:hover,
.payment-checkout-btn:hover,
.sea-checkout-submit:hover,
.pdp-actions__buy:hover,
.tp-product-details-buy-now-btn:hover {
  transform: translateY(-3px) scale(1.03) !important;
  filter: brightness(1.06) saturate(1.08) !important;
  animation-play-state: paused !important;
}

.sea-btn--primary:not(.sea-btn--ghost):hover,
.home-app-hero__cta:not(.home-app-hero__cta--ghost):hover {
  transform: translateY(-3px) scale(1.03) !important;
  filter: brightness(1.07) !important;
  animation-play-state: paused !important;
}

.sea-btn--secondary:active,
.sea-minicart__cta:active,
.sea-cart-checkout:active,
.order-sticky__cta:active,
.payment-checkout-btn:active,
.sea-checkout-submit:active,
.pdp-actions__buy:active,
.sea-btn--primary:active,
.home-app-hero__cta:not(.home-app-hero__cta--ghost):active {
  transform: translateY(1px) scale(0.98) !important;
}

@media (max-width: 767px) {
  .order-sticky__cta:hover {
    transform: translateY(-1px) scale(1.02) !important;
  }
}

/* —— Scroll reveal —— */
.sea-fun-reveal {
  opacity: 0;
  transform: translateY(14px);
  animation: sea-fun-rise 0.55s ease-out forwards;
}

.sea-fun-reveal.is-in {
  opacity: 1;
  transform: none;
}

.home-product.sea-fun-reveal,
.home-cat.sea-fun-reveal,
.home-trust__item.sea-fun-reveal {
  animation-fill-mode: both;
}

.home-product.sea-fun-reveal:nth-child(1),
.home-cat.sea-fun-reveal:nth-child(1),
.home-trust__item.sea-fun-reveal:nth-child(1) { animation-delay: 0.02s; }
.home-product.sea-fun-reveal:nth-child(2),
.home-cat.sea-fun-reveal:nth-child(2),
.home-trust__item.sea-fun-reveal:nth-child(2) { animation-delay: 0.07s; }
.home-product.sea-fun-reveal:nth-child(3),
.home-cat.sea-fun-reveal:nth-child(3),
.home-trust__item.sea-fun-reveal:nth-child(3) { animation-delay: 0.12s; }
.home-product.sea-fun-reveal:nth-child(4),
.home-cat.sea-fun-reveal:nth-child(4),
.home-trust__item.sea-fun-reveal:nth-child(4) { animation-delay: 0.17s; }
.home-product.sea-fun-reveal:nth-child(5),
.home-cat.sea-fun-reveal:nth-child(5) { animation-delay: 0.22s; }
.home-product.sea-fun-reveal:nth-child(6),
.home-cat.sea-fun-reveal:nth-child(6) { animation-delay: 0.27s; }

/* —— Confetti burst —— */
.sea-fun-burst {
  position: fixed;
  inset: 0;
  z-index: 80;
  pointer-events: none;
  overflow: hidden;
}

.sea-fun-piece {
  position: absolute;
  top: var(--y, 40%);
  left: var(--x, 50%);
  width: var(--s, 8px);
  height: var(--s, 8px);
  background: var(--c, #ffb703);
  border-radius: 2px;
  animation: sea-fun-burst 0.85s ease-out forwards;
  transform: translate(-50%, -50%) rotate(var(--r, 0deg));
}

.sea-fun-piece.is-dot {
  border-radius: 999px;
}

.sea-fun-piece.is-star {
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
  background: var(--c, #ffb703);
}

/* —— Keyframes —— */
@keyframes sea-fun-twinkle {
  0%, 100% { opacity: 0.45; transform: scale(0.85) rotate(0deg); }
  50% { opacity: 1; transform: scale(1.15) rotate(12deg); }
}

@keyframes sea-fun-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}

@keyframes sea-fun-wiggle {
  0%, 100% { transform: rotate(-28deg) translateX(0); }
  50% { transform: rotate(-18deg) translateX(6px); }
}

@keyframes sea-fun-bob {
  0%, 100% { transform: translateY(0); }
  40% { transform: translateY(-6px); }
  70% { transform: translateY(2px); }
}

@keyframes sea-fun-pop-in {
  from { opacity: 0; transform: translateY(8px) scale(0.96); }
  to { opacity: 1; transform: none; }
}

@keyframes sea-fun-shine {
  0%, 55% { transform: translateX(0); opacity: 0; }
  70% { opacity: 1; }
  100% { transform: translateX(320%); opacity: 0; }
}

@keyframes sea-cta-shine {
  0%, 35% {
    transform: skewX(-18deg) translateX(0);
    opacity: 0;
  }
  45% { opacity: 1; }
  70%, 100% {
    transform: skewX(-18deg) translateX(360%);
    opacity: 0;
  }
}

@keyframes sea-cta-glow-yellow {
  0%, 100% {
    filter: brightness(1) drop-shadow(0 0 0 rgb(255 183 3 / 0%));
    transform: scale(1);
  }
  50% {
    filter: brightness(1.05) drop-shadow(0 0 14px rgb(255 183 3 / 70%));
    transform: scale(1.015);
  }
}

@keyframes sea-cta-glow-blue {
  0%, 100% {
    filter: brightness(1) drop-shadow(0 0 0 rgb(0 180 216 / 0%));
    transform: scale(1);
  }
  50% {
    filter: brightness(1.06) drop-shadow(0 0 14px rgb(0 180 216 / 65%));
    transform: scale(1.015);
  }
}

/* legacy aliases kept so older refs still resolve */
@keyframes sea-cta-pulse-yellow {
  0%, 100% { opacity: 1; }
  50% { opacity: 1; }
}

@keyframes sea-cta-pulse-blue {
  0%, 100% { opacity: 1; }
  50% { opacity: 1; }
}

@keyframes sea-fun-badge {
  0%, 100% { transform: scale(1) rotate(-2deg); }
  50% { transform: scale(1.08) rotate(2deg); }
}

@keyframes sea-fun-cart-wiggle {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-10deg); }
  50% { transform: rotate(8deg); }
  75% { transform: rotate(-4deg); }
}

@keyframes sea-fun-heart {
  0% { transform: scale(1); }
  30% { transform: scale(1.22); }
  55% { transform: scale(0.92); }
  100% { transform: scale(1); }
}

@keyframes sea-fun-logo {
  0%, 100% { transform: rotate(0deg) translateY(0); }
  50% { transform: rotate(-3deg) translateY(-2px); }
}

@keyframes sea-fun-promo {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-1px); box-shadow: 0 0 0 4px rgb(239 71 111 / 10%); }
}

@keyframes sea-fun-pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

@keyframes sea-fun-rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

@keyframes sea-fun-burst {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(var(--r, 0deg)) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--dx, 0px)), calc(-50% + var(--dy, -80px))) rotate(calc(var(--r, 0deg) + 120deg)) scale(0.4);
  }
}

@media (prefers-reduced-motion: reduce) {
  .sea-fun-doodles,
  .sea-fun-burst,
  .home-app-hero__cta::after,
  .home-product__badge,
  .sea-logo__mark img,
  .sea-nav__promo,
  .home-section-head iconify-icon,
  .sea-points-chip.is-user .sea-points-chip__icon,
  .sea-btn--secondary,
  .sea-minicart__cta,
  .sea-cart-checkout,
  .order-sticky__cta,
  .payment-checkout-btn,
  .sea-checkout-submit,
  .pdp-actions__buy,
  .tp-product-details-buy-now-btn,
  .sea-btn--primary,
  .home-app-hero__cta:not(.home-app-hero__cta--ghost),
  .sea-btn--secondary::after,
  .sea-minicart__cta::after,
  .sea-cart-checkout::after,
  .order-sticky__cta::after,
  .payment-checkout-btn::after,
  .sea-checkout-submit::after,
  .sea-btn--primary::after,
  .pdp-actions__buy::before,
  .tp-product-details-buy-now-btn::before {
    animation: none !important;
  }

  .sea-fun-reveal {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
  }

  .home-product:hover,
  .home-cat:hover,
  .home-product:hover img,
  .sea-btn--secondary:hover,
  .sea-minicart__cta:hover,
  .sea-cart-checkout:hover,
  .order-sticky__cta:hover,
  .payment-checkout-btn:hover,
  .sea-checkout-submit:hover,
  .pdp-actions__buy:hover,
  .sea-btn--primary:hover,
  .home-app-hero__cta:hover {
    transform: none !important;
  }
}
