/* Footer Dynamic Texts Styling - Inherits from theme CSS variables */
/* الخط يتم وراثته تلقائياً من القالب الأساسي */
.ah-footer{
  position: relative;
  background: var(--td_black, #222);
  color: #e9e9e9;
  padding: 60px 0 28px;
  overflow: hidden;
  font-size: 14px; /* حجم خط أساسي أصغر */
  line-height: 1.6;
  /* font-family يتم وراثته تلقائياً من القالب الأساسي */
}

/* .ah-footer::before{
  content:"";
  position:absolute;
  inset:0;
  background: radial-gradient(1200px 420px at 50% 10%, rgba(255,255,255,.06), transparent 60%);
  pointer-events:none;
} */

/* شريط الملون الصغير أسفل اليسار - يستخدم لون القالب */
.ah-footer::after{
  content:"";
  position:absolute;
  left: 60px;
  bottom: 18px;
  width: 92px;
  height: 4px;
  background: var(--td_theme_color, #e11);
  border-radius: 999px;
  opacity: .95;
}

.ah-footer__container{
  width: min(1200px, calc(100% - 80px));
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.ah-footer__grid{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 48px;
  align-items: start;
}

.ah-footer__title{
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 14px 0;
  color: #ffffff;
  line-height: 1.3;
  font-family: inherit;
}

.ah-footer__brandTop{
  display: flex;
  flex-direction: row-reverse; /* لأن الشعار يمين */
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 10px;
}

.ah-footer__logoBox{
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--td_theme_color, #e11);
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #fff;
  font-size: 18px;
  font-family: inherit;
}

.ah-footer__brandName{
  font-size: 18px;
  font-weight: 800;
  margin: 0;
  color: #fff;
  line-height: 1.2;
  font-family: inherit;
}

.ah-footer__brandTag{
  font-size: 12px;
  color: rgba(255,255,255,.65);
  margin-top: 4px;
  font-family: inherit;
}

.ah-footer__about{
  margin: 12px 0 0;
  max-width: 52ch;
  line-height: 1.7;
  color: rgba(255,255,255,.70);
  font-size: 13px;
  font-family: inherit;
}

.ah-footer__links{
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 14px;
}

.ah-footer__links li{
  margin: 0;
  padding: 0;
}

.ah-footer__links a{
  color: rgba(255,255,255,.65);
  text-decoration: none;
  font-size: 14px;
  transition: color .2s ease, transform .2s ease;
  display: inline-block;
  font-family: inherit;
}

.ah-footer__links a:hover{
  color: var(--td_theme_color, rgba(255,255,255,.92));
  transform: translateX(-2px);
}

/* التواصل: نص ثم أيقونة حمراء على اليمين (كما في الصورة) */
.ah-footer__contact{
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 16px;
}

.ah-footer__contact li{
  display: flex;
  flex-direction: row-reverse;  /* الأيقونة على اليمين في RTL */
  align-items: center;
  gap: 14px;
  justify-content: flex-start;
}

.ah-footer__contactText{
  color: rgba(255,255,255,.70);
  font-size: 14px;
  flex: 1;
  font-family: inherit;
}

.ah-footer__contactText a{
  font-family: inherit;
  font-size: inherit;
}

.ah-footer__contactIcon{
  color: var(--td_theme_color, #e11);
  font-size: 14px;
  line-height: 1;
  flex-shrink: 0;
}

[dir="rtl"] .ah-footer__contact li{
  flex-direction: row-reverse;
}

/* أزرار السوشيال داخل مربعات رمادية */
.ah-footer__social{
  display: flex;
  gap: 18px;
  align-items: center;
  margin-top: 10px;
}

.ah-footer__socialBtn{
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  text-decoration: none;
  color: rgba(255,255,255,.45);
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  transition: transform .2s ease, color .2s ease, background .2s ease;
  font-weight: 800;
  font-family: inherit;
}

.ah-footer__socialBtn svg{
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.ah-footer__socialBtn:hover{
  transform: translateY(-2px);
  color: rgba(255,255,255,.80);
  background: rgba(255,255,255,.06);
}

.ah-footer__bottom{
  margin-top: 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: rgba(255,255,255,.60);
  font-size: 13px;
  padding-top: 6px;
  position: relative;
  font-family: inherit;
}

.ah-footer__bottom p{
  margin: 0;
  flex: 1;
  text-align: right;
  font-family: inherit;
  font-size: inherit;
}

[dir="rtl"] .ah-footer__bottom p{
  text-align: right;
}

[dir="ltr"] .ah-footer__bottom p{
  text-align: left;
}

/* ريسبونسف */
@media (max-width: 1100px){
  .ah-footer__grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ah-footer::after{ left: 24px; }
  
  /* RTL في الشاشات المتوسطة */
  [dir="rtl"] .ah-footer::after,
  html[dir="rtl"] .ah-footer::after,
  body[dir="rtl"] .ah-footer::after,
  body.rtl .ah-footer::after{
    left: auto;
    right: 24px;
  }
}

@media (max-width: 640px){
  .ah-footer{
    padding: 40px 0 20px;
    font-size: 13px;
  }
  
  .ah-footer__grid{ 
    grid-template-columns: 1fr; 
    gap: 32px;
  }
  
  .ah-footer__container{ 
    width: min(1200px, calc(100% - 32px)); 
  }
  
  .ah-footer__social{ 
    flex-wrap: wrap; 
    gap: 12px;
  }
  
  .ah-footer__title{
    font-size: 15px;
    margin-bottom: 12px;
  }
  
  .ah-footer__brandName{
    font-size: 16px;
  }
  
  .ah-footer__logoBox{
    width: 44px;
    height: 44px;
    font-size: 16px;
  }
  
  .ah-footer__socialBtn{
    width: 44px;
    height: 44px;
  }
  
  .ah-footer__socialBtn svg{
    width: 18px;
    height: 18px;
  }
  
  .ah-footer__bottom{
    margin-top: 32px;
    font-size: 12px;
    flex-direction: column;
    text-align: center;
    gap: 12px;
  }
  
  /* RTL في الشاشات الصغيرة */
  [dir="rtl"] .ah-footer::after,
  html[dir="rtl"] .ah-footer::after,
  body[dir="rtl"] .ah-footer::after,
  body.rtl .ah-footer::after{
    left: auto;
    right: 16px;
    bottom: 14px;
  }
  
  [dir="rtl"] .ah-footer__bottom,
  html[dir="rtl"] .ah-footer__bottom,
  body[dir="rtl"] .ah-footer__bottom,
  body.rtl .ah-footer__bottom{
    text-align: center;
  }
  
  [dir="rtl"] .ah-footer__bottom p,
  html[dir="rtl"] .ah-footer__bottom p,
  body[dir="rtl"] .ah-footer__bottom p,
  body.rtl .ah-footer__bottom p{
    text-align: center;
  }
  
  /* اتجاه الشعار في الشاشات الصغيرة */
  [dir="rtl"] .ah-footer__brandTop,
  html[dir="rtl"] .ah-footer__brandTop,
  body[dir="rtl"] .ah-footer__brandTop,
  body.rtl .ah-footer__brandTop{
    flex-direction: row;
  }
  
  /* اتجاه قائمة التواصل */
  [dir="rtl"] .ah-footer__contact li,
  html[dir="rtl"] .ah-footer__contact li,
  body[dir="rtl"] .ah-footer__contact li,
  body.rtl .ah-footer__contact li{
    flex-direction: row-reverse;
  }
}

/* RTL Support */
[dir="rtl"] .ah-footer::after,
html[dir="rtl"] .ah-footer::after{
  left: auto;
  right: 60px;
}

[dir="rtl"] .ah-footer__brandTop,
html[dir="rtl"] .ah-footer__brandTop{
  flex-direction: row;
}

[dir="rtl"] .ah-footer__links a:hover,
html[dir="rtl"] .ah-footer__links a:hover{
  transform: translateX(2px);
}

[dir="rtl"] .ah-footer__bottom p,
html[dir="rtl"] .ah-footer__bottom p{
  text-align: right;
}

@media (max-width: 1100px){
  [dir="rtl"] .ah-footer::after,
  html[dir="rtl"] .ah-footer::after{ 
    right: 24px; 
  }
}

/* Auto RTL detection */
body[dir="rtl"] .ah-footer::after,
body.rtl .ah-footer::after{
  left: auto;
  right: 60px;
}

body[dir="rtl"] .ah-footer__brandTop,
body.rtl .ah-footer__brandTop{
  flex-direction: row;
}

body[dir="rtl"] .ah-footer__links a:hover,
body.rtl .ah-footer__links a:hover{
  transform: translateX(2px);
}

body[dir="rtl"] .ah-footer__bottom p,
body.rtl .ah-footer__bottom p{
  text-align: right;
}

@media (max-width: 1100px){
  body[dir="rtl"] .ah-footer::after,
  body.rtl .ah-footer::after{ 
    right: 24px; 
  }
}
