/* ============================================================
   SW Footer Widget — استایل‌ها
   ============================================================ */

.swfw-footer {
  --swfw-primary: #ea2d4d;
  --swfw-primary-dark: #cf1f3c;
  --swfw-text: #2c2c2c;
  --swfw-muted: #6b6b6b;
  --swfw-line: #eeeeee;
  --swfw-dark-bg: #2a2d3d;
  --swfw-dark-text: #e6e8ef;
  --swfw-dark-muted: #a0a4b8;
  --swfw-copy-bg: #1e2130;

  position: relative;
  background: #ffffff;
  border-top: 1px solid var(--swfw-line);
  direction: rtl;
  font-family: Vazirmatn, IRANSans, "Segoe UI", Tahoma, sans-serif;
  color: var(--swfw-text);
  line-height: 1.9;
  box-sizing: border-box;
}
/* اجبار به نمایش نشان روی لبه */
.swfw-footer {
  overflow: visible !important;
}
.swfw-footer *,
.swfw-footer *::before,
.swfw-footer *::after { box-sizing: border-box; }

/* ---------- Badge ---------- */
.swfw-footer__badge {
  position: absolute;
  top: -38px;
  left: 50%;
  transform: translateX(-50%);
  width: 76px;
  height: 76px;
  background: #ffffff;
  border: 1px solid var(--swfw-line);
  border-radius: 50%;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  display: grid;
  place-items: center;
  z-index: 2;
  overflow: hidden;
  text-decoration: none;
  transition: transform .35s cubic-bezier(.22,.61,.36,1), box-shadow .35s ease;
}

.swfw-footer__badge-svg {
  width: 52px;
  height: auto;
  display: block;
  transition: transform .6s cubic-bezier(.22,.61,.36,1);
}
.swfw-footer__badge-img {
  width: 60%;
  height: 60%;
  object-fit: contain;
  display: block;
}

/* ---------- Animations ---------- */
@keyframes swfw-pulse {
  0%, 100% { transform: translateX(-50%) scale(1); }
  50%      { transform: translateX(-50%) scale(1.08); }
}
@keyframes swfw-bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%      { transform: translateX(-50%) translateY(-8px); }
}
@keyframes swfw-float {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%      { transform: translateX(-50%) translateY(-6px); }
}
@keyframes swfw-rotate {
  0%, 100% { transform: translateX(-50%) rotate(0deg); }
  50%      { transform: translateX(-50%) rotate(8deg); }
}
@keyframes swfw-glow {
  0%, 100% { box-shadow: 0 8px 24px rgba(0,0,0,.08), 0 0 0 0 rgba(234,45,77,.5); }
  50%      { box-shadow: 0 8px 24px rgba(0,0,0,.08), 0 0 24px 6px rgba(234,45,77,.35); }
}

.swfw-anim--pulse  { animation: swfw-pulse infinite ease-in-out; }
.swfw-anim--bounce { animation: swfw-bounce infinite ease-in-out; }
.swfw-anim--float  { animation: swfw-float infinite ease-in-out; }
.swfw-anim--rotate { animation: swfw-rotate infinite ease-in-out; }
.swfw-anim--glow   { animation: swfw-glow infinite ease-in-out; }

/* چرخش لوگو در هاور */
.swfw-footer__badge:hover .swfw-footer__badge-svg {
  transform: rotate(4deg) scale(1.05);
}

/* ---------- Layout ---------- */
.swfw-footer__inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 66px 24px 40px;
  display: grid;
  grid-template-columns: 1.6fr 0.9fr 0.9fr auto;
  grid-template-areas: "story actions trust social";
  gap: 36px;
  align-items: start;
}

.swfw-footer__story   { grid-area: story; }
.swfw-footer__actions { grid-area: actions; }
.swfw-footer__trust   { grid-area: trust; }
.swfw-footer__social  { grid-area: social; }

/* ---------- Story ---------- */
.swfw-footer__title {
  margin: 0 0 14px;
  font-size: 22px;
  font-weight: 800;
  color: var(--swfw-text);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  line-height: 1.4;
}

.swfw-footer__info {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  background: transparent;
  border: 1.5px solid #2d7dd2;
  color: #2d7dd2;
  cursor: pointer;
  border-radius: 8px;
  transition: background .2s ease, color .2s ease, transform .2s ease;
}
.swfw-footer__info:hover {
  background: #2d7dd2;
  color: #ffffff;
  transform: translateY(-1px);
}
.swfw-footer__info svg { display: block; }

.swfw-footer__text-wrap {
  position: relative;
  overflow: hidden;
  transition: max-height .55s cubic-bezier(.22,.61,.36,1);
}
.swfw-footer__text-wrap.is-open { max-height: 2000px !important; }

