/* ============ Footer Styles ============ */
/* از رنگ‌ها و فونت‌های main.css استفاده می‌کنیم */

.site-footer {
  background: var(--color-bg);
  color: var(--color-white);
}

.site-footer__inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: clamp(28px, 5vw, 64px) clamp(16px, 3vw, 32px);
}

/* لایه‌بندی بالا: برند در راست، ستون‌ها در چپ (هم‌راستا با تصویر) */
.footer__top {
  display: flex;
  flex-wrap: wrap;
  flex-direction: row; /* برند سمت راست */
  align-items: flex-start;
  gap: clamp(20px, 1vw, 56px);
}

/* برند */
.footer-brand {
  min-width: 240px;
  max-width: 320px;
}

.brand-logo img {
  display: block;
  width: 180px;
  height: auto;
  margin: 0 0 43px 0;
}

.brand-caption {
  margin: 0 0 8px 0;
  font-size: 14px;
  line-height: 1.9;
  color: var(--color-white);
  font-weight: 600;
}

/* شبکه‌های اجتماعی */
.social {
  display: flex;
  gap: 16px;
}

.social__link {
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.9);
  background: transparent;
  text-decoration: none;
  transition: transform .18s ease, border-color .18s ease, background-color .18s ease, color .18s ease;
}

.social__link img{
    height: 18px;
}

.social__link:hover,
.social__link:focus-visible {
  background: var(--color-btn-bg);
  border-color: rgba(255,255,255,0.38);
  color: var(--color-link-hover);
  transform: translateY(-2px);
  outline: none;
}

/* ستون‌های لینک */
.footer-col {
  min-width: 190px;
  flex: 1 1 200px;
}

.footer-title {
  margin: 0 0 14px 0;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -.1px;
}

.footer-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-list li + li {
  margin-top: 12px;
}

.footer-list a {
  display: inline-block;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 16px;
  line-height: 1.85;
  transition: color .18s ease, transform .18s ease;
    font-weight: 600;
}

.footer-list a:hover,
.footer-list a:focus-visible {
  color: var(--color-link-hover);
  transform: translateX(-2px); /* در RTL کمی به چپ می‌رود شبیه نمونه */
  outline: none;
}

/* خط بسیار ملایم بالای فوتر (اختیاری) */
/*
.site-footer {
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}
*/

/* ---------- ریسپانسیو ---------- */

/* تبلت کوچک: کمی جمع‌وجورتر */
@media (max-width: 720px) {
  .brand-logo img { width: 160px; }

  /* در موبایل/تبلت کوچک: تبدیل لایه بالایی به گرید دو ستونه */
  .footer__top {
    display: grid;                           /* به‌جای flex */
    grid-template-columns: 1fr 1fr;          /* دو ستون مساوی */
    gap: 20px 16px;                          /* فاصله سطر/ستون */
    align-items: start;
  }

  /* برند باید تک‌ستونه و تمام‌عرض باشد */
  .footer-brand {
    min-width: 0;
    max-width: none;
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px 16px;
    align-items: start;
  }

  /* ستون‌ها داخل گرید دیگر به min-width نیاز ندارند */
  .footer-col {
    min-width: 0;
    flex: initial;                           /* خنثی‌کردن flex برای اطمینان */
  }
}

/* موبایل خیلی کوچک: حفظ دو ستونه + تنظیمات ریز */
@media (max-width: 480px) {
  /* همچنان دو ستونه بماند */
  .footer__top {
    grid-template-columns: 1fr 1fr;
  }

  .footer-col { min-width: 0; }              /* جلوگیری از شکستن به تک‌ستونه */
  .social__link { width: 24px; height: 24px; }
}


/* ---------- enamad ---------- */

.footer-enamad {
    margin: 0 0 12px 0;
    display: flex;
    justify-content: center;
}

.enamad-trigger {
    border: 0;
    padding: 0;
    background: transparent;
    cursor: pointer;
}

.footer-enamad img {
    display: block;
    width: 96px;
    height: auto;
    background: white;
    border-radius: 10px;
    margin-left: 3.3rem;
}

/* ---------- پاپ‌آپ enamad ---------- */

.enamad-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.enamad-modal.is-open {
    display: flex;
}

.enamad-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
}

.enamad-modal__dialog {
    position: relative;
    z-index: 1;
    background: var(--color-bg);
    color: var(--color-white);
    padding: 24px 20px;
    border-radius: 16px;
    max-width: 360px;
    width: calc(100% - 32px);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
    text-align: center;
}

.enamad-modal__title {
    margin: 0 0 16px 0;
    font-size: 18px;
    font-weight: 600;
}

.enamad-modal__body a img {
    width: 128px;
    height: auto;
}

/* دکمه بستن؛ هماهنگ با جهت متن */
.enamad-modal__close {
    position: absolute;
    top: 8px;
    font-size: 22px;
    border: 0;
    background: transparent;
    color: var(--color-white);
    cursor: pointer;
}

/* در حالت RTL دکمه سمت چپ بالاست (مثل بقیه پنل‌های سایت تو) */
.site-footer[dir="rtl"] .enamad-modal__close {
    left: 12px;
    right: auto;
}

/* در حالت LTR دکمه سمت راست بالا باشد */
.site-footer[dir="ltr"] .enamad-modal__close {
    right: 12px;
    left: auto;
}

@media (max-width: 480px) {
    .enamad-modal__dialog {
        width: calc(100% - 24px);
        padding: 20px 16px;
    }
}
