/* RTL Overrides for Drivin Template */

/* General RTL Direction */
.rtl {
    direction: rtl;
    text-align: right;
}

/* Navbar RTL Adjustments */
.rtl .navbar-brand {
    margin-right: 0;
    margin-left: 2.5rem;
}

.rtl .navbar-toggler {
    margin-left: auto;
    margin-right: 0;
}

.rtl .navbar-nav {
    flex-direction: row-reverse;
}

.rtl .navbar-nav .nav-item {
    margin-left: 0;
    margin-right: 1.5rem;
}

.rtl .navbar-nav .nav-link {
    text-align: right;
}

/* Button Adjustments */
.rtl .btn {
    text-align: center;
}

/* Icons and Floats */
.rtl .float-left {
    float: right !important;
}

.rtl .float-right {
    float: left !important;
}

/* Text Alignment */
.rtl .text-left {
    text-align: right !important;
}

.rtl .text-right {
    text-align: left !important;
}

/* Margins and Paddings for RTL */
.rtl .ml-auto {
    margin-left: auto !important;
    margin-right:  !important;
}

.rtl .mr-auto {
    margin-right: auto !important;
    margin-left: 0 !important;
}

.rtl .pl-4 {
    padding-left: 1.5rem !important;
    padding-right: 0 !important;
}

.rtl .pr-4 {
    padding-right: 1.5rem !important;
    padding-left: 0 !important;
}

/* Specific Component Adjustments */
.rtl .container-fluid {
    direction: rtl;
}

.rtl .portfolio .container {
    direction: rtl;
}

/* Form Elements */
.rtl .form-control {
    text-align: right;
}

.rtl .form-label {
    text-align: right;
}

/* Dropdowns */
.rtl .dropdown-menu {
    left: auto;
    right: 0;
}

/* Cards and Grids */
.rtl .card {
    text-align: right;
}

/* Back to Top Button */
.rtl .back-to-top {
    left: 30px;
    right: auto;
}

/* Spinner */
.rtl #spinner {
    left: 50%;
    right: auto;
    transform: translateX(50%);
}

/* Owl Carousel (if used) */
.rtl .owl-carousel .owl-nav button.owl-prev {
    left: 0;
    right: auto;
}

.rtl .owl-carousel .owl-nav button.owl-next {
    right: 0;
    left: auto;
}

/* Footer */
.rtl .footer .container {
    direction: rtl;
}

/* Additional Utilities */
.rtl .text-start {
    text-align: right !important;
}

.rtl .text-end {
    text-align: left !important;
}

.rtl .ms-auto {
    margin-left: auto !important;
    margin-right: 0 !important;
}

.rtl .me-auto {
    margin-right: auto !important;
    margin-left: 0 !important;
}



/* 2. Adjust icon margins in RTL */
.rtl i, .rtl svg, .rtl .icon {
    margin-right: 0.5rem !important;
    margin-left: 0.5rem !important;
}


.rtl .navbar-nav .nav-link i,
.rtl .btn i,
.rtl .navbar-nav .nav-link svg,
.rtl .btn svg {
    margin-left: 0;
    margin-right: 0;
}



/* Footer button links RTL alignment */
.rtl .footer .btn-link {
    text-align: right !important;
    display: block !important;
    width: 100%;
}

/* Right-align the link columns */
.rtl .footer .col-lg-3.col-md-6 {
    text-align: right;
}

/* Reverse social media icons order */
.rtl .footer .d-flex.pt-2 {
    flex-direction: row-reverse;
}

/* Adjust social icon spacing */
.rtl .footer .d-flex.pt-2 .btn {
    margin-left: 0.25rem !important;
    margin-right: 0 !important;
}

/* Reverse newsletter input group */
.rtl .footer .input-group {
    flex-direction: row-reverse;
}

/* Copyright text swapping */
.rtl .copyright .text-md-start {
    text-align: right !important;
}

.rtl .copyright .text-md-end {
    text-align: left !important;
}


/* RTL Footer Links */
.rtl .footer .btn.btn-link {
    text-align: right !important; /* Align text to right */
    padding-left: 0 !important;
}

.rtl .footer .btn.btn-link::before {
    content: "\f104" !important; /* Font Awesome chevron-left */
    margin-right: 0 !important; /* Remove right margin */
    margin-left: 10px !important; /* Add left margin */
    float: right !important; /* Float to right side */
    order: 2; /* Move to after text in flex flow */
}

/* If using flex for better control */
.rtl .footer .btn.btn-link {
    display: flex !important;
    flex-direction: row-reverse !important;
    justify-content: flex-end !important;
    align-items: center !important;
}

.rtl .footer .btn.btn-link::before {
    order: 2; /* Chevron after text */
    margin-left: 10px !important;
    margin-right: 0 !important;
}
/* For more complex navbars */
.rtl .navbar-nav {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    direction: rtl;
}

.rtl .navbar-nav .nav-item {
    direction: ltr; /* Keep text LTR within items */
    unicode-bidi: isolate;
}