/* =============================================================
   animations.css  —  حركات احترافية لكامل الموقع
   ============================================================= */

/* =============================================
   1. SCROLL-REVEAL BASE CLASSES
   ============================================= */

/* Hidden state (before entering viewport) */
.reveal {
  opacity: 0;
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

.reveal.from-bottom  { transform: translateY(50px); }
.reveal.from-right   { transform: translateX(60px); }
.reveal.from-left    { transform: translateX(-60px); }
.reveal.scale-in     { transform: scale(0.85); }
.reveal.rotate-in    { transform: rotate(-6deg) scale(0.9); }

/* Visible state */
.reveal.visible {
  opacity: 1;
  transform: none;
}

/* Stagger delays for grid children */
.reveal-stagger > *:nth-child(1)  { transition-delay: 0s; }
.reveal-stagger > *:nth-child(2)  { transition-delay: 0.1s; }
.reveal-stagger > *:nth-child(3)  { transition-delay: 0.18s; }
.reveal-stagger > *:nth-child(4)  { transition-delay: 0.26s; }
.reveal-stagger > *:nth-child(5)  { transition-delay: 0.34s; }
.reveal-stagger > *:nth-child(6)  { transition-delay: 0.42s; }
.reveal-stagger > *:nth-child(7)  { transition-delay: 0.50s; }
.reveal-stagger > *:nth-child(8)  { transition-delay: 0.58s; }

/* =============================================
   2. HERO SECTION — ANIMATED TEXT ENTRANCE
   ============================================= */

/* Animate each child element staggered inside active slide */
.slide.active .hero-content .subtitle {
  animation: heroSubIn 0.7s cubic-bezier(0.22,1,0.36,1) both;
  animation-delay: 0.35s;
}

.slide.active .hero-content h1 {
  animation: heroTitleIn 0.8s cubic-bezier(0.22,1,0.36,1) both;
  animation-delay: 0.5s;
}

.slide.active .hero-content p {
  animation: heroParaIn 0.8s cubic-bezier(0.22,1,0.36,1) both;
  animation-delay: 0.65s;
}

.slide.active .hero-content .hero-btns {
  animation: heroParaIn 0.8s cubic-bezier(0.22,1,0.36,1) both;
  animation-delay: 0.8s;
}

@keyframes heroSubIn {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: none; }
}

@keyframes heroTitleIn {
  from { opacity: 0; transform: translateY(30px) skewY(2deg); }
  to   { opacity: 1; transform: none; }
}

@keyframes heroParaIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: none; }
}

/* =============================================
   3. SECTION TITLE — ANIMATED UNDERLINE
   ============================================= */

.section-title h2::after {
  transition: width 0.6s cubic-bezier(0.22,1,0.36,1);
  width: 0;
}

.section-title.line-animate h2::after {
  width: 60px;
}

/* =============================================
   4. SALE BADGE — PULSE & BOUNCE
   ============================================= */

.sale-badge {
  animation: badgeBounce 2.5s ease-in-out infinite;
}

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

/* =============================================
   5. PRODUCT CARD — HOVER LIFT + SPOTLIGHT
   ============================================= */

.product-card {
  transition: transform 0.35s cubic-bezier(0.22,1,0.36,1),
              box-shadow 0.35s ease;
  position: relative;
  overflow: hidden;
}

/* Shine sweep on hover */
.product-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -80%;
  width: 60%;
  height: 100%;
  background: linear-gradient(120deg,
    transparent 30%,
    rgba(255,255,255,0.18) 50%,
    transparent 70%);
  transform: skewX(-18deg);
  transition: left 0.55s ease;
  z-index: 1;
  pointer-events: none;
}

.product-card:hover::before {
  left: 120%;
}

.product-card:hover {
  transform: translateY(-8px) scale(1.015);
  box-shadow: 0 20px 40px rgba(233,30,99,0.14);
}

/* =============================================
   6. CATEGORY CARD — 3D TILT HINT
   ============================================= */

.category-card {
  transition: transform 0.4s cubic-bezier(0.22,1,0.36,1),
              box-shadow 0.4s ease;
}

.category-card:hover {
  transform: translateY(-10px) scale(1.04);
  box-shadow: 0 18px 38px rgba(233,30,99,0.15);
}

/* =============================================
   7. WHY-US CARDS — ICON BOUNCE
   ============================================= */

.why-card:hover .why-icon {
  animation: iconBounce 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes iconBounce {
  0%   { transform: scale(1); }
  30%  { transform: scale(1.25) rotate(-8deg); }
  60%  { transform: scale(0.95) rotate(5deg); }
  100% { transform: scale(1) rotate(0); }
}

/* =============================================
   8. BUTTON — RIPPLE EFFECT
   ============================================= */

.btn {
  position: relative;
  overflow: hidden;
}

.btn .ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.35);
  transform: scale(0);
  animation: rippleEffect 0.55s linear;
  pointer-events: none;
}

@keyframes rippleEffect {
  to { transform: scale(4); opacity: 0; }
}

/* =============================================
   9. TESTIMONIAL CARD — FLOAT
   ============================================= */

.testimonial-card {
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.testimonial-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 36px rgba(233,30,99,0.12);
}

/* =============================================
   10. TRUST BAR ICONS — SPIN ON HOVER
   ============================================= */

.trust-item:hover .trust-icon {
  animation: trustSpin 0.6s ease both;
}

@keyframes trustSpin {
  from { transform: rotate(0deg) scale(1); }
  50%  { transform: rotate(20deg) scale(1.15); }
  to   { transform: rotate(0deg) scale(1); }
}

/* =============================================
   11. ADD-TO-CART BUTTON — POP CONFIRMATION
   ============================================= */

