/*
 * Keep Portfolio Loop Carousel items at their expected width when
 * Elementor/Swiper does not initialize because too few items are returned.
 */

/* Remove slide spacing in every supported device mode. */
body[data-elementor-device-mode="widescreen"] .portfolio-loop-carousel .swiper:not(.swiper-initialized) .swiper-slide,
body[data-elementor-device-mode="desktop"] .portfolio-loop-carousel .swiper:not(.swiper-initialized) .swiper-slide,
body[data-elementor-device-mode="laptop"] .portfolio-loop-carousel .swiper:not(.swiper-initialized) .swiper-slide,
body[data-elementor-device-mode="tablet"] .portfolio-loop-carousel .swiper:not(.swiper-initialized) .swiper-slide,
body[data-elementor-device-mode="mobile"] .portfolio-loop-carousel .swiper:not(.swiper-initialized) .swiper-slide {
    margin: 0 !important;
}

/* Widescreen: 4 cards */
body[data-elementor-device-mode="widescreen"]
.portfolio-loop-carousel .swiper:not(.swiper-initialized) .swiper-slide {
    flex: 0 0 25% !important;
    max-width: 25% !important;
}

/* Desktop / Laptop: 3 cards */
body[data-elementor-device-mode="desktop"]
.portfolio-loop-carousel .swiper:not(.swiper-initialized) .swiper-slide,
body[data-elementor-device-mode="laptop"]
.portfolio-loop-carousel .swiper:not(.swiper-initialized) .swiper-slide {
    flex: 0 0 33.3333% !important;
    max-width: 33.3333% !important;
}

/* Tablet: 2 cards */
body[data-elementor-device-mode="tablet"]
.portfolio-loop-carousel .swiper:not(.swiper-initialized) .swiper-slide {
    flex: 0 0 50% !important;
    max-width: 50% !important;
}

/* Mobile: 1 card */
body[data-elementor-device-mode="mobile"]
.portfolio-loop-carousel .swiper:not(.swiper-initialized) .swiper-slide {
    flex: 0 0 100% !important;
    max-width: 100% !important;
}
