/* Miftah Projets Slider Tabs Widget Styles */

.miftah-pts-wrapper {
    width: 100%;
    position: relative;
    overflow: hidden;
}

/* Tabs */
.miftah-pts-tabs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 40px;
    position: relative;
    z-index: 10;
}

.miftah-pts-tab-btn {
    border: none;
    outline: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    /* Default colors, can be overridden by Elementor settings */
    background-color: #8a7d51; 
    color: #ffffff;
    padding: 15px 30px;
    border-radius: 0;
}

.miftah-pts-tab-btn.active,
.miftah-pts-tab-btn:hover {
    background-color: #4e7760;
    color: #ffffff;
}

/* Sliders */
.miftah-pts-sliders-container {
    position: relative;
    width: 100%;
}

.miftah-pts-slider-container {
    display: none; /* Hide inactive sliders */
    width: 100%;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.miftah-pts-slider-container.active {
    display: block;
    opacity: 1;
}

.miftah-pts-slider-container .swiper {
    width: 100%;
    height: 100%;
    overflow: visible !important; /* Allow side slides to be visible */
    position: relative;
}

.miftah-pts-slider-container .swiper-wrapper {
    align-items: center; /* Center slides vertically to handle height difference */
}

.miftah-pts-slide-image {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
}

/* Centered Slides Effect */
.miftah-pts-slider-container .swiper-slide {
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.5s ease;
    opacity: 1;
    position: relative;
    height: 100%;
    /* width is controlled by elementor, default 60% */
}

.miftah-pts-slider-container .swiper-slide:not(.swiper-slide-active) {
    /* Height and overlay controlled by elementor inline style */
    z-index: 1;
}

.miftah-pts-slider-container .swiper-slide-active {
    z-index: 2;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2); /* Slight shadow for active slide */
}

/* Overlay for side slides */
.miftah-pts-slider-container .swiper-slide::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: transparent;
    transition: all 0.5s ease;
    pointer-events: none;
    z-index: 3;
}

/* Active slide has no overlay */
.miftah-pts-slider-container .swiper-slide-active::after {
    background-color: transparent !important;
}

/* Navigation */
.miftah-pts-slider-container .swiper-button-next,
.miftah-pts-slider-container .swiper-button-prev {
    width: 60px;
    height: 60px;
    background-color: #8a7d51;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 100;
    pointer-events: auto;
}

.miftah-pts-slider-container .swiper-button-next:hover,
.miftah-pts-slider-container .swiper-button-prev:hover {
    background-color: #4e7760;
}

.miftah-pts-slider-container .swiper-button-next::after,
.miftah-pts-slider-container .swiper-button-prev::after {
    font-size: 24px;
    font-weight: bold;
}

/* Adjust button positions to be exactly on the edges of the active slide */
.miftah-pts-slider-container .swiper-button-prev {
    left: calc((100% - var(--center-slide-width, 60%)) / 2);
}

.miftah-pts-slider-container .swiper-button-next {
    right: calc((100% - var(--center-slide-width, 60%)) / 2);
}

/* Pagination */
.miftah-pts-slider-container .swiper-pagination {
    bottom: -40px; /* Push pagination below slider */
}

.miftah-pts-slider-container .swiper-pagination-bullet {
    width: 10px;
    height: 10px;
    background-color: rgba(0,0,0,0.3);
    opacity: 1;
    transition: all 0.3s ease;
}

.miftah-pts-slider-container .swiper-pagination-bullet-active {
    background-color: #8a7d51;
}

@media (max-width: 768px) {
    .miftah-pts-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        justify-content: flex-start;
        padding-bottom: 10px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        scrollbar-color: #8a7d51 transparent;
    }
    
    .miftah-pts-tabs::-webkit-scrollbar {
        height: 6px;
    }
    .miftah-pts-tabs::-webkit-scrollbar-thumb {
        background-color: #8a7d51;
        border-radius: 3px;
    }
    
    .miftah-pts-tab-btn {
        flex: 0 0 auto;
        white-space: nowrap;
        width: auto;
    }
    
    .miftah-pts-wrapper {
        --mobile-center-width: 85%;
    }
    
    .miftah-pts-slider-container .swiper-slide {
        width: var(--mobile-center-width) !important;
    }
    
    .miftah-pts-slider-container .swiper-button-prev {
        left: calc((100% - var(--mobile-center-width)) / 2) !important;
        width: 40px;
        height: 40px;
    }
    
    .miftah-pts-slider-container .swiper-button-next {
        right: calc((100% - var(--mobile-center-width)) / 2) !important;
        width: 40px;
        height: 40px;
    }
    
    .miftah-pts-slider-container .swiper-button-next::after,
    .miftah-pts-slider-container .swiper-button-prev::after {
        font-size: 16px;
    }
}