.swfw-footer__text {
  margin: 0;
  font-size: 14px;
  line-height: 2;
  color: var(--swfw-muted);
}

.swfw-footer__fade {
  position: absolute;
  bottom: 0;
  right: 0;
  left: 0;
  height: 3.5em;
  background: linear-gradient(to bottom, rgba(255,255,255,0), #ffffff 90%);
  pointer-events: none;
  opacity: 1;
  transition: opacity .35s ease;
}
.swfw-footer__text-wrap.is-open .swfw-footer__fade { opacity: 0; }

.swfw-footer__more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 6px 12px;
  background: transparent;
  border: 1px solid var(--swfw-primary);
  border-radius: 8px;
  color: var(--swfw-primary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s ease, color .2s ease, border-color .2s ease, transform .2s ease;
}
.swfw-footer__more:hover {
  background: var(--swfw-primary);
  color: #ffffff;
  transform: translateY(-1px);
}
.swfw-footer__more-text--less { display: none; }
.swfw-footer__more.is-open .swfw-footer__more-text--more { display: none; }
.swfw-footer__more.is-open .swfw-footer__more-text--less { display: inline; }

.swfw-footer__more-icon { transition: transform .4s cubic-bezier(.22,.61,.36,1); }
.swfw-footer__more-close { display: none; }
.swfw-footer__more.is-open .swfw-footer__more-arrow { display: none; }
.swfw-footer__more.is-open .swfw-footer__more-close { display: block; }

/* ---------- Buttons ---------- */
.swfw-footer__actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 4px;
}

.swfw-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px 22px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  line-height: 1.4;
  transition: background .2s ease, transform .2s ease, box-shadow .2s ease;
  white-space: nowrap;
}
.swfw-btn svg { flex-shrink: 0; }

