/* ===== توکن‌های مشترک ===== */
:root {
  --btb-brand: var(--theme-color, #0d6efd);
  --btb-brand-rgb: var(--theme-color-rgb, 13, 110, 253);
  --btb-brand-soft: rgba(var(--btb-brand-rgb), 0.1);

  --btb-dark: #1a1a2e;
  --btb-muted: #6b7280;
  --btb-border: #eef0f3;

  --btb-radius: 16px;
  --btb-radius-sm: 8px;
  --btb-shadow: 0 6px 24px rgba(20, 40, 80, 0.07);

  --btb-section-pad: 72px;
  --btb-lh-body: 1.9;
  --btb-lh-title: 1.6;
}

/* ===== Hero (تعریف واحد) ===== */
.hero-b2b {
  direction: rtl;
  text-align: right;
  position: relative;
  overflow: visible;
  background: linear-gradient(180deg, #eef2f7 0%, #f6f8fb 100%);
  padding: var(--btb-section-pad) 0 0;
}

.hero-b2b__bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(
      42% 55% at 22% 30%,
      color-mix(in srgb, var(--btb-brand) 9%, transparent),
      transparent 70%
    ),
    radial-gradient(
      30% 40% at 85% 15%,
      color-mix(in srgb, var(--btb-brand) 6%, transparent),
      transparent 70%
    );
}
.hero-b2b .container {
  position: relative;
  z-index: 1;
}

/* بج با نقطه‌ی تپنده (ادغام دو تعریف) */
.hero-b2b__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--btb-brand) 8%, #fff);
  border: 1px solid color-mix(in srgb, var(--btb-brand) 20%, transparent);
  color: var(--btb-brand);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 16px;
}
.hero-b2b__badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--btb-brand);
  animation: btb-pulse 2.4s ease-in-out infinite;
}
@keyframes btb-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--btb-brand) 35%, transparent);
  }
  50% {
    box-shadow: 0 0 0 6px transparent;
  }
}

.hero-b2b__title {
  font-size: 38px;
  font-weight: 800;
  line-height: var(--btb-lh-title);
  color: var(--btb-dark);
  margin-bottom: 12px;
}

.hero-b2b__title-accent {
  font-size: inherit;
  font-weight: inherit;
  font-family: inherit;
  line-height: inherit;
  display: inline;
  padding: 0;
  background: linear-gradient(
    transparent 62%,
    color-mix(in srgb, #f59e0b 30%, transparent) 62%
  );
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.hero-b2b__tagline {
  font-size: 19px;
  font-weight: 600;
  color: var(--btb-brand);
  margin-bottom: 10px;
}

.hero-b2b__desc {
  font-size: 15px;
  line-height: 2;
  color: var(--btb-muted);
  max-width: 540px;
  margin-bottom: 28px;
}

.hero-b2b__actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* CTA (ادغام دو تعریف) */
.hero-b2b__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--btb-brand);
  color: #fff;
  padding: 12px 32px;
  border-radius: var(--btb-radius-sm);
  font-weight: 600;
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease;
}
.hero-b2b__cta svg {
  padding-right: 2px;
  transition: transform 0.25s ease;
}
.hero-b2b__cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px color-mix(in srgb, var(--btb-brand) 28%, transparent);
}
.hero-b2b__cta:hover svg {
  transform: translateX(-4px);
}

.hero-b2b__cta--ghost {
  background: transparent;
  border: 1.5px solid var(--btb-muted);
  color: var(--btb-brand);
  padding: 12px 28px;
  border-radius: var(--btb-radius-sm);
}
.hero-b2b__cta--ghost:hover {
  transform: translateY(-2px);
  border: 1.5px solid var(--btb-brand);
  box-shadow: 0 10px 24px color-mix(in srgb, var(--btb-brand) 28%, transparent);
}
.hero-b2b__cta--ghost svg {
  transition: transform 0.25s ease;
}
.hero-b2b__cta--ghost:hover svg {
  transform: translateX(-4px);
}
/* تصویر (ادغام دو تعریف) */
.hero-b2b__visual {
  position: relative;
  display: flex;
  justify-content: center;
}
.hero-b2b__visual::before {
  content: "";
  position: absolute;
  inset: 8% 4%;
  border-radius: 50%;
  background: radial-gradient(
    closest-side,
    color-mix(in srgb, var(--btb-brand) 14%, #fff),
    transparent
  );
  filter: blur(24px);
  z-index: 0;
}
.hero-b2b__visual::after {
  content: "";
  position: absolute;
  bottom: 4%;
  left: 50%;
  transform: translateX(-50%);
  width: 62%;
  height: 22px;
  border-radius: 50%;
  background: rgba(20, 30, 50, 0.16);
  filter: blur(14px);
  z-index: 0;
}
.hero-b2b__img {
  position: relative;
  z-index: 1;
  animation: btb-float 7s ease-in-out infinite;
  will-change: transform;
}
@keyframes btb-float {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-8px) rotate(0.4deg);
  }
}

