/**
 * Hi Q Genetics — animations.css
 * All keyframe definitions, special transitions, and animation utilities.
 * Loaded after main style.css.
 */

/* ============================================================
   CSS CUSTOM PROPS — Animation timings
   ============================================================ */
:root {
  --ease-spring:    cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-out-expo:  cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-quart:  cubic-bezier(0.5, 0, 0.75, 0);
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
}

/* ============================================================
   SPIN — loading indicator
   ============================================================ */
@keyframes spin {
  to { transform: rotate(360deg); }
}
.spin {
  animation: spin 800ms linear infinite;
}

/* ============================================================
   PULSE DOT — live indicator
   ============================================================ */
@keyframes pulse-dot {
  0%, 100% { transform: scale(1);   opacity: 1; }
  50%       { transform: scale(1.4); opacity: 0.6; }
}
.pulse-dot {
  animation: pulse-dot 1.5s ease-in-out infinite;
}

/* ============================================================
   MARQUEE — infinite horizontal scroll
   ============================================================ */
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 25s linear infinite;
}
.marquee-track:hover {
  animation-play-state: paused;
}

/* ============================================================
   SHIMMER — skeleton loading
   ============================================================ */
@keyframes shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position:  400px 0; }
}
.skeleton {
  background: linear-gradient(
    90deg,
    var(--color-mist) 25%,
    rgba(24,50,41, 0.07) 50%,
    var(--color-mist) 75%
  );
  background-size: 400px 100%;
  animation: shimmer 1.6s ease-in-out infinite;
}

/* ============================================================
   CARD BLOOM RING — expands from center on add-to-cart
   ============================================================ */
@keyframes bloom-ring {
  0%   { transform: translate(-50%, -50%) scale(0.5); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(3);   opacity: 0; }
}

/* ============================================================
   FLOAT BOB — hero scroll indicator and floating elements
   ============================================================ */
@keyframes float-bob {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-10px); }
}
.float-bob {
  animation: float-bob 3s ease-in-out infinite;
}
.float-bob-sm {
  animation: float-bob 2.5s ease-in-out infinite;
}

