/**
 * Vertical Pinned Slider
 *
 * Desktop: two-column sticky image + scrollable cards.
 * Mobile: single column with inline thumbnails.
 *
 * @package mohawk-consumer-2027
 */

/* ---------------------------------------------------------------
   Container
--------------------------------------------------------------- */

.section.vertical-pinned-slider {
    position: relative;
    box-sizing: border-box;
    z-index: 2;
    overflow: visible;

    &.blue-background-image {
        background-image: url('../../../images/lift-category-bkgd.png');
        background-size: cover;
        background-position: center bottom;
        background-repeat: no-repeat;
        box-shadow: 0 0 30px 0 rgba(0, 0, 0, 0.5);
    }

    &.contain-images .vertical-pinned-slider__pinned .vertical-pinned-slider__img {
        object-fit: contain !important;
    }
}

/* ---------------------------------------------------------------
   Intro content
--------------------------------------------------------------- */

.vertical-pinned-slider__intro {
    overflow: visible;
    padding-top: 0;
    padding-left: 0;
    padding-right: 0;
    max-width: var(--container-wide, 1680px);
    margin: 0 auto;

    .text-center {
        text-align: center;
        margin: 0 auto;
        padding: 0 0 30px;
        max-width: 800px;
        width: 90%;

        @media (min-width: 768px) {
            padding: 0 0 20px;
        }

        @media (min-width: 960px) {
            padding: 0 0 30px;
        }
    }

    p {
        text-align: center;
    }
}

#content .vertical-pinned-slider__intro h1.section__heading,
#content .vertical-pinned-slider__intro h2.section__heading {
    line-height: 1em;
    color: var(--color-blue-dark-alt) !important;
    font-size: 24px !important;
    font-weight: 600 !important;
    text-align: center;
    clear: none;
    padding: 0;
    letter-spacing: -0.015em;
    text-transform: uppercase;

    @media (min-width: 768px) {
        font-size: 32px !important;
    }

    @media (min-width: 960px) {
        font-size: 40px !important;
    }
}

/* ---------------------------------------------------------------
   Wrapper (two-column layout)
--------------------------------------------------------------- */

.vertical-pinned-slider__wrapper {
    padding-left: 5%;
    padding-right: 5%;
    padding-bottom: 0;
    margin: 0 auto;

    @media (min-width: 960px) {
        display: flex;
        align-items: flex-start;
        position: relative;
        width: 100%;
        box-sizing: border-box;
        padding: 0;
    }

    @media (max-width: 959px) {
        min-height: auto !important;
        display: block;
    }
}

/* ---------------------------------------------------------------
   Left column — pinned images (desktop only)
--------------------------------------------------------------- */

.vertical-pinned-slider__pinned {
    display: none;

    @media (min-width: 960px) {
        display: block;
        position: sticky;
        top: 230px;
        width: 50%;
        height: calc(100vh - 340px);
        max-height: 450px;
        overflow: hidden;
        box-sizing: border-box;
        margin-left: 15px;
        margin-right: 15px;
        border-radius: 7px;
        background-color: #fff;
        border: 4px #fff solid;
        box-shadow: 0 0 30px 0 rgba(0, 0, 0, 0.2) !important;
    }

    @media (min-width: 1101px) {
        max-height: 550px;
    }

    @media (min-width: 1360px) {
        max-height: 650px;
    }
}

.vertical-pinned-slider__image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;

    &.is-active {
        opacity: 1;
    }
}

.vertical-pinned-slider__img {
    display: block;
    border-radius: 5px;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease-in-out;
}

/* ---------------------------------------------------------------
   Right column — text cards
--------------------------------------------------------------- */

.vertical-pinned-slider__cards {
    width: 50%;
    box-sizing: border-box;
    margin: 0 15px;
    padding: 0;
    overflow: clip;
    display: flex;
    flex-direction: column;

    @media (max-width: 959px) {
        width: 100%;
        padding-right: 15px;
        padding-left: 15px;
        margin: 0;
        overflow: visible;
    }
}

/* ---------------------------------------------------------------
   Individual card
--------------------------------------------------------------- */

.vertical-pinned-slider__card {
    opacity: 0.5;
    min-height: 150px;
    height: auto;
    background-color: #fff;
    border-radius: 7px;
    padding: 0 0 30px 30px;
    box-sizing: border-box;
    display: flex;
    flex-direction: row;
    flex-shrink: 0;
    justify-content: space-between;
    text-align: left;
    margin: 0 0 25px 25px;
    transition: margin-left 0.3s ease-in-out;
    cursor: default;

    &:first-child {
        margin-top: 0;
    }

    &.is-active {
        margin-left: 0;
        opacity: 1;
    }

    @media (max-width: 959px) {
        margin-left: 0;
        min-height: auto;
        width: 100%;
        border-color: #dee2e6;
        font-weight: normal;
        margin-bottom: 20px;
        padding: 30px;
        transition: none;
        opacity: 1;
        align-items: center;
        position: relative;
        overflow: hidden;
    }

    @media (max-width: 768px) {
        padding: 0;
    }
}

