.spruce-highlight-carousel-container {
    display: flex;
    flex-flow: row wrap;
    align-items: stretch;
    gap: 1rem;
    position: relative;
    width: 100%;
    max-width: 100%;
    min-height: 100%;
    box-sizing: border-box;
}

/*
 * Divi Sizing (e.g. height: 460px) lands on the parent module. Slides are
 * position:absolute, so without this chain the reel collapses and
 * overflow:hidden clips the product image. min-height: min-content lets a
 * wrapped second row grow the module instead of clipping it.
 */
.spruce_wsm_highlight_products_carousel {
    display: flex;
    flex-direction: column;
    min-height: min-content;
}

/*
 * Child modules default to width: 100% (Divi Sizing). That forces one item
 * per row. Override so they share a row and wrap when the basis no longer
 * fits — phone-width screens stack automatically.
 */
.spruce-highlight-carousel-container > .spruce_wsm_highlight_carousel_item {
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    flex: 1 1 16rem;
    width: auto;
    max-width: 100%;
    min-width: min(16rem, 100%);
    min-height: 12rem;
}

.spruce-highlight-carousel {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex: 1 1 auto;
    width: 100%;
    min-width: 12rem;
    height: 100%;
    min-height: 0;
}

.spruce-carousel-item-fixed-title {
    text-align: center;
    margin-bottom: 15px;
    z-index: 10;
    position: relative;
    flex: 0 0 auto;
}

.spruce-carousel-slides-container {
    position: relative;
    flex: 1 1 auto;
    width: 100%;
    min-height: 0;
}

.spruce-carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transform: translateX(-100%);
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: inherit;
    z-index: 1;
    min-height: 0;
    box-sizing: border-box;
}

.spruce-carousel-slide.active {
    opacity: 1;
    transform: translateX(0);
    z-index: 2;
}

.spruce-carousel-slide.exit {
    opacity: 0;
    transform: translateX(100%);
    z-index: 1;
}

.spruce-carousel-image {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.spruce-carousel-image img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.spruce-carousel-title {
    text-align: center;
    flex: 0 0 auto;
}

.spruce-highlight-carousel__empty {
    margin: 0;
    text-align: center;
}

/*
 * On phone/tablet the children wrap into a column. Divi's 460px height then
 * clips them and they paint past the site footer. Drop the fixed height so
 * the module (and its column) grow with the stacked items; the active slide
 * returns to normal flow so the reel has a real height.
 */
@media screen and (max-width: 980px) {
    .spruce_wsm_highlight_products_carousel,
    .et_pb_column:has(.spruce_wsm_highlight_products_carousel) {
        height: auto !important;
        max-height: none !important;
    }

    .spruce-highlight-carousel-container {
        min-height: 0;
        height: auto;
    }

    .spruce-highlight-carousel-container > .spruce_wsm_highlight_carousel_item,
    .spruce-highlight-carousel {
        height: auto;
        min-height: 0;
    }

    .spruce-carousel-slide.active {
        position: relative;
        height: auto;
        transform: none;
    }

    .spruce-carousel-image img {
        max-height: none;
        width: 100%;
        height: auto;
    }
}