/* ============================================================
   FADE UP — standard reveal
   ============================================================ */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fade-down {
  from { opacity: 0; transform: translateY(-20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fade-left {
  from { opacity: 0; transform: translateX(28px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes fade-right {
  from { opacity: 0; transform: translateX(-28px); }
  to   { opacity: 1; transform: translateX(0); }
}

.anim-fade-up    { animation: fade-up    600ms var(--ease-out-quart) both; }
.anim-fade-down  { animation: fade-down  600ms var(--ease-out-quart) both; }
.anim-fade-left  { animation: fade-left  600ms var(--ease-out-quart) both; }
.anim-fade-right { animation: fade-right 600ms var(--ease-out-quart) both; }

/* ============================================================
   SCALE IN — modal/card entrance
   ============================================================ */
@keyframes scale-in {
  from { opacity: 0; transform: scale(0.88); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes scale-in-spring {
  from { opacity: 0; transform: scale(0.7); }
  to   { opacity: 1; transform: scale(1); }
}
.anim-scale-in        { animation: scale-in        400ms var(--ease-out-quart) both; }
.anim-scale-in-spring { animation: scale-in-spring 500ms var(--ease-spring) both; }

/* ============================================================
   SLIDE IN — drawers, flyouts
   ============================================================ */
@keyframes slide-in-right {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}
@keyframes slide-in-left {
  from { transform: translateX(-100%); }
  to   { transform: translateX(0); }
}
@keyframes slide-in-up {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

/* ============================================================
   AURORA PULSE — hero background breathing
   ============================================================ */
@keyframes aurora-pulse {
  0%   {
    background-position: 50% 0%;
    opacity: 0.85;
  }
  33% {
    background-position: 60% 10%;
    opacity: 1;
  }
  66% {
    background-position: 40% 5%;
    opacity: 0.9;
  }
  100% {
    background-position: 50% 0%;
    opacity: 0.85;
  }
}

.hiq-hero__aurora {
  animation: aurora-pulse 10s ease-in-out infinite;
}

/* ============================================================
   SEED POP — add-to-cart button celebration
   ============================================================ */
@keyframes seed-pop {
  0%   { transform: scale(1) rotate(0deg); }
  20%  { transform: scale(1.5) rotate(15deg); }
  50%  { transform: scale(0.85) rotate(-10deg); }
  70%  { transform: scale(1.1) rotate(5deg); }
  100% { transform: scale(1) rotate(0deg); }
}

/* ============================================================
   CART BADGE BUMP
   ============================================================ */
@keyframes cart-bump {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.6); }
  65%  { transform: scale(0.85); }
  85%  { transform: scale(1.1); }
  100% { transform: scale(1); }
}
.bump {
  animation: cart-bump 450ms var(--ease-spring);
}

/* ============================================================
   NUMBER COUNT-UP
   ============================================================ */
@keyframes count-up {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   TEXT REVEAL — clip-path wipe
   ============================================================ */
@keyframes text-reveal {
  from { clip-path: inset(0 100% 0 0); }
  to   { clip-path: inset(0 0% 0 0); }
}
.text-reveal {
  animation: text-reveal 700ms var(--ease-out-expo) both;
}

/* ============================================================
   LINE DRAW — SVG stroke animation
   ============================================================ */
@keyframes line-draw {
  from { stroke-dashoffset: 100; }
  to   { stroke-dashoffset: 0; }
}
.line-draw {
  stroke-dasharray: 100;
  animation: line-draw 1s var(--ease-out-quart) both;
}

/* ============================================================
   GRADIENT SHIFT — animated gradient backgrounds
   ============================================================ */
@keyframes gradient-shift {
  0%   { background-position: 0%   50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0%   50%; }
}
.gradient-shift {
  background-size: 200% 200%;
  animation: gradient-shift 6s ease infinite;
}

/* ============================================================
   PAGE LOAD SEQUENCE — stagger classes
   ============================================================ */
.delay-0   { animation-delay:   0ms; }
.delay-50  { animation-delay:  50ms; }
.delay-100 { animation-delay: 100ms; }
.delay-150 { animation-delay: 150ms; }
.delay-200 { animation-delay: 200ms; }
.delay-300 { animation-delay: 300ms; }
.delay-400 { animation-delay: 400ms; }
.delay-500 { animation-delay: 500ms; }
.delay-600 { animation-delay: 600ms; }
.delay-700 { animation-delay: 700ms; }
.delay-800 { animation-delay: 800ms; }
.delay-1000 { animation-delay: 1000ms; }

/* ============================================================
   HOVER LIFT — universal hover elevation
   ============================================================ */
.hover-lift {
  transition: transform 300ms var(--ease-spring), box-shadow 300ms ease;
}
.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

/* ============================================================
   TOOLTIP
   ============================================================ */
[data-tooltip] {
  position: relative;
}
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: var(--color-evergreen);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 600;
  white-space: nowrap;
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius-full);
  pointer-events: none;
  opacity: 0;
  transition: opacity 150ms ease, transform 150ms ease;
  z-index: 100;
}
[data-tooltip]:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ============================================================
   FOCUS VISIBLE — Accessible keyboard focus rings
   ============================================================ */
:focus-visible {
  outline: 2px solid var(--color-bloom);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

:focus:not(:focus-visible) {
  outline: none;
}

/* ============================================================
   REDUCED MOTION — Respect prefers-reduced-motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration:        0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration:       0.01ms !important;
    scroll-behavior:           auto !important;
  }

  .hiq-hero__aurora {
    animation: none;
  }

  #hero-particles {
    display: none;
  }

  [data-reveal] {
    opacity: 1;
    transform: none;
  }
}

/* ============================================================
   PRODUCT CARD BLOOM — the signature hover effect
   ============================================================ */
.hiq-product-card {
  --mouse-x: 50%;
  --mouse-y: 50%;
}

/* Grow sprout effect on card hover */
.hiq-product-card::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 60%;
  height: 3px;
  background: linear-gradient(to right, var(--color-bloom), var(--color-gold), var(--color-bloom));
  border-radius: var(--radius-full);
  transition: transform 400ms var(--ease-spring);
}

.hiq-product-card:hover::after {
  transform: translateX(-50%) scaleX(1);
}

/* ============================================================
   BADGE ENTRANCE
   ============================================================ */
.hiq-badge {
  animation: scale-in-spring 300ms var(--ease-spring) both;
}

/* ============================================================
   MEGA MENU ENTRANCE
   ============================================================ */
.hiq-mega-menu.open {
  animation: fade-down 200ms var(--ease-out-quart) both;
}

/* ============================================================
   TOAST SLIDE UP
   ============================================================ */
.hiq-toast {
  animation: none; /* handled by JS .show class */
}
.hiq-toast.show {
  animation: fade-up 300ms var(--ease-out-quart) both;
}

/* ============================================================
   AGE GATE ENTRANCE
   ============================================================ */
.hiq-age-gate__card {
  animation: scale-in-spring 600ms var(--ease-spring) both;
}

/* ============================================================
   MOBILE MENU SLIDE
   ============================================================ */
.hiq-mobile-menu.open .hiq-mobile-menu__link {
  animation: fade-right 400ms var(--ease-out-quart) both;
}
.hiq-mobile-menu.open .hiq-mobile-menu__link:nth-child(2) { animation-delay: 50ms; }
.hiq-mobile-menu.open .hiq-mobile-menu__link:nth-child(3) { animation-delay: 100ms; }
.hiq-mobile-menu.open .hiq-mobile-menu__link:nth-child(4) { animation-delay: 150ms; }
.hiq-mobile-menu.open .hiq-mobile-menu__link:nth-child(5) { animation-delay: 200ms; }

/* ============================================================
   CART FLYOUT ENTRANCE
   ============================================================ */
.hiq-cart-flyout.open {
  animation: slide-in-right 400ms var(--ease-out-expo) both;
}

/* ============================================================
   COLLECTION CARD IMAGE ZOOM
   ============================================================ */
.hiq-collection-card .hiq-collection-card__bg {
  will-change: transform;
}

/* ============================================================
   NORTHERN AURORA GLOW — applied to section headings
   ============================================================ */
.aurora-text {
  background: linear-gradient(
    135deg,
    var(--color-bloom) 0%,
    var(--color-gold)  50%,
    var(--color-bloom) 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradient-shift 4s linear infinite;
}

/* ============================================================
   RIPPLE EFFECT — buttons
   ============================================================ */
.btn {
  overflow: hidden;
}

.btn .ripple {
  position: absolute;
  border-radius: 50%;
  transform: scale(0);
  animation: ripple-expand 600ms linear;
  background: rgba(255, 255, 255, 0.25);
  pointer-events: none;
}

@keyframes ripple-expand {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* ============================================================
   EXIT INTENT MODAL
   ============================================================ */
#hiq-exit-modal {
  position: fixed;
  inset: 0;
  z-index: 9990;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(24,50,41, 0.7);
  backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms ease;
}

#hiq-exit-modal.show {
  opacity: 1;
  pointer-events: all;
}

#hiq-exit-modal .modal-card {
  background: #fff;
  border-radius: var(--radius-xl);
  padding: clamp(2rem, 5vw, 3.5rem);
  max-width: 500px;
  width: 90%;
  text-align: center;
  animation: scale-in-spring 400ms var(--ease-spring) both;
  position: relative;
}

/* Close (X) button. padding/min-width are reset because the parent
   theme's global `button` padding (10px 20px) squeezed the icon to 0px
   wide, leaving only an empty circle. */
#hiq-exit-modal-close {
  position: absolute;
  top: .875rem;
  right: .875rem;
  width: 40px;
  height: 40px;
  padding: 0;
  min-width: 0;
  border: 0;
  border-radius: 50%;
  background: #F6F1E7;
  color: var(--color-evergreen);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  line-height: 1;
  transition: background-color 150ms ease, color 150ms ease, transform 150ms ease;
}
#hiq-exit-modal-close svg { flex-shrink: 0; display: block; }
#hiq-exit-modal-close:hover {
  background: var(--color-evergreen);
  color: #fff;
  transform: rotate(90deg);
}
#hiq-exit-modal-close:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 2px;
}

/* ============================================================
   STICKY ADD-TO-CART BAR — single product page
   ============================================================ */
.hiq-sticky-atc {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 998;
  background: rgba(248, 246, 240, 0.95);
  backdrop-filter: blur(16px);
  border-top: 1px solid rgba(24,50,41, 0.08);
  padding: 1rem 0;
  transform: translateY(100%);
  transition: transform 400ms var(--ease-out-quart);
}

.hiq-sticky-atc.visible {
  transform: translateY(0);
}

/* ============================================================
   WISHLIST HEART PULSE
   ============================================================ */
@keyframes heart-pulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.3); }
}
.heart-pulse {
  animation: heart-pulse 300ms var(--ease-spring);
}

/* ============================================================
   IMAGE LAZY LOAD BLUR-UP
   ============================================================ */
img.lazy {
  filter: blur(12px);
  transition: filter 400ms ease;
}
img.lazy.loaded {
  filter: blur(0);
}

/* ============================================================
   SCROLLBAR STYLING
   ============================================================ */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--color-mist);
}
::-webkit-scrollbar-thumb {
  background: rgba(24,50,41, 0.25);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-bloom);
}

/* Cart flyout scrollbar */
.hiq-cart-flyout__items::-webkit-scrollbar { width: 4px; }
.hiq-cart-flyout__items::-webkit-scrollbar-thumb {
  background: rgba(24,50,41, 0.15);
  border-radius: 2px;
}

/* ============================================================
   PRINT UTILITY
   ============================================================ */
@media print {
  .hiq-nav,
  .hiq-footer,
  .hiq-age-gate,
  .hiq-cart-flyout,
  .hiq-mobile-menu,
  .hiq-toast,
  #hiq-exit-modal,
  .hiq-sticky-atc,
  .hiq-announcement-bar,
  #hero-particles {
    display: none !important;
  }
}
