/* ==================================================
   integrations.css — «Партнерські інтеграції»
   PROD build 26-04-2025 — відкориговано відступи
   ================================================== */

/* ---------- wrapper -------------------------------- */
.integrations {
  position: relative;
  /* вертикальні паддінги зменшено */
  padding-block: clamp(40px, 10vh, 60px);
  /* горизонтальні паддінги додано */
  padding-inline: clamp(16px, 4vw, 24px);
  background: var(--about-bg-dark);
  color: var(--txt-accent-dark);
  overflow: visible; /* Заголовок і текст більше не обрізаються */
  transition: color 0.3s ease; /* Added transition for color */
  will-change: background;
}
body.light-theme .integrations {
  background: var(--about-bg-light);
  color: var(--txt-accent-light);
  transition: color 0.3s ease; /* Переход только для текста */
}
body.light-theme .hero {
  background: var(--about-bg-light);
}

/* ---------- title ---------------------------------- */
.integrations-title {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 700;
  text-align: center;
  margin-bottom: 24px; /* зменшено */
  color: inherit;
}
.integrations-title span { color: #f59e0b; }
body.light-theme .integrations-title span { color: #2563eb; }

/* ---------- wrapper inner ------------------------- */
.integrations-wrapper {
  display: flex;
  flex-direction: column;
  gap: 16px; /* зменшено */
  overflow: hidden; /* тепер треки обрізаються тут */
}

/* ---------- tracks --------------------------------- */
.integrations-track {
  display: flex;
  gap: 16px; /* зменшено */
  animation: scroll-left 30s linear infinite;
  will-change: transform;
}
.integrations-track.reverse {
  animation: scroll-right 30s linear infinite;
}

/* ---------- logos ---------------------------------- */
.integrations-track img {
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
  object-fit: contain;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  padding: 8px;
  transition: transform 0.3s;
}
.integrations-track img:hover {
  transform: scale(1.1);
}

/* ---------- fade-градієнт ------------------------- */
.integrations::before,
.integrations::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 80px; /* зменшено */
  pointer-events: none;
  z-index: 1;
}
.integrations::before {
  left: 0;
  background: linear-gradient(to right, var(--about-bg-dark), transparent);
}
.integrations::after {
  right: 0;
  background: linear-gradient(to left, var(--about-bg-dark), transparent);
}
body.light-theme .integrations::before {
  background: linear-gradient(to right, var(--about-bg-light), transparent);
}
body.light-theme .integrations::after {
  background: linear-gradient(to left, var(--about-bg-light), transparent);
}

/* ---------- keyframes ------------------------------ */
@keyframes scroll-left {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
@keyframes scroll-right {
  from { transform: translateX(-50%); }
  to   { transform: translateX(0); }
}

/* ---------- hover-pause ---------------------------- */
.integrations-wrapper:hover .integrations-track {
  animation-play-state: paused;
}

/* ---------- prefers-reduced-motion ---------------- */
@media (prefers-reduced-motion: reduce) {
  .integrations-track { animation: none; }
}

/* ---------- responsive ----------------------------- */
/* ≤1024px */
@media (max-width: 1024px) {
  .integrations {
    padding-block: clamp(32px, 8vh, 50px);
  }
  .integrations-track img {
    width: 56px;
    height: 56px;
  }
}

/* ≤768px */
@media (max-width: 768px) {
  .integrations {
    padding-block: clamp(24px, 8vh, 40px);
    padding-inline: 16px;
  }
  .integrations-wrapper {
    gap: 12px;
  }
  .integrations-track {
    gap: 12px;
    animation: scroll-left 20s linear infinite;
  }
  .integrations-track.reverse {
    display: none;
  }
  .integrations-track img {
    width: 48px;
    height: 48px;
    padding: 6px;
  }
}

/* ≤480px */
@media (max-width: 480px) {
  .integrations {
    padding-block: clamp(16px, 6vh, 32px);
  }
  .integrations-title {
    font-size: 1.4rem;
    margin-bottom: 16px;
  }
  .integrations-track {
    gap: 8px;
    animation-duration: 15s;
  }
  .integrations-track img {
    width: 40px;
    height: 40px;
    padding: 4px;
  }
  .integrations::before,
  .integrations::after {
    width: 40px;
  }
}