/* ---------------------------------------------------------------
   Card body
--------------------------------------------------------------- */

.vertical-pinned-slider__card-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin: 0;
    padding: 30px 20px 0 0;
    flex: 0 0 83.333%;
    max-width: 83.333%;

    @media (max-width: 959px) {
        padding: 0 0 0 20px;
        flex: 0 0 66.666%;
        max-width: 66.666%;
    }

    @media (max-width: 768px) {
        padding-top: 6px;
        padding-bottom: 6px;
    }
}

#content .vertical-pinned-slider__card-body {
    a h3:hover {
        text-decoration: underline;
    }

    h3 {
        font-size: 32px !important;
        color: var(--color-red);
        line-height: 1em;
        letter-spacing: -0.02em;
        margin-top: 0;
        font-family: var(--font-heading);

        @media (max-width: 768px) {
            font-size: 22px !important;
        }
    }

    h4 {
        color: #000;
        font-family: var(--font-body);
        font-size: 18px;
        font-weight: 400;
        line-height: 1.4em;
    }
}

#content .vertical-pinned-slider__card-content p {
    color: var(--color-black);
    font-family: var(--font-body);
    font-size: 18px;
    font-weight: 400;
    line-height: 1.4em;
}

.vertical-pinned-slider__card-content {
    @media (max-width: 768px) {
        display: none;
    }
}

/* ---------------------------------------------------------------
   Card thumbnail (mobile only)
--------------------------------------------------------------- */

.vertical-pinned-slider__thumb {
    display: none;

    @media (max-width: 959px) {
        display: flex;
        position: relative;
        padding: 0;
        margin: 0;
        height: auto;
        flex: 0 0 16.666%;
        max-width: 16.666%;
        border: none;
    }
}

.vertical-pinned-slider__thumb-img {
    width: 100%;
    min-height: 110px;
    object-position: center;
    object-fit: cover;
}

/* ---------------------------------------------------------------
   Card actions (icon + CTA)
--------------------------------------------------------------- */

.vertical-pinned-slider__card-actions {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-direction: column;
    flex: 0 0 16.666%;
    max-width: 16.666%;

    &:not(:has(.vertical-pinned-slider__card-icon)) {
        justify-content: flex-end;
    }
}

.vertical-pinned-slider__card-icon {
    height: auto;
    margin-bottom: 15px;
    display: flex;
    justify-content: flex-end;

    img {
        width: auto;
        height: 100%;
        margin-right: 5px;
        margin-top: 5px;
    }

    @media (max-width: 959px) {
        display: none;
    }

    @media (max-width: 768px) {
        margin-bottom: 10px;
    }
}

.vertical-pinned-slider__card-cta {
    background-position: center right;
    margin: 0;
    padding: 0;
    margin-right: 30px;

    a {
        display: block;
        width: 56px;
        height: 56px;
    }

    svg {
        width: 100%;
        height: 100%;
        transition: transform 0.2s ease, filter 0.2s ease;
    }

    a:hover svg {
        transform: scale(1.05);
        filter: brightness(0.75);
    }

    @media (max-width: 959px) {
        background-position: center right;
        width: 40px;
        height: 40px;
        margin-right: 20px;

        a {
            width: 40px;
            height: 40px;
        }
    }

    @media (max-width: 768px) {
        background-position: center;
        width: 40px;
        height: 40px;
        padding-right: 10px;

        a {
            width: 40px;
            height: 40px;
        }
    }
}

/* ---------------------------------------------------------------
   Last card (special styling)
--------------------------------------------------------------- */

.vertical-pinned-slider__card--last {
    opacity: 1;
    transition: opacity 0.5s ease-in 0.5s;
    background-color: var(--color-tan);
    background-image: linear-gradient(
        var(--color-tan),
        var(--color-tan),
        var(--color-light-gray-2)
    );
    border: 2px var(--color-gray) solid;
    margin-left: 0;

    .button {
        margin-bottom: 0;
    }

    .vertical-pinned-slider__card-actions {
        justify-content: flex-end;
    }

    @media (max-width: 959px) {
        display: flex;
        margin-left: 0;
        opacity: 1;

        .vertical-pinned-slider__card-cta {
            background-position: center right;
            justify-content: flex-end;
            width: 40px;
            height: 40px;
            margin-right: 20px;

            a {
                width: 40px;
                height: 40px;
            }
        }
    }
}

#content .vertical-pinned-slider__card--last h3 {
    font-size: 32px !important;
    text-transform: uppercase;
    letter-spacing: -0.02em;
}

/* ---------------------------------------------------------------
   Home page override
--------------------------------------------------------------- */

@media (min-width: 960px) {
    body.home .vertical-pinned-slider__wrapper {
        padding-right: 5%;
        padding-left: 5%;
    }
}
