/* RTL Support for Arabic Language */

/* Base RTL Direction */
[dir="rtl"] {
    direction: rtl;
    text-align: right;
    font-family: 'Tajawal', sans-serif !important;
}
body {
    text-align: right;
    direction: rtl;
}

/* Arabic Font for RTL */
[dir="rtl"] * {
    font-family: 'Tajawal', sans-serif !important;
}
#topnav .navigation-menu > li > a {
    font-size: 16px !important;
}

#topnav .navigation-menu .has-submenu .menu-arrow {
    left:-1px;
    right:auto;
}
/* Better Arabic Text Rendering */
[dir="rtl"] {
    font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Arabic Font Weights */
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3, [dir="rtl"] h4, [dir="rtl"] h5, [dir="rtl"] h6 {
    font-weight: 700;
}

[dir="rtl"] .btn {
    font-weight: 500;
}

[dir="rtl"] .text-muted {
    font-weight: 400;
}

/* Header Layout RTL */
/* [dir="rtl"] header .container {
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    justify-content: space-between;
}

[dir="rtl"] header .container > div:first-child {
    order: 3;
}

[dir="rtl"] header .buy-button {
    order: 1; 
} */



/* [dir="rtl"] .language-switcher {
    margin-left: 0;
    margin-right: 15px;
} */

/* Ensure proper header layout */
/* [dir="rtl"] header .container {
    display: flex !important;
    flex-direction: row-reverse !important;
}

[dir="rtl"] header .container > div:first-child {
    order: 3 !important;
}

[dir="rtl"] header .buy-button {
    order: 1 !important;
} */



/* Override main CSS header styles for RTL */
/* [dir="rtl"] #topnav .container {
    display: flex !important;
    flex-direction: row-reverse !important;
    width: auto !important;
} */

/* [dir="rtl"] #topnav .container > div:first-child {
    order: 3 !important;
} 

[dir="rtl"] #topnav .buy-button {
    order: 0 !important;
} */
@media (min-width: 992px) {
    #topnav .buy-button {
        padding-right: 15px;
        padding-left: unset;
        margin-right: 15px;
        margin-left: unset;
    }
}


/* Form Elements RTL */
[dir="rtl"] .form-control {
    text-align: right;
}

[dir="rtl"] .input-group-append {
    order: -1;
}

[dir="rtl"] .input-group-prepend {
    order: 1;
}

/* Icons and Elements RTL */

[dir="rtl"] .mdi {
    margin-left: 0;
    margin-right: 0.5rem;
}

/* Cards and Sections RTL */


[dir="rtl"] .text-center {
    text-align: center;
}

/* Lists RTL */
[dir="rtl"] .list-unstyled li {
    text-align: right;
}

[dir="rtl"] .list-unstyled .text-primary {
    margin-left: 0;
    margin-right: 0.5rem;
}

/* Buttons RTL */
[dir="rtl"] .btn i,
[dir="rtl"] .btn .mdi,
[dir="rtl"] .btn .fea {
    margin-left: 0;
    margin-right: 0.5rem;
}

/* Modal RTL */
[dir="rtl"] .modal-header .close {
    margin: -1rem auto -1rem -1rem;
}

/* Footer RTL */
[dir="rtl"] .footer-list {
    text-align: right;
}

[dir="rtl"] .social-icon {
    text-align: right;
}

[dir="rtl"] .social-icon .list-inline-item:last-child {
    margin-right: 0;
}

[dir="rtl"] .footer {
    text-align: right;
}

[dir="rtl"] .footer .footer-head {
    text-align: right;
}

[dir="rtl"] .footer .foot-subscribe {
    text-align: right;
}

[dir="rtl"] .footer .foot-subscribe label {
    text-align: right;
}

[dir="rtl"] .footer .foot-subscribe .form-control {
    text-align: right;
}

[dir="rtl"] .footer .foot-subscribe .form-control::placeholder {
    text-align: right;
}

