/* ملف تنسيق صفحة المنتجات - products.css */

/* الحاوي الرئيسي للصفحة */
.products-page {
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  min-height: 100vh;
}

.products-page-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* قسم البحث */
.search-section {
  margin-bottom: 2rem;
}

.search-section-inner {
  max-width: 28rem;
  margin: 0 auto;
}

.search-input-container {
  position: relative;
  background: white;
  border-radius: 25px;
  border: 2px solid #e2e8f0;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.search-input-container:focus-within {
  border-color: #4299e1;
  box-shadow: 0 4px 12px rgba(66, 153, 225, 0.15);
}

.products-search-input {
  width: 100%;
  padding: 1rem 3rem 1rem 1.5rem;
  background: transparent;
  border: none;
  border-radius: 25px;
  font-size: 1rem;
}

.search-icon-container {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #718096;
}

.search-icon {
  width: 1.25rem;
  height: 1.25rem;
}

/* المحتوى الرئيسي */
.products-main-content {
  gap: 2rem;
}

/* الشريط الجانبي للمرشحات */
.filters-sidebar {
  width: 100%;
}
.view-product-button {
  background: transparent;
  color: #3b82f6;
  border: 2px solid #3b82f6;
  transition: all 0.2s ease;
}
.cart-button {
  background: linear-gradient(135deg,#0c7fea, #1e40af);
  color: white;
  box-shadow: 0 2px 10px rgba(59, 130, 246, 0.3);
  transition: all 0.2s ease;
  border: none;
}
.cart-button-disabled {
  background: #9ca3af;
  color: white;
  cursor: not-allowed;
}
.buy-now-button {
  background: linear-gradient(135deg,#0c7fea , #ea580c);
  color: white;
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.3);
  transition: all 0.2s ease;
  border: none;
}

@media (min-width: 768px) {
  .filters-sidebar {
    width: 16rem;
  }
}

.filters-container {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border: 1px solid #e2e8f0;
}

.filters-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e2e8f0;
}

.filters-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #2d3748;
}

.filters-toggle-btn {
  padding: 0.5rem;
  color: #4a5568;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.filters-toggle-btn:hover {
  background-color: #f7fafc;
  color: #2d3748;
}

.filter-chevron-icon {
  width: 1.25rem;
  height: 1.25rem;
}

.filters-content {
  space-y: 1.5rem;
}

/* مرشح التصنيفات */
.categories-filter {
  margin-bottom: 2rem;
}

.categories-filter-title {
  font-size: 1rem;
  font-weight: 600;
  color: #4a5568;
  margin-bottom: 1rem;
  gap: 0.5rem;
}

.category-title-icon {
  width: 1rem;
  height: 1rem;
  color: #718096;
}

.categories-list {
  space-y: 0.5rem;
}

.category-item {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  font-size: 0.875rem;
  font-weight: 500;
}

.category-item-active {
  background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
  color: white;
  border-color: #3182ce;
  box-shadow: 0 2px 4px rgba(66, 153, 225, 0.3);
}

.category-item-inactive {
  color: #4a5568;
  border-color: #e2e8f0;
}

.category-item-inactive:hover {
  background-color: #f7fafc;
  border-color: #cbd5e0;
}

/* مرشح السعر */
.price-filter {
  margin-bottom: 2rem;
}

.price-filter-title {
  font-size: 1rem;
  font-weight: 600;
  color: #4a5568;
  margin-bottom: 1rem;
  gap: 0.5rem;
}

.price-title-icon {
  width: 1rem;
  height: 1rem;
  color: #718096;
}

.price-inputs {
  margin-top: 1rem;
}

.price-range-container {
  gap: 0.75rem;
}

.price-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f7fafc;
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

