/* RTL (Right-to-Left) Styles for Arabic Language */

/* Base RTL Direction */
html[dir="rtl"] {
    direction: rtl;
}

html[dir="rtl"] body {
    text-align: right;
}

/* Keep numbers in correct LTR order */
html[dir="rtl"] .about-us p,
html[dir="rtl"] .who-we-are p,
html[dir="rtl"] .why-do-we p,
html[dir="rtl"] .feature-block-content p {
    direction: ltr;
    text-align: right;
    unicode-bidi: embed;
}

/* Font Family for Arabic */
html[dir="rtl"] body {
    font-family: 'Tajawal', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Flexbox Direction Reversal */
html[dir="rtl"] .d-flex,
html[dir="rtl"] .flex-row {
    flex-direction: row-reverse;
}

html[dir="rtl"] .justify-content-start {
    justify-content: flex-end !important;
}

html[dir="rtl"] .justify-content-end {
    justify-content: flex-start !important;
}

/* Margin and Padding Adjustments */
html[dir="rtl"] .ms-1, html[dir="rtl"] .ms-2, html[dir="rtl"] .ms-3, html[dir="rtl"] .ms-4, html[dir="rtl"] .ms-5 {
    margin-right: inherit !important;
    margin-left: 0 !important;
}

html[dir="rtl"] .me-1, html[dir="rtl"] .me-2, html[dir="rtl"] .me-3, html[dir="rtl"] .me-4, html[dir="rtl"] .me-5 {
    margin-left: inherit !important;
    margin-right: 0 !important;
}

html[dir="rtl"] .ps-1, html[dir="rtl"] .ps-2, html[dir="rtl"] .ps-3, html[dir="rtl"] .ps-4, html[dir="rtl"] .ps-5 {
    padding-right: inherit !important;
    padding-left: 0 !important;
}

html[dir="rtl"] .pe-1, html[dir="rtl"] .pe-2, html[dir="rtl"] .pe-3, html[dir="rtl"] .pe-4, html[dir="rtl"] .pe-5 {
    padding-left: inherit !important;
    padding-right: 0 !important;
}

/* Navigation */
html[dir="rtl"] .navbar-nav {
    padding-right: 0;
}

html[dir="rtl"] .navbar .nav-link {
    text-align: right;
}

html[dir="rtl"] .dropdown-menu {
    text-align: right;
    left: auto;
    right: 0;
}

/* Header */
html[dir="rtl"] .header .container {
    flex-direction: row-reverse;
    justify-content: flex-start;
    gap: 30px;
}

html[dir="rtl"] .header .logo {
    order: 2;
    margin-left: auto;
}

html[dir="rtl"] .header .navmenu {
    order: 1;
}

html[dir="rtl"] .header .lang-switch-text {
    order: 0;
}

html[dir="rtl"] .header-logo {
    margin-left: auto;
    margin-right: 0;
}

html[dir="rtl"] .header-contact {
    text-align: left;
}

/* Buttons with Icons */
html[dir="rtl"] .btn i,
html[dir="rtl"] .btn svg {
    margin-left: 0.5rem;
    margin-right: 0;
}

html[dir="rtl"] .btn-icon-right i,
html[dir="rtl"] .btn-icon-right svg {
    margin-right: 0.5rem;
    margin-left: 0;
}

/* Forms */
html[dir="rtl"] .form-control,
html[dir="rtl"] .form-select,
html[dir="rtl"] textarea {
    text-align: right;
}

html[dir="rtl"] .form-check {
    padding-left: 0;
    padding-right: 1.5em;
}

html[dir="rtl"] .form-check-input {
    float: right;
    margin-left: 0;
    margin-right: -1.5em;
}

/* Input Groups */
html[dir="rtl"] .input-group > .form-control:not(:last-child),
html[dir="rtl"] .input-group > .form-select:not(:last-child) {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border-top-right-radius: var(--bs-border-radius);
    border-bottom-right-radius: var(--bs-border-radius);
}

html[dir="rtl"] .input-group > .form-control:not(:first-child),
html[dir="rtl"] .input-group > .form-select:not(:first-child) {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-top-left-radius: var(--bs-border-radius);
    border-bottom-left-radius: var(--bs-border-radius);
}

/* Cards */
html[dir="rtl"] .card-body {
    text-align: right;
}

/* Lists */
html[dir="rtl"] ul,
html[dir="rtl"] ol {
    padding-right: 2rem;
    padding-left: 0;
}

html[dir="rtl"] .list-unstyled {
    padding-right: 0;
}

/* Text Alignment Overrides */
html[dir="rtl"] .text-start {
    text-align: right !important;
}

html[dir="rtl"] .text-end {
    text-align: left !important;
}

/* Float Overrides */
html[dir="rtl"] .float-start {
    float: right !important;
}

html[dir="rtl"] .float-end {
    float: left !important;
}

/* Hero Section */
html[dir="rtl"] .hero-content {
    text-align: right;
}

html[dir="rtl"] .hero-title,
html[dir="rtl"] .hero-subtitle {
    text-align: right;
}

/* Product Cards */
html[dir="rtl"] .product-card {
    text-align: right;
}

html[dir="rtl"] .product-details {
    text-align: right;
}

/* Products Page - Categories and Listings */
html[dir="rtl"] .product-listing h2 {
    text-align: center;
}

html[dir="rtl"] .product-tab {
    text-align: center;
}

/* Ensure tab buttons have same styling as English */
html[dir="rtl"] .tab-nav-custom .nav-link {
    line-height: 1.5;
    vertical-align: middle;
}

html[dir="rtl"] .product-listing .featured-products-list .row {
    flex-direction: row-reverse;
}

html[dir="rtl"] .featured-product-item {
    text-align: center;
}

html[dir="rtl"] .featured-product-name {
    text-align: center;
}

/* Footer */
html[dir="rtl"] .footer-widget {
    text-align: right;
}

html[dir="rtl"] .footer-links {
    padding-right: 0;
}

html[dir="rtl"] .footer-links li {
    text-align: right;
}

html[dir="rtl"] .social-links {
    justify-content: flex-start;
}

/* Footer phone numbers and email - keep LTR */
html[dir="rtl"] .footer a[href^="tel"],
html[dir="rtl"] .footer a[href^="mailto"],
html[dir="rtl"] .footer-contact a,
html[dir="rtl"] .footer .phone-number,
html[dir="rtl"] .footer .contact-info a,
html[dir="rtl"] footer a[href^="tel"],
html[dir="rtl"] footer a[href^="mailto"],
html[dir="rtl"] .footer-contact-details p,
html[dir="rtl"] .footer-contact-details p a,
html[dir="rtl"] .footer-contact-details a {
    direction: ltr !important;
    display: inline-block;
    unicode-bidi: embed;
}

/* Breadcrumb */
html[dir="rtl"] .breadcrumb {
    padding-right: 0;
}

html[dir="rtl"] .breadcrumb-item + .breadcrumb-item::before {
    float: right;
    padding-left: 0.5rem;
    padding-right: 0;
    content: "\2190"; /* Left arrow for RTL */
}

/* Tables */
html[dir="rtl"] .table {
    text-align: right;
}

html[dir="rtl"] .table th,
html[dir="rtl"] .table td {
    text-align: right;
}

/* Swiper/Carousel */
html[dir="rtl"] .swiper-button-next {
    right: auto;
    left: 10px;
}

html[dir="rtl"] .swiper-button-prev {
    left: auto;
    right: 10px;
}

html[dir="rtl"] .swiper-pagination {
    direction: ltr;
}

/* Hero Banner Arrows - Keep original positions in RTL */
html[dir="rtl"] .hero-arrow {
    flex-direction: row !important;
    direction: ltr !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    padding: 0 !important;
}

html[dir="rtl"] .hero-arrow i,
html[dir="rtl"] .hero-arrow .bi {
    margin: 0 !important;
    padding: 0 !important;
    transform: none !important;
    position: static !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: auto !important;
    height: auto !important;
    line-height: 1 !important;
}

html[dir="rtl"] .hero-prev {
    left: 30px !important;
    right: auto !important;
}

html[dir="rtl"] .hero-next {
    right: 30px !important;
    left: auto !important;
}

@media (max-width: 991px) {
    html[dir="rtl"] .hero-prev {
        left: 20px !important;
    }
    html[dir="rtl"] .hero-next {
        right: 20px !important;
    }
}

@media (max-width: 576px) {
    html[dir="rtl"] .hero-prev {
        left: 15px !important;
    }
    html[dir="rtl"] .hero-next {
        right: 15px !important;
    }
}

/* Modals */
html[dir="rtl"] .modal-header {
    flex-direction: row-reverse;
}

html[dir="rtl"] .modal-header .btn-close {
    margin: -0.5rem auto -0.5rem -0.5rem;
}

/* Alerts */
html[dir="rtl"] .alert {
    text-align: right;
}

html[dir="rtl"] .alert-dismissible {
    padding-left: 3rem;
    padding-right: 1rem;
}

html[dir="rtl"] .alert-dismissible .btn-close {
    left: 0;
    right: auto;
}

/* Badges */
html[dir="rtl"] .badge {
    margin-left: 0;
    margin-right: 0.25rem;
}

/* Pagination */
html[dir="rtl"] .pagination {
    padding-right: 0;
}

/* Accordions */
html[dir="rtl"] .accordion-button::after {
    margin-left: 0;
    margin-right: auto;
}

/* Contact/Location Cards */
html[dir="rtl"] .location-card {
    text-align: right;
}

html[dir="rtl"] .location-card i {
    margin-left: 0.5rem;
    margin-right: 0;
}

/* Contact Page - Phone numbers and email */
html[dir="rtl"] .contact-info .value,
html[dir="rtl"] .contact-info .value a,
html[dir="rtl"] .contact-info a[href^="tel"],
html[dir="rtl"] .contact-info a[href^="mailto"],
html[dir="rtl"] .contact-info a[href^="https://wa.me"] {
    direction: ltr !important;
    display: inline-block;
    unicode-bidi: embed;
}

/* Specifications Table */
html[dir="rtl"] .spec-label {
    text-align: right;
}

html[dir="rtl"] .spec-value {
    text-align: left;
}

/* Language Switcher - RTL adjustments */
html[dir="rtl"] .lang-switcher-simple {
    flex-direction: row-reverse;
}

/* Banner Text */
html[dir="rtl"] .banner-content {
    text-align: right;
}

html[dir="rtl"] .banner-title,
html[dir="rtl"] .banner-subtitle {
    text-align: right;
}

/* Icons Alignment */
html[dir="rtl"] .icon-text {
    flex-direction: row-reverse;
}

html[dir="rtl"] .icon-text i,
html[dir="rtl"] .icon-text svg {
    margin-left: 0.5rem;
    margin-right: 0;
}

/* Feature Box */
html[dir="rtl"] .feature-box {
    text-align: right;
}

/* About Section */
html[dir="rtl"] .about-content {
    text-align: right;
}

/* Section Titles */
html[dir="rtl"] .section-title {
    text-align: right;
}

html[dir="rtl"] .section-title::after {
    right: 0;
    left: auto;
}

/* Chairman Message */
html[dir="rtl"] .chairman-message {
    text-align: right;
}

/* Company Vision Section - RTL */
html[dir="rtl"] .company-vision {
    background-position: left center, right top;
}

html[dir="rtl"] .company-vision .row {
    flex-direction: row-reverse;
    justify-content: flex-start;
}

html[dir="rtl"] .company-vision .col-lg-6 {
    margin-left: auto;
    margin-right: 0;
}

html[dir="rtl"] .company-vision-content {
    text-align: right;
}

/* Contact Form */
html[dir="rtl"] .contact-form {
    text-align: right;
}

/* Career Form */
html[dir="rtl"] .career-form {
    text-align: right;
}

/* File Input */
html[dir="rtl"] input[type="file"] {
    text-align: right;
}

/* Select Dropdown Arrow */
html[dir="rtl"] .form-select {
    background-position: left 0.75rem center;
    padding-left: 2.25rem;
    padding-right: 0.75rem;
}

/* Custom Scrollbar for RTL */
html[dir="rtl"] ::-webkit-scrollbar-track {
    margin-right: 0;
    margin-left: 2px;
}

/* Feature Block / Why Do We Do It Section - RTL */
html[dir="rtl"] .feature-block .section-small-title {
    padding-top: 2em;
}

html[dir="rtl"] .feature-block .section-small-title h2 {
    direction: ltr;
    text-align: right;
}

html[dir="rtl"] .feature-block-content {
    text-align: right;
}

html[dir="rtl"] .feature-block-content p {
    direction: ltr;
    text-align: right;
}

/* Featured Products Section - RTL */
html[dir="rtl"] .featured-products .section-small-title,
html[dir="rtl"] .featured-products .section-small-title h2,
body.rtl .featured-products .section-small-title,
body.rtl .featured-products .section-small-title h2 {
    text-align: center !important;
}

html[dir="rtl"] .featured-products-list > .row,
html[dir="rtl"] .featured-products .row,
html[dir="rtl"] section.featured-products .row,
body.rtl .featured-products-list > .row,
body.rtl .featured-products .row,
body.rtl section.featured-products .row {
    flex-direction: row-reverse !important;
    direction: rtl !important;
}

html[dir="rtl"] .featured-product-item,
body.rtl .featured-product-item {
    text-align: center;
}

html[dir="rtl"] .featured-product-name,
body.rtl .featured-product-name {
    text-align: center;
}

/* Animation Direction */
html[dir="rtl"] [data-aos="fade-left"] {
    transform: translate3d(50px, 0, 0);
}

html[dir="rtl"] [data-aos="fade-right"] {
    transform: translate3d(-50px, 0, 0);
}


html[dir="rtl"] .navmenu-offcanvas ul{
        margin-right: auto;
    margin-left: 0;
}
html[dir="rtl"] .footer-links {
    border-right: 0px solid #707070;
      border-left: 1px solid #707070;
}
html[dir="rtl"]  .footer-bottom p, html[dir="rtl"]  .footer-bottom ul{
    margin-bottom: 0;
}
html[dir="rtl"]  .footer-bottom ul{
       justify-content: flex-start;
}
html[dir="rtl"] .product-tab ul{
    padding: 0 !important;
}
html[dir="rtl"] .navmenu-bottom{
    justify-content: flex-end;
}
html[dir="rtl"] .lang-switcher-simple{
        position: absolute;
    top: 0;
    left: 33px;
}
html[dir="rtl"] .lang-switcher-simple{
    padding: 10px;
    border: 1px solid #fff;
    background-color: #fff;
    color: #00246a;
}