.mdev-template-carousel {
    --mdev-carousel-arrow-offset: 12px;
    --mdev-shadow-safe-space-x: 22px;
    --mdev-shadow-safe-space-y: 22px;
    position: relative;
    width: 100%;
}

/* Prevent first-load flash before Swiper calculates responsive slides. */
.mdev-template-carousel:not(.mdev-template-carousel--ready) .mdev-template-carousel__swiper {
    opacity: 0;
    visibility: hidden;
}

.mdev-template-carousel.mdev-template-carousel--ready .mdev-template-carousel__swiper {
    opacity: 1;
    visibility: visible;
    transition: opacity .18s ease;
}

.mdev-template-carousel,
.mdev-template-carousel * {
    box-sizing: border-box;
}

.mdev-template-carousel__swiper {
    overflow: hidden;
    width: 100%;
}

.mdev-template-carousel .swiper-wrapper {
    align-items: stretch;
}

/* Shadow preservation: keep the main Swiper clipped, but give each slide internal safe room.
   This prevents card shadow clipping without exposing off-canvas loop slides. */
.mdev-template-carousel--preserve-shadow.mdev-template-carousel {
    overflow: hidden;
}

.mdev-template-carousel--preserve-shadow .swiper.mdev-template-carousel__swiper,
.mdev-template-carousel--preserve-shadow .mdev-template-carousel__swiper {
    overflow: hidden !important;
    padding-block: var(--mdev-shadow-safe-space-y);
}

.mdev-template-carousel--preserve-shadow .swiper-wrapper {
    overflow: visible;
}
.mdev-template-carousel__slide {
    height: auto;
    display: flex;
}

.mdev-template-carousel--preserve-shadow .mdev-template-carousel__slide {
    padding: var(--mdev-shadow-safe-space-y) var(--mdev-shadow-safe-space-x);
    z-index: 1;
}

.mdev-template-carousel--preserve-shadow .mdev-template-carousel__slide:hover,
.mdev-template-carousel--preserve-shadow .mdev-template-carousel__slide.swiper-slide-active {
    z-index: 3;
}

.mdev-template-carousel--align-start .mdev-template-carousel__slide {
    justify-content: flex-start;
}

.mdev-template-carousel--align-center .mdev-template-carousel__slide {
    justify-content: center;
}

.mdev-template-carousel--align-end .mdev-template-carousel__slide {
    justify-content: flex-end;
}

.mdev-template-carousel__slide-inner {
    width: 100%;
    min-width: 0;
    overflow: hidden;
}

.mdev-template-carousel--preserve-shadow .mdev-template-carousel__slide-inner,
.mdev-template-carousel--preserve-shadow .mdev-template-carousel__template,
.mdev-template-carousel--preserve-shadow .mdev-template-carousel__template > .elementor,
.mdev-template-carousel--preserve-shadow .mdev-template-carousel__template .elementor-element,
.mdev-template-carousel--preserve-shadow .mdev-template-carousel__template .e-con,
.mdev-template-carousel--preserve-shadow .mdev-template-carousel__template .elementor-widget,
.mdev-template-carousel--preserve-shadow .mdev-template-carousel__template .elementor-widget-container {
    overflow: visible !important;
}

.mdev-template-carousel__template,
.mdev-template-carousel__template > .elementor,
.mdev-template-carousel__template > .elementor > .elementor-section-wrap {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.mdev-template-carousel--stretch-template .mdev-template-carousel__template > .elementor > .e-con,
.mdev-template-carousel--stretch-template .mdev-template-carousel__template > .elementor > .elementor-section,
.mdev-template-carousel--stretch-template .mdev-template-carousel__template > .elementor > .elementor-section-wrap > .elementor-section {
    width: 100%;
    max-width: 100%;
}

.mdev-template-carousel--force-inner-width .mdev-template-carousel__template .e-con,
.mdev-template-carousel--force-inner-width .mdev-template-carousel__template .e-container,
.mdev-template-carousel--force-inner-width .mdev-template-carousel__template .elementor-container,
.mdev-template-carousel--force-inner-width .mdev-template-carousel__template .elementor-widget-wrap {
    --width: 100% !important;
    --content-width: 100% !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
}

.mdev-template-carousel--force-inner-width .mdev-template-carousel__template .elementor-widget {
    max-width: 100%;
}

.mdev-template-carousel--remove-template-spacing .mdev-template-carousel__template > .elementor {
    margin: 0 !important;
    padding: 0 !important;
}

.mdev-template-carousel--remove-template-spacing .mdev-template-carousel__template > .elementor > .e-con:first-child,
.mdev-template-carousel--remove-template-spacing .mdev-template-carousel__template > .elementor > .elementor-section:first-child,
.mdev-template-carousel--remove-template-spacing .mdev-template-carousel__template > .elementor > .elementor-section-wrap > .elementor-section:first-child {
    margin-top: 0 !important;
}

.mdev-template-carousel--remove-template-spacing .mdev-template-carousel__template > .elementor > .e-con:last-child,
.mdev-template-carousel--remove-template-spacing .mdev-template-carousel__template > .elementor > .elementor-section:last-child,
.mdev-template-carousel--remove-template-spacing .mdev-template-carousel__template > .elementor > .elementor-section-wrap > .elementor-section:last-child {
    margin-bottom: 0 !important;
}

.mdev-template-carousel--equal-height .mdev-template-carousel__slide-inner,
.mdev-template-carousel--equal-height .mdev-template-carousel__template,
.mdev-template-carousel--equal-height .mdev-template-carousel__template > .elementor {
    height: 100%;
}

.mdev-template-carousel--equal-height .mdev-template-carousel__template > .elementor > .elementor-section-wrap,
.mdev-template-carousel--equal-height .mdev-template-carousel__template > .elementor > .e-con,
.mdev-template-carousel--equal-height .mdev-template-carousel__template > .elementor > .elementor-element {
    height: 100%;
}

.mdev-template-carousel--normalize-images .mdev-template-carousel__template .elementor-widget-image,
.mdev-template-carousel--normalize-images .mdev-template-carousel__template .elementor-widget-image .elementor-widget-container,
.mdev-template-carousel--normalize-images .mdev-template-carousel__template .elementor-widget-image a,
.mdev-template-carousel--normalize-images .mdev-template-carousel__template .elementor-widget-image picture {
    display: block;
    width: 100%;
    max-width: 100%;
}

.mdev-template-carousel--normalize-images .mdev-template-carousel__template img {
    display: block;
    width: 100%;
    max-width: 100%;
}

.mdev-template-carousel--normalize-images.mdev-template-carousel--image-ratio-1-1 .mdev-template-carousel__template .elementor-widget-image img {
    aspect-ratio: 1 / 1;
    height: auto;
}

.mdev-template-carousel--normalize-images.mdev-template-carousel--image-ratio-4-3 .mdev-template-carousel__template .elementor-widget-image img {
    aspect-ratio: 4 / 3;
    height: auto;
}

.mdev-template-carousel--normalize-images.mdev-template-carousel--image-ratio-3-2 .mdev-template-carousel__template .elementor-widget-image img {
    aspect-ratio: 3 / 2;
    height: auto;
}

.mdev-template-carousel--normalize-images.mdev-template-carousel--image-ratio-16-9 .mdev-template-carousel__template .elementor-widget-image img {
    aspect-ratio: 16 / 9;
    height: auto;
}

.mdev-template-carousel--normalize-images:not(.mdev-template-carousel--image-ratio-auto) .mdev-template-carousel__template .elementor-widget-image img {
    height: auto;
    object-position: center center;
}

.mdev-template-carousel__arrow {
    position: absolute;
    top: 50%;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    color: #fff;
    background: #293e78;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .16);
    cursor: pointer;
    transform: translateY(-50%);
    transition: transform .2s ease, opacity .2s ease, box-shadow .2s ease;
}

.mdev-template-carousel__arrow:hover,
.mdev-template-carousel__arrow:focus-visible {
    transform: translateY(-50%) scale(1.04);
    box-shadow: 0 10px 28px rgba(0, 0, 0, .2);
}

.mdev-template-carousel__arrow span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    line-height: 0;
    pointer-events: none;
}

