/* Skeleton Loader Styles */
.skeleton-loader {
  display: none;
  background: #f6f7f8;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}

.skeleton-loader.show {
  display: block;
}

.skeleton-loader::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

/* Product Card Skeleton */
.skeleton-product-card {
  background-color: #fff;
  padding: 1rem;
  border-radius: 10px;
  box-shadow: 0 0 10px #00000011;
  margin-bottom: 1.5rem;
}

.skeleton-image {
  width: 100%;
  height: 200px;
  background-color: #e0e0e0;
  border-radius: 6px;
  margin-bottom: 0.75rem;
}

.skeleton-title {
  width: 80%;
  height: 20px;
  background-color: #e0e0e0;
  border-radius: 4px;
  margin-bottom: 0.5rem;
}

.skeleton-description {
  width: 100%;
  height: 16px;
  background-color: #e0e0e0;
  border-radius: 4px;
  margin-bottom: 0.25rem;
}

.skeleton-description:nth-child(3) {
  width: 70%;
}

.skeleton-description:nth-child(4) {
  width: 90%;
}

.skeleton-link {
  width: 30%;
  height: 16px;
  background-color: #e0e0e0;
  border-radius: 4px;
  margin-top: 0.5rem;
}

/* Category Sidebar Skeleton */
.skeleton-sidebar {
  flex: 1;
  min-width: 250px;
  background-color: #fff;
  box-shadow: rgba(0, 0, 0, 0.35) 0px 5px 15px;
  padding: 1rem;
}

.skeleton-sidebar-header {
  width: 60%;
  height: 24px;
  background-color: #e0e0e0;
  border-radius: 4px;
  margin-bottom: 1rem;
}

.skeleton-category-tab {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  background-color: #f8f9fa;
  border-radius: 4px;
}

.skeleton-category-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-color: #e0e0e0;
}

.skeleton-category-name {
  width: 70%;
  height: 18px;
  background-color: #e0e0e0;
  border-radius: 4px;
}

/* Loading Overlay for Products Only */
.loading-overlay {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  height: 100% !important;
  background-color: rgba(255, 255, 255, 0.8) !important;
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 99999 !important;
  margin: 0 !important;
  padding: 0 !important;
  box-sizing: border-box !important;
}

/* Products Grid Loading State */
.products-loading {
  position: relative;
  min-height: 400px;
}

.loading-overlay.show {
  display: flex !important;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #263823;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  position: relative;
  z-index: 100000;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Grid Layout for Skeleton */
.skeleton-products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .skeleton-products-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
  }
  
  .skeleton-image {
    height: 150px;
  }
}
