/* -------------------------------------------
   Google Fonts (مثال Montserrat)
   أضف هذا في رأس الـ HTML أو في ملف CSS منفصل
--------------------------------------------- */
/* @import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;700&display=swap'); */

/* -------------------------------------------
   متغيرات الألوان والخطوط
--------------------------------------------- */
:root {
  --accent-color: #ffffff; /* استبدل الذهبي بالأبيض */
  --footer-bg: #000;       /* خلفية داكنة */
  --footer-text: #fff;     /* نص أبيض */
  --overlay-bg: rgba(255, 255, 255, 0.1); /* تراكب خفيف لزجاجية الخلفية */
  --transition-speed: 0.3s;
  --font-family: 'Montserrat', sans-serif; /* استبدل Montserrat بـ Poppins إن رغبت */
  --back-to-top-bg: #333;   /* خلفية زر العودة إلى الأعلى */
  --back-to-top-hover: var(--accent-color);
}

/* -------------------------------------------
   Advanced Footer Styles - Upgraded
--------------------------------------------- */
.advanced-footer {
  background: var(--footer-bg) !important;
  color: var(--footer-text);
  padding: 60px 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 40px;
  /* Using relative positioning with a low z-index ensures that the footer sits
     behind fixed elements like the header and mobile nav overlay */
  position: relative;
  z-index: 1;
  font-family: var(--font-family);
  transition: background var(--transition-speed) ease;
  backdrop-filter: none;
}

/* إزالة التراكب الشفاف */
.advanced-footer::before {
  display: none;
}

/* تأكيد لون النص داخل الفوتر */
.advanced-footer h1,
.advanced-footer h2,
.advanced-footer h3,
.advanced-footer h4,
.advanced-footer h5,
.advanced-footer h6,
.advanced-footer p,
.advanced-footer li,
.advanced-footer span {
  color: var(--footer-text) !important;
  -webkit-text-fill-color: var(--footer-text) !important;
}

/* أقسام الفوتر */
.advanced-footer .footer-section {
  margin-bottom: 20px;
}
.advanced-footer .footer-section h3 {
  font-size: 1.5rem;
  margin-bottom: 15px;
  position: relative;
  font-weight: 600;
}
.advanced-footer .footer-section h3::after {
  content: "";
  display: block;
  margin: 8px auto 0; /* centers the line under the heading */
  width: 50px;        /* initial fixed width */
  height: 2px;
  background: var(--accent-color);
  transition: width var(--transition-speed) ease;
}
.advanced-footer .footer-section h3:hover::after {
  width: 130px; /* expands only slightly on hover */
}

/* تنسيق الفقرات */
.advanced-footer p {
  font-size: 0.95rem;
  line-height: 1.8;
  margin: 0 0 10px 0;
}

/* تنسيق الروابط مع حالة التركيز للوصولية (Accessibility) */
.advanced-footer a {
  color: var(--footer-text);
  text-decoration: none;
  transition: color var(--transition-speed) ease, transform var(--transition-speed) ease;
}
.advanced-footer a:hover,
.advanced-footer a:focus {
  color: var(--accent-color);
  transform: translateY(-2px);
  outline: none;
}

/* -------------------------------------------
   Newsletter Section تحسين قسم النشرة البريدية
--------------------------------------------- */
.footer-newsletter {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  margin-top: 15px;
}
.footer-newsletter input[type="email"] {
  padding: 10px;
  font-size: 0.95rem;
  width: 100%;
  max-width: 250px;
  border: 1px solid #ccc;
  border-radius: 4px;
  outline: none;
}
.footer-newsletter input[type="email"]:focus {
  border-color: var(--accent-color);
}
.footer-newsletter button {
  padding: 10px 20px;
  background: var(--accent-color);
  color: #000;
  font-weight: 600;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background var(--transition-speed) ease;
}
.footer-newsletter button:hover {
  background: #ffffff;
}

/* -------------------------------------------
   Social Links Styling (أيقونات التواصل الاجتماعي)
--------------------------------------------- */
.advanced-footer .social-links {
  display: flex;
  gap: 15px;
  margin-top: 20px;
  /* Center the social icons */
  justify-content: center;
}
.advanced-footer .social-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 45px;
  height: 45px;
  border: 2px solid var(--footer-text);
  border-radius: 50%;
  transition: background var(--transition-speed) ease, transform var(--transition-speed) ease;
  font-size: 1.2rem;
}
.advanced-footer .social-links a:hover,
.advanced-footer .social-links a:focus {
  background: var(--accent-color);
  color: #000;
  transform: scale(1.1);
}

