/* ===== قسم المنتجات (Products) - خلفية عامة ===== */
.products-section {
  padding: 100px 0;
  background: #0d1021;     /* نفس لون الـ body الداكن */
  color: #ffffff;
}

/* ===== عنوان ووصف القسم ===== */
.section-header {
  text-align: center;
  margin-bottom: 40px;
}

.section-header .section-title {
  font-size: 2.5rem;
  color: #ffffff;
}

.section-header .section-title span {
  color: #4cc9f0;
}

.section-header .section-subtitle {
  color: #c5c7d0;
  font-size: 1.1rem;
  max-width: 650px;
  margin: 0 auto;
}

/* ===== أزرار الفلترة ===== */
.products-filter {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 50px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 10px 24px;
  border-radius: 30px;
  background: #1a1f3c;
  color: #c5c7d0;
  border: 1px solid #2a2e4c;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
}

.filter-btn:hover,
.filter-btn.active {
  background: #4cc9f0;
  color: #ffffff;
  border-color: #4cc9f0;
  transform: translateY(-2px);
}

/* ===== شبكة المنتجات مع تمرير أفقي ===== */
.products-grid{
  display:grid;
  grid-template-columns:repeat(4,1fr);   /* ⬅️ أربع أعمدة ثابتة */
  gap:20px;
  margin-bottom:40px;
  overflow:visible;          /* لا حاجة للتمرير الأفقي */
  white-space:normal;
}

.product-section {
  margin-bottom: 60px;
}

.product-section > h3.section-title {
  font-size: 1.6rem;
  margin-bottom: 15px;
  color: #ffffff;
}

/* ===== البطاقة ===== */
.product-card {
  display: inline-block;
  vertical-align: top;
  width: 260px;
  margin-left: 20px;
  scroll-snap-align: start;
  background: #1a1f3c;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(0,0,0,0.25);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-card:first-child { margin-left: 0; }

.product-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 28px rgba(0,0,0,0.35);
}

/* صورة المنتج */
.product-image {
  height: 200px;
  overflow: hidden;
  background: #10142a;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.product-card:hover .product-image img {
  transform: scale(1.05);
}

/* محتوى البطاقة */
.product-content {
  padding: 20px;
}

.product-category {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 20px;
  background: rgba(76, 201, 240, 0.15);
  color: #4cc9f0;
  margin-bottom: 10px;
}

.product-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 10px;
  min-height: 48px;      /* ثبات الارتفاع */
}

.product-price {
  font-size: 1.3rem;
  font-weight: 900;
  color: #4cc9f0;
  margin-bottom: 15px;
}

/* زِر الطلب */
.product-meta {
  text-align: center;
}

.product-meta .btn-primary {
  display: inline-block;
  width: 100%;
  padding: 10px 0;
  border-radius: 30px;
  background: #4cc9f0;
  color: #10142a;
  font-weight: 800;
  border: none;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.product-meta .btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 15px rgba(76, 201, 240, 0.35);
}

/* ===== تمرير الشريط ===== */
.products-grid::-webkit-scrollbar {
  height: 8px;
}
.products-grid::-webkit-scrollbar-track {
  background: #1a1f3c;
}
.products-grid::-webkit-scrollbar-thumb {
  background: #2a2e4c;
  border-radius: 10px;
}
.products-grid::-webkit-scrollbar-thumb:hover {
  background: #4cc9f0;
}

/* ===== استجابة (Responsive) ===== */
@media (max-width: 576px) {
  .product-card { width: 220px; }
  .product-title { font-size: 1rem; min-height: 40px; }
  .product-price { font-size: 1.1rem; }
}

/* تخطيط المنتجات بفلاتر جانبية */
.products-layout {
  display: flex;
  gap: 30px;
}

/* القائمة الجانبية */
.products-sidebar {
  width: 240px;
  background: #1a1f3c;
  padding: 20px;
  border-radius: 12px;
  position: sticky;
  top: 120px;
  height: fit-content;
}

/* أزرار الفلاتر داخل الشريط الجانبي */
.products-sidebar .products-filter {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* محتوى المنتجات */
.products-content {
  flex: 1;
}

/* استجابة للجوال */
@media (max-width: 768px) {
  .products-layout {
    flex-direction: column;
  }
  .products-sidebar {
    width: 100%;
    position: static;
  }
}

/* تحسين مظهر صور الهواتف اختياريًا */
#phones-grid .product-image {
  height: 240px;              /* أعلى قليلًا للهواتف */
}
#phones-grid .product-image img {
  object-fit: contain;        /* لعرض الهاتف بالكامل بدون قص */
  background: #0f1330;
}

/* ===== شبكة المنتجات - تحسينات للهواتف ===== */
@media (max-width: 767px) {
  #products #products-grid,
  #products .products-grid,
  #featured-products,
  #phones-grid,
  .products-grid {
    grid-template-columns: repeat(3, minmax(120px, 1fr)) !important;
    gap: 12px !important;
    padding: 12 8px; /* إضافة padding لتجنب الحواف المقطوعة */
    box-sizing: border-box;
    width: 100% !important;
    margin: 0 auto !important;
  }
  
  /* تعديل حجم البطاقة للهواتف */
  .product-card {
    width: 100% !important;
    margin: 0 !important;
    max-width: none !important;
  }
  
  /* تعديل حجم الصورة للهواتف */
  .product-image {
    height: 150px !important;
  }
  
  /* تحسين التخطيط الجانبي للهواتف */
  .products-layout {
    flex-direction: column;
    gap: 20px;
    padding: 0 10px;
  }
  
  .products-sidebar {
    width: 100% !important;
    position: static;
    padding: 15px;
  }
  
  .products-sidebar .products-filter {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .products-sidebar .filter-btn {
    margin: 4px;
    padding: 8px 16px;
    font-size: 0.9rem;
  }
  
  .products-content {
    width: 100%;
  }
}

/* موبايل صغير جداً: عمود واحد */
@media (max-width: 375px) {
  #products #products-grid,
  #products .products-grid,
  #featured-products,
  #phones-grid {
    grid-template-columns: 1fr !important;
    gap: 15px !important;
  }
  
  .products-sidebar .products-filter {
    flex-direction: column;
  }
  
  .products-sidebar .filter-btn {
    width: 100%;
    margin: 5px 0;
  }
}

/* تحسينات إضافية للعرض على جميع الشاشات */
.products-grid {
  display: grid;
  justify-items: center; /* توسيط العناصر */
}

.product-card {
  box-sizing: border-box;
}









