.justifiedCarousel {
    width: 100%;
    position: relative;
    overflow: hidden;
    line-height: 0;
}

.justifiedCarousel .justified-swiper-container {
    width: 100%;
    position: relative;
}

/* Reverted height back to original setup */
.justifiedCarousel .swiper-slide {
    width: auto !important;
    height: var(--carousel-height, 400px); 
    position: relative;
    line-height: 0;
}

.justifiedCarousel img.jc-image {
    height: 100%;
    width: auto;
    max-width: none !important;
    object-fit: cover;
    display: block;
    cursor: pointer;
    vertical-align: top;
    margin: 0;
    padding: 0;
}

/* Overlay Wrapper - Full size flex container */
.justifiedCarousel .jc-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    z-index: 10;
    line-height: normal;
    /* Defaults */
    justify-content: center;
    align-items: center;
}

/* Navigation Arrows - Flush to sides */
.justifiedCarousel .swiper-button-prev,
.justifiedCarousel .swiper-button-next {
    top: 50%;
    transform: translateY(-50%);
    margin: 0;
    width: auto;
    height: auto;
    z-index: 20;
    color: #fff;
    background: rgba(0,0,0,0.5);
    padding: 10px;
    border-radius: 0;
}
.justifiedCarousel .swiper-button-prev {
    left: 0;
    right: auto;
}
.justifiedCarousel .swiper-button-next {
    right: 0;
    left: auto;
}
.justifiedCarousel .swiper-button-prev::after,
.justifiedCarousel .swiper-button-next::after {
    font-size: 24px;
}

/* Pagination Dots */
.justifiedCarousel .swiper-pagination {
    position: absolute;
    text-align: center;
    transition: 0.3s opacity;
    transform: translate3d(0, 0, 0);
    z-index: 20;
    bottom: 10px; /* Inside only */
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: auto !important; /* Wrap around dots */
    display: inline-flex;
    justify-content: center;
    align-items: center;
}

/* Ensure no opacity is applied to inactive dots natively */
.justifiedCarousel .swiper-pagination-bullet {
    opacity: 1 !important;
}


/* Modifier Classes from Elementor prefix_class */
/* Vertical Alignment */
.jc-valign-flex-start .jc-overlay,
.jc-valign-tablet-flex-start .jc-overlay,
.jc-valign-mobile-flex-start .jc-overlay { justify-content: flex-start !important; }

.jc-valign-center .jc-overlay,
.jc-valign-tablet-center .jc-overlay,
.jc-valign-mobile-center .jc-overlay { justify-content: center !important; }

.jc-valign-flex-end .jc-overlay,
.jc-valign-tablet-flex-end .jc-overlay,
.jc-valign-mobile-flex-end .jc-overlay { justify-content: flex-end !important; }

/* Horizontal Alignment */
.jc-halign-flex-start .jc-overlay,
.jc-halign-tablet-flex-start .jc-overlay,
.jc-halign-mobile-flex-start .jc-overlay { align-items: flex-start !important; }

.jc-halign-center .jc-overlay,
.jc-halign-tablet-center .jc-overlay,
.jc-halign-mobile-center .jc-overlay { align-items: center !important; }

.jc-halign-flex-end .jc-overlay,
.jc-halign-tablet-flex-end .jc-overlay,
.jc-halign-mobile-flex-end .jc-overlay { align-items: flex-end !important; }

.jc-halign-stretch .jc-overlay,
.jc-halign-tablet-stretch .jc-overlay,
.jc-halign-mobile-stretch .jc-overlay { align-items: stretch !important; }

/* Stretch the credit box when horizontal stretch is active */
.jc-halign-stretch .jc-overlay .jc-credit,
.jc-halign-tablet-stretch .jc-overlay .jc-credit,
.jc-halign-mobile-stretch .jc-overlay .jc-credit {
    width: 100% !important;
}

/* Media Credit / Text Block */
.justifiedCarousel .jc-credit {
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 12px;
    border-radius: 4px;
    pointer-events: auto;
    z-index: 20;
    box-sizing: border-box;
    display: inline-block;
    width: auto;
}


/* Lightbox */
.jc-lightbox-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100000;
    background: rgba(0, 0, 0, 0.92);
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease;
    line-height: normal;
}

.jc-lightbox-overlay.active {
    display: flex;
    opacity: 1;
}

.jc-lightbox-overlay img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
    margin: 0 auto;
}