/* Tap to top button */
.tap-top {
  /* از توکن‌های تم استفاده می‌کند؛ اگر جای دیگری تعریف شده‌اند این fallback ها حذف شوند */
  --tap-top-brand: var(--color-brand, #1b2a4a); /* سرمه‌ای */
  --tap-top-accent: var(--color-accent, #5c748f); /* آبی‌خاکستری */

  position: fixed;
  inset-inline-end: 1.25rem;
  bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
  z-index: 1030;

  /* هم‌راستا با .stat-item__icon و آیکون‌های service-card */
  inline-size: 56px;
  block-size: 56px;
  display: grid;
  place-items: center;

  border: 1px solid color-mix(in srgb, var(--tap-top-brand) 18%, transparent);
  border-radius: 0.9rem;
  background: color-mix(in srgb, var(--tap-top-brand) 8%, #fff);
  color: var(--tap-top-brand);
  font-size: 1.5rem;
  cursor: pointer;

  /* همان سایه‌ای که برای bg-light استفاده کردیم */
  box-shadow: 0 8px 24px
    color-mix(in srgb, var(--tap-top-brand) 14%, transparent);

  /* حالت اولیه: مخفی با ورود نرم از پایین */
  opacity: 0;
  visibility: hidden;
  translate: 0 12px;
  transition:
    opacity 0.3s ease,
    visibility 0.3s ease,
    translate 0.3s ease,
    background-color 0.25s ease,
    color 0.25s ease,
    box-shadow 0.25s ease;
}

.tap-top.is-visible {
  opacity: 1;
  visibility: visible;
  translate: 0 0;
}

/* هاور فقط روی دستگاه‌های دارای پوینتر واقعی — همان الگوی قبلی */
@media (hover: hover) and (pointer: fine) {
  .tap-top:hover {
    background: var(--tap-top-brand);
    border-color: var(--tap-top-brand);
    color: #fff;
    translate: 0 -6px; /* همان لیفت کارت‌ها و آیتم‌های آمار */
    box-shadow: 0 14px 32px
      color-mix(in srgb, var(--tap-top-brand) 28%, transparent);
  }
}

/* فیدبک لمسی در موبایل به‌جای هاور */
.tap-top:active {
  background: var(--tap-top-brand);
  color: #fff;
  translate: 0 0;
}

/* دسترسی: حلقه فوکوس هم‌رنگ برند */
.tap-top:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--tap-top-accent) 60%, transparent);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .tap-top {
    transition:
      opacity 0.2s ease,
      visibility 0.2s ease;
    translate: 0 0;
  }
  @media (hover: hover) and (pointer: fine) {
    .tap-top:hover {
      translate: 0 0;
    }
  }
}


/* Final CTA */


/* ===== 4) CTA پایانی ===== */
.final-cta {
  --final-cta-pad-block: clamp(3rem, 6vw, 5rem);
  --final-cta-box-pad: clamp(2rem, 4vw, 3.5rem);
  --final-cta-radius: 20px;

  padding-block: var(--final-cta-pad-block);
}

.final-cta__box {
  margin-inline: auto;
  background-color: #fff;
  padding: var(--final-cta-box-pad, 40px); /* خط شکستهٔ var(--g…) اصلاح شد */
  text-align: center;
  border-radius: var(--final-cta-radius);
  box-shadow: 0 18px 40px rgba(27, 42, 74, 0.18);
}

.final-cta__title {
  margin: 0 0 0.75rem;
  font-size: clamp(1.35rem, 2.5vw, 2rem);
  line-height: 1.4;
}

.final-cta__desc {
  margin: 0 auto 2rem;
  max-width: 60ch;
  font-size: clamp(0.95rem, 1.6vw, 1.05rem);
  line-height: 2;
}

.final-cta__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 1rem;
}

.final-cta__actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}


@media (max-width: 575px) {

  .final-cta__box {
    padding-inline: clamp(1.25rem, 6vw, 2rem);
  }

  .final-cta__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .final-cta__actions .btn {
    width: 100%;
    justify-content: center;
  }
}
