/* ═══════════════════════════════════════════════════════════════
   بهینه‌سازی — لندینگ: افکت‌های هیرو فعال | داشبورد: سبک‌تر
   ═══════════════════════════════════════════════════════════════ */

/* بدون preloader: محتوا فوراً دیده شود */
html:not(.tc-preloader-active) .landing-home[data-landing-root] .tc-shell {
  opacity: 1;
  transform: none;
}

/* لندینگ: حتی اگر JS خطا بدهد، محتوا دیده شود */
.landing-home.is-page-ready [data-reveal],
.landing-home[data-landing-root].is-page-ready [data-reveal] {
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
}

/*
 * ضد شطرنجی شدن اسکرول:
 * paint containment و content-visibility باعث deferred paint می‌شوند.
 * فقط روی المان‌هایی که قبلاً contain داشتند override می‌کنیم.
 */
.landing-home main > section,
.landing-home .tc-page-section,
.landing-home .tc-shell,
.landing-home .tc-article-card,
.landing-home .tc-store-product-card,
.landing-home .tc-promo-card,
.landing-home .tc-store-catalog__inner,
.landing-home .tc-pdp__hero,
.landing-home .tc-pdp__checkout-card,
.landing-home .tc-pdp__intro,
.landing-home .tc-pdp-similar,
.landing-home .tc-content-detail__cover,
.landing-home .tc-content-detail__article,
.landing-home .tc-related-content-section,
.site-home .tc-article-card,
.site-home .tc-store-product-card,
.site-home .tc-promo-card,
.site-home .tc-store-catalog__inner,
.site-home .tc-pdp__hero,
.site-home .tc-pdp__checkout-card,
.site-home .tc-pdp__intro,
.site-home .tc-pdp-similar,
.site-home .tc-content-detail__cover,
.site-home .tc-content-detail__article,
.site-home .tc-related-content-section,
.tc-dashboard-body > .tc-dash-data-table,
.tc-dash-data-table tbody tr,
.tc-store-catalog__pagination,
.tc-pdf-preview__sheet {
  contain: none !important;
  content-visibility: visible !important;
}

/* blur تزئینی روی لایه‌های بزرگ = tearing هنگام اسکرول سریع */
.landing-home .tc-shell-blob,
.landing-home .tc-hero-blob,
.landing-home .tc-hero-spark,
.landing-home .tc-cta-blob,
.site-home .tc-footer::before,
.site-home .tc-footer::after {
  filter: none !important;
}

/* نویز SVG روی شِل (گران) — فقط لندینگ؛ افکت‌های هیرو دست نخورده */
.landing-home[data-landing-root] .tc-shell::after {
  content: none !important;
}

/* ── داشبورد: perf-mode (بدون غیرفعال کردن هیرو لندینگ) ── */
html.tc-perf-mode .landing-home.landing-dashboard .tc-shell-blobs {
  display: none !important;
}

html.tc-perf-mode .landing-home.landing-dashboard .tc-dash-site-nav {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  background: rgba(255, 255, 255, 0.94) !important;
}

html.tc-perf-mode .landing-home.landing-dashboard .tc-dashboard-body > section {
  animation: none !important;
}

/* اتصال بسیار ضعیف: فقط داشبورد سبک */
html.tc-perf-lite .landing-home.landing-dashboard .tc-shell-blobs {
  display: none !important;
}

html.tc-perf-lite .landing-home.landing-dashboard .tc-dash-site-nav {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  background: rgba(255, 255, 255, 0.96) !important;
}

/* تب مخفی: توقف انیمیشن‌ها */
html.tc-tab-hidden .landing-home * {
  animation-play-state: paused !important;
}

.landing-home video[data-video-src]:not([src]) {
  background: #f4f0ff;
}

/* اسکرول بازگشت به بالا: توقف parallax و blob تا لگ نخورد */
html.tc-scroll-animating .landing-home [data-parallax],
html.tc-scroll-animating .landing-home .tc-shell-blob {
  transform: none !important;
  will-change: auto;
}

html.tc-scroll-animating .landing-home .tc-shell-blobs {
  pointer-events: none;
}

