/* RTL Testimonials Fix CSS */
/* إصلاح مشاكل عرض قسم الشهادات (Testimonials) في اللغة العربية RTL */

/* إصلاحات RTL للشاشات الكبيرة والمتوسطة */
[dir="rtl"] .testimonials-wrapper {
    direction: rtl;
}

/* إصلاح موضع العناصر المطلقة */
[dir="rtl"] .left-elips {
    left: auto;
    right: -77px;
}

[dir="rtl"] .right-elips {
    right: auto;
    left: 0;
}

/* إصلاح موضع testimonial-border */
[dir="rtl"] .testimonial-border {
    right: auto;
    left: 58px;
}

/* إصلاح اتجاه النص والمحاذاة */
[dir="rtl"] .testimonial-des {
    padding: 45px 80px 26px 20px;
    text-align: right;
}

/* إصلاح موضع الخط الجانبي */
[dir="rtl"] .testimonial-des::before {
    left: auto;
    right: -11px;
    border-radius: 0 41px 41px 0;
}

/* إصلاح موضع الخط العمودي */
[dir="rtl"] .testimonial-des .description::before {
    left: auto;
    right: -35px;
}

/* إصلاح اتجاه معلومات المستخدم */
[dir="rtl"] .user-info {
    flex-direction: row-reverse;
}

[dir="rtl"] .user-info ul {
    margin-right: 0;
    margin-left: 10px;
}

/* إصلاح موضع أزرار التنقل */
[dir="rtl"] .testimonials-wrapper .owl-theme .owl-nav {
    left: auto;
    right: -398px;
}

[dir="rtl"] .user-slider .owl-nav .owl-prev {
    margin-right: 0;
    margin-left: 30px;
}

/* إصلاح اتجاه أزرار التنقل */
[dir="rtl"] .user-slider .owl-nav .owl-prev i {
    transform: scaleX(-1);
}

[dir="rtl"] .user-slider .owl-nav .owl-next i {
    transform: scaleX(-1);
}

/* إصلاحات للشاشات المتوسطة */
@media (max-width: 1100px) {
    [dir="rtl"] .testimonial-border {
        left: 0px;
        right: auto;
    }
}

@media (max-width: 1024px) {
    [dir="rtl"] .testimonials-wrapper .owl-theme .owl-nav {
        right: -320px;
        left: auto;
    }
}

/* إصلاحات للشاشات الصغيرة */
@media (max-width: 991px) {
    [dir="rtl"] .testimonial-border {
        left: 0px;
        right: auto;
        width: 330px;
    }
    
    [dir="rtl"] .testimonial-des {
        padding: 20px 35px 20px 20px;
    }
    
    [dir="rtl"] .testimonials-wrapper .owl-theme .owl-nav {
        position: inherit;
        right: 0;
        left: auto;
        bottom: 0 !important;
    }
}