[dir="rtl"] .footer .foot-subscribe .icons {
    right: auto;
    left: 15px;
}

[dir="rtl"] .footer .foot-subscribe .form-control {
    padding-left: 15px;
    padding-right: 40px;
}

[dir="rtl"] .footer .footer-list li a {
    text-align: right;
}

[dir="rtl"] .footer .footer-list li a i {
    margin-left: 0;
    margin-right: 0.25rem;
}

[dir="rtl"] .footer .footer-list li a i:before {
    content: "\F0141";
}

[dir="rtl"] .footer-bar .text-sm-right {
    text-align: right !important;
}

[dir="rtl"] .footer-bar .list-unstyled {
    text-align: left;
}

/* Breadcrumb RTL */
[dir="rtl"] .breadcrumb-item + .breadcrumb-item::before {    
    padding-right: 0.5rem;
    padding-left: 0;
}

/* Pricing Cards RTL */
[dir="rtl"] .pricing-rates .list-unstyled li {
    text-align: right;
}

/* Accordion RTL */
[dir="rtl"] .accordion .btn-link {
    text-align: right !important;
}

/* Custom RTL Adjustments */
[dir="rtl"] .mr-2 {
    margin-right: 0 !important;
    margin-left: 0.5rem !important;
}

[dir="rtl"] .ml-2 {
    margin-left: 0 !important;
    margin-right: 0.5rem !important;
}

[dir="rtl"] .mr-1 {
    margin-right: 0 !important;
    margin-left: 0.25rem !important;
}

[dir="rtl"] .ml-1 {
    margin-left: 0 !important;
    margin-right: 0.25rem !important;
}

/* Text Alignment Classes */
[dir="rtl"] .text-left {
    text-align: right !important;
}

[dir="rtl"] .text-right {
    text-align: left !important;
}

/* Float Adjustments */
[dir="rtl"] .float-left {
    float: right !important;
}

[dir="rtl"] .float-right {
    float: left !important;
}

/* Flexbox RTL */

[dir="rtl"] .justify-content-start {
    justify-content: flex-end !important;
}

[dir="rtl"] .justify-content-end {
    justify-content: flex-start !important;
}


/* Input Groups RTL */
[dir="rtl"] .input-group > .form-control:not(:last-child) {
    border-radius: 0 0.25rem 0.25rem 0;
}

[dir="rtl"] .input-group > .form-control:not(:first-child) {
    border-radius: 0.25rem 0 0 0.25rem;
}

/* Dropdown RTL */
[dir="rtl"] .dropdown-menu {
    text-align: right;
}

/* Alert RTL */
[dir="rtl"] .alert {
    text-align: right;
}

/* Badge RTL */
[dir="rtl"] .badge {
    margin-left: 0;
    margin-right: 0.25rem;
}

/* Table RTL */
[dir="rtl"] .table th,
[dir="rtl"] .table td {
    text-align: right;
}

/* Progress Bar RTL */
[dir="rtl"] .progress-bar {
    float: right;
}

/* Carousel RTL */
[dir="rtl"] .carousel-control-prev {
    left: auto;
    right: 0;
}

[dir="rtl"] .carousel-control-next {
    right: auto;
    left: 0;
}

/* Pagination RTL */
[dir="rtl"] .pagination .page-item:first-child .page-link {
    border-radius: 0 0.25rem 0.25rem 0;
}

[dir="rtl"] .pagination .page-item:last-child .page-link {
    border-radius: 0.25rem 0 0 0.25rem;
}

/* Custom Components RTL */

[dir="rtl"] .custom-control-label::before {
    left: auto;
    right: 0;
}

[dir="rtl"] .custom-control-label::after {
    left: auto;
    right: 0;
}

/* Language Menu Item Styling */
.language-menu-item a {
    font-weight: 500;
    transition: all 0.3s ease;
}

