/* Miftah Gallery Tab Widget Styles - Alma-style coverflow slider */

.miftah-gallery-tab-section {
    width: 100%;
    position: relative;
    overflow: hidden;
    background-color: #0f2e5c;
    padding: 60px 40px;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Header Text Styles */
.miftah-gallery-tab-section .miftah-gallery-title {
    font-size: 36px;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 16px 0;
    line-height: 1.25;
    text-align: center;
}

.miftah-gallery-tab-section .miftah-gallery-desc {
    font-size: 15px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.75);
    max-width: 600px;
    margin: 0 auto 35px auto;
    line-height: 1.6;
    text-align: center;
}

/* Tabs */
.miftah-gallery-tab-section .miftah-gallery-tabs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 30px;
    margin-bottom: 40px;
    position: relative;
    z-index: 10;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 12px;
    width: 100%;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.miftah-gallery-tab-section .miftah-gallery-tab-btn {
    background: transparent;
    border: none;
    outline: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    color: #ffffff;
    padding: 6px 12px;
    position: relative;
    transition: all 0.3s ease;
}

.miftah-gallery-tab-section .miftah-gallery-tab-btn:hover,
.miftah-gallery-tab-section .miftah-gallery-tab-btn:focus {
    background-color: transparent;
    color: #c9a96e;
}

.miftah-gallery-tab-section .miftah-gallery-tab-btn::after {
    content: '';
    position: absolute;
    bottom: -13px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: #c9a96e;
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.miftah-gallery-tab-section .miftah-gallery-tab-btn.active {
    background-color: transparent;
    color: #c9a96e;
}

.miftah-gallery-tab-section .miftah-gallery-tab-btn.active::after {
    transform: scaleX(1);
}

/* Sliders Container */
.miftah-gallery-tab-section .miftah-gallery-sliders-wrap {
    position: relative;
    width: 100%;
}

.miftah-gallery-tab-section .miftah-gallery-slider-outer {
    display: none;
    width: 100%;
    height: 500px; /* Default height, overridden by Elementor control */
    opacity: 0;
    transition: opacity 0.5s ease;
}

.miftah-gallery-tab-section .miftah-gallery-slider-outer.active {
    display: block;
    opacity: 1;
}

.miftah-gallery-tab-section .miftah-gallery-slider-outer .swiper {
    width: 100%;
    height: 100%;
    overflow: visible !important;
    position: relative;
}

.miftah-gallery-tab-section .miftah-gallery-slider-outer .swiper-wrapper {
    align-items: center;
}

/* Slide Image */
.miftah-gallery-tab-section .miftah-gallery-slide-image {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
}

/* Centered Slides Effect */
.miftah-gallery-tab-section .miftah-gallery-slider-outer .swiper-slide {
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.5s ease;
    opacity: 1;
    position: relative;
    height: 100%;
    /* Default width, overridden by Elementor control */
    width: 60%;
}

.miftah-gallery-tab-section .miftah-gallery-slider-outer .swiper-slide:not(.swiper-slide-active) {
    z-index: 1;
}

.miftah-gallery-tab-section .miftah-gallery-slider-outer .swiper-slide-active {
    z-index: 2;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* Overlay for side slides */
.miftah-gallery-tab-section .miftah-gallery-slider-outer .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-gallery-tab-section .miftah-gallery-slider-outer .swiper-slide-active::after {
    background-color: transparent !important;
}

/* Navigation Arrows */
.miftah-gallery-tab-section .miftah-gallery-slider-outer .swiper-button-next,
.miftah-gallery-tab-section .miftah-gallery-slider-outer .swiper-button-prev {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.25);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 100;
    pointer-events: auto;
}

.miftah-gallery-tab-section .miftah-gallery-slider-outer .swiper-button-next:hover,
.miftah-gallery-tab-section .miftah-gallery-slider-outer .swiper-button-prev:hover {
    background-color: rgba(255, 255, 255, 0.45);
}

.miftah-gallery-tab-section .miftah-gallery-slider-outer .swiper-button-next::after,
.miftah-gallery-tab-section .miftah-gallery-slider-outer .swiper-button-prev::after {
    font-size: 20px;
    font-weight: bold;
}

/* Position arrows at edges of active slide */
.miftah-gallery-tab-section .miftah-gallery-slider-outer .swiper-button-prev {
    left: calc((100% - var(--center-slide-width, 60%)) / 2);
    right: auto;
}

.miftah-gallery-tab-section .miftah-gallery-slider-outer .swiper-button-next {
    right: calc((100% - var(--center-slide-width, 60%)) / 2);
    left: auto;
}

/* RTL Specific Overrides for proper arrow positioning */
[dir="rtl"] .miftah-gallery-tab-section .miftah-gallery-slider-outer .swiper-button-prev {
    left: calc((100% - var(--center-slide-width, 60%)) / 2) !important;
    right: auto !important;
}

[dir="rtl"] .miftah-gallery-tab-section .miftah-gallery-slider-outer .swiper-button-next {
    right: calc((100% - var(--center-slide-width, 60%)) / 2) !important;
    left: auto !important;
}

/* Rotate Swiper arrow icons in RTL because they are physically placed on correct sides */
[dir="rtl"] .miftah-gallery-tab-section .miftah-gallery-slider-outer .swiper-button-prev::after,
[dir="rtl"] .miftah-gallery-tab-section .miftah-gallery-slider-outer .swiper-button-next::after {
    transform: rotate(180deg) !important;
}

/* Pagination */
.miftah-gallery-tab-section .miftah-gallery-slider-outer .swiper-pagination {
    bottom: -40px;
}

.miftah-gallery-tab-section .miftah-gallery-slider-outer .swiper-pagination-bullet {
    width: 10px;
    height: 10px;
    background-color: rgba(255, 255, 255, 0.5);
    opacity: 1;
    transition: all 0.3s ease;
}

.miftah-gallery-tab-section .miftah-gallery-slider-outer .swiper-pagination-bullet-active {
    background-color: #c9a96e;
}

/* Brochure Button Wrapper */
.miftah-gallery-tab-section .miftah-gallery-btn-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 50px;
    width: 100%;
}

