.cases {
    padding: 80px 0;
    background: #F9FAFB;
    overflow: hidden;
}

.cases__subtitle {
    font-size: 16px;
    line-height: 19px;
    color: #3d3d3d;
    margin: 0;
}

.cases__heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 20px;
    position: relative;
    top: 0;
    transition: opacity 0.5s ease-in, top 0.5s ease;

    .eyebrow {
        margin-bottom: 12px;
    }
}

.cases__heading .bootstrap-select {
    &.show .btn-light {
        background: #fff;
    }

    .btn-light {
        border: 1px solid #0071B8;
        border-radius: 5px;
        padding: 12px 30px;

        .filter-option-inner-inner {
            color: #0071B8;
            font-weight: normal;
        }

        &::after {
            background-image: url(./images/arrow_down.svg);
        }
    }

    .dropdown-menu {
        max-width: unset;
        left: unset !important;
        right: 0;

        .dropdown-item {
            display: flex;
        }
    }
}

.cases__grid.owl-carousel {
    position: relative;

    .owl-nav {
        display: block !important;
    }

    .owl-nav button.owl-prev,
    .owl-nav button.owl-next {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        width: 40px;
        height: 40px;
        border-radius: 100%;
        background-repeat: no-repeat;
        background-position: center;
        background-color: #fff;
        font-size: 0;
        transition: all .3s;
        margin: 0;
        box-shadow: 0 4px 10px rgba(0, 0, 0, .1);

        span {
            display: none;
        }

        &:hover {
            background-color: #ddd;
        }

        &.disabled {
            display: none;
        }
    }

    .owl-nav button.owl-prev {
        left: -60px;
        background-image: url(/local/templates/slats2022/images/icons/arrow-right.svg);
        transform: translateY(-50%) rotate(180deg);
    }

    .owl-nav button.owl-next {
        right: -60px;
        background-image: url(/local/templates/slats2022/images/icons/arrow-right.svg);
    }

    .owl-dots {
        position: absolute;
        bottom: -20px;
        left: 50%;
        transform: translateX(-50%);
        margin: 0;

        .owl-dot {
            width: 8px;
            height: 6px;
            background: #D9D9D9;
            border: none;
            border-radius: 10px;

            &.active {
                width: 32px;
                background: #0071B8;
            }
        }
    }
}

.case-card {
    width: 100%;
    height: 330px;
    position: relative;
    overflow: hidden;
    border-radius: 10px;

    transition:
        opacity 0.5s ease-in,
        scale 0.5s ease;

    &:nth-child(3) {
        transition:
            opacity 0.5s ease-in 0.2s,
            scale 0.5s ease 0.2s;
    }

    &:nth-child(4) {
        transition:
                opacity 0.5s ease-in 0.3s,
                scale 0.5s ease 0.3s;
    }

    &:nth-child(5) {
        transition:
                opacity 0.5s ease-in 0.4s,
                scale 0.5s ease 0.4s;
    }
}

.case-card__img {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s ease;

    .case-card:hover & {
        transform: scale(1.05);
    }
}

.case-card-backdrop {
    position: absolute;
    top: 40%;
    left: 0;
    width: 100%;
    height: 100%;
    transition: top .4s ease;
    background: linear-gradient(0deg, rgba(0,0,0,.8), rgba(0,0,0,0));

    .case-card:hover & {
        top: 0;
    }
}

.case-card__content {
    position: absolute;
    bottom: 0;
    left: 0;
    padding: 20px;
}

.case-card__title {
    font-size: 18px;
    color: #fff;
    font-family: 'Montserrat', sans-serif;
    max-width: 300px;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
}

.case-card__description {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.4s ease-in-out, padding-bottom 0.4s ease-in-out;
    margin: 0;
    color: #fff;
    font-size: 14px;

    p {
        margin: 0;
    }

    .case-card:hover & {
        grid-template-rows: 1fr;
        padding-bottom: 20px;
    }
}

.case-card__description-inner {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 6;
    overflow: hidden;
    min-height: 0;
}

.case-card .button {
    padding: 8px 12px;
    background: rgba(255, 255, 255, .1);
}

.case-popup {
    max-width: 900px;

    h3 {
        font-size: 20px;
        margin-bottom: 16px;
    }
}

@media screen and (max-width: 1700px) {
    .cases__grid.owl-carousel {
        .owl-nav button.owl-prev {
            left: 20px;
        }

        .owl-nav button.owl-next {
            right: 20px;
        }
    }
}

@media screen and (max-width: 1200px) {
    .cases__heading {
        flex-direction: column;
        align-items: flex-start;
    }

    .cases__heading-left {
        margin-bottom: 20px;
    }

    .cases__grid.owl-carousel {
        .owl-stage-outer {
            overflow: unset;
        }

        .owl-nav {
            display: none !important;
        }
    }
}

@media screen and (max-width: 768px) {
    .cases__grid.owl-carousel {
        margin-left: -20px;

        .owl-item {
            padding-right: 15px;
        }
    }

    .case-card {
        height: 350px;
    }

    .case-card__description-inner {
        -webkit-line-clamp: 10;
    }

    .cases__heading .bootstrap-select {
        .dropdown-menu {
            right: unset !important;
            left: 0;
        }
    }
}

.cases:not(._animated) {
    .cases__heading {
        opacity: 0;
        top: 20px;
    }

    .case-card {
        opacity: 0;
        scale: 0.8;
    }
}