/* Barneo Products Widget - Animations */

/* Spinner Animation */
@keyframes barneo-spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Product Card Hover Animation */
.barneo-product-card {
  animation: barneo-fade-in 0.3s ease-in-out;
  transition: all var(--barneo-transition-normal);
}

@keyframes barneo-fade-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Pagination Button Hover Animation */
.barneo-pagination-button,
.barneo-pagination-page {
  position: relative;
  overflow: hidden;
  transition: all var(--barneo-transition-normal);
}

.barneo-pagination-button::before,
.barneo-pagination-page::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(59, 130, 246, 0.1),
    transparent
  );
  transition: left var(--barneo-transition-slow);
}

.barneo-pagination-button:hover::before,
.barneo-pagination-page:hover::before {
  left: 100%;
}

/* Loading State Animation */
.barneo-products-loading {
  animation: barneo-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes barneo-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* Empty State Animation */
.barneo-products-empty {
  animation: barneo-slide-up 0.4s ease-out;
}

@keyframes barneo-slide-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Error State Animation */
.barneo-products-error {
  animation: barneo-shake 0.5s ease-in-out;
}

@keyframes barneo-shake {
  0%,
  100% {
    transform: translateX(0);
  }
  10%,
  30%,
  50%,
  70%,
  90% {
    transform: translateX(-5px);
  }
  20%,
  40%,
  60%,
  80% {
    transform: translateX(5px);
  }
}

/* Product Image Loading Animation */
.barneo-product-image {
  position: relative;
}

.barneo-product-image img {
  position: relative;
  z-index: 1;
}

/* Grid Animation */
.adaptive-grid {
  animation: barneo-grid-fade-in 0.5s ease-out;
}

@keyframes barneo-grid-fade-in {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Staggered Animation for Product Cards */
.barneo-product-card {
  animation: barneo-stagger-fade-in 0.3s ease-out;
  animation-fill-mode: both;
}

.barneo-product-card:nth-child(1) {
  animation-delay: 0.1s;
}
.barneo-product-card:nth-child(2) {
  animation-delay: 0.2s;
}
.barneo-product-card:nth-child(3) {
  animation-delay: 0.3s;
}
.barneo-product-card:nth-child(4) {
  animation-delay: 0.4s;
}
.barneo-product-card:nth-child(5) {
  animation-delay: 0.5s;
}
.barneo-product-card:nth-child(6) {
  animation-delay: 0.6s;
}
.barneo-product-card:nth-child(7) {
  animation-delay: 0.7s;
}
.barneo-product-card:nth-child(8) {
  animation-delay: 0.8s;
}
.barneo-product-card:nth-child(9) {
  animation-delay: 0.9s;
}
.barneo-product-card:nth-child(10) {
  animation-delay: 1s;
}
.barneo-product-card:nth-child(11) {
  animation-delay: 1.1s;
}
.barneo-product-card:nth-child(12) {
  animation-delay: 1.2s;
}
.barneo-product-card:nth-child(13) {
  animation-delay: 1.3s;
}
.barneo-product-card:nth-child(14) {
  animation-delay: 1.4s;
}
.barneo-product-card:nth-child(15) {
  animation-delay: 1.5s;
}
.barneo-product-card:nth-child(16) {
  animation-delay: 1.6s;
}
.barneo-product-card:nth-child(17) {
  animation-delay: 1.7s;
}
.barneo-product-card:nth-child(18) {
  animation-delay: 1.8s;
}
.barneo-product-card:nth-child(19) {
  animation-delay: 1.9s;
}
.barneo-product-card:nth-child(20) {
  animation-delay: 2s;
}

@keyframes barneo-stagger-fade-in {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Skeleton Loading Animation */
.barneo-product-skeleton {
  animation: barneo-skeleton-pulse 1.5s ease-in-out infinite;
}

@keyframes barneo-skeleton-pulse {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
  100% {
    opacity: 1;
  }
}