/* ===== نوار آمار: wrapper فقط جای‌گذاری، ظاهر کارت روی row ===== */
.hero-b2b__stats {
  margin-top: 56px;
  position: relative;
  z-index: 2;
  transform: translateY(50%);
}
.hero-b2b__stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  text-align: center;
  background: #fff;
  border: 1px solid rgba(20, 30, 50, 0.06);
  border-radius: var(--btb-radius);
  box-shadow: var(--btb-shadow);
  padding: 1.75rem 1rem;
}
.hero-b2b__stats-row strong {
  display: block;
  font-size: 20px;
  color: var(--btb-brand);
}
.hero-b2b__stats-row span {
  font-size: 13px;
  color: var(--btb-muted);
}
.hero-b2b__stats-row .stat-item:not(:first-child) {
  border-inline-start: 1px solid rgba(20, 30, 50, 0.08);
}

/* انیمیشن ورود آیتم‌های آمار */
.stat-item {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 0.6s ease,
    transform 0.6s cubic-bezier(0.22, 0.61, 0.36, 1);
  transition-delay: var(--d, 0s);
}
.stat-item.is-visible {
  opacity: 1;
  transform: none;
}
.stat-item:nth-child(1) {
  --d: 0s;
}
.stat-item:nth-child(2) {
  --d: 0.12s;
}
.stat-item:nth-child(3) {
  --d: 0.24s;
}
.stat-item:nth-child(4) {
  --d: 0.36s;
}

/* Stats icons*/
.stat-item__icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 0.9rem;
  color: var(--btb-brand);
  background: color-mix(in srgb, var(--btb-brand) 9%, transparent);
  margin: 0 auto 1.1rem;
  transition:
    background 0.3s ease,
    color 0.3s ease,
    transform 0.3s ease;
}

.stat-item:hover .stat-item__icon {
  background: var(--btb-brand);
  color: #fff;
  transform: translateY(-6px);
}

/* ===== Partners ===== */
.btb-partners {
  padding: 70px 0;
  background: #fff;
  overflow: hidden;
}

