/* ==========================================================
   بی‌توبی کلاب — اورراید فوتر Multikart (RTL)
   نسخهٔ یکپارچه — باید بعد از تمام CSS های قالب لود شود.
   منبع واحد حقیقت برای استایل فوتر؛ از --theme-color نارنجی
   قالب استفاده نمی‌کند و کاملاً روی توکن‌های برند سوار است.
   ========================================================== */

/* ---------- ۰. توکن‌های محلی (fallback امن) ---------- */
footer.footer-light {
  --ftr-brand: var(--btb-brand, #1e3a6e);
  --ftr-accent: var(--btb-accent, #5b7fb5);
  --ftr-brand-dark: #16294f; /* fallback برای color-mix */
  --ftr-text: #64748b;
  --ftr-text-strong: #475569;
  --ftr-line: #e6ebf2;
  --ftr-field-border: #dde4ee;

  background: #f6f8fb;
  border-top: 1px solid var(--ftr-line);
}

/* ---------- ۱. ریتم عمودی و تایپوگرافی ---------- */
footer.footer-light .footer-content p {
  font-size: 14px;
  line-height: 2; /* متن فارسی به line-height بلندتر نیاز دارد */
  text-align: justify;
  color: var(--ftr-text);
  margin-bottom: 18px;
}

footer.footer-light .footer-logo {
  margin-bottom: 20px;
}

footer.footer-light .footer-logo img {
  max-height: 48px;
  width: auto;
}

footer.footer-light .footer-theme.partition-f > div {
  margin-bottom: 0;
}

/* ---------- ۲. عناوین ستون‌ها ---------- */
footer.footer-light .footer-title h4 {
  position: relative;
  color: var(--ftr-brand);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.6;
  letter-spacing: 0;
  padding-bottom: 12px;
  margin-bottom: 18px;
}

footer.footer-light .footer-title h4::after {
  content: "";
  position: absolute;
  bottom: 0;
  inset-inline-start: 0;
  width: 32px;
  height: 3px;
  border-radius: 2px;
  background: var(--ftr-accent);
}

/* ---------- ۳. لینک‌های ستون‌ها (انیمیشن RTL) ---------- */
footer.footer-light .footer-content ul li {
  display: block; /* جای inline-block پیش‌فرض قالب */
  line-height: 1.9;
  padding-top: 0;
  margin-bottom: 10px;
}

footer.footer-light .footer-content ul li:last-child {
  margin-bottom: 0;
}

footer.footer-light .footer-content ul li a {
  position: relative;
  display: inline-block;
  font-size: 14px;
  line-height: 1.9;
  color: var(--ftr-text);
  transition:
    color 0.25s ease,
    padding 0.25s ease;
}

/* خط زیرین در RTL از سمت start (راست) رشد می‌کند */
footer.footer-light .footer-content ul li a::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  bottom: -2px;
  width: 0;
  height: 1px;
  background-color: var(--ftr-accent);
  transition: width 0.3s ease;
}

footer.footer-light .footer-content ul li a:hover,
footer.footer-light .footer-content ul li a:focus-visible {
  color: var(--ftr-brand);
  padding-inline-start: 4px;
}

footer.footer-light .footer-content ul li a:hover::before,
footer.footer-light .footer-content ul li a:focus-visible::before {
  width: 100%;
}

/* ---------- ۴. متن «درباره ما» + دکمهٔ باز/بسته ---------- */
footer.footer-light .footer-about {
  font-size: 14px;
  line-height: 2;
  text-align: justify;
  color: var(--ftr-text);
  margin-bottom: 10px;
}

footer.footer-light .footer-about.is-clamped {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

footer.footer-light .footer-about-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  margin-bottom: 18px;
  border: 0;
  background: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.9;
  color: var(--ftr-brand);
  transition: opacity 0.2s ease;
}

footer.footer-light .footer-about-toggle:hover {
  opacity: 0.8;
}

footer.footer-light .footer-about-toggle i {
  font-size: 14px;
  transition: transform 0.25s ease;
}

footer.footer-light .footer-about-toggle[aria-expanded="true"] i {
  transform: rotate(180deg);
}

/* ---------- ۵. لیست تماس (flex، بدون دردسر RTL) ---------- */
footer.footer-light .contact-list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--ftr-text);
  line-height: 2.1;
  margin-bottom: 14px;
}

