/* ============================================================
   Karty | كارتي — Animations & Keyframes
   ============================================================ */

/* ============================================================
   GSAP FALLBACK — ensure nothing stays invisible if CDN fails
   ============================================================ */
.hero__pill,
.hero__headline .line-white,
.hero__headline .line-gradient,
.hero__subheadline,
.hero__ctas .btn,
.trust-item,
.hero__card,
.hero__scroll-indicator {
  /* Default: visible. GSAP overrides this on animation start. */
  opacity: 1;
}

/* ============================================================
   KEYFRAMES
   ============================================================ */

/* Cursor blink (hero typing effect) */
@keyframes cursorBlink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* Cart badge pop */
@keyframes badgePop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.4); }
  70%  { transform: scale(0.9); }
  100% { transform: scale(1); }
}

/* Toast slide in */
@keyframes toastIn {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

@keyframes toastOut {
  from { transform: translateY(0);    opacity: 1; max-height: 120px; margin-bottom: 8px; }
  to   { transform: translateY(20px); opacity: 0; max-height: 0;     margin-bottom: 0;  }
}

/* Shimmer loading skeleton */
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}

/* Success pop */
@keyframes successPop {
  0%   { transform: scale(0) rotate(-20deg); opacity: 0; }
  60%  { transform: scale(1.15) rotate(5deg); }
  80%  { transform: scale(0.95); }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

/* Float (hero cards) */
@keyframes float {
  0%,100% { transform: rotate(-8deg) translateY(-40px) translateX(-20px); }
  50%     { transform: rotate(-8deg) translateY(-52px) translateX(-20px); }
}
@keyframes float2 {
  0%,100% { transform: rotate(3deg) translateY(20px) translateX(20px); }
  50%     { transform: rotate(3deg) translateY(10px) translateX(20px); }
}
@keyframes float3 {
  0%,100% { transform: rotate(-4deg) translateY(60px) translateX(-60px); }
  50%     { transform: rotate(-4deg) translateY(68px) translateX(-60px); }
}

/* Glow pulse */
@keyframes glowPulse {
  0%,100% { opacity: 0.3; transform: scale(1); }
  50%     { opacity: 0.6; transform: scale(1.05); }
}

/* Logo pulse */
@keyframes logoPulse {
  0%,100% { text-shadow: 0 0 8px rgba(0,255,135,0.4); }
  50%     { text-shadow: 0 0 20px rgba(0,255,135,0.8); }
}

/* Slide up (scroll reveal) */
@keyframes slideUp {
  from { transform: translateY(30px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* Clip reveal (section headings) */
@keyframes clipReveal {
  from { clip-path: inset(0 0 100% 0); }
  to   { clip-path: inset(0 0 0% 0); }
}

/* Checkmark draw */
@keyframes checkDraw {
  from { stroke-dashoffset: 100; }
  to   { stroke-dashoffset: 0; }
}

/* Spin (loading states) */
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Scale in */
@keyframes scaleIn {
  from { transform: scale(0.8); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

/* Fade in */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Count up number highlight */
@keyframes numberHighlight {
  0%   { color: var(--text-primary); }
  50%  { color: var(--neon-green); }
  100% { color: var(--text-primary); }
}

/* Neon border travel */
@keyframes neonBorderTravel {
  0%   { background-position: 0% 50%;   }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%;   }
}

/* ============================================================
   HERO FLOATING CARDS
   ============================================================ */
.hero__card--1 { animation: float  4s ease-in-out infinite; }
.hero__card--2 { animation: float2 5s ease-in-out infinite 0.5s; }
.hero__card--3 { animation: float3 6s ease-in-out infinite 1s; }

.hero__glow { animation: glowPulse 4s ease-in-out infinite; }

/* ============================================================
   LOGO PULSE (every 5s)
   ============================================================ */
.navbar__logo-en {
  animation: logoPulse 5s ease-in-out infinite;
}

/* ============================================================
   SCROLL REVEAL BASE CLASSES
   (GSAP overrides these; CSS fallback for no-JS)
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(30px);
}
.reveal.is-visible {
  animation: slideUp 0.65s var(--ease-out) forwards;
}

.reveal-delay-1 { animation-delay: 0.1s; }
.reveal-delay-2 { animation-delay: 0.2s; }
.reveal-delay-3 { animation-delay: 0.3s; }

/* ============================================================
   PRODUCT CARD ENHANCEMENTS
   ============================================================ */
.product-card:hover {
  box-shadow:
    0 0 0 1px rgba(0,255,135,0.2),
    0 0 30px rgba(0,255,135,0.12),
    var(--shadow-card);
}

/* Add to cart ripple */
.btn--primary:active::after {
  transform: scale(2.5);
  opacity: 0;
  transition: transform 0.5s ease-out, opacity 0.5s ease-out;
}

/* ============================================================
   LOADING SPINNER
   ============================================================ */
.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(0,255,135,0.2);
  border-top-color: var(--neon-green);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
  vertical-align: middle;
}
.spinner--sm {
  width: 16px;
  height: 16px;
  border-width: 2px;
}
.spinner--lg {
  width: 40px;
  height: 40px;
  border-width: 4px;
}

/* ============================================================
   STEP CONNECTOR ANIMATION
   ============================================================ */
.step-connector {
  color: var(--neon-green);
  opacity: 0.4;
  animation: glowPulse 2s ease-in-out infinite;
}

/* ============================================================
   CATEGORY CARD HOVER GLOW
   ============================================================ */
.category-card:hover {
  box-shadow:
    0 0 20px rgba(0,255,135,0.15),
    0 4px 16px rgba(0,0,0,0.3);
}

/* ============================================================
   NAVBAR SCROLL STATE
   ============================================================ */
.navbar {
  transition:
    background 0.3s ease,
    box-shadow 0.3s ease;
}

/* ============================================================
   MOBILE MENU LINK STAGGER
   ============================================================ */
.mobile-menu--open .mobile-menu__link:nth-child(1) { animation: slideUp 0.3s ease 0.05s both; }
.mobile-menu--open .mobile-menu__link:nth-child(2) { animation: slideUp 0.3s ease 0.10s both; }
.mobile-menu--open .mobile-menu__link:nth-child(3) { animation: slideUp 0.3s ease 0.15s both; }
.mobile-menu--open .mobile-menu__link:nth-child(4) { animation: slideUp 0.3s ease 0.20s both; }
.mobile-menu--open .mobile-menu__link:nth-child(5) { animation: slideUp 0.3s ease 0.25s both; }
.mobile-menu--open .mobile-menu__link:nth-child(6) { animation: slideUp 0.3s ease 0.30s both; }
.mobile-menu--open .mobile-menu__link:nth-child(7) { animation: slideUp 0.3s ease 0.35s both; }
.mobile-menu--open .mobile-menu__link:nth-child(8) { animation: slideUp 0.3s ease 0.40s both; }

/* ============================================================
   STAT CARD HIGHLIGHT
   ============================================================ */
.stat-card__number { transition: color 0.3s; }

/* ============================================================
   PAGE TRANSITION
   ============================================================ */
.page-transition {
  position: fixed;
  inset: 0;
  background: var(--bg-primary);
  z-index: 9998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.page-transition--active {
  opacity: 1;
  pointer-events: all;
}

/* ============================================================
   NEON BORDER ANIMATED (product card selected)
   ============================================================ */
.neon-border-animated {
  position: relative;
}
.neon-border-animated::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--neon-green), var(--neon-cyan), var(--neon-purple), var(--neon-green));
  background-size: 200% 200%;
  animation: neonBorderTravel 3s linear infinite;
  z-index: -1;
}

/* ============================================================
   CURRENCY FLIP
   ============================================================ */
.price-flip {
  animation: priceFlip 0.3s ease;
}
@keyframes priceFlip {
  0%   { transform: rotateX(0deg);   opacity: 1; }
  50%  { transform: rotateX(90deg);  opacity: 0; }
  100% { transform: rotateX(0deg);   opacity: 1; }
}

/* ============================================================
   REDUCED MOTION — DISABLE ALL ANIMATIONS
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .hero__card--1,
  .hero__card--2,
  .hero__card--3,
  .hero__glow,
  .navbar__logo-en,
  .step-connector,
  .spinner {
    animation: none !important;
  }

  .mobile-menu--open .mobile-menu__link {
    animation: none !important;
    opacity: 1;
  }

  .reveal, .reveal.is-visible {
    animation: none !important;
    opacity: 1;
    transform: none;
  }
}