.partners-marquee {
  margin-top: 40px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.marquee-track {
  display: flex;
  width: max-content;
  animation: btb-marquee 55s linear infinite;
}
.marquee-reverse {
  animation-direction: reverse;
}
.partners-marquee:hover .marquee-track {
  animation-play-state: paused;
}

.marquee-row {
  display: flex;
  align-items: center;
  gap: 56px;
  padding: 0 28px;
  margin: 0;
  list-style: none;
}

.marquee-row img {
  height: 52px;
  width: auto;
  max-width: 150px;
  object-fit: contain;
  filter: grayscale(1);
  opacity: 0.65;
  transition:
    filter 0.3s,
    opacity 0.3s;
}
.marquee-row img:hover {
  filter: none;
  opacity: 1;
}

@keyframes btb-marquee {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

/* ===== ریسپانسیو (همه در انتها، بعد از قواعد پایه) ===== */
@media (max-width: 991px) {
  .hero-b2b__title {
    font-size: 28px;
  }
  /* کارت شناور در موبایل داخل جریان قرار می‌گیرد */
  .hero-b2b {
    padding-bottom: 48px;
  }
  .hero-b2b__stats {
    transform: none;
  }
  .hero-b2b__stats-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 18px 0;
  }
  .hero-b2b__stats-row .stat-item {
    border: 0 !important;
  }
  /* وقتی کارت شناور نیست، جبران پدینگ هم لازم نیست */
  .hero-b2b + .btb-services {
    padding-top: var(--btb-section-pad);
  }
  .btb-services__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 767px) {
  .marquee-row {
    gap: 36px;
  }
  .marquee-row img {
    height: 40px;
  }
}

@media (max-width: 575px) {
  .hero-b2b {
    padding-top: 64px;
    padding-bottom: 32px;
  }
  .btb-services,
  .hero-b2b + .btb-services {
    padding-top: 64px;
    padding-bottom: 64px;
  }
  .btb-services__grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
}

/* ===== کاهش حرکت (یک بلاک واحد) ===== */
@media (prefers-reduced-motion: reduce) {
  .marquee-track {
    animation: none;
    flex-wrap: wrap;
    width: auto;
    justify-content: center;
  }
  .stat-item {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .stat-item__icon {
    transition: none;
  }
  .stat-item:hover .stat-item__icon {
    transform: none;
  }
  .hero-b2b__badge-dot,
  .hero-b2b__img {
    animation: none;
  }
  .hero-b2b__cta,
  .hero-b2b__cta svg {
    transition: none;
  }
}

/* ===== موبایل و تبلت ===== */
@media (max-width: 991.98px) {
  .hero-b2b {
    /* padding-top: calc(var(--btb-section-pad) * 0.6); */
    padding-top: var(--btb-section-pad);
  }

  .hero-b2b__content {
    text-align: center;
  }

  .hero-b2b__badge {
    margin-inline: auto;
  }

  .hero-b2b__title {
    font-size: clamp(1.5rem, 5.5vw, 2.1rem);
    line-height: 1.5;
    margin-bottom: 0.75rem;
  }

  .hero-b2b__tagline {
    font-size: 1rem;
    margin-bottom: 0.5rem;
  }

  .hero-b2b__desc {
    font-size: 0.9rem;
    line-height: 1.9;
    margin-bottom: 1.5rem;
    max-width: 34rem;
    margin-inline: auto;
  }

  /* دکمه‌ها: باهم تمام عرض */
  .hero-b2b__actions {
    display: flex;
    gap: 0.75rem;
    width: 100%;
  }

  .hero-b2b__actions .btn {
    flex: 1 1 0; /* هر دکمه نصف عرض */
    justify-content: center; /* متن و آیکن وسط دکمه */
    text-align: center;
    padding-inline: 0.5rem; /* جا برای متن در عرض کم */
    white-space: nowrap;
  }

  .hero-b2b__stats {
    transform: translateY(30%);
  }

  .btb-services {
    padding-top: calc(var(--btb-section-pad) + 3rem);
  }

  /* کارت آمار: به‌جای شناور، گرید ۲×۲ */
  .hero-b2b__stats-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem 0.75rem;
    padding: 1.25rem 1rem;
  }

  .stat-item {
    text-align: center;
    padding: 0.25rem 1rem;
  }

  .stat-item strong {
    font-size: 1.15rem;
  }

  .stat-item span {
    font-size: 0.78rem;
    line-height: 1.7;
  }

  .stat-item__icon {
    width: 46px;
    height: 46px;
    border-radius: 0.75rem;
    margin-bottom: 0.75rem;
  }
  .stat-item__icon svg {
    width: 20px;
    height: 20px;
  }
}

@media (max-width: 575.98px) {
  /* اگر متن دکمه‌ها در عرض خیلی کم جا نشد، زیر هم و تمام‌عرض */
  .hero-b2b__actions {
    flex-direction: column;
  }

  .hero-b2b__actions .btn {
    width: 100%;
  }
}
/* -----------------------------------------------
   شناورسازی طبیعی خودرو + سایهٔ هم‌فاز
----------------------------------------------- */
.car .hero-b2b__visual {
  animation: btb-drift 11s cubic-bezier(0.37, 0, 0.63, 1) infinite;
  will-change: transform;
}

@keyframes btb-drift {
  0%,
  100% {
    transform: translate3d(-2px, 0, 0);
  }
  50% {
    transform: translate3d(2px, 0, 0);
  }
}

/* ۲) خودرو: bob عمودی + پیچ پاندولی — بدون کلیدفریم میانی */
.car .hero-b2b__img {
  position: relative;
  z-index: 1;
  transform-origin: 50% 60%;
  animation: btb-float 7s cubic-bezier(0.37, 0, 0.63, 1) infinite;
  will-change: transform;
}

@keyframes btb-float {
  0%,
  100% {
    transform: translate3d(0, 0, 0) rotate(-0.3deg);
  }
  50% {
    transform: translate3d(0, -12px, 0) rotate(0.3deg);
  }
}

/* ۳) سایه: فقط transform/opacity — فیلتر ثابت می‌ماند */
.car .hero-b2b__visual::after {
  content: "";
  position: absolute;
  bottom: 28%;
  left: 50%;
  width: 46%;
  height: 30px;
  border-radius: 50%;
  background: radial-gradient(
    ellipse at 50% 50%,
    color-mix(in srgb, var(--car-navy) 32%, transparent),
    color-mix(in srgb, var(--car-navy) 16%, transparent) 45%,
    transparent 72%
  );
  filter: blur(6px); /* ثابت — یک‌بار raster می‌شود، نه هر فریم */
  z-index: 0;
  animation: btb-float-shadow 7s cubic-bezier(0.37, 0, 0.63, 1) infinite;
  will-change: transform, opacity;
}

@keyframes btb-float-shadow {
  0%,
  100% {
    transform: translateX(-50%) scale(1, 0.5);
    opacity: 1;
  }
  50% {
    transform: translateX(-50%) scale(0.84, 0.42);
    opacity: 0.55;
  }
}

@media (prefers-reduced-motion: reduce) {
  .car .hero-b2b__visual,
  .car .hero-b2b__img,
  .car .hero-b2b__visual::after {
    animation: none;
  }
}
/* =========================================================
   HERO B2B — Desktop / RTL
   ========================================================= */

/* دسکتاپ: محتوا راست، تصویر چپ */
@media (min-width: 992px) {
  .hero-b2b .row {
    display: flex;
    align-items: center;
  }

  .hero-b2b__content {
    order: 1;
  }

  .hero-b2b__visual-col {
    order: 2;
  }

  .hero-b2b__visual {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .hero-b2b__img {
    display: block;
    width: 100%;
    max-width: 520px;
    height: auto;
  }
}

/* =========================================================
   Tablet + Mobile
   ========================================================= */

@media (max-width: 991.98px) {
  .hero-b2b .row {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }

  /* تصویر بالای محتوا */
  .hero-b2b__visual-col {
    order: 1;
    width: 100%;
    max-width: 100%;
  }

  /* محتوا زیر تصویر */
  .hero-b2b__content {
    order: 2;
    width: 100%;
    max-width: 100%;
  }

  .hero-b2b__visual {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-bottom: 28px;
  }

  .hero-b2b__img {
    display: block;
    width: min(100%, 480px);
    height: auto;
  }
}

/* =========================================================
   Tablet
   ========================================================= */

@media (min-width: 768px) and (max-width: 991.98px) {
  .hero-b2b__img {
    width: min(100%, 460px);
  }

  .hero-b2b__visual {
    margin-bottom: 32px;
  }
}

/* =========================================================
   Mobile
   ========================================================= */

@media (max-width: 767.98px) {
  /* فضای کلی Hero */
  .hero-b2b {
    padding-top: 28px;
    padding-bottom: 0;
  }

  /* تصویر */
  .hero-b2b__visual {
    margin-bottom: 14px;
  }

  .hero-b2b__img {
    width: min(78vw, 320px);
    max-height: 270px;
    object-fit: contain;
  }

  /* محتوای Hero */
  .hero-b2b__content {
    padding-right: 12px;
    padding-left: 12px;
  }

  /* Badge */
  .hero-b2b__badge {
    margin-bottom: 10px;
  }

  /* Title */
  .hero-b2b__title {
    margin-bottom: 12px;
  }

  /* Tagline */
  .hero-b2b__tagline {
    margin-bottom: 8px;
  }

  /* Description */
  .hero-b2b__desc {
    margin-bottom: 16px;
  }

  /* CTA */
  .hero-b2b__actions {
    margin-top: 12px;
  }

  /* Stats */
  .hero-b2b__stats {
    margin-top: 24px;
  }
}

.header-style-1,
.car header.header-style-1 {
  position: relative;
}