.swfw-btn--primary { background: var(--swfw-primary); color: #fff; }
.swfw-btn--primary:hover {
  background: var(--swfw-primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(234, 45, 77, 0.28);
}

.swfw-btn--ghost { background: #fce4e8; color: var(--swfw-primary); }
.swfw-btn--ghost:hover { background: #fbd2d8; transform: translateY(-1px); }

/* ---------- Trust ---------- */
.swfw-footer__trust {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding-top: 4px;
}

.swfw-footer__logos {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}
.swfw-footer__logos a { display: inline-block; transition: transform .2s ease; }
.swfw-footer__logos a:hover { transform: translateY(-2px); }
.swfw-footer__logos img {
  display: block;
  width: auto;
  height: 82px;
  max-width: 100%;
  object-fit: contain;
}

.swfw-footer__phone {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--swfw-text);
  font-weight: 700;
  font-size: 16px;
  text-decoration: none;
  transition: color .2s ease;
  direction: ltr;
  white-space: nowrap;
  margin-top: 2px;
}
.swfw-footer__phone:hover { color: var(--swfw-primary); }
.swfw-footer__phone span { direction: rtl; }

/* ---------- Social ---------- */
.swfw-footer__social {
  list-style: none;
  margin: 0;
  padding: 6px 0 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

.swfw-social {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  text-decoration: none;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.swfw-social:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.swfw-social--aparat    { color: #ed145b; background: #fde8f0; }
.swfw-social--aparat:hover    { background: #fbd7e5; }
.swfw-social--instagram { color: #d62976; background: #fdeaf2; }
.swfw-social--instagram:hover { background: #fbd8e8; }
.swfw-social--telegram  { color: #229ED9; background: #e6f4fb; }
.swfw-social--telegram:hover  { background: #d2ebf8; }
.swfw-social--whatsapp  { color: #25d366; background: #e4f8ec; }
.swfw-social--whatsapp:hover  { background: #cef1da; }
.swfw-social--youtube   { color: #ff0000; background: #ffe5e5; }
.swfw-social--youtube:hover   { background: #ffcccc; }
.swfw-social--linkedin  { color: #0a66c2; background: #e0edfa; }
.swfw-social--linkedin:hover  { background: #c9dff5; }

.swfw-social svg { width: 22px; height: 22px; }

/* ---------- Links section ---------- */
.swfw-footer__links {
  background: var(--swfw-dark-bg);
  color: var(--swfw-dark-text);
  border-top: 1px solid #606470;
}
.swfw-footer__links-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 48px 24px 40px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
}

.swfw-links-col__title {
  margin: 0 0 16px;
  font-size: 16px;
  font-weight: 800;
  color: #ffffff;
  position: relative;
  padding-bottom: 10px;
}
.swfw-links-col__title::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 32px;
  height: 2px;
  background: var(--swfw-primary);
  border-radius: 2px;
}

.swfw-links-col__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.swfw-links-col__list a {
  display: inline-block;
  color: var(--swfw-dark-muted);
  text-decoration: none;
  font-size: 13.5px;
  line-height: 1.8;
  transition: color .2s ease;
}
.swfw-links-col__list a::before {
  content: '';
  display: inline-block;
  width: 0;
  height: 6px;
  border-radius: 50%;
  background: var(--swfw-primary);
  vertical-align: middle;
  margin-inline-end: 0;
  transition: width .25s ease, margin-inline-end .25s ease;
}
.swfw-links-col__list a:hover { color: #ffffff; }
.swfw-links-col__list a:hover::before { width: 6px; margin-inline-end: 8px; }

/* ---------- Copyright ---------- */
.swfw-footer__copy {
  background: var(--swfw-copy-bg);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.swfw-footer__copy-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  direction: rtl;
}

.swfw-footer__copy-text,
.swfw-footer__copy-made {
  margin: 0;
  font-size: 13px;
  color: var(--swfw-dark-muted);
  line-height: 1.8;
}
.swfw-footer__copy-text strong { color: #ffffff; font-weight: 700; }

/* ============================================================
   ریسپانسیو
   ============================================================ */

@media (max-width: 1023px) and (min-width: 768px) {
  .swfw-footer__inner {
    padding: 66px 24px 36px;
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "story   story"
      "actions trust"
      "social  social";
    gap: 28px;
  }
  .swfw-footer__social {
    flex-direction: row;
    justify-content: center;
    padding-top: 0;
  }
  .swfw-footer__links-inner {
    grid-template-columns: repeat(2, 1fr);
    padding: 40px 24px 32px;
  }
}

@media (max-width: 767px) {
  .swfw-footer__badge {
    top: -33px;
    left: 24px;
    transform: none;
    width: 66px;
    height: 66px;
  }
  .swfw-footer__badge-svg { width: 44px; }

  /* انیمیشن‌ها بدون translateX در موبایل */
  @keyframes swfw-pulse  { 0%,100%{transform:scale(1)} 50%{transform:scale(1.08)} }
  @keyframes swfw-bounce { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-8px)} }
  @keyframes swfw-float  { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-6px)} }
  @keyframes swfw-rotate { 0%,100%{transform:rotate(0)} 50%{transform:rotate(8deg)} }

  .swfw-footer__inner {
    padding: 60px 18px 32px;
    grid-template-columns: 1fr;
    grid-template-areas: "story" "actions" "trust" "social";
    gap: 26px;
    text-align: center;
  }

  .swfw-footer__title {
    font-size: 19px;
    justify-content: center;
    width: 100%;
  }
  .swfw-footer__text { font-size: 13px; text-align: right; }
  .swfw-footer__actions { width: 100%; padding-top: 0; }
  .swfw-btn { width: 100%; padding: 14px 20px; font-size: 14px; }
  .swfw-footer__trust { padding-top: 0; }
  .swfw-footer__logos { gap: 12px; }
  .swfw-footer__logos img { height: 72px; }
  .swfw-footer__social {
    flex-direction: row;
    justify-content: center;
    gap: 12px;
    padding-top: 0;
  }
  .swfw-social { width: 42px; height: 42px; }

  .swfw-footer__links-inner {
    grid-template-columns: repeat(2, 1fr);
    gap: 28px 18px;
    padding: 36px 18px 28px;
  }
  .swfw-links-col__title { font-size: 14px; margin-bottom: 12px; }
  .swfw-links-col__list a { font-size: 12.5px; }

  .swfw-footer__copy-inner {
    padding: 18px;
    justify-content: center;
    text-align: center;
    flex-direction: column;
    gap: 8px;
  }
}

@media (max-width: 380px) {
  .swfw-footer__logos img { height: 62px; }
  .swfw-social { width: 38px; height: 38px; }
  .swfw-footer__links-inner { gap: 24px 14px; }
}

/* ---------- Reduced Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .swfw-footer__badge,
  .swfw-btn,
  .swfw-social,
  .swfw-footer__logos a,
  .swfw-footer__info,
  .swfw-footer__badge-svg { transition: none !important; }
  .swfw-footer__badge { animation: none !important; }
  .swfw-footer__badge:hover { transform: none !important; }
}
/* ============================================================
   رفع مشکل بریده شدن نشان روی لبه فوتر
   ============================================================ */
.swfw-footer > *:last-child {
  border-bottom-left-radius: inherit;
  border-bottom-right-radius: inherit;
}

/* اگر نشان روی لبه با overflow مشکل داشت، اطمینان از نمایش */
.swfw-footer__badge {
  overflow: visible;
}