/* إصلاحات للموبايل */
@media (max-width: 767px) {
    [dir="rtl"] .testimonials-wrapper {
        text-align: right;
        padding: 40px 0 !important; /* تقليل الـ padding العمودي */
        min-height: auto !important; /* إزالة الحد الأدنى للارتفاع */
    }
    
    [dir="rtl"] .testimonials-wrapper .section-title {
        text-align: right;
        margin-top: 20px !important; /* تقليل المسافة العلوية */
        margin-bottom: 30px !important;
    }
    
    [dir="rtl"] .testimonials-wrapper .section-title .title-head,
    [dir="rtl"] .testimonials-wrapper .section-title .title,
    [dir="rtl"] .testimonials-wrapper .section-title .description {
        text-align: right;
    }
    
    [dir="rtl"] .single-opinion {
        direction: rtl;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        margin-bottom: 30px !important;
    }
    
    [dir="rtl"] .user-image {
        width: 100% !important;
        max-width: 280px !important;
        margin-bottom: 20px !important;
    }
    
    [dir="rtl"] .user-image img {
        width: 100% !important;
        height: 200px !important; /* تقليل الارتفاع للموبايل */
        object-fit: cover !important;
        border-radius: 10px !important;
    }
    
    [dir="rtl"] .testimonial-border {
        position: relative !important;
        left: auto !important;
        right: auto !important;
        top: auto !important;
        transform: none !important;
        margin: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        box-shadow: var(--box-shadow-2) !important;
        border-radius: 15px !important;
    }
    
    [dir="rtl"] .testimonial-des {
        padding: 20px !important;
        text-align: right;
        background: #fff !important;
        border-radius: 15px !important;
    }
    
    [dir="rtl"] .testimonial-des::before {
        display: none !important;
    }
    
    [dir="rtl"] .testimonial-des .description::before {
        display: none !important;
    }
    
    [dir="rtl"] .user-info {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        gap: 10px !important;
        margin-top: 15px !important;
    }
    
    [dir="rtl"] .user-info .ellipsis-line-2 {
        text-align: right;
    }
    
    [dir="rtl"] .user-info ul {
        margin-left: 0;
        margin-right: 0;
    }
    
    /* إصلاح مشكلة الـ Owl Carousel على الموبايل */
    [dir="rtl"] .user-slider .owl-stage-outer {
        overflow: visible !important;
    }
    
    [dir="rtl"] .user-slider .owl-item {
        padding: 0 15px !important;
    }
}

/* إصلاحات للشاشات الصغيرة جداً */
@media (max-width: 575px) {
    [dir="rtl"] .testimonials-wrapper {
        padding: 30px 0 !important; /* تقليل أكثر للشاشات الصغيرة */
    }
    
    [dir="rtl"] .testimonials-wrapper .section-title {
        margin-top: 15px !important;
        margin-bottom: 25px !important;
    }
    
    [dir="rtl"] .single-opinion {
        margin-bottom: 25px !important;
    }
    
    [dir="rtl"] .user-image {
        max-width: 250px !important;
        margin-bottom: 15px !important;
    }
    
    [dir="rtl"] .user-image img {
        height: 180px !important; /* تقليل أكثر للشاشات الصغيرة */
    }
    
    [dir="rtl"] .testimonial-border {
        margin: 0 !important;
        border-radius: 12px !important;
    }
    
    [dir="rtl"] .testimonial-des {
        padding: 15px !important;
        border-radius: 12px !important;
    }
    
    [dir="rtl"] .user-info {
        flex-direction: column;
        align-items: flex-end;
        gap: 10px;
        margin-top: 12px !important;
    }
    
    [dir="rtl"] .user-info .ellipsis-line-2 {
        width: 100%;
        text-align: right;
    }
    
    [dir="rtl"] .user-info ul {
        align-self: flex-end;
    }
    
    /* تحسين المسافات للشاشات الصغيرة */
    [dir="rtl"] .user-slider .owl-item {
        padding: 0 10px !important;
    }
}

/* إصلاح خاص لـ Owl Carousel RTL */
[dir="rtl"] .owl-carousel {
    direction: ltr;
}

[dir="rtl"] .owl-carousel .owl-item {
    direction: rtl;
}

/* إصلاحات عامة للموبايل لحل مشكلة الفراغ الكبير */
@media (max-width: 767px) {
    /* إصلاح مشكلة section-padding على الموبايل */
    [dir="rtl"] .section-padding {
        padding: 40px 0 !important;
    }
    
    /* إصلاح مشكلة الارتفاع الزائد */
    [dir="rtl"] .testimonials-wrapper .container {
        padding: 0 15px !important;
    }
    
    /* إصلاح مشكلة الـ row على الموبايل */
    [dir="rtl"] .testimonials-wrapper .row {
        margin: 0 !important;
        align-items: stretch !important;
    }
    
    /* إصلاح مشكلة الأعمدة على الموبايل */
    [dir="rtl"] .testimonials-wrapper .col-lg-4,
    [dir="rtl"] .testimonials-wrapper .col-md-4,
    [dir="rtl"] .testimonials-wrapper .col-lg-8,
    [dir="rtl"] .testimonials-wrapper .col-md-8 {
        padding: 0 15px !important;
        margin-bottom: 20px !important;
    }
    
    /* إخفاء العناصر الزخرفية على الموبايل */
    [dir="rtl"] .left-elips,
    [dir="rtl"] .right-elips {
        display: none !important;
    }
}