.add-to-cart-btn.pop-animate {
  animation: cartPop 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes cartPop {
  0%   { transform: scale(1); }
  40%  { transform: scale(0.88); }
  70%  { transform: scale(1.1); }
  100% { transform: scale(1); }
}

/* =============================================
   12. CART BADGE — BOUNCE
   ============================================= */

.cart-badge.badge-pop {
  animation: badgePop 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes badgePop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.55); }
  100% { transform: scale(1); }
}

/* =============================================
   13. HERO FLOATING ELEMENTS (decorative blobs)
   ============================================= */

.hero-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.18;
  pointer-events: none;
  z-index: 0;
  animation: blobFloat 8s ease-in-out infinite alternate;
}

.hero-blob-1 {
  width: 400px; height: 400px;
  background: #e91e63;
  top: -80px; right: -100px;
  animation-delay: 0s;
}

.hero-blob-2 {
  width: 300px; height: 300px;
  background: #ff80ab;
  bottom: -60px; left: -80px;
  animation-delay: 2s;
}

@keyframes blobFloat {
  from { transform: translate(0,0) scale(1); }
  to   { transform: translate(30px, 20px) scale(1.08); }
}

/* =============================================
   14. SCROLL-PROGRESS BAR
   ============================================= */

#scroll-progress-bar {
  position: fixed;
  top: 0;
  right: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, #E91E63, #ff80ab, #E91E63);
  background-size: 200% 100%;
  z-index: 9999;
  transition: width 0.1s linear;
  animation: progressGlow 2s linear infinite;
}

@keyframes progressGlow {
  0%   { background-position: 0% 0%; }
  100% { background-position: 200% 0%; }
}

/* =============================================
   15. COUNTER NUMBERS — ANIMATE
   ============================================= */

.stat-number {
  display: inline-block;
  transition: color 0.3s;
}

/* =============================================
   16. FOOTER LINKS — UNDERLINE SLIDE
   ============================================= */

.footer-col ul a {
  position: relative;
  display: inline-block;
}

.footer-col ul a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  right: 0;
  width: 0;
  height: 2px;
  background: var(--color-primary);
  transition: width 0.3s ease;
}

.footer-col ul a:hover::after {
  width: 100%;
}

/* =============================================
   17. WISHLIST HEART — HEARTBEAT
   ============================================= */

.wishlist-btn.active {
  animation: heartbeat 0.5s ease both;
}

@keyframes heartbeat {
  0%   { transform: scale(1); }
  30%  { transform: scale(1.35); }
  60%  { transform: scale(0.9); }
  100% { transform: scale(1); }
}

/* =============================================
   18. TOP-BAR — PROFESSIONAL ANIMATIONS
   ============================================= */

@keyframes topBarGradient {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes topBarShimmer {
  0%   { left: -80%; opacity: 0; }
  20%  { opacity: 1; }
  80%  { opacity: 1; }
  100% { left: 110%; opacity: 0; }
}

@keyframes topBarItemIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes iconFloat {
  0%, 100% { transform: translateY(0) scale(1); }
  40%       { transform: translateY(-4px) scale(1.15); }
  60%       { transform: translateY(-2px) scale(1.08); }
}

@keyframes topBarTicker {
  0%    { opacity: 0; transform: translateY(10px); }
  4%    { opacity: 1; transform: translateY(0); }
  21%   { opacity: 1; transform: translateY(0); }
  25%   { opacity: 0; transform: translateY(-10px); }
  100%  { opacity: 0; transform: translateY(-10px); }
}

/* =============================================
   19. HEADER LOGO — COLOR SHIFT
   ============================================= */

.logo span {
  display: inline-block;
  animation: logoColor 4s ease-in-out infinite alternate;
}

@keyframes logoColor {
  from { color: var(--color-primary); }
  to   { color: #ff4081; text-shadow: 0 0 12px rgba(233,30,99,0.4); }
}

/* =============================================
   20. BACK-TO-TOP — BOUNCE
   ============================================= */

.back-to-top.visible {
  animation: btnFloat 2.5s ease-in-out infinite;
}

@keyframes btnFloat {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-6px); }
}

/* =============================================
   21. PAGE LOADING CURTAIN
   ============================================= */

#page-curtain {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #fff, #fce4ec);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
  animation: none;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

#page-curtain.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.curtain-logo {
  font-size: 2.8rem;
  font-weight: 800;
  font-family: 'Cairo', sans-serif;
  color: var(--color-primary, #E91E63);
  animation: logoPulse 1s ease-in-out infinite alternate;
}

.curtain-logo span { opacity: 0.5; }

.curtain-bar {
  width: 120px;
  height: 4px;
  background: #f5d0dc;
  border-radius: 4px;
  overflow: hidden;
}

.curtain-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #E91E63, #ff80ab);
  border-radius: 4px;
  animation: curtainLoad 1.2s cubic-bezier(0.22,1,0.36,1) forwards;
}

@keyframes curtainLoad {
  to { width: 100%; }
}

@keyframes logoPulse {
  from { opacity: 0.7; transform: scale(0.97); }
  to   { opacity: 1; transform: scale(1.03); }
}

/* =============================================
   22. PROMO BANNER — GLITTER EFFECT
   ============================================= */

.promo-inner {
  position: relative;
  overflow: hidden;
}

.promo-inner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg,
    transparent 20%,
    rgba(255,255,255,0.12) 40%,
    transparent 60%);
  animation: promShine 3.5s ease-in-out infinite;
  pointer-events: none;
}

@keyframes promShine {
  0%   { transform: translateX(-100%); }
  60%  { transform: translateX(160%); }
  100% { transform: translateX(160%); }
}

/* =============================================
   REDUCED MOTION: respect user preference
   ============================================= */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