/* موبایل: افکت‌های سنگین عمومی را سبک کن، بدون حذف محتوا */
@media (max-width: 900px) {
  /* Non-landing pages: keep footer look, only lighten heavy effects */
  html.tc-mobile-optimized .site-home .tc-footer {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  html.tc-mobile-optimized .site-home .tc-footer::before,
  html.tc-mobile-optimized .site-home .tc-footer::after {
    content: none !important;
    display: none !important;
  }

  html.tc-mobile-optimized .site-home .tc-footer a,
  html.tc-mobile-optimized .site-home .tc-footer button,
  html.tc-mobile-optimized .site-home .tc-footer input,
  html.tc-mobile-optimized .site-home .tc-footer * {
    transition: none !important;
    will-change: auto !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  html.tc-mobile-optimized .tc-support-fab,
  html.tc-mobile-optimized .tc-support-fab__inner,
  html.tc-mobile-optimized .tc-support-fab__pulse {
    animation: none !important;
    transform: none !important;
    transition: none !important;
    will-change: auto !important;
  }

  html.tc-mobile-optimized .landing-home .tc-shell-blobs,
  html.tc-mobile-optimized .landing-home .tc-shell-blob,
  html.tc-mobile-optimized .landing-home .tc-hero-blob,
  html.tc-mobile-optimized .landing-home .tc-hero-spark,
  html.tc-mobile-optimized .landing-home [data-parallax] {
    will-change: auto;
  }

  html.tc-mobile-lite .landing-home .tc-shell-blobs,
  html.tc-mobile-lite .landing-home .tc-shell-blob,
  html.tc-mobile-lite .landing-home .tc-hero-blob,
  html.tc-mobile-lite .landing-home .tc-hero-spark,
  html.tc-mobile-lite .landing-home [data-parallax] {
    animation: none !important;
    transform: none !important;
  }

  html.tc-mobile-lite .landing-home *,
  html.tc-mobile-lite .site-home *,
  html.tc-mobile-lite .tc-dashboard-page *,
  html.tc-mobile-lite .jx-shell * {
    animation: none !important;
  }

  html.tc-mobile-lite .landing-home *,
  html.tc-mobile-lite .site-home *,
  html.tc-mobile-lite .tc-dashboard-page * {
    will-change: auto !important;
  }

  html.tc-mobile-optimized,
  html.tc-mobile-optimized body {
    scroll-behavior: auto !important;
    overscroll-behavior-y: contain;
  }

  html.tc-mobile-optimized .landing-home .tc-shell::after,
  html.tc-mobile-optimized .site-home .tc-shell::after {
    content: none !important;
  }

  html.tc-mobile-optimized .landing-home .tc-shell-blobs,
  html.tc-mobile-optimized .landing-home .tc-shell-blob,
  html.tc-mobile-optimized .landing-home .tc-hero-bg-deco,
  html.tc-mobile-optimized .landing-home .tc-hero-blob,
  html.tc-mobile-optimized .landing-home .tc-hero-spark,
  html.tc-mobile-optimized .landing-home .tc-cta-blob,
  html.tc-mobile-optimized .landing-home [data-parallax],
  html.tc-mobile-optimized .site-home .tc-pricing-hero::before,
  html.tc-mobile-optimized .site-home .tc-pricing-hero__panel::after {
    animation: none !important;
    transform: none !important;
    filter: none !important;
    will-change: auto !important;
  }

  html.tc-mobile-optimized .landing-home .tc-header,
  html.tc-mobile-optimized .site-home .tc-header,
  html.tc-mobile-optimized .site-home .tc-pricing-stat,
  html.tc-mobile-optimized .site-home .tc-store-filter .tc-card,
  html.tc-mobile-optimized .site-home .tc-store-product-card__badge,
  html.tc-mobile-optimized .site-home .tc-store-products-loader,
  html.tc-mobile-optimized .tc-dashboard-page .tc-dashboard-nav-backdrop,
  html.tc-mobile-optimized .tc-dashboard-page .tc-dash-site-nav {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  html.tc-mobile-scrolling .landing-home .tc-btn,
  html.tc-mobile-scrolling .landing-home .tc-card,
  html.tc-mobile-scrolling .landing-home .tc-feature-card,
  html.tc-mobile-scrolling .landing-home .tc-promo-card,
  html.tc-mobile-scrolling .landing-home .tc-testimonial,
  html.tc-mobile-scrolling .landing-home .tc-social-link,
  html.tc-mobile-scrolling .site-home .tc-pricing-card,
  html.tc-mobile-scrolling .site-home .tc-pricing-card__cta,
  html.tc-mobile-scrolling .site-home .tc-pricing-seo__links a,
  html.tc-mobile-scrolling .site-home .tc-store-product-card,
  html.tc-mobile-scrolling .site-home .tc-promo-card,
  html.tc-mobile-scrolling .site-home .tc-store-catalog__search,
  html.tc-mobile-scrolling .site-home .tc-store-catalog__page-btn,
  html.tc-mobile-scrolling .tc-dashboard-page .tc-dash-btn-white,
  html.tc-mobile-scrolling .tc-dashboard-page .tc-dash-data-table,
  html.tc-mobile-scrolling .tc-dashboard-page .tc-dash-heading {
    transition: none !important;
  }

  html.tc-mobile-scrolling .landing-home .tc-shell-blobs,
  html.tc-mobile-scrolling .landing-home .tc-shell-blob,
  html.tc-mobile-scrolling .landing-home .tc-hero-blob,
  html.tc-mobile-scrolling .landing-home .tc-hero-spark,
  html.tc-mobile-scrolling .landing-home [data-parallax],
  html.tc-mobile-scrolling .site-home .tc-store-product-card,
  html.tc-mobile-scrolling .site-home .tc-promo-card,
  html.tc-mobile-scrolling .site-home .tc-store-hero,
  html.tc-mobile-scrolling .site-home .tc-store-filter .tc-card,
  html.tc-mobile-scrolling .site-home .tc-store-catalog__inner,
  html.tc-mobile-scrolling .site-home .tc-store-product-card__kind,
  html.tc-mobile-scrolling .site-home .tc-store-product-card__badge,
  html.tc-mobile-scrolling .tc-dashboard-page .tc-dash-site-nav,
  html.tc-mobile-scrolling .tc-dashboard-page .tc-dashboard-mobile-drawer,
  html.tc-mobile-scrolling .tc-dashboard-page .tc-dashboard-nav-backdrop,
  html.tc-mobile-scrolling .tc-dashboard-page .tc-dash-data-table,
  html.tc-mobile-scrolling .tc-dashboard-page .tc-dash-btn-white {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    filter: none !important;
    will-change: auto !important;
  }

  html.tc-mobile-scrolling .site-home .tc-store-product-card,
  html.tc-mobile-scrolling .site-home .tc-promo-card,
  html.tc-mobile-scrolling .site-home .tc-store-catalog__inner,
  html.tc-mobile-scrolling .site-home .tc-store-filter .tc-card,
  html.tc-mobile-scrolling .site-home .tc-store-hero,
  html.tc-mobile-scrolling .tc-dashboard-page .tc-dash-data-table,
  html.tc-mobile-scrolling .tc-dashboard-page .tc-dash-btn-white,
  html.tc-mobile-scrolling .tc-dashboard-page .tc-dash-heading,
  html.tc-mobile-scrolling .tc-dashboard-page .tc-dashboard-mobile-drawer {
    box-shadow: none !important;
  }
}

/* موبایل ضعیف: نسخه خیلی سبک (بدون تغییر چیدمان) */
@media (max-width: 900px) {
  html.tc-mobile-lite .landing-home [data-parallax],
  html.tc-mobile-lite .landing-home .tc-shell-blob,
  html.tc-mobile-lite .landing-home .tc-hero-blob,
  html.tc-mobile-lite .landing-home .tc-hero-spark,
  html.tc-mobile-lite .landing-home .tc-cta-blob,
  html.tc-mobile-lite .landing-home .tc-hero-float {
    animation: none !important;
    transform: none !important;
    will-change: auto !important;
  }

  html.tc-mobile-lite .landing-home [data-reveal],
  html.tc-mobile-lite .landing-home .tc-feature-card,
  html.tc-mobile-lite .landing-home .tc-promo-card,
  html.tc-mobile-lite .landing-home .tc-testimonial,
  html.tc-mobile-lite .landing-home .tc-hero-promo-slide {
    transition: none !important;
  }

  html.tc-mobile-lite .site-home .tc-store-filter .tc-card,
  html.tc-mobile-lite .site-home .tc-store-catalog__inner,
  html.tc-mobile-lite .site-home .tc-promo-card,
  html.tc-mobile-lite .site-home .tc-store-product-card__kind,
  html.tc-mobile-lite .site-home .tc-store-product-card__badge {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  html.tc-mobile-lite .site-home .tc-store-product-card,
  html.tc-mobile-lite .site-home .tc-promo-card,
  html.tc-mobile-lite .site-home .tc-store-hero__cta,
  html.tc-mobile-lite .site-home .tc-store-filter .pastel-btn-primary,
  html.tc-mobile-lite .site-home .tc-store-catalog__search,
  html.tc-mobile-lite .site-home .tc-store-catalog__page-btn,
  html.tc-mobile-lite .site-home .tc-pdp-share__net,
  html.tc-mobile-lite .site-home .tc-pdp-share__copy,
  html.tc-mobile-lite .site-home .tc-pdp-share__close {
    transition: none !important;
    animation: none !important;
    transform: none !important;
    will-change: auto !important;
  }
}
