/* =========================================
   ABOUT / OPTIMIZATION SECTION (Splide-ready)
   Markup:
   .optimization__body-block.splide.optimization-splide
     .splide__track
       ul.splide__list
         li.splide__slide
           .optimization__block
   ========================================= */

/* About wrapper */
.about__us-number {
    margin: 100px 0;
    overflow: hidden;
}

.about__us-number-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    gap: 20px;
}

.about__us-number-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex: 1;
}

.about__us-number-header-content div {
    margin-right: 100px;
}

.about__us-header-title {
    margin: 0;
    font-size: 48px;
    font-weight: 600;
    line-height: 120%;
}

.mob-about__us-header {
    display: none;
}

.about__us-header-title span {
    color: var(--blue);
    font-style: italic;
}

.optimization__small-title {
    text-align: center;
    font-weight: 500;
    font-size: 24px;
    line-height: 120%;
    letter-spacing: -0.02em;
}

/* body wrapper */
.optimization__main-body-block {
    position: relative;
    overflow: hidden;
    cursor: grab;
}

/* line under title (type1) */
.optimization__line-title {
    width: 100%;
    height: 1px;
    background-color: #04040433;
    margin: 50px 0;
}

/* -----------------------------------------
   Arrows in header (keep your look)
   IMPORTANT: don't duplicate global .splide__arrows rules;
   scope them to this section to avoid overriding stage.
   ----------------------------------------- */
.about__us-number .optimization__custom-arrows {
    display: flex;
    gap: 50px;
    flex-shrink: 0;
    align-items: center;
}

/* стрелки (в этом блоке хотим именно "белые", как было) */
.about__us-number .optimization__custom-arrows .splide__arrow {
    background: #fff;
    border: 1px solid rgba(44, 44, 44, 0.2);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    min-width: 50px;
    min-height: 50px;

    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
    outline: none;
}

.about__us-number .optimization__custom-arrows .splide__arrow:hover:not([disabled]) {
    background: #f5f5f5;
    border-color: rgba(44, 44, 44, 0.4);
}

.about__us-number .optimization__custom-arrows .splide__arrow--prev svg {
    transform: rotate(180deg);
}