.price-input:focus {
  background: white;
  border-color: #4299e1;
  box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

.price-separator {
  color: #718096;
  font-weight: 500;
}

/* مرشح الترتيب */
.sort-filter {
  margin-bottom: 2rem;
}

.sort-filter-title {
  font-size: 1rem;
  font-weight: 600;
  color: #4a5568;
  margin-bottom: 1rem;
}

.sort-select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: white;
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

.sort-select:focus {
  border-color: #4299e1;
  box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

/* زر تطبيق المرشحات */
.apply-filters-container {
  margin-top: 2rem;
}

.apply-filters-btn {
  width: 100%;
  background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
  color: white;
  padding: 0.875rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
}

.apply-filters-btn:hover {
  background: linear-gradient(135deg, #3182ce 0%, #2c5aa0 100%);
  box-shadow: 0 4px 12px rgba(66, 153, 225, 0.4);
  transform: translateY(-1px);
}

/* منطقة المنتجات */
.products-content {
  padding: 0;
}

.products-header {
  margin-bottom: 2rem;
  text-align: center;
}

.products-page-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: #2d3748;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.products-count-info {
  color: #718096;
  font-size: 1rem;
  margin-bottom: 0;
}

.category-info {
  color: #4299e1;
  font-weight: 600;
}

.search-info {
  color: #38a169;
  font-weight: 600;
}

/* حالة التحميل */
.products-loading {
  gap: 1.5rem;
}

.product-skeleton {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.product-skeleton-image {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.product-skeleton-content {
  padding: 1rem;
  space-y: 0.75rem;
}

.product-skeleton-title {
  height: 1rem;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
  width: 66.666667%;
}

.product-skeleton-description {
  height: 0.75rem;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
  width: 100%;
}

.product-skeleton-price {
  height: 1.25rem;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
  width: 33.333333%;
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* حالة عدم وجود منتجات */
.products-empty-state {
  text-align: center;
  padding: 4rem 2rem;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.products-empty-message {
  color: #718096;
  font-size: 1.125rem;
  font-weight: 500;
}

/* شبكة المنتجات */
.products-grid-container {
  margin-bottom: 3rem;
}

.products-grid {
  gap: 1.5rem;
}

@media (max-width: 768px) {
  .products-grid {
    gap: 1rem;
  }
}

/* بطاقة المنتج */
.product-card-custom {
  height: 100%;
}

.product-card-inner {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border: 1px solid #e2e8f0;
  height: 100%;
  overflow: hidden;
  transition: all 0.3s ease;
}

.product-card-inner:hover {
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  transform: translateY(-4px);
  border-color: #cbd5e0;
}

/* صورة المنتج */
.product-image-container {
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
}

.product-image {
  width: 100%;
  height: 100%;
}

.product-image-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
}

.product-image-placeholder-text {
  color: #a0aec0;
  font-size: 0.875rem;
}

/* شارات المنتج */
.product-badges {
  top: 0.5rem;
  right: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.product-discount-badge {
  background: linear-gradient(135deg, #e53e3e 0%, #c53030 100%);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.5rem;
  border-radius: 9999px;
  box-shadow: 0 2px 4px rgba(229, 62, 62, 0.4);
}

.product-digital-badge {
  background: linear-gradient(135deg, #3182ce 0%, #2c5aa0 100%);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.5rem;
  border-radius: 9999px;
  box-shadow: 0 2px 4px rgba(49, 130, 206, 0.4);
}

/* معلومات المنتج */
.product-info {
  padding: 1.25rem;
}

.product-title {
  font-weight: 600;
  color: #2d3748;
  font-size: 1.125rem;
  margin-bottom: 0.5rem;
}

.product-description {
  color: #718096;
  font-size: 0.875rem;
  margin-bottom: 0.75rem;
  line-height: 1.5;
}

.product-price-container {
  margin-top: auto;
}

/* الترقيم */
.pagination-container {
  margin-top: 3rem;
}

.pagination-nav {
  background: white;
  border-radius: 12px;
  padding: 0.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border: 1px solid #e2e8f0;
  gap: 0.25rem;
}

.pagination-btn {
  padding: 0.75rem 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: white;
  color: #4a5568;
  font-weight: 500;
  cursor: pointer;
  min-width: 2.5rem;
  text-align: center;
}

.pagination-btn:hover:not(:disabled) {
  background: #f7fafc;
  border-color: #cbd5e0;
}

.pagination-btn-active {
  background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
  color: white;
  border-color: #3182ce;
  box-shadow: 0 2px 4px rgba(66, 153, 225, 0.3);
}

.pagination-btn-inactive {
  background: white;
  color: #4a5568;
}

.pagination-prev,
.pagination-next {
  font-weight: 600;
  padding: 0.75rem 1.5rem;
}

.products-error-alert {
  margin-bottom: 2rem;
  border-radius: 8px;
}