/*
 * Hero B2B — section index
 *  1  Tokens            12 Small phones
 *  2  Hero container    13 Car animations
 *  3  Badge             14 Desktop (RTL)
 *  4  Title & text      15 Stacked layout
 *  5  CTA buttons       16 Tablet
 *  6  Hero visual       17 Mobile
 *  7  Stats bar
 *  8  Partners marquee
 *  9  Responsive overrides
 * 10  Reduced motion
 * 11  Tablet & mobile layout
 */
/* ===== 1. Tokens (non-color, hero-local) ===== */
:root {
  --btb-brand: var(--brand-primary);
  --btb-brand-rgb: var(--theme-color-rgb);
  --btb-brand-soft: color-mix(in srgb, var(--btb-brand) 10%, transparent);

  --btb-dark: var(--text-heading);
  --btb-muted: var(--text-secondary);
  --btb-border: var(--border-subtle);

  --btb-radius: 16px;
  --btb-radius-sm: 8px;
  --btb-shadow: var(--ds-shadow-md);

  --btb-section-pad: 72px;
  --btb-lh-body: 1.9;
  --btb-lh-title: 1.6;
}

/* ===== 2. Hero container ===== */
.hero-b2b {
  direction: rtl;
  text-align: right;
  position: relative;
  overflow: visible;
  background: linear-gradient(
    180deg,
    var(--surface-background) 0%,
    var(--surface-background) 100%
  );
  padding: var(--btb-section-pad) 0 0;
}

.hero-b2b__bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(
      40% 50% at 15% 20%,
      color-mix(in srgb, var(--ds-primary) 10%, transparent),
      transparent 70%
    ),
    radial-gradient(
      30% 40% at 88% 12%,
      color-mix(in srgb, var(--theme-color) 9%, transparent),
      transparent 70%
    ),
    radial-gradient(
      50% 35% at 60% 100%,
      color-mix(in srgb, var(--ds-accent) 6%, transparent),
      transparent 75%
    ),
    linear-gradient(
      135deg,
      transparent 0%,
      color-mix(in srgb, var(--ds-primary) 3%, transparent) 100%
    );
}

.hero-b2b .container {
  position: relative;
  z-index: 1;
}

/* ===== 3. Badge ===== */
.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%, var(--surface-card));
  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(--theme-color);
  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(--theme-color) 35%, transparent);
  }
  50% {
    box-shadow: 0 0 0 6px transparent;
  }
}

/* ===== 4. Title & text ===== */
.hero-b2b__title {
  font-size: 38px;
  font-weight: 800;
  line-height: var(--btb-lh-title);
  margin-bottom: 12px;
}

.hero-b2b__title-accent {
  font-size: inherit;
  font-weight: inherit;
  font-family: inherit;
  line-height: inherit;
  display: inline;
  padding: 0;
  color: var(--btb-dark);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.hero-b2b__tagline {
  font-size: 19px;
  font-weight: 600;
  color: var(--brand-primary);
  margin-bottom: 10px;
}

.hero-b2b__desc {
  font-size: 15px;
  line-height: 2;
  color: var(--text-secondary);
  max-width: 540px;
  margin-bottom: 28px;
}

.hero-b2b__actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* ===== 5. CTA buttons ===== */
.hero-b2b__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--btb-brand);
  color: var(--text-white);
  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(--text-secondary);
  color: var(--theme-color);
  padding: 12px 28px;
  border-radius: var(--btb-radius-sm);
}
.hero-b2b__cta--ghost:hover {
  transform: translateY(-2px);
  border: 1.5px solid var(--theme-color);
  box-shadow: 0 10px 24px
    color-mix(in srgb, var(--theme-color) 28%, transparent);
}
.hero-b2b__cta--ghost svg {
  transition: transform 0.25s ease;
}
.hero-b2b__cta--ghost:hover svg {
  transform: translateX(-4px);
}
/* ===== 6. Hero visual ===== */
.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(--theme-color) 14%, var(--surface-card)),
    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: color-mix(in srgb, var(--ds-shadow-color) 16%, transparent);
  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;
}
/* ===== 7. Stats bar ===== */
.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: var(--surface-card);
  border: 1px solid color-mix(in srgb, var(--border-color) 60%, transparent);
  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
    color-mix(in srgb, var(--border-color) 80%, transparent);
}

/* Entrance animation for stat items */
.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;
}

/* Stat 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: var(--text-white);
  transform: translateY(-6px);
}

/* ===== 8. Partners marquee ===== */
.btb-partners {
  padding: 70px 0;
  background: var(--surface-card);
  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%);
  }
}

/* ===== 9. Responsive overrides (after base rules) ===== */
@media (max-width: 991px) {
  .hero-b2b__title {
    font-size: 28px;
  }
  /* Floating card flows in-document on mobile */
  .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;
  }
  /* No padding offset needed when the card is not floating */
  .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;
  }
}

/* ===== 10. Reduced motion ===== */
@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;
  }
}

/* ===== 11. Tablet & mobile layout ===== */
@media (max-width: 991.98px) {
  .hero-b2b {
    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;
  }

  /* Buttons: equal width, side by side */
  .hero-b2b__actions {
    display: flex;
    gap: 0.75rem;
    width: 100%;
  }

  .hero-b2b__actions .btn {
    flex: 1 1 0; /* Equal halves */
    justify-content: center; /* Center text and icon */
    text-align: center;
    padding-inline: 0.5rem; /* Room for text on narrow widths */
    white-space: nowrap;
  }

  .hero-b2b__stats {
    transform: translateY(30%);
  }

  .btb-services {
    padding-top: calc(var(--btb-section-pad) + 3rem);
  }

  /* Stats card: 2x2 grid instead of floating */
  .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;
  }
}

/* ===== 12. Small phones ===== */
@media (max-width: 575.98px) {
  /* Stack buttons full-width if text does not fit */
  .hero-b2b__actions {
    flex-direction: column;
  }

  .hero-b2b__actions .btn {
    width: 100%;
  }
}
/* ===== 13. Car animations ===== */
.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);
  }
}

/* Vertical bob + pendulum sway, no mid keyframe */
.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);
  }
}

/* Shadow: transform/opacity only; filter stays static */
.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(--ds-shadow-color) 32%, transparent),
    color-mix(in srgb, var(--ds-shadow-color) 16%, transparent) 45%,
    transparent 72%
  );
  filter: blur(6px); /* Static blur: rasterized once, not every frame */
  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;
  }
}
/* ===== 14. Desktop (RTL, >=992px) ===== */

/* Content right, visual left */
@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;
  }
}

/* ===== 15. Stacked layout (<=991.98px) ===== */

@media (max-width: 991.98px) {
  .hero-b2b .row {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }

  /* Visual above content */
  .hero-b2b__visual-col {
    order: 1;
    width: 100%;
    max-width: 100%;
  }

  /* Content below visual */
  .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;
  }
}

/* ===== 16. Tablet (768-991px) ===== */

@media (min-width: 768px) and (max-width: 991.98px) {
  .hero-b2b__img {
    width: min(100%, 460px);
  }

  .hero-b2b__visual {
    margin-bottom: 32px;
  }
}

/* ===== 17. Mobile (<=767.98px) ===== */

@media (max-width: 767.98px) {
  /* Hero spacing */
  .hero-b2b {
    padding-top: 28px;
    padding-bottom: 0;
  }

  /* Visual */
  .hero-b2b__visual {
    margin-bottom: 14px;
  }

  .hero-b2b__img {
    width: min(78vw, 320px);
    max-height: 270px;
    object-fit: contain;
  }

  /* Hero content */
  .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;
}