.about__us-number .optimization__custom-arrows .splide__arrow[disabled] {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

/* -----------------------------------------
   Cards styling (same as before)
   ----------------------------------------- */
/* -----------------------------------------
   Cards styling (скорректировано под Splide perPage)
   ----------------------------------------- */
.optimization__block {
    display: flex;
    position: relative;
    height: max-content;
    flex-direction: row;
    
    padding: 56px 20px 0;
    border-radius: 25px;
    gap: 20px;

    /* карточка ровно в ячейке Splide */
    flex-shrink: 0;

    transition: background 0.3s ease, color 0.3s ease;
}
.optimization-splide .splide__slide .optimization__block {
    display: flex;
    position: relative;
    height: max-content;
    flex-direction: row;

    padding: 56px 20px 0;
    border-radius: 25px;
    gap: 20px;

    width: 100%;           /* ВАЖНО: ровно ширина слайда */
    min-width: 0;
    max-width: none;
    flex-shrink: 0;

    min-height: 100%;
    transition: background 0.3s ease, color 0.3s ease;
}

/* Слайд как колонка сетки — пусть сам Splide считает ширину */
.optimization-splide .splide__slide {
    display: flex;
    height: auto;
    flex: 0 0 auto; /* стандарт для Splide в горизонтальном режиме */
}

.optimization__block * {
    transition: color 0.3s ease;
}

.optimization__block:not(:first-child)::before {
    position: absolute;
    content: "";
    height: 70%;
    width: 1px;
    left: -25px;
    background-color: #C4C4C4;
}

.optimization__block-number {
    color: #2C2C2C66 !important;
    font-weight: 500;
    font-size: 100px;
    line-height: 70%;
    margin: 0;
    background-color: transparent !important;
}

.optimization__block-text {
    gap: 30px;
    display: flex;
    flex-direction: column;
    user-select: none;
}

.optimization__line {
    height: 1px;
    background: #2C2C2C66;
    width: 50%;
}

.optimization__block-text span {
    white-space: pre-wrap;
    color: #2C2C2C66 !important;
    font-size: 32px;
    line-height: 130%;
    letter-spacing: -0.2px;
    font-weight: 600;
    height: 80px;
    display: flex;
    align-items: flex-end;
}

.optimization__block-text p {
    margin: 0;
    font-weight: 400;
    color: #2C2C2C66;
    font-size: 16px;
    line-height: 120%;
    letter-spacing: -0.2px;
    padding-bottom: 20px;
}

/* hover */
.optimization__block:hover {
    background: #fff;
}

.optimization__block:hover .optimization__block-text span,
.optimization__block:hover .optimization__block-text p {
    color: #2C2C2C !important;
}

.optimization__block:hover .optimization__block-number {
    color: #4A5FE6 !important;
}

.optimization__block:hover .optimization__line {
    background: #2C2C2C;
}

/* -----------------------------------------
   OLD fallback scroll mode (if Splide not loaded)
   This applies only when optimization-splide is NOT initialized.
   ----------------------------------------- */
.optimization__body-block {
    /* root is .splide now, but these rules are safe as fallback */
    display: flex;
    flex-wrap: nowrap;

    overflow-x: auto;
    overflow-y: hidden;

    align-items: center;
    gap: 50px;

    padding-top: 0px;
    padding-bottom: 60px;

    scrollbar-width: none;
    -ms-overflow-style: none;

    cursor: grab;
    user-select: none;
}

.about__us-number-header div {
    margin-right: 0 !important;
}

.optimization__body-block::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.optimization__body-block:active {
    cursor: grabbing;
}

/* =========================================
   SPLIDE MODE overrides
   When .optimization__body-block has .splide and is initialized,
   we must disable overflow scrolling + make list/slide behave.
   ========================================= */

/* Track should not clip the card top/lines if any */
.optimization-splide .splide__track {
    overflow: visible;
    cursor: grab;
}

/* The list is the moving flex row in Splide — allow stretch for equal-height base */
.optimization-splide .splide__list {
    align-items: stretch; /* flexbox stretch base [web:89] */
}

/* root should not be a scroll container in Splide mode */
.optimization-splide.optimization__body-block {
    overflow: visible !important;
    overflow-x: visible !important;
    overflow-y: visible !important;

    scroll-behavior: auto !important;
    cursor: default !important;
    user-select: auto !important;

    /* horizontal drag handled by Splide; let page scroll vertically */
    touch-action: pan-y;
}




/* -----------------------------------------
   Mobile
   ----------------------------------------- */
@media (max-width: 768px) {
    .about__us-number {
        margin: 30px 0;
        overflow: visible;
    }

    .about__us-number-header-content {
        display: flex;
        flex-direction: column;
        gap: 20px;
        align-items: flex-start;
    }

    .mob-about__us-header { display: block; }

    .about__us-number-header h2 { margin-bottom: 0; }

    .about__us-number-header h2 p {
        font-size: 22px;
    }

    .about__us-header-title-desk,
    .us-header-title-desk {
        display: none;
    }

    .about__us-number-header {
        flex-direction: row;
        align-items: flex-start;
        margin-bottom: 0;
    }



    .about__us-header-title {
        font-size: 16px;
    }

    .optimization__small-title {
        text-align: left;
        font-size: 17px;
    }

    .optimization__line-title {
        width: 100%;
        height: 1px;
        background-color: #04040433;
        margin: 5px 0;
        margin-top: 20px;
    }

    /* arrows */
    .about__us-number .optimization__custom-arrows {
        align-self: center;
        margin-top: 0px;
        gap: 40px;
        width: 110px;
    }

    /* fallback scroll spacing */
    .optimization__body-block {
        padding-top: 15px;
        gap: 40px;
        padding-bottom: 10px;
    }

    /* card sizing on mobile */
    .optimization__block {
        padding: 20px 12px 57px 12px;
        gap: 10px;

        width: 300px;
        min-width: 300px !important;
        max-width: 300px;

        /* фикс height лучше не ставить, если нужно "вмещать весь текст".
           Если прям нужно фиксированно — верни height:310px; */
    }

    .stage__body-block-item-attr p {
        width: max-content;
        padding: 10px 0px;
        background: #fff;
        color: #2c2c2c;
        border-radius: 15px;
    }

    .optimization__block-number {
        font-size: 64px;
        padding: 10px 0px !important;
    }

    .optimization__block-text {
        gap: 30px;
        display: flex;
        flex-direction: column;
    }

    .optimization__block-text span {
        font-size: 24px;
        height: min-content;
    }

    .optimization__block-text p {
        font-size: 14px;
    }
}
.splide__arrow svg {
    fill: none !important;
}