/* =====================================================
   إصلاح القسم الأبيض الأخير والفوتر — مليون كارد
===================================================== */

/* استهداف آخر قسم في الصفحة الرئيسية */
body.home #main-content > section:last-of-type,
body.index #main-content > section:last-of-type,
#main-content > section:last-of-type,
main > section:last-of-type {
  min-height: auto !important;
  margin: 0 !important;
  padding: 55px 20px !important;

  color: #ffffff !important;

  background:
    radial-gradient(
      circle at 50% 0%,
      rgba(212, 175, 55, 0.08),
      transparent 28rem
    ),
    linear-gradient(
      180deg,
      #111111,
      #090909
    ) !important;

  border-top:
    1px solid rgba(212, 175, 55, 0.18) !important;

  border-bottom:
    1px solid rgba(212, 175, 55, 0.18) !important;
}

/* إزالة الخلفية البيضاء من الحاويات الداخلية */
body.home #main-content > section:last-of-type > div,
body.index #main-content > section:last-of-type > div,
#main-content > section:last-of-type > div,
main > section:last-of-type > div {
  color: #ffffff !important;
  background-color: transparent !important;
}

/* معالجة كلاسات الخلفيات البيضاء والرمادية داخل القسم */
#main-content > section:last-of-type
:is(
  .bg-white,
  .bg-gray-50,
  .bg-gray-100,
  .bg-slate-50,
  .bg-neutral-50
),
main > section:last-of-type
:is(
  .bg-white,
  .bg-gray-50,
  .bg-gray-100,
  .bg-slate-50,
  .bg-neutral-50
) {
  background-color: transparent !important;
}

/* بطاقات القسم الست */
#main-content > section:last-of-type .grid > *,
main > section:last-of-type .grid > * {
  color: #ffffff !important;

  background:
    linear-gradient(
      145deg,
      #1a1a1a,
      #0d0d0d
    ) !important;

  border:
    1px solid rgba(212, 175, 55, 0.28) !important;

  border-radius: 18px !important;

  box-shadow:
    0 14px 34px rgba(0, 0, 0, 0.28) !important;

  transition:
    transform 0.3s ease,
    border-color 0.3s ease,
    box-shadow 0.3s ease !important;
}

/* حركة البطاقات */
#main-content > section:last-of-type .grid > *:hover,
main > section:last-of-type .grid > *:hover {
  transform: translateY(-6px);

  border-color:
    rgba(245, 215, 122, 0.8) !important;

  box-shadow:
    0 19px 42px rgba(0, 0, 0, 0.34),
    0 0 24px rgba(212, 175, 55, 0.09) !important;
}

/* عناوين القسم والبطاقات */
#main-content > section:last-of-type h2,
#main-content > section:last-of-type h3,
#main-content > section:last-of-type h4,
main > section:last-of-type h2,
main > section:last-of-type h3,
main > section:last-of-type h4 {
  color: #ffffff !important;
  font-weight: 800 !important;
}

/* عنوان القسم الرئيسي */
#main-content > section:last-of-type > div > h2,
#main-content > section:last-of-type header h2,
main > section:last-of-type > div > h2,
main > section:last-of-type header h2 {
  color: #f5d77a !important;
  font-weight: 900 !important;
}

/* وصف البطاقات */
#main-content > section:last-of-type p,
main > section:last-of-type p {
  color: #bdbdbd !important;
  line-height: 1.9 !important;
}

/* دوائر الأيقونات */
#main-content > section:last-of-type .grid > *
:is(
  [class*="icon"],
  [class*="Icon"]
),
main > section:last-of-type .grid > *
:is(
  [class*="icon"],
  [class*="Icon"]
) {
  color: #d4af37 !important;

  background:
    rgba(212, 175, 55, 0.1) !important;

  border:
    1px solid rgba(212, 175, 55, 0.3) !important;
}

/* توحيد الأيقونات بالذهبي */
#main-content > section:last-of-type svg,
#main-content > section:last-of-type i,
main > section:last-of-type svg,
main > section:last-of-type i {
  color: #d4af37 !important;
  stroke: currentColor !important;
}

/* معالجة الخلفية المكتوبة مباشرة داخل HTML */
#main-content > section:last-of-type
[style*="background-color: rgb(255"],
#main-content > section:last-of-type
[style*="background-color:#fff"],
#main-content > section:last-of-type
[style*="background-color: #fff"],
main > section:last-of-type
[style*="background-color: rgb(255"],
main > section:last-of-type
[style*="background-color:#fff"],
main > section:last-of-type
[style*="background-color: #fff"] {
  background-color: transparent !important;
}

/* =====================================================
   تقليل الفراغ الكبير قبل الفوتر
===================================================== */

.store-footer,
footer.store-footer,
footer {
  min-height: auto !important;
  margin-top: 0 !important;
  padding-top: 35px !important;
}

/* حاويات الفوتر الداخلية */
.store-footer > div,
footer.store-footer > div,
.store-footer .container,
footer.store-footer .container,
.store-footer__inner,
.footer-container,
.footer-wrapper {
  min-height: auto !important;
  margin-top: 0 !important;
  padding-top: 20px !important;
}

/* زر العودة للأعلى */
.store-footer .back-to-top,
.store-footer .scroll-to-top,
footer .back-to-top,
footer .scroll-to-top {
  margin-top: 0 !important;
  margin-bottom: 28px !important;
}

/* منع أي عنصر فارغ من صناعة مساحة كبيرة */
.store-footer > div:empty,
footer.store-footer > div:empty,
#main-content > section:last-of-type + div:empty {
  display: none !important;
}

/* الجوال */
@media (max-width: 767px) {
  body.home #main-content > section:last-of-type,
  body.index #main-content > section:last-of-type,
  #main-content > section:last-of-type,
  main > section:last-of-type {
    padding: 38px 14px !important;
  }

  #main-content > section:last-of-type .grid > *,
  main > section:last-of-type .grid > * {
    border-radius: 14px !important;
  }

  .store-footer,
  footer.store-footer,
  footer {
    padding-top: 25px !important;
  }
}