/* إجبار ترتيب الطبقات */
#main-links-2 .luna-categories-category.swiper-slide {
  position: relative;            /* مهم عشان الأوفرلاي يتمدد فوقها */
  overflow: hidden;
}
#main-links-2 .luna-categories-category.swiper-slide img,
#main-links-2 .luna-categories-category.swiper-slide .image {
  display: block;
  width: 100%;
  height: auto;
  z-index: 1;
}

/* طبقة النص فوق الصورة دائماً */
#main-links-2 .text {
  position: absolute;            /* أوفـرلاي */
  inset: 0;                      /* top/right/bottom/left = 0 */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;     /* ينزّل النص لتحت */
  padding-bottom: 15px;
  text-align: center;
  z-index: 3;                    /* أعلى من الصورة والتأثيرات */
  pointer-events: none;          /* يمنع لمس النص نفسه بالجوال */
}
#main-links-2 .text * { color: #fff; }

/* العنوان دايم ظاهر بكل الأجهزة */
#main-links-2 .text h4 {
  font-size: 18px;
  line-height: 1.3;
  opacity: 1 !important;
  transform: none !important;
}

/* الوصف ظاهر افتراضياً (ديسكتوب/تابلت) */
#main-links-2 .text span {
  font-size: 12px;
  opacity: 0.9;
  transform: none;
  transition: opacity .35s ease, transform .35s ease;
  pointer-events: auto;
}

/* ——— الجوال: إخفاء الوصف وإظهاره مع الضغط ——— */
@media (max-width: 768px) {
  /* تقسيم: سلايدين */
  #main-links-2 .luna-categories-category.swiper-slide {
    flex: 0 0 50% !important;
    width: 50% !important;
    padding: 0 5px !important;
    box-sizing: border-box;
  }

  /* اخفاء الوصف افتراضياً بالجوال */
  #main-links-2 .text span {
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
  }

  /* إظهاره لما السكربت يضيف show-text على السلايد */
  #main-links-2 .luna-categories-category.swiper-slide.show-text .text span {
    opacity: 0.95;
    transform: translateY(0);
    pointer-events: auto;
  }

  /* (اختياري) تعتيم بسيط للصورة عند ظهور الوصف */
  #main-links-2 .luna-categories-category.swiper-slide img {
    transition: filter .35s ease;
  }
  #main-links-2 .luna-categories-category.swiper-slide.show-text img {
    filter: brightness(0.85);
  }
}

/* تابلت */
@media (min-width: 769px) and (max-width: 1024px) {
  #main-links-2 .luna-categories-category.swiper-slide {
    flex: 0 0 33.333% !important;
    width: 33.333% !important;
  }
  #main-links-2 .text span {
    opacity: 0.9 !important; transform: none !important; pointer-events: auto !important;
  }
}

/* كمبيوتر */
@media (min-width: 1025px) {
  #main-links-2 .luna-categories-category.swiper-slide {
    flex: 0 0 25% !important;
    width: 25% !important;
  }
  #main-links-2 .text span {
    opacity: 0.9 !important; transform: none !important; pointer-events: auto !important;
  }
}