/* ============================================================
   ABM Partner — СЕКЦИЯ «НАШИ КЛИЕНТЫ»
   Три бегущие строки с логотипами партнёров и блок-призыв.
   ============================================================ */

.clients {
    background: var(--color-bg-tint);
    padding-bottom: 1.77rem;
}

/* ===== Ряды ===== */
.clients__rows {
    display: flex;
    flex-direction: column;
    gap: clamp(2.2rem, 4.4vw, 3.75rem);
    width: 100%;
    min-width: 0;
    padding-bottom: 1.77rem;
}

.clients__row {
    --speed: 30;  /* скорость бегущей строки, px/сек */

    display: grid;
    grid-template-columns: minmax(14.375rem, 20rem) 1fr;
    column-gap: var(--gap-columns);
    align-items: center;
    padding: 0;
}

/* Подпись ряда */
.clients__row-label {
    position: relative;
    padding: 0.625rem 0.9375rem;
    background: var(--color-surface-warm);
    border-radius: var(--radius-xl) 0;
    min-height: 8.25rem;
}

.clients__row-title {
    font-size: var(--fs-h5);
    font-weight: var(--fw-h5);
    line-height: var(--lh-h5);
    letter-spacing: var(--ls-h5);
    margin: 0 0 var(--space-xs);
    color: var(--color-ink);
}

.clients__row-desc {
    margin: 0;
    font-family: var(--font-sans);
    font-size: var(--fs-xs);
    line-height: var(--lh-ui);
    letter-spacing: 0.02em;
    color: var(--color-muted);
    min-height: 2.5rem;
}

/* ===== Бегущая строка ===== */
.clients__marquee {
    overflow: hidden;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
    touch-action: pan-y;
    user-select: none;
    -webkit-user-select: none;
    cursor: grab;
}

.clients__row--dragging .clients__marquee {
    cursor: grabbing;
}

.clients__marquee-track {
    display: flex;
    width: max-content;
    /* Ленту ведёт JS (transform каждый кадр) — свой слой, иначе
       браузер перерисовывает всю полосу картинок на каждом кадре. */
    will-change: transform;
}

.clients__marquee-group {
    display: flex;
    gap: 1.1rem;
    padding-right: 1.1rem;
}

/* ===== Логотип партнёра ===== */
.clients__logo {
    position: relative;
    flex: 0 0 auto;
    width: 12.5rem;
    height: 7.5rem;
    background: var(--color-surface);
    border-radius: var(--radius-md);
    display: grid;
    place-items: center;
    overflow: hidden;
    margin: 0;
    user-select: none;
    -webkit-user-select: none;
}

.clients__logo img {
    width: 80%;
    height: 80%;
    object-fit: contain;
    filter: grayscale(1);
    opacity: 0.6;
    transition:
        filter 0.45s,
        opacity 0.45s;
    pointer-events: none;
    -webkit-user-drag: none;
    user-drag: none;
    -webkit-touch-callout: none;
}

.clients__logo:hover img {
    filter: none;
    opacity: 1;
}


/* ============================================================
   БЛОК «СТАНЬТЕ ПАРТНЁРОМ»
   ============================================================ */
.clients__cta {
    position: relative;
    margin-top: clamp(3.5rem, 7vw, 6rem);
    border-radius: var(--radius-2xl);
    overflow: hidden;
    background: var(--color-hero-bg) url("../images/slide.jpg") bottom / cover no-repeat;
    color: var(--color-cream);
    padding: clamp(2rem, 5vw, 3.75rem);
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: var(--gap-columns);
}

/* Цветная подложка поверх фото */
.clients__cta::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(95deg, rgba(25, 67, 147, 0.75) 0%, rgba(128, 154, 216, 0.55) 45%, rgba(38, 37, 84, 0.73) 100%);
}


.clients__cta-content,
.clients__cta-action {
    position: relative;
    z-index: 1;
}

.clients__cta-pretitle {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0;
    font-family: var(--font-sans);
    font-size: var(--fs-xs);
    text-transform: uppercase;
    letter-spacing: 0.22em;
    color: var(--color-cream-soft);
}

.clients__cta-pretitle::before {
    content: "";
    flex: none;
    width: 2.25rem;
    height: 1px;
    background: rgba(251, 245, 233, 0.6);
}

.clients__cta-title {
    position: relative;
    margin: 1.1rem 0 0;
    font-size: var(--fs-h3);
    font-weight: var(--fw-h3);
    letter-spacing: 0.015em;
    text-transform: uppercase;
    line-height: var(--lh-h3);
    color: var(--color-cream);
}

.clients__cta-text {
    position: relative;
    margin: var(--gap-text) 0 0;
    font-size: var(--fs-base);
    line-height: var(--lh-base);
    color: var(--color-cream-soft);
    max-width: 52ch;
}

.clients__cta-action {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: 0.9rem;
    min-width: min(20rem, 100%);
}

.clients__cta-buttons {
    display: flex;
    flex-wrap: wrap;
    flex-direction: column;
    gap: 0.9rem;
}

.clients__cta-buttons .btn {
    width: 100%;
}

.clients__btn {
    gap: 0.9rem;
    padding: 1.15rem 2rem;
}

.clients__btn svg {
    width: var(--fs-base);
    height: var(--fs-base);
}

/* ============================================================
   АДАПТИВ
   ============================================================ */
@media (min-width: 60rem) {  /* 960px */
    /* Безопасный bleed вправо до края экрана (как у писем):
       % в margin считается от .container, поэтому правый край
       встаёт ровно по вьюпорту — без горизонтального скролла.
       Лишнюю ширину забирает колонка 1fr с бегущей строкой,
       подписи рядов остаются выровненными по контейнеру. */
    .clients__rows {
        width: auto;
        margin-right: calc(50% - 50vw);
    }
}

@media (min-width: 68.75rem) {  /* 1100px */
    .clients__cta { padding-right: 8.75rem; }
}

@media (max-width: 60rem) {  /* 960px */
    .clients__row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .clients__row-label,
    .clients__row-desc {
        min-height: auto;
    }
    .clients__cta { grid-template-columns: 1fr; }
    .clients__cta-action {
        width: 100%;
        max-width: 26.25rem;
    }
}

@media (max-width: 35rem) {  /* 560px */
    .clients__logo {
        width: 10rem;
        height: 6rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .clients__marquee {
        overflow-x: auto;
        -webkit-mask-image: none;
        mask-image: none;
        touch-action: auto;
        cursor: auto;
    }
}

/* Без JS лента не едет — отдаём её пользователю прокруткой */
@media (scripting: none) {
    .clients__marquee {
        overflow-x: auto;
        -webkit-mask-image: none;
        mask-image: none;
        touch-action: auto;
        cursor: auto;
    }
}