.language-menu-item .arabic-text {
    font-family: 'Tajawal', sans-serif !important;
    font-weight: 500;
    direction: rtl;
    text-align: center;
    font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
    text-rendering: optimizeLegibility;
}

/* Ensure Arabic text uses Tajawal font in English version */
.language-menu-item a[href*="lang=ar"] {
    font-family: 'Tajawal', sans-serif !important;
    font-weight: 500;
    direction: rtl;
    text-align: center;
    font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
    text-rendering: optimizeLegibility;
}

/* Language Menu Item RTL */
[dir="rtl"] .language-menu-item {
    text-align: right;
}
/* Responsive Language Menu Item */
@media (max-width: 768px) {
    .language-menu-item a {
        font-size: 14px;
        padding: 10px 15px;
    }
}

/* Responsive RTL */
@media (max-width: 768px) {
    [dir="rtl"] .text-md-left {
        text-align: right !important;
    }
    
    [dir="rtl"] .text-md-right {
        text-align: left !important;
    }
    
    /* Mobile Header RTL */
    [dir="rtl"] header .container {
        flex-direction: column;
    }
    
    [dir="rtl"] .logo {
        order: 1;
        text-align: center;
    }
    
    
    
    [dir="rtl"] .buy-button {
        order: 3;
        text-align: center;
    }
    

    
/* Mobile Menu Arabic Text Improvements */
@media (max-width: 768px) {
    
    
    [dir="rtl"] .language-menu-item a {
        font-family: 'Tajawal', sans-serif !important;
        line-height: 1.6;
    }
}
}

/* Arabic Text Improvements */


[dir="rtl"] .text-left {
    text-align: left !important;
}

[dir="rtl"] .text-right {
    text-align: right !important;
}

/* Arabic Line Height */
[dir="rtl"] p, [dir="rtl"] .para-desc {
    line-height: 1.8;
}

[dir="rtl"] .list-unstyled li {
    line-height: 1.6;
}

/* Arabic Button Text */
[dir="rtl"] .btn {
    letter-spacing: 0;
}

/* Arabic Form Labels */
[dir="rtl"] label {
    font-weight: 500;
}

/* Arabic Modal Text */
[dir="rtl"] .modal-title {
    font-weight: 700;
}

[dir="rtl"] .modal-body {
    line-height: 1.7;
} 
@media (min-width: 992px) {
    #topnav .navigation-menu > li .submenu:before {
        right: 45px;
        left: auto;
    }
}
@media (min-width: 992px) {
    #topnav .navigation-menu > li .submenu {
        right: 0;
        left: auto;
    }
}
@media (min-width: 992px) {
    #topnav .navigation-menu > li .submenu li a {
        padding: 10px 0 10px 20px;
    }
}
.back-to-top {
    left: 30px;
    right:auto;
}
.list-unstyled {
    padding-left: auto;
    padding-right: 0;
}
.breadcrumb .breadcrumb-item:after {
    content: "\F0141" !important;
    padding-left: unset;
    padding-right: 5px;
    padding-top: 2px;
}
@media (min-width: 768px) {
    .text-md-left {
        text-align: right !important;
    }
}
.custom-control {  
    padding-right: 1.5rem;
    padding-left: unset;
}
.custom-control-input {
    right: 0;
    left: auto;
}
.custom-control-label::before {
    right: -1.5rem !important;
    left: auto !important;
}
.custom-control-label::after {
    right: -1.5rem !important;
    left: auto !important;
}
.custom-checkbox .custom-control-input:checked~.custom-control-label::after {
    right: -1.5rem !important;
    left: auto !important;
}
#topnav .logo {
    float: right;
}
#topnav .buy-button, #topnav .menu-extras{
    float: left;
}
@media (max-width: 991px) {
    #topnav .navigation-menu > li .submenu {
        padding-left: unset;
        padding-right: 20px;
    }
}
