/* Portfolio Carousel Styles */

.portfolio-carousel-container {
    margin-bottom: 40px;
    position: relative;
    width: 100%;
    overflow: hidden;
}

/* Main Swiper Styles */
.portfolio-main-swiper {
    width: 100%;
    margin-bottom: 10px;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.portfolio-main-swiper .swiper-slide {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding-bottom: 50px;
    position: relative;
}

.portfolio-carousel-item {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 100%;
}

.portfolio-carousel-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.portfolio-carousel-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.portfolio-carousel-caption {
    left: 0;
    bottom: 0;
    width: 100%;
    color: #000 !important;
    padding: 10px;
    font-size: 14px;
    line-height: 1.4;
    text-align: center;
    font-size: 16px;
    font-style: italic;
}

/* Default (Bottom) Thumbnail Layout */
.thumbnail-position-bottom .portfolio-thumbs-swiper {
    width: 100%;
    padding: 5px 0;
    height: auto !important;
}

.thumbnail-position-bottom .portfolio-thumbs-swiper .swiper-wrapper {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    transform: none !important;
    margin: -5px;
}

.thumbnail-position-bottom .portfolio-thumbs-swiper .swiper-slide {
    width: calc(100% / 4) !important;
    height: 100px !important;
    padding: 5px;
    box-sizing: border-box;
    cursor: pointer;
    overflow: hidden;
    flex-grow: 0;
    margin: 0px !important;
    opacity: 1 !important;
}

/* Right Thumbnail Layout */
.thumbnail-position-right .portfolio-carousel-container {
    display: flex;
    flex-direction: row;
    gap: 20px;
    align-items: flex-start;
}

.thumbnail-position-right .portfolio-main-swiper {
    width: calc(60% - 5px);
    margin-bottom: 0;
}

.thumbnail-position-right .portfolio-thumbs-swiper {
    width: calc(40% - 5px);
    height: auto !important;
    padding: 0;
}

.thumbnail-position-right .portfolio-thumbs-swiper .swiper-wrapper {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    height: auto !important;
    transform: none !important;
    gap: 10px;
    margin: 0;
}

.thumbnail-position-right .portfolio-thumbs-swiper .swiper-slide {
    width: 120px !important;
    margin-bottom: 10px !important;
    padding: 0;
    cursor: pointer;
    overflow: hidden;
    opacity: 1 !important;
}

.thumbnail-position-bottom .portfolio-carousel-thumb img {
    object-fit: contain;
}

/* Navigation Arrows */
.portfolio-main-swiper .swiper-button-next,
.portfolio-main-swiper .swiper-button-prev {
    color: #fff;
    background: rgb(6, 56, 8);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.portfolio-main-swiper .swiper-button-next:after,
.portfolio-main-swiper .swiper-button-prev:after {
    font-size: 20px;
}

.portfolio-main-swiper .swiper-button-disabled {
    opacity: 0.35;
}

.portfolio-carousel-thumb {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 2px;
    box-sizing: border-box;
    border-radius: 4px;
}

.portfolio-carousel-thumb img {
    max-width: 100%;
    max-height: 100%;
    display: block;
    object-fit: cover;
    width: 120px !important;
    height: 120px !important;
}


/* Responsive Adjustments */
@media (max-width: 767px) {
    .thumbnail-position-right .portfolio-carousel-container {
        flex-direction: column;
    }

    .thumbnail-position-right .portfolio-main-swiper,
    .thumbnail-position-right .portfolio-thumbs-swiper {
        width: 100%;
    }

    .thumbnail-position-bottom .portfolio-thumbs-swiper .swiper-slide {
        width: calc(100% / 2) !important;
    }
}

@media (min-width: 768px) and (max-width: 991px) {
    .thumbnail-position-bottom .portfolio-thumbs-swiper .swiper-slide {
        width: calc(100% / 3) !important;
    }
}

/* Editor Style Fixes */
.elementor-editor-active .portfolio-carousel-container,
.elementor-editor-preview .portfolio-carousel-container {
    overflow: hidden !important;
    width: 100% !important;
    max-width: 100% !important;
}

.elementor-editor-active .portfolio-main-swiper,
.elementor-editor-preview .portfolio-main-swiper {
    overflow: hidden !important;
    max-width: 100% !important;
    width: 100% !important;
}

.elementor-editor-active .portfolio-main-swiper .swiper-slide,
.elementor-editor-preview .portfolio-main-swiper .swiper-slide {
    overflow: hidden !important;
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
}

.elementor-editor-active .portfolio-carousel-image,
.elementor-editor-preview .portfolio-carousel-image {
    overflow: hidden !important;
    max-width: 100% !important;
    width: 100% !important;
}

.elementor-editor-active .portfolio-carousel-image img,
.elementor-editor-preview .portfolio-carousel-image img {
    max-width: 100% !important;
    width: auto !important;
    height: auto !important;
    margin: 0 auto;
}

/* Fix for Elementor editor canvas */
.elementor-editor-active .elementor-widget-portfolio-carousel,
.elementor-editor-preview .elementor-widget-portfolio-carousel {
    overflow: hidden !important;
}

body.elementor-editor-active .elementor-widget-portfolio-carousel .portfolio-main-swiper {
    z-index: 1 !important;
}