/* =========================================================
   ECX INDUSTRIES
========================================================= */

.ecx-ind {
    --ecx-ind-bg: #f6f8fb;
    --ecx-ind-card: #ffffff;
    --ecx-ind-ink: #17202b;
    --ecx-ind-muted: #5b6474;
    --ecx-ind-line: #e6e9ef;
    --ecx-ind-blue: #1d5fe0;
    --ecx-ind-navy: #0b2545;
    --ecx-ind-red: #ec3024;
    --ecx-ind-stack-top: 70px;   /* where the cards stick */

    position: relative;
    z-index: 1;
    isolation: isolate;
    overflow: clip;
    background: var(--ecx-ind-bg);
    color: var(--ecx-ind-ink);
    font-family: "Poppins", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    /* Bottom padding is real space after the stack, so the next section
       starts once the last card has scrolled clear of the viewport. */
    padding: 60px 15px 40px;
}

/* The sections after Industries paint above the sticky cards.
   Without this, the last card stays on top of Platform Suite as it arrives. */
.ecx-ind ~ section {
    position: relative;
    z-index: 2;
}

.ecx-ind *,
.ecx-ind *::before,
.ecx-ind *::after {
    box-sizing: border-box;
}

.ecx-ind__container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 12px;
}


/* =========================================================
   HEADER
========================================================= */

.ecx-ind__header {
    position: relative;
    z-index: 5;
    padding: var(--section-y) 0 var(--section-head-gap);
    background: var(--ecx-ind-bg);
    text-align: center;
    margin-bottom: 50px;
}

.ecx-ind__tag {
    display: inline-flex;
    align-items: center;
    margin-bottom: 14px;
    padding: 5px 12px;
    border: 1px solid transparent;
    border-radius: 30px;
    background:
        linear-gradient(var(--ecx-ind-bg), var(--ecx-ind-bg)) padding-box,
        linear-gradient(90deg, #7fa3e6, #d7a3c8) border-box;
    color: var(--ecx-ind-blue);
    font-size: 10px;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.ecx-ind__title {
    margin: 0 0 12px;
    color: var(--ecx-ind-ink);
    /* Floor matches the other section titles (.section-title, 1.7rem) on tablet */
    font-size: clamp(1.7rem, 2.3vw, 40px);
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -0.01em;
}

.ecx-ind__sub {
    max-width: 560px;
    margin: 0 auto;
    color: var(--ecx-ind-muted);
    font-size: 13px;
    line-height: 1.6;
}


/* =========================================================
   STAGE & CARDS
========================================================= */

.ecx-ind__stage {
    display: flex;
    flex-direction: column;
    gap: 80px;
}

.ecx-ind__card {
    position: relative;
    min-width: 0;
    padding: 8px 16px 10px;
    border: 1px solid var(--ecx-ind-line);
    border-radius: 16px;
    background: var(--ecx-ind-card);
    box-shadow: 0 -10px 30px rgba(11, 37, 69, 0.06), 0 18px 40px rgba(11, 37, 69, 0.08);
}

/* Spacer: a short pause once the last card has settled, before the stack scrolls away.
   (Must be real content: sticky ignores the container's padding.) */
.ecx-ind__stage::after {
    content: "";
    /* Room for the stack to lift off before the next section reaches it */
    height: 160px;
}

/* Card stack: every card sticks at the same place, so each new card slides
   up over the previous one and covers it completely. */
.ecx-ind__card {
    position: sticky;
    top: var(--ecx-ind-stack-top);
    z-index: calc(1 + var(--ecx-ind-i, 0));
}

/* Scroll motion: as the next card slides over a card, that card recedes -
   it shrinks back and fades out (industries.js scrubs transform + opacity).
   Each card gets its own layer so that stays on the GPU. */
@media (min-width: 768px) {
    .ecx-ind__card {
        will-change: transform, opacity;
    }
}

.ecx-ind__card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--ecx-ind-line);
}

.ecx-ind__card-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    color: var(--ecx-ind-ink);
    font-size: 15px;
    font-weight: 500;
    line-height: 1.3;
}

.ecx-ind__card-icon {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
    color: var(--ecx-ind-red);
}


/* =========================================================
   FILTER PILLS
========================================================= */

.ecx-ind__filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
}

.ecx-ind__filter {
    padding: 3px 12px;
    border: 1px solid #cfd8e3;
    border-radius: 20px;
    background: transparent;
    color: var(--ecx-ind-navy);
    font-family: inherit;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.5;
    cursor: pointer;
    transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.ecx-ind__filter:hover {
    border-color: var(--ecx-ind-blue);
    color: var(--ecx-ind-blue);
}

.ecx-ind__filter.is-active {
    border-color: var(--ecx-ind-blue);
    background: var(--ecx-ind-blue);
    color: #ffffff;
}


/* =========================================================
   SLIDER
========================================================= */

.ecx-ind__swiper {
    padding-bottom: 22px;
}

.ecx-ind__slide {
    position: relative;
    /* Width comes from the slider (1 / 2 / 4 per view); fixed height matches the
       Industries slider cards on evolvecortex.com */
    height: 480px;
    overflow: hidden;
    border-radius: 14px;
    background: var(--ecx-ind-navy);
}

/* Shrink the slides on short screens so a whole stuck card fits in the viewport.
   --ecx-ind-card-chrome (card height minus slide height) is measured by industries.js */
.ecx-ind__slide {
    height: clamp(
        120px,
        calc(100dvh - var(--ecx-ind-stack-top) - var(--ecx-ind-card-chrome, 110px) - 12px),
        520px
    );
}


.ecx-ind__slide::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(11, 37, 69, 0.92) 0%, rgba(11, 37, 69, 0.3) 28%, rgba(11, 37, 69, 0) 50%);
    pointer-events: none;
}

.ecx-ind__video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ecx-ind__label {
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 12px;
    z-index: 1;
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
}

.ecx-ind__pagination.swiper-pagination {
    left: 0;
    right: 0;
    bottom: 0px;
}

.ecx-ind__pagination .swiper-pagination-bullet {
    width: 8px;
    height: 8px;
    margin: 0 4px !important;
    background: #b8c4d3;
    opacity: 1;
    transition: width 0.3s ease, background-color 0.3s ease;
}

.ecx-ind__pagination .swiper-pagination-bullet:hover {
    background: #8fa3bb;
}

.ecx-ind__pagination .swiper-pagination-bullet-active {
    width: 22px;
    border-radius: 4px;
    background: var(--ecx-ind-blue);
}

/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 767.98px) {

    .ecx-ind__card {
        padding: 8px 12px 8px;
    }

    .ecx-ind__card-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .ecx-ind__filters {
        justify-content: flex-start;
    }

    /* No stacking animation on mobile: cards scroll by in normal flow
       (industries.js runs a simple reveal here instead) */
    .ecx-ind__stage {
        gap: 24px;
    }

    .ecx-ind__stage::after {
        display: none;
    }

    .ecx-ind__card {
        position: relative;
        top: auto;
        z-index: auto;
    }

    /* Slides no longer have to fit a stuck card in the viewport */
    .ecx-ind__slide {
        height: min(440px, 70vh);
    }
}