.mdev-template-carousel__arrow svg {
    display: block;
    width: 52%;
    height: 52%;
    fill: none;
    stroke: currentColor;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.mdev-template-carousel__arrow--prev {
    left: var(--mdev-carousel-arrow-offset);
}

.mdev-template-carousel__arrow--next {
    right: var(--mdev-carousel-arrow-offset);
}

[dir="rtl"] .mdev-template-carousel__arrow--prev,
.mdev-template-carousel[dir="rtl"] .mdev-template-carousel__arrow--prev {
    right: var(--mdev-carousel-arrow-offset);
    left: auto;
}

[dir="rtl"] .mdev-template-carousel__arrow--next,
.mdev-template-carousel[dir="rtl"] .mdev-template-carousel__arrow--next {
    right: auto;
    left: var(--mdev-carousel-arrow-offset);
}


[dir="rtl"] .mdev-template-carousel__arrow svg,
.mdev-template-carousel[dir="rtl"] .mdev-template-carousel__arrow svg {
    transform: scaleX(-1);
}

.mdev-template-carousel__pagination {
    position: static;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 18px;
}

.mdev-template-carousel .swiper-pagination-bullet {
    width: 9px;
    height: 9px;
    margin: 0 !important;
    opacity: 1;
    background: #d7dce8;
    transition: width .2s ease, background .2s ease;
}

.mdev-template-carousel .swiper-pagination-bullet-active {
    width: 24px;
    border-radius: 999px;
    background: #293e78;
}

.mdev-template-carousel__empty {
    padding: 18px;
    border: 1px dashed #ccd2dd;
    border-radius: 10px;
    color: #4b5563;
    background: #f8fafc;
    text-align: center;
}

@media (max-width: 767px) {
    .mdev-template-carousel {
        --mdev-carousel-arrow-offset: 6px;
    }

    .mdev-template-carousel__arrow {
        width: 36px;
        height: 36px;
    }

    .mdev-template-carousel__arrow svg {
        width: 50%;
        height: 50%;
    }
}


/* Responsive navigation visibility */
.mdev-template-carousel--no-arrows-desktop .mdev-template-carousel__arrow,
.mdev-template-carousel--no-dots-desktop .mdev-template-carousel__pagination {
    display: none !important;
}

@media (min-width: 768px) and (max-width: 1024px) {
    .mdev-template-carousel--no-arrows-tablet .mdev-template-carousel__arrow,
    .mdev-template-carousel--no-dots-tablet .mdev-template-carousel__pagination {
        display: none !important;
    }

    .mdev-template-carousel--arrows-tablet .mdev-template-carousel__arrow {
        display: inline-flex !important;
    }

    .mdev-template-carousel--dots-tablet .mdev-template-carousel__pagination {
        display: flex !important;
    }
}

@media (max-width: 767px) {
    .mdev-template-carousel--no-arrows-mobile .mdev-template-carousel__arrow,
    .mdev-template-carousel--no-dots-mobile .mdev-template-carousel__pagination {
        display: none !important;
    }

    .mdev-template-carousel--arrows-mobile .mdev-template-carousel__arrow {
        display: inline-flex !important;
    }

    .mdev-template-carousel--dots-mobile .mdev-template-carousel__pagination {
        display: flex !important;
    }
}
