/* =========================================
   NEW STAGE SECTION (fallback + Splide mode)
   ========================================= */

/* Section spacing */
.stage {
    padding: 100px 0;
}

.stage .container {
    overflow: visible;
}

.main_new__stage_body-block {
    position: relative;
    width: 100%;
    overflow: visible;
    padding-top: 100px;
}

/* -----------------------------------------
   Header / Titles
   ----------------------------------------- */
.stage__header-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 30px;
    margin-bottom: 0;
}

.stage__title-block {
    flex: 1;
    min-width: 0;
}

.new__main-title {
    margin: 0;
    color: #2C2C2C;
    font-size: 40px;
    font-weight: 600;
    line-height: 120%;
    letter-spacing: -0.2px;
}

.new__main-title h2 {
    margin: 0;
    color: #2C2C2C;
    font-size: 40px;
    font-weight: 600;
    line-height: 120%;
    letter-spacing: -0.2px;
}

.new__main-title h2 > span {
    color: #5665f2;
}

.new__small-title {
    margin: 10px 0;
    white-space: pre-line;
    text-align: center;
    font-weight: 400;
    font-size: 24px;
    line-height: 120%;
    letter-spacing: -0.02em;
}

/* Align helpers */
.text-center { text-align: center; }

.new__main-title.text-center,
.new__main-title.text-center h2 {
    text-align: center;
}

.new__main-title.text-left,
.new__main-title.text-left h2 {
    text-align: left;
}

/* -----------------------------------------
   Arrows (your design)
   ----------------------------------------- */
.splide__arrows {
    display: flex;
    gap: 42px;
    flex-shrink: 0;
    align-items: center;
    position: relative;
}

.splide__arrow svg {
    fill: none !important;
}

.splide__arrow {
    background: transparent;
    border: 1px solid #E0E0E0;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    padding: 0;
    outline: none;
    position: relative !important;
    transition: none;
    transform: translateY(0%);
}

.splide__arrow:hover {
    background: transparent;
    border-color: #2C2C2C;
}

.splide__arrow:active {
    background: transparent;
    border-color: #5665f2;
}

.splide__arrow--prev svg {
    transform: rotate(180deg);
}

.splide__arrow svg {
    width: 11px;
    height: 18px;
    pointer-events: none;
}

.splide__arrow svg path {
    transition: stroke 0.2s ease;
}

.splide__arrow:hover svg path {
    stroke: #5665f2;
}

/* Disabled */
.splide__arrow[disabled] {
    opacity: 0.4;
    cursor: default;
    pointer-events: none;
}

/* -----------------------------------------
   Cards (shared for both modes)
   ----------------------------------------- */
.new__stage_body-block {
    padding-top: 100px;
    gap: 12px;
    padding-bottom: 60px;
}

/* Card */
.new__stage-block {
    display: flex;
    flex-direction: column;
    padding: 16px;
    position: relative;
    gap: 20px;
    padding-bottom: 25px;

    border-radius: 15px;
    flex-shrink: 0;
    user-select: none;

    width: 300px;
    min-width: 300px;
    max-width: 300px;
}

.new__stage-block * {
    user-select: none;
}