footer.footer-light .contact-list li i {
  flex-shrink: 0;
  color: var(--ftr-accent);
  font-size: 16px;
  margin-top: 4px;
}

footer.footer-light .contact-list li a,
footer.footer-light .contact-list li p {
  color: var(--ftr-text-strong);
  margin: 0;
  transition: color 0.2s ease;
}

footer.footer-light .contact-list li a:hover {
  color: var(--ftr-brand);
}

/* شماره و ایمیل همیشه LTR نمایش داده شوند */
footer.footer-light .contact-list li a[href^="tel:"],
footer.footer-light .contact-list li a[href^="mailto:"] {
  direction: ltr;
  unicode-bidi: embed;
}

/* ---------- ۶. آیکون‌های شبکه‌های اجتماعی ---------- */
footer.footer-light .footer-social ul {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0 0;
}

footer.footer-light .footer-social ul li {
  margin: 0 !important;
  padding: 0;
  display: inline-flex;
}

footer.footer-light .footer-social ul li a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  line-height: 1;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--ftr-line);
  color: var(--ftr-brand);
  transition:
    background-color 0.25s ease,
    color 0.25s ease,
    transform 0.25s ease;
}

footer.footer-light .footer-social ul li a i {
  font-size: 17px;
  padding: 0;
}

footer.footer-light .footer-social ul li a:hover {
  background: var(--ftr-brand);
  color: #fff;
  transform: translateY(-3px);
}

/* روی آیکون‌ها خط زیرین لینک لازم نیست */
footer.footer-light .footer-social ul li a::before {
  display: none;
}

/* ---------- ۷. خبرنامه ---------- */
footer.footer-light .subscribe h4 {
  color: var(--ftr-brand);
  font-weight: 700;
  line-height: 1.6;
  margin-bottom: 10px;
}

footer.footer-light .subscribe p {
  color: var(--ftr-text);
  line-height: 2;
  margin-bottom: 0;
}

footer.footer-light .subscribe-form .form-control {
  line-height: 1.8;
  text-align: right;
  border: 1px solid var(--ftr-field-border);
  border-radius: 10px;
  background: #fff;
  padding: 12px 16px;
  transition:
    border-color 0.25s ease,
    box-shadow 0.25s ease;
}

footer.footer-light .subscribe-form .form-control:focus {
  border-color: var(--ftr-brand);
  box-shadow: 0 0 0 3px rgba(30, 58, 110, 0.12);
  outline: none;
}

footer.footer-light .subscribe-form .btn-solid {
  background: var(--ftr-brand);
  border: none;
  border-radius: 10px;
  padding: 11px 32px;
  line-height: 1.8;
  transition:
    background 0.25s ease,
    transform 0.25s ease;
}

footer.footer-light .subscribe-form .btn-solid:hover {
  background: #fff;
  color: var(--btb-brand);
  box-shadow: 0 10px 24px color-mix(in srgb, var(--btb-brand) 28%, transparent);
  transform: translateY(-2px);
}

/* ---------- ۸. فوتر پایینی (ساب‌فوتر سرمه‌ای) ---------- */
footer.footer-light .sub-footer {
  background: var(--ftr-brand);
}

footer.footer-light .sub-footer > .container > .row {
  padding: 14px 0;
}

footer.footer-light .sub-footer .footer-end p {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 13px;
  line-height: 2;
  margin: 0;
}