/* إصلاح النصوص العربية */
[dir="rtl"] .testimonials-wrapper * {
    font-family: 'Cairo', 'Tajawal', 'Amiri', Arial, sans-serif !important;
}

/* إصلاحات إضافية لـ Owl Carousel */
.testimonials-wrapper .user-slider {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.testimonials-wrapper .owl-carousel {
    display: block !important;
}

.testimonials-wrapper .user-slider .owl-stage-outer {
    overflow: hidden !important;
    position: relative;
}

.testimonials-wrapper .user-slider .owl-stage {
    display: flex !important;
    align-items: stretch !important;
    transform: translate3d(0px, 0px, 0px);
    transition: all 0.25s ease 0s;
    width: auto;
}

.testimonials-wrapper .user-slider .owl-item {
    display: block !important;
    min-height: 1px !important;
    float: none !important;
    -webkit-backface-visibility: hidden;
    -webkit-touch-callout: none;
}

.testimonials-wrapper .user-slider .owl-item.active {
    display: flex !important;
}

/* Force show all items initially until carousel loads */
.testimonials-wrapper .user-slider:not(.owl-loaded) .single-opinion {
    display: none;
}

.testimonials-wrapper .user-slider:not(.owl-loaded) .single-opinion:first-child {
    display: block;
}

/* إصلاح أزرار التنقل */
.testimonials-wrapper .user-slider .owl-nav {
    margin-top: 20px !important;
    text-align: center !important;
    display: block !important;
}

.testimonials-wrapper .user-slider .owl-nav button {
    background: #007bff !important;
    color: white !important;
    border: none !important;
    border-radius: 50% !important;
    width: 40px !important;
    height: 40px !important;
    margin: 0 5px !important;
    font-size: 16px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
}

.testimonials-wrapper .user-slider .owl-nav button:hover {
    background: #0056b3 !important;
    transform: scale(1.1) !important;
}

.testimonials-wrapper .user-slider .owl-nav button.owl-prev,
.testimonials-wrapper .user-slider .owl-nav button.owl-next {
    display: inline-block !important;
}

/* إصلاح النقاط */
.testimonials-wrapper .user-slider .owl-dots {
    text-align: center !important;
    margin-top: 15px !important;
    display: block !important;
}

.testimonials-wrapper .user-slider .owl-dots .owl-dot {
    display: inline-block !important;
    margin: 0 5px !important;
    cursor: pointer;
}

.testimonials-wrapper .user-slider .owl-dots .owl-dot span {
    width: 12px !important;
    height: 12px !important;
    background: #ddd !important;
    border-radius: 50% !important;
    display: block !important;
    transition: all 0.3s ease !important;
}

.testimonials-wrapper .user-slider .owl-dots .owl-dot.active span,
.testimonials-wrapper .user-slider .owl-dots .owl-dot:hover span {
    background: #007bff !important;
}

/* إصلاح مشكلة العرض على الموبايل */
@media (max-width: 767px) {
    .testimonials-wrapper .user-slider .owl-nav {
        display: none !important;
    }
    
    .testimonials-wrapper .user-slider .owl-dots {
        display: block !important;
    }
    
    .testimonials-wrapper .user-slider .single-opinion {
        margin-bottom: 20px;
    }
}

/* RTL Support for Owl Carousel */
[dir="rtl"] .testimonials-wrapper .owl-carousel .owl-nav .owl-prev {
    left: auto;
    right: 0;
}

[dir="rtl"] .testimonials-wrapper .owl-carousel .owl-nav .owl-next {
    right: auto;
    left: 0;
}

[dir="rtl"] .testimonial-des .description {
    line-height: 1.8;
    text-align: right;
}

[dir="rtl"] .user-info h4,
[dir="rtl"] .user-info p {
    text-align: right;
}