/* Colors (fallback mode: nth-child works when cards are direct children) */
.new__stage-block:nth-child(1) { background-color: #EDEEFF; }
.new__stage-block:nth-child(2) { background-color: #FFFFFF; }
.new__stage-block:nth-child(3) { background-color: #B3B3B31A; }
.new__stage-block:nth-child(4) { background-color: #FFFFFF; }
.new__stage-block:nth-child(5) { background-color: #EDEEFF; }
.new__stage-block:nth-child(6) { background-color: #B3B3B31A; }

.new__stage-block-img {
    width: auto;
    height: 90px !important;
    position: absolute;
    top: -46px;
    right: 20px;
    overflow: visible;
    pointer-events: none;
    user-select: none;
}

.new__stage-block-number {
    color: rgba(0, 54, 246, 0.2) !important;
    font-weight: 600;
    font-size: 22px;
    line-height: 120%;
    background-color: transparent !important;
    user-select: none;
}

.new__stage-block-text {
    gap: 30px;
    display: flex;
    flex-direction: column;
}

.new__line {
    height: 1px;
    background: #2C2C2C66;
    width: 50%;
}

.new__stage-block-text span {
    white-space: pre-wrap;
    color: var(--blue) !important;
    font-size: 22px;
    line-height: 120%;
    letter-spacing: -0.2px;
    font-weight: 600;
    display: flex;
    align-items: flex-end;
    user-select: none;
}

/* Text animation (текст показывается через .is-visible из JS) */
.new__stage-block-text p {
    margin: 0;
    font-weight: 400;
    color: #2C2C2C99;
    font-size: 18px;
    line-height: 120%;
    letter-spacing: -0.2px;
    word-wrap: break-word;
    overflow-wrap: break-word;

    transform: translateY(20px);
    user-select: none;
}

.new__stage-block-text.is-visible p {
    opacity: 1;
    transform: translateY(0);
}

.new__stage__btn-footer {
    display: flex;
    justify-content: center;
    margin-top: 40px;
}

/* =========================================================
   FALLBACK MODE (old scroll container)
   ========================================================= */
.stage__body-block::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

.stage__body-block {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    scroll-padding: 20px;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    touch-action: pan-x pan-y;
    align-items: stretch;
    cursor: grab;
    user-select: none;
}

.stage__body-block:active {
    cursor: grabbing;
}

.stage__body-block > * {
    scroll-snap-align: start;
}

/* =========================================
   SPLIDE MODE (when .stage-splide exists)
   Structure must be track > list > slide. [web:21]
   ========================================= */
.stage-splide .splide__track {
    overflow: visible;
}

/* Список (ul.stage__body-block) — это flex-лента Splide, тянем по высоте */
.stage-splide .splide__list {
    align-items: stretch; /* equal-height base in flex rows [web:89] */
}

/* В Splide режиме твой list не должен быть scroll-контейнером */
.stage-splide .stage__body-block {
    overflow: visible !important;
    overflow-x: visible !important;
    overflow-y: visible !important;

    scroll-snap-type: none !important;
    scroll-behavior: auto !important;

    cursor: default !important;
    user-select: auto !important;

    /* горизонталь отдаём Splide, вертикаль — странице */
    touch-action: pan-y;
}

/* На детях тоже вырубаем snap */
.stage-splide .stage__body-block > * {
    scroll-snap-align: none !important;
}

/* Важное для одинаковой высоты:
   делаем slide flex-контейнером, а карточку — height:100% */
.stage-splide .splide__slide {
    width: 300px;         /* используется с autoWidth:true [web:43] */
    flex: 0 0 auto;

    display: flex;
    height: auto;         /* высоту выставит JS (max-height) */
}

.stage-splide .splide__slide .new__stage-block {
    width: 100%;
    min-width: 0;
    max-width: none;

    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Цвета в Splide режиме (nth-child теперь на li) */
.stage-splide .splide__slide:nth-child(1) .new__stage-block { background-color: #EDEEFF; }
.stage-splide .splide__slide:nth-child(2) .new__stage-block { background-color: #FFFFFF; }
.stage-splide .splide__slide:nth-child(3) .new__stage-block { background-color: #B3B3B31A; }
.stage-splide .splide__slide:nth-child(4) .new__stage-block { background-color: #FFFFFF; }
.stage-splide .splide__slide:nth-child(5) .new__stage-block { background-color: #EDEEFF; }
.stage-splide .splide__slide:nth-child(6) .new__stage-block { background-color: #B3B3B31A; }

/* -----------------------------------------
   Responsive
   ----------------------------------------- */
@media (max-width: 768px) {
    .stage { padding: 60px 0; }

    .splide__arrows { display: none; }

    .stage__header-wrapper { margin-bottom: 0; }

    .new__stage_body-block {
        padding-top: 60px;
        padding-bottom: 40px;
    }

    .new__main-title.text-center,
    .new__main-title.text-center h2 {
        text-align: left;
    }

    /* ВАЖНО: если хочешь, чтобы текст всегда вмещался,
       фиксированную высоту на мобиле лучше убрать.
       Поэтому height/min-height НЕ задаём. */

    .new__stage-block {
        width: 280px;
        min-width: 280px;
        max-width: 280px;
        padding: 16px;
        gap: 10px;
    }

    .stage-splide .splide__slide { width: 280px; }

    .new__main-title h2 { font-size: 28px; }

    .new__small-title {
        font-size: 16px;
        margin: 10px 0 40px 0;
    }

    .new__stage-block-text span {
        font-size: 20px;
        height: auto;
        min-height: 60px;
    }

    .new__stage-block-text p { font-size: 16px; }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .new__stage-block {
        width: 280px;
        min-width: 280px;
        max-width: 280px;
    }
    .stage-splide .splide__slide { width: 280px; }
}

@media (min-width: 1025px) {
    .new__stage-block {
        width: 300px;
        min-width: 300px;
        max-width: 300px;
    }
    .stage-splide .splide__slide { width: 300px; }
}

/* -----------------------------------------
   Safety: show text before JS init (optional)
   ----------------------------------------- */
.stage-splide:not(.is-initialized) .new__stage-block-text p {
    opacity: 1;
    transform: none;
    transition: none;
}