/* -------------------------------------------
   Payment Icons (ترتيب شعارات الدفع)
--------------------------------------------- */
.payment-icons {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-top: 20px;
}
.payment-icons img {
  max-height: 30px;
  object-fit: contain;
  transition: transform var(--transition-speed) ease;
}
.payment-icons img:hover {
  transform: scale(1.1);
}

/* -------------------------------------------
   Footer Bottom Section (الجزء السفلي)
--------------------------------------------- */
.advanced-footer .footer-bottom {
  grid-column: 1 / -1;
  text-align: center;
  margin-top: 40px;
  font-size: 0.85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.3);
  padding-top: 20px;
}

/* عبارة ختامية - إبراز مع تأثير أنيق */
.footer-message {
  color: var(--accent-color);
  font-weight: 500;
  text-shadow: 0 0 5px rgba(255, 255, 255, 0.6);
  display: inline-block;
}

/* ربط المصمم مع تأثير Hover متقدم */
.advanced-footer .footer-bottom a.designer {
  display: inline-block;
  position: relative;
  transition: text-shadow var(--transition-speed) ease, transform var(--transition-speed) ease;
  color: var(--accent-color);
}
.advanced-footer .footer-bottom a.designer::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 2px;
  background: var(--accent-color);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition-speed) ease;
}
.advanced-footer .footer-bottom a.designer:hover,
.advanced-footer .footer-bottom a.designer:focus {
  text-shadow: 0 0 10px var(--accent-color);
  transform: translateY(-2px);
}
.advanced-footer .footer-bottom a.designer:hover::after,
.advanced-footer .footer-bottom a.designer:focus::after {
  transform: scaleX(1);
}

/* -------------------------------------------
   Back-to-Top Button Styles (زر العودة للأعلى)
--------------------------------------------- */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: var(--back-to-top-bg);
  color: var(--footer-text);
  padding: 10px 15px;
  border: none;
  border-radius: 5px;
  font-family: var(--font-family);
  cursor: pointer;
  transition: background var(--transition-speed) ease, transform var(--transition-speed) ease;
  z-index: 1000;
}
.back-to-top:hover,
.back-to-top:focus {
  background: var(--back-to-top-hover);
  transform: translateY(-3px);
  outline: none;
}

/* -------------------------------------------
   Responsive Adjustments (تجاوب الشاشات الصغيرة)
--------------------------------------------- */
@media (max-width: 768px) {
  .advanced-footer {
    grid-template-columns: 1fr;
    text-align: center;
    background: var(--footer-bg) !important; /* Keep background black for all screen sizes */
    pointer-events: none;
  }
  /* Re-enable pointer events for all interactive elements inside */
  .advanced-footer .footer-bottom,
  .footer-newsletter,
  .advanced-footer a,
  .advanced-footer * {
    pointer-events: auto;
  }
  .footer-newsletter {
    align-items: center;
  }
  .footer-newsletter input[type="email"] {
    max-width: 100%;
  }
}

/* -------------------------------------------
   Mobile Navigation Overlay z-index Adjustment
--------------------------------------------- */
@media screen and (max-width: 768px) {
  .nav-links {
    z-index: 1200;
  }
}

.advanced-footer .social-links img {
  width: 24px; /* Set your desired width */
  height: 24px; /* Set your desired height */
  object-fit: contain; /* Ensure the SVG scales correctly */
}

/* -------------------------------------------
   Custom Payment Icons Layout for Smart & Tablet
--------------------------------------------- */
@media (max-width: 768px) {
  .payment-icons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center; /* centers the icons */
  }
  /* Style the first three icons (Apple Pay, MasterCard, Visa) */
  .payment-icons img:nth-child(-n+3) {
    flex: 0 0 33.33%;
    max-width: 33.33%;
    margin-bottom: 10px; /* optional spacing */
  }
  /* Style the remaining icons in the second row */
  .payment-icons img:nth-child(n+4) {
    flex: 0 0 25%;
    max-width: 25%;
    margin-bottom: 10px; /* optional spacing */
  }
}

/* -------------------------------------------
   Quick Links Adjustments (Remove bullet points & center items)
--------------------------------------------- */
.advanced-footer .quick-links ul {
  list-style: none;
  padding: 0;
  margin: 0 auto;
  text-align: center;
}
.advanced-footer .quick-links ul li {
  margin-bottom: 10px;
}

/* -------------------------------------------
   Center Footer Section Content for Desktop & Tablet
--------------------------------------------- */
@media (min-width: 769px) {
  .advanced-footer .footer-section {
    text-align: center;
  }
}
