/* UX Improvement: Add loading skeleton for search results */
/* This improves perceived performance and user experience */

.search-loading-skeleton {
  display: none;
  padding: 20px;
}

.search-loading-skeleton.active {
  display: block;
}

.skeleton-item {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
  animation: pulse 1.5s ease-in-out infinite;
}

.skeleton-image {
  width: 200px;
  height: 200px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  border-radius: 8px;
  animation: shimmer 1.5s ease-in-out infinite;
}

.skeleton-content {
  flex: 1;
}

.skeleton-title {
  height: 24px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  border-radius: 4px;
  margin-bottom: 12px;
  animation: shimmer 1.5s ease-in-out infinite;
}

.skeleton-price {
  height: 32px;
  width: 120px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  border-radius: 4px;
  margin-bottom: 12px;
  animation: shimmer 1.5s ease-in-out infinite;
}

.skeleton-button {
  height: 40px;
  width: 150px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  border-radius: 4px;
  animation: shimmer 1.5s ease-in-out infinite;
}

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

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

/* Recently viewed products feature */
.recently-viewed {
  margin-top: 40px;
  padding: 20px;
  background: #f8f8f8;
  border-radius: 8px;
}

.recently-viewed h3 {
  margin-bottom: 15px;
  font-size: 18px;
  color: #333;
}

.recently-viewed-items {
  display: flex;
  gap: 15px;
  overflow-x: auto;
  padding-bottom: 10px;
}

.recently-viewed-item {
  flex: 0 0 auto;
  width: 150px;
  text-align: center;
}

.recently-viewed-item img {
  width: 150px;
  height: 150px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 8px;
}

.recently-viewed-item .price {
  color: #ff4d4f;
  font-weight: bold;
  font-size: 16px;
}