.miftah-gallery-tab-section .miftah-gallery-brochure-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #ffffff;
    background-color: transparent;
    color: #ffffff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1px;
    padding: 14px 34px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.miftah-gallery-tab-section .miftah-gallery-brochure-btn:hover {
    background-color: #ffffff;
    color: #0f2e5c;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .miftah-gallery-tab-section {
        padding: 40px 20px;
    }

    .miftah-gallery-tab-section .miftah-gallery-title {
        font-size: 28px;
    }

    .miftah-gallery-tab-section .miftah-gallery-slider-outer {
        height: 350px;
    }

    .miftah-gallery-tab-section .miftah-gallery-tabs {
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        justify-content: flex-start !important;
        align-items: center !important;
        padding: 5px 0 12px 0 !important;
        margin-bottom: 25px !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
        -ms-overflow-style: none !important;
        gap: 15px;
    }

    .miftah-gallery-tab-section .miftah-gallery-tabs::-webkit-scrollbar {
        display: none !important;
    }

    .miftah-gallery-tab-section .miftah-gallery-tab-btn {
        flex: 0 0 auto !important;
        white-space: nowrap !important;
        font-size: 13px !important;
        padding: 6px 10px !important;
    }

    .miftah-gallery-tab-section .miftah-gallery-slider-outer .swiper-slide {
        width: 85% !important;
    }

    .miftah-gallery-tab-section .miftah-gallery-slider-outer .swiper-button-prev {
        left: calc((100% - 85%) / 2) !important;
        width: 40px;
        height: 40px;
    }

    .miftah-gallery-tab-section .miftah-gallery-slider-outer .swiper-button-next {
        right: calc((100% - 85%) / 2) !important;
        width: 40px;
        height: 40px;
    }

    .miftah-gallery-tab-section .miftah-gallery-slider-outer .swiper-button-next::after,
    .miftah-gallery-tab-section .miftah-gallery-slider-outer .swiper-button-prev::after {
        font-size: 16px;
    }

    .miftah-gallery-tab-section .miftah-gallery-brochure-btn {
        padding: 12px 28px;
        font-size: 12px;
    }
}
