/* استدعاء خط تجوال من جوجل */
@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@500;700&display=swap');

/* إعدادات السيكشن الأساسية (بعرض الشاشة بالكامل 100%) */
.custom-categories-section {
  position: relative;
  width: 100%; /* العرض الكامل */
  margin: 50px 0; /* مسافة من فوق وتحت بدون هوامش جانبية */
  font-family: 'Tajawal', sans-serif;
}

/* صورة الخلفية العريضة (بدون حواف دائرية لتمتد للآخر) */
.categories-bg {
  position: absolute;
  top: 0; 
  left: 0; 
  width: 100%; 
  height: 400px; 
  background-size: cover; 
  background-position: center; 
  z-index: 1;
  overflow: hidden;
}

/* طبقة التغبيش الداكنة فوق الخلفية */
.bg-overlay {
  position: absolute; 
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

/* حاوية الكروت الـ 4 */
.categories-wrapper {
  position: relative; 
  z-index: 2; 
  display: flex; 
  justify-content: center; 
  gap: 20px; 
  width: 100%; 
  padding-top: 180px; 
  padding-bottom: 40px; 
  padding-left: 20px; /* لحماية الكروت من الالتصاق بالشاشة في بعض الأجهزة */
  padding-right: 20px;
}

/* تصميم كارت التصنيف الواحد */
.category-card {
  display: block; 
  width: 280px; 
  height: 420px; 
  border-radius: 16px; 
  overflow: hidden;
  position: relative; 
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease; 
  flex-shrink: 0; 
  text-decoration: none;
}

.category-card:hover { 
  transform: translateY(-10px); 
}

.category-card img { 
  width: 100%; 
  height: 100%; 
  object-fit: cover; 
  transition: transform 0.5s ease; 
}

.category-card:hover img { 
  transform: scale(1.06); 
}

/* اسم التصنيف (الزر الأبيض) */
.category-title {
  position: absolute; 
  bottom: 25px; 
  left: 50%; 
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.95); 
  color: #111; 
  padding: 10px 30px;
  border-radius: 30px; 
  font-size: 18px; 
  font-weight: 700; 
  white-space: nowrap;
}

/* ======================================================== */
/* شاشات الجوال (Mobile Responsive) */
/* ======================================================== */
@media (max-width: 991px) {
  .custom-categories-section { 
    margin: 30px 0; 
  }
  
  .categories-bg { 
    height: 350px; 
  }
  
  /* تحويل الـ 4 كروت لتمرير أفقي سلس في الموبايل */
  .categories-wrapper {
    justify-content: flex-start; 
    overflow-x: auto; 
    scroll-snap-type: x mandatory;
    gap: 15px; 
    padding-top: 150px; 
    padding-left: 15px; 
    padding-right: 15px;
    -ms-overflow-style: none; 
    scrollbar-width: none;
  }
  .categories-wrapper::-webkit-scrollbar { display: none; }
  
  .category-card { 
    width: 250px; 
    height: 380px; 
    scroll-snap-align: center; 
  }
  
  .category-title { 
    font-size: 16px; 
    bottom: 20px; 
  }
}