/* Base state for elements before they appear */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

/* Active state when element is in viewport */
.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* Fade in from left */
.reveal-left {
  opacity: 0;
  transform: translateX(-50px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.reveal-left.active {
  opacity: 1;
  transform: translateX(0);
}

/* Fade in from right */
.reveal-right {
  opacity: 0;
  transform: translateX(50px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.reveal-right.active {
  opacity: 1;
  transform: translateX(0);
}

/* Scale up reveal */
.reveal-scale {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.reveal-scale.active {
  opacity: 1;
  transform: scale(1);
}

/* Staggered children animation */
.stagger-children>* {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.stagger-children.active>*:nth-child(1) {
  transition-delay: 0.1s;
}

.stagger-children.active>*:nth-child(2) {
  transition-delay: 0.2s;
}

.stagger-children.active>*:nth-child(3) {
  transition-delay: 0.3s;
}

.stagger-children.active>*:nth-child(4) {
  transition-delay: 0.4s;
}

.stagger-children.active>*:nth-child(5) {
  transition-delay: 0.5s;
}

.stagger-children.active>*:nth-child(6) {
  transition-delay: 0.6s;
}

.stagger-children.active>* {
  opacity: 1;
  transform: translateY(0);
}

/* ─────────────────────────────────────────────────────────
   2. PRODUCT CARD ANIMATIONS
   ───────────────────────────────────────────────────────── */

.bluelly-product-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  overflow: hidden;
}

/* Hover lift effect */
.bluelly-product-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

/* Image container animations */
.bluelly-product-image {
  overflow: hidden;
  position: relative;
  transition: transform 0.3s ease;
}

.bluelly-product-card:hover .bluelly-product-image img {
  transform: scale(1.05);
  transition: transform 0.5s ease;
}

/* Shimmer effect on product image */
.bluelly-product-image::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg,
      transparent,
      rgba(255, 255, 255, 0.1),
      transparent);
  transform: rotate(45deg);
  transition: all 0.6s ease;
  opacity: 0;
}

.bluelly-product-card:hover .bluelly-product-image::before {
  opacity: 1;
  animation: shimmer 1.5s ease-in-out;
}

@keyframes shimmer {
  0% {
    left: -50%;
  }

  100% {
    left: 150%;
  }
}

/* Button animations */
.bluelly-product-actions button {
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.bluelly-product-actions button::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.4s ease, height 0.4s ease;
}

.bluelly-product-actions button:hover::before {
  width: 300px;
  height: 300px;
}

.cart-btn:hover {
  transform: scale(1.1) rotate(5deg);
}

.buy-btn:hover {
  transform: translateX(5px);
}

/* Wishlist heart animation */
.wishlist-icon {
  transition: all 0.3s ease;
  cursor: pointer;
}

.wishlist-icon:hover {
  transform: scale(1.2);
}

.wishlist-icon.active {
  animation: heartBeat 0.6s ease;
  color: #ff4757 !important;
}

@keyframes heartBeat {
  0%, 100% {
    transform: scale(1);
  }

  25% {
    transform: scale(1.3);
  }

  50% {
    transform: scale(1.1);
  }

  75% {
    transform: scale(1.25);
  }
}

/* ─────────────────────────────────────────────────────────
   3. CATEGORY ANIMATIONS
   ───────────────────────────────────────────────────────── */

.category {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}

.category:hover {
  transform: translateY(-10px) scale(1.05);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.category img {
  transition: transform 0.5s ease;
}

.category:hover img {
  transform: rotate(360deg);
}

.category span {
  transition: color 0.3s ease;
}

.category:hover span {
  color: #4A90E2;
}

/* ─────────────────────────────────────────────────────────
   4. HERO SECTION ANIMATIONS
   ───────────────────────────────────────────────────────── */

.hero-text h1 {
  animation: fadeInUp 1s ease-out;
}

.hero-text p {
  animation: fadeInUp 1.2s ease-out;
}

.hero-buttons {
  animation: fadeInUp 1.4s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Button pulse effect */
.primary,
.secondary {
  transition: all 0.3s ease;
  position: relative;
}

.primary::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  box-shadow: 0 0 0 0 rgba(74, 144, 226, 0.7);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(74, 144, 226, 0.7);
  }

  70% {
    box-shadow: 0 0 0 10px rgba(74, 144, 226, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(74, 144, 226, 0);
  }
}

.primary:hover,
.secondary:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

.primary:active,
.secondary:active {
  transform: translateY(0);
}

/* ─────────────────────────────────────────────────────────
   5. SEARCH BAR ANIMATIONS
   ───────────────────────────────────────────────────────── */

.search-bar input {
  transition: all 0.3s ease;
}

.search-bar input:focus {
  transform: scale(1.02);
  box-shadow: 0 5px 20px rgba(74, 144, 226, 0.2);
}

/* Typing indicator */
.search-bar input:focus::placeholder {
  animation: placeholderPulse 2s ease-in-out infinite;
}

@keyframes placeholderPulse {
  0%, 100% {
    opacity: 0.5;
  }

  50% {
    opacity: 1;
  }
}

/* ─────────────────────────────────────────────────────────
   6. TESTIMONIAL ANIMATIONS
   ───────────────────────────────────────────────────────── */

.testimonial-card {
  transition: transform 0.5s ease, box-shadow 0.5s ease;
}

.testimonial-card:hover {
  transform: scale(1.05);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

/* Floating animation for center card */
.testimonial-card.center {
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-10px);
  }
}

/* Stars twinkle effect */
.stars {
  animation: twinkle 2s ease-in-out infinite;
}

@keyframes twinkle {
  0%, 100% {
    opacity: 1;
  }

  50% {
    opacity: 0.7;
  }
}

/* ─────────────────────────────────────────────────────────
   7. WHY CHOOSE US SECTION
   ───────────────────────────────────────────────────────── */

.why-item-exact {
  transition: all 0.3s ease;
  cursor: pointer;
}

.why-item-exact:hover {
  transform: translateY(-15px);
}

.why-item-exact .icon-circle {
  transition: all 0.4s ease;
}

.why-item-exact:hover .icon-circle {
  transform: rotate(360deg) scale(1.1);
  box-shadow: 0 10px 30px rgba(74, 144, 226, 0.3);
}

.why-item-exact img {
  transition: transform 0.3s ease;
}

.why-item-exact:hover img {
  transform: scale(1.2);
}

/* ─────────────────────────────────────────────────────────
   8. LOADING ANIMATIONS
   ───────────────────────────────────────────────────────── */

/* Page load fade in */
body {
  animation: pageLoad 0.5s ease-out;
}

@keyframes pageLoad {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* Skeleton loading for images */
.loading-skeleton {
  background: linear-gradient(90deg,
      #f0f0f0 25%,
      #e0e0e0 50%,
      #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s ease-in-out infinite;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

/* ─────────────────────────────────────────────────────────
   9. FOOTER ANIMATIONS
   ───────────────────────────────────────────────────────── */

.footer-social a {
  transition: all 0.3s ease;
  display: inline-block;
}

.footer-social a:hover {
  transform: translateY(-5px) rotate(10deg);
}

.footer-social svg {
  transition: all 0.3s ease;
}

.footer-social a:hover svg {
  fill: #4A90E2;
  filter: drop-shadow(0 5px 10px rgba(74, 144, 226, 0.3));
}

/* ─────────────────────────────────────────────────────────
   10. NAVBAR ANIMATIONS
   ───────────────────────────────────────────────────────── */

/* Smooth navbar slide in */
nav {
  animation: slideDown 0.5s ease-out;
}

@keyframes slideDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Nav links hover effect */
nav a {
  position: relative;
  transition: color 0.3s ease;
}

nav a::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  width: 0;
  height: 2px;
  background: #4A90E2;
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

nav a:hover::after {
  width: 100%;
}

/* Cart badge pulse */
.cart-badge {
  animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
  0%, 100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.1);
  }
}

/* ─────────────────────────────────────────────────────────
   11. MICRO-INTERACTIONS
   ───────────────────────────────────────────────────────── */

/* Ripple effect on click */
.ripple {
  position: relative;
  overflow: hidden;
}

.ripple::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.ripple:active::after {
  width: 300px;
  height: 300px;
}

/* Smooth color transitions */
* {
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Focus states for accessibility */
button:focus,
a:focus,
input:focus {
  outline: 2px solid #4A90E2;
  outline-offset: 2px;
  transition: outline 0.2s ease;
}

/* ─────────────────────────────────────────────────────────
   12. SPECIAL EFFECTS
   ───────────────────────────────────────────────────────── */

/* Gradient text animation */
.gradient-text {
  background: linear-gradient(90deg,
      #4A90E2,
      #A855F7,
      #EC4899,
      #4A90E2);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientFlow 3s linear infinite;
}

@keyframes gradientFlow {
  0% {
    background-position: 0% center;
  }

  100% {
    background-position: 200% center;
  }
}

/* Parallax scroll effect (add to hero section) */
.parallax {
  transition: transform 0.5s cubic-bezier(0, 0, 0, 1);
}

/* Bounce on scroll into view */
.bounce-in {
  animation: bounceIn 0.8s ease-out;
}

@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: scale(0.3);
  }

  50% {
    opacity: 1;
    transform: scale(1.05);
  }

  70% {
    transform: scale(0.9);
  }

  100% {
    transform: scale(1);
  }
}

/* ─────────────────────────────────────────────────────────
   13. RESPONSIVE ANIMATIONS
   ───────────────────────────────────────────────────────── */

/* Reduce animations on mobile for performance */
@media (max-width: 768px) {

  .reveal,
  .reveal-left,
  .reveal-right,
  .reveal-scale {
    animation-duration: 0.5s;
  }

  /* Disable complex animations on mobile */
  .testimonial-card.center {
    animation: none;
  }

  .primary::after {
    animation: none;
  }
}

/* Respect user preferences for reduced motion */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}