.carousel {
    width: 100%;
    position: relative;
    padding-bottom: 40%;
    overflow: hidden;

    &.stacked {
        padding-bottom: 0 !important;
    }

    .left-btn,
    .right-btn {
        display: none;
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        padding: 12px 20px 15px 20px;
        font-size: 38px;
        font-weight: 800;
        line-height: 1;
        color: #fff;
        cursor: pointer;
        z-index: 2;
        background-color: rgba(0, 0, 0, .1);

        @media all and (min-width: 786px) {
            display: block;
        }

        &:hover,
        &:focus {
            background-color: rgba(0, 0, 0, .7);
        }

        &.stacked {
            display: none;
        }
    }

    .left-btn {
        left: 0;
        border-top-right-radius: 4px;
        border-bottom-right-radius: 4px;
    }

    .right-btn {
        right: 0;
        border-top-left-radius: 4px;
        border-bottom-left-radius: 4px;
    }

    .dots {
        position: absolute;
        bottom: 0;
        padding-bottom: 10px;
        left: 50%;
        transform: translateX(-50%);
        z-index: 2;

        &.stacked {
            display: none;
        }

        .dot {
            display: inline-block;
            border-radius: 100%;
            width: 14px;
            height: 14px;
            background-color: rgba(0, 0, 0, .1);
            border: 1px solid #ddd;
            cursor: pointer;
            margin: 0 5px;
            transition: background-color 400ms;

            &:hover,
            &:focus {
                background-color: rgba(0, 0, 0, .6);
            }

            &.active {
                background-color: rgba(255, 255, 255, 8);
            }
        }
    }
}

.carousel-item {
    width: 100%;
    display: flex;
    flex-flow: row wrap;
    justify-content: center;
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background-size: cover;
    background-position: center;

    &.stacked {
        position: relative;
        top: auto;
        left: auto;
        height: auto;
    }

    &.active {
        z-index: 1;
    }

    &.appear-from-left {
        animation-name: appear-from-left;
        animation-duration: 700ms;
        animation-timing-function: ease-out;
    }

    &.appear-from-right {
        animation-name: appear-from-right;
        animation-duration: 700ms;
        animation-timing-function: ease-out;
    }

    &.hide-to-left {
        animation-name: hide-to-left;
        animation-duration: 700ms;
        animation-timing-function: ease-out;
        animation-fill-mode: forwards;
    }

    &.hide-to-right {
        animation-name: hide-to-right;
        animation-duration: 700ms;
        animation-timing-function: ease-out;
        animation-fill-mode: forwards;
    }

    &.fade-in {
        animation-name: fade-in;
        animation-duration: 700ms;
        animation-fill-mode: forwards;
    }

    &.fade-out {
        animation-name: fade-out;
        animation-duration: 700ms;
        animation-fill-mode: forwards;
    }
}

@keyframes appear-from-left {
    from {
        transform: translateX(-110%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes appear-from-right {
    from {
        transform: translateX(110%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes hide-to-left {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(-110%);
    }
}

@keyframes hide-to-right {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(110%);
    }
}

@keyframes fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fade-out {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}