/* ---------- ۹. دسترس‌پذیری کیبورد ---------- */
footer.footer-light a:focus-visible,
footer.footer-light .footer-about-toggle:focus-visible {
  outline: 2px solid var(--ftr-accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------- ۱۰. ریسپانسیو ---------- */
@media (max-width: 991px) {
  footer.footer-light .footer-theme.partition-f > div {
    margin-bottom: 28px;
  }
  footer.footer-light .footer-title h4 {
    margin-bottom: 14px;
  }
  footer.footer-light .footer-content p {
    line-height: 1.9;
  }
  footer.footer-light .subscribe {
    text-align: center;
    margin-bottom: 20px;
  }
  footer.footer-light .subscribe-form {
    justify-content: center;
  }
  /* آکاردئون موبایل قالب */
  footer.footer-light .footer-title.active .footer-content {
    padding-top: 10px;
  }
}

@media (max-width: 577px) {
  footer.footer-light .footer-content ul li {
    margin-bottom: 8px;
  }
  footer.footer-light .footer-social ul li a {
    width: 34px;
    height: 34px;
  }
  footer.footer-light .subscribe-form .form-group,
  footer.footer-light .subscribe-form .form-control,
  footer.footer-light .subscribe-form .btn-solid {
    width: 100%;
    margin-inline: 0;
  }
  /* غلبه بر text-nowrap قالب روی آدرس */
  footer.footer-light .contact-list li p {
    white-space: normal !important;
  }
}

/* ---------- ۱۱. احترام به تنظیمات کاربر ---------- */
@media (prefers-reduced-motion: reduce) {
  footer.footer-light .footer-content ul li a,
  footer.footer-light .footer-content ul li a::before,
  footer.footer-light .footer-social ul li a,
  footer.footer-light .footer-about-toggle i {
    transition: none;
  }
  footer.footer-light .footer-social ul li a:hover {
    transform: none;
  }
}
/* ===== فرم خبرنامه ===== */
.subscribe-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.subscribe-form .form-group {
  flex: 1 1 220px;
  min-width: 0;
  margin: 0;
}

.subscribe-form .form-control {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.subscribe-form .btn {
  flex: 0 0 auto;
  margin: 0;
  white-space: nowrap;
}

/* ===== پیام موفقیت / خطا ===== */
.newsletter-message-container {
  flex: 0 0 100%;
  order: -1;
  display: flex;
  align-items: center;
  overflow: hidden; /* جلوگیری از فاصله اضافی */
  transition: max-height 0.3s ease-in-out;
  max-height: 0; /* پیش‌فرض: بسته */
}

.newsletter-message-container.active {
  max-height: 60px; /* وقتی پیام داریم باز می‌شود */
}

.newsletter-message {
  width: 100%;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: clamp(12px, 3.2vw, 13px);
  line-height: 1.7;
  text-align: right;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-5px);
  transition:
    opacity 0.3s ease-in-out,
    transform 0.3s ease-in-out,
    visibility 0.3s ease-in-out;
}

.newsletter-message.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.newsletter-message.success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.newsletter-message.error {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* موبایل: دکمه full-width و متن wrap می‌شود */
@media (max-width: 575.98px) {
  .subscribe-form {
    flex-direction: column;
    align-items: stretch;
  }

  .subscribe-form .form-group,
  .subscribe-form .btn {
    flex: 1 1 auto;
    width: 100%;
  }

  .subscribe-form .btn {
    white-space: normal; /* متن دکمه می‌تواند wrap شود */
    padding: 10px 15px; /* padding مناسب برای متن چندخطی */
  }
}

/* موبایل خیلی کوچک: فونت‌ها و padding کوچک‌تر */
@media (max-width: 400px) {
  .subscribe-form .form-control {
    font-size: 14px;
    padding: 8px 12px;
  }

  .subscribe-form .btn {
    font-size: 14px;
    padding: 8px 12px;
  }
}
