/* RTL CSS for Arabic Websites */
/* This file provides RTL (Right-to-Left) layout overrides for Arabic locale */

/* Base RTL Direction */
html[dir="rtl"],
html[dir="rtl"] body {
    direction: rtl;
    text-align: right;
}

/* Navigation and Header RTL Mirroring */
.navbar-nav {
    flex-direction: row-reverse;
}

.main-header .navbar-nav .nav-item {
    margin-left: 1rem;
    margin-right: 0;
}

/* Header RTL Layout - Complete Redesign for Proper Mirroring */

/* Header-1: Logo stays centered - Contact and Navigation swap */
@media (min-width: 1200px) {
    .main-header .navbar-brand.order-0.order-xl-1 {
        order: 1 !important; /* Logo stays centered */
        flex: 0 0 auto !important;
        margin-left: auto !important;
        margin-right: auto !important;
        padding: 0 40px !important;
    }

    .main-header .navbar-collapse.order-3.order-xl-0 {
        order: 2 !important; /* Navigation to right */
        flex: 0 0 auto !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        max-width: 35% !important;
    }

    .main-header .ml-auto.order-xl-2 {
        order: 0 !important; /* Contact to left */
        flex: 0 0 auto !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        max-width: 35% !important;
    }

    /* Ensure proper flex layout */
    .main-header .navbar.navbar-expand-xl {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
    }

    /* Make logo wider to match English version */
    .main-header .navbar-brand.order-0.order-xl-1 img {
        height: 70px !important;
        width: auto !important;
        max-width: none !important;
    }
}

/* Header-2: Logo(left) -> Navigation(center) -> Social(right) becomes Social(left) -> Navigation(center) -> Logo(right) */
.header-02:not(.header-sticky) .navbar-brand:not(.order-0) {
    margin-left: auto !important;
    margin-right: 0 !important;
}

.header-02:not(.header-sticky) .navbar-collapse {
    margin-right: auto !important;
    margin-left: auto !important;
    flex-grow: 0 !important;
}

.header-02:not(.header-sticky) .ml-auto.d-none.d-xl-block {
    margin-left: 0 !important;
    margin-right: auto !important;
}

/* Header-3: Logo(left) -> Navigation(center) -> Contact(right) becomes Contact(left) -> Navigation(center) -> Logo(right) */
.header-sticky .navbar-brand {
    margin-left: auto !important;
    margin-right: 0 !important;
}

.header-sticky .navbar-collapse.mx-auto {
    /* Keep mx-auto for center positioning */
    margin-right: auto !important;
    margin-left: auto !important;
}

.header-sticky .ml-auto.d-none.d-xl-block {
    margin-left: 0 !important;
    margin-right: auto !important;
}

/* Header-3 mobile toggle positioning */
.header-sticky .d-flex.d-xl-none.ml-auto {
    margin-left: 0 !important;
    margin-right: auto !important;
}

/* Header-3 navigation alignment */
.header-sticky .justify-content-xl-end {
    justify-content: flex-start !important;
}

/* Mobile header RTL fixes */
@media (max-width: 1199px) {
    /* Mirror mobile header - burger on right, logo on left with padding */
    .main-header .navbar-brand {
        order: 1 !important;
        margin-right: 0 !important;
        margin-left: 0 !important;
        padding-left: 15px !important;
        padding-right: 10px !important;
    }

    .main-header .navbar-toggler,
    .main-header .d-flex.d-xl-none,
    .main-header .d-flex.d-lg-none {
        order: 2 !important;
        margin-left: 0 !important;
        margin-right: 15px !important;
        padding-right: 0 !important;
        padding-left: 10px !important;
    }

    /* Ensure proper spacing and alignment */
    .main-header .navbar {
        justify-content: space-between !important;
        align-items: center !important;
    }

    /* Container padding for mobile */
    .main-header .container,
    .main-header .container-xxl {
        padding-left: 5px !important;
        padding-right: 5px !important;
    }
}


/* Alignment fixes */
.main-header .justify-content-lg-end,
.main-header .justify-content-xl-end {
    justify-content: flex-start !important;
}

/* Social icons spacing fix */
.main-header .list-inline-item {
    margin-left: 0.25rem !important;
    margin-right: 0 !important;
}

.main-header .px-4 {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
}

.dropdown-menu {
    right: 0;
    left: auto;
}

.dropdown-toggle::after {
    margin-left: 0;
    margin-right: 0.5rem;
}

/* Footer */
.footer-list {
    text-align: right;
}

.list-inline-item {
    margin-left: 0.5rem;
    margin-right: 0;
}

.list-inline {
    text-align: right !important;
}

/* Property Cards */
.mr-auto {
    margin-left: auto !important;
    margin-right: 0 !important;
}

.ml-auto {
    margin-right: auto !important;
    margin-left: 0 !important;
}

.mr-1, .mr-2, .mr-3, .mr-4, .mr-5 {
    margin-right: 0 !important;
}

.mr-1 {
    margin-left: 0.25rem !important;
}

.mr-2 {
    margin-left: 0.5rem !important;
}

.mr-3 {
    margin-left: 1rem !important;
}

.mr-4 {
    margin-left: 1.5rem !important;
}

.mr-5 {
    margin-left: 3rem !important;
}

.ml-1, .ml-2, .ml-3, .ml-4, .ml-5 {
    margin-left: 0 !important;
}

.ml-1 {
    margin-right: 0.25rem !important;
}

.ml-2 {
    margin-right: 0.5rem !important;
}

.ml-3 {
    margin-right: 1rem !important;
}

.ml-4 {
    margin-right: 1.5rem !important;
}

.ml-5 {
    margin-right: 3rem !important;
}

/* Padding adjustments */
.pr-0, .pr-1, .pr-2, .pr-3, .pr-4, .pr-5 {
    padding-right: 0 !important;
}

.pl-0, .pl-1, .pl-2, .pl-3, .pl-4, .pl-5 {
    padding-left: 0 !important;
}

.pr-1 {
    padding-left: 0.25rem !important;
}

.pr-2 {
    padding-left: 0.5rem !important;
}

.pr-3 {
    padding-left: 1rem !important;
}

.pr-4 {
    padding-left: 1.5rem !important;
}

.pr-5 {
    padding-left: 3rem !important;
}

.pl-1 {
    padding-right: 0.25rem !important;
}

.pl-2 {
    padding-right: 0.5rem !important;
}

.pl-3 {
    padding-right: 1rem !important;
}

.pl-4 {
    padding-right: 1.5rem !important;
}

.pl-5 {
    padding-right: 3rem !important;
}

/* Text alignment */
.text-left {
    text-align: right !important;
}

.text-right {
    text-align: left !important;
}

.text-start {
    text-align: right !important;
}

.text-end {
    text-align: left !important;
}

/* Flexbox adjustments */
.justify-content-start {
    justify-content: flex-end !important;
}

.justify-content-end {
    justify-content: flex-start !important;
}

.flex-row {
    flex-direction: row-reverse !important;
}

/* Icons and elements positioning */
.fas, .fab, .far {
    margin-left: 0.5rem;
    margin-right: 0;
}

/* Property card specific adjustments */
.card-img-overlay .d-flex {
    flex-direction: row-reverse;
}

.list-inline-item svg {
    margin-left: 0.15rem;
    margin-right: 0;
}

/* Badges and labels */
.badge {
    margin-left: 0.5rem;
    margin-right: 0;
}

/* Custom packages positioning for RTL */
.custom-packages {
    left: 10px !important;
    right: auto !important;
}

/* Contact information alignment */
.contact-info {
    text-align: right;
}

/* Footer social links */
.col-sm-4 .list-inline {
    text-align: start !important;
}

/* Footer-2 specific RTL fixes */
/* H5 headings alignment */
.custom-footer h5 {
    text-align: right !important;
    padding-right: 40px;
}

/* Social icons centering in footer-2 */
.custom-footer .list-inline-item[style*="place-content: center"] {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.custom-footer .list-inline-item[style*="place-content: center"] a {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
}

.custom-footer .list-inline-item[style*="place-content: center"] a i {
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1 !important;
    position: relative !important;
    left: 0 !important;
    right: 0 !important;
}

/* Footer-3 specific centering fix */
.custom-footer .container,
.custom-footer .container-xxl {
    max-width: 90% !important;
    margin: 0 auto !important;
}

.custom-footer .row {
    margin-left: 0 !important;
    margin-right: 0 !important;
    justify-content: center !important;
}

.custom-footer .col-lg-4,
.custom-footer .col-lg-8,
.custom-footer .col-sm-8,
.custom-footer .col-sm-4 {
    direction: rtl !important;
    text-align: right !important;
    padding-left: 15px !important;
    padding-right: 15px !important;
}
.mb-n3, .my-n3 {
    margin-bottom: 0rem !important;
}
/* Responsive adjustments */
@media (max-width: 767px) {
    .navbar-nav {
        text-align: right;
    }

    .navbar-collapse {
        padding-right: 1rem;
        padding-left: 0;
    }

    .navbar-brand img{
        padding: 10px !important;
    }
}

@media (min-width: 1200px) {
    .navbar-nav .nav-item {
        padding-left: 1rem;
        padding-right: 0;
    }
}

/* Forms and inputs */
.form-control {
    text-align: right;
}

.input-group-text {
    order: 2;
}

.form-control {
    order: 1;
}

/* Select dropdowns (Bootstrap Select) */
.selectpicker,
.bootstrap-select .dropdown-toggle {
    text-align: right !important;
    direction: rtl !important;
}

.bootstrap-select .dropdown-menu {
    text-align: right !important;
    right: 0 !important;
    left: auto !important;
}

.bootstrap-select .dropdown-menu li a {
    text-align: right !important;
}

.bootstrap-select .dropdown-toggle .caret {
    float: left !important;
    margin-left: 0 !important;
    margin-right: 8px !important;
}

.bootstrap-select .dropdown-toggle .filter-option {
    text-align: right !important;
    margin-right: 0 !important;
    margin-left: auto !important;
    padding-right: 30px !important;
    padding-left: 10px !important;
}

/* RTL dropdown arrow positioning */
.bootstrap-select .dropdown-toggle::after {
    right: auto !important;
    left: 12px !important;
}

.selectpicker {
    padding-right: 10px !important;
    padding-left: 30px !important;
}

/* Location accordion RTL arrow positioning */
.accordion .btn-block::after {
    right: auto !important;
    left: 15px !important;
}

/* Filter form RTL fixes */
.form-check {
    text-align: right !important;
    position: relative !important;
}

.form-check-input {
    float: right !important;
    margin-left: 0.25rem !important;
    margin-right: -1.25rem !important;
    position: relative !important;
    right: 0 !important;
    left: auto !important;
}

.form-check-label {
    margin-left: 0 !important;
    margin-right: 0.75rem !important;
    padding-left: 0 !important;
    padding-right: 0.25rem !important;
}

/* Location filter specific fixes */
.filter-check .form-check {
    margin-right: 0 !important;
    margin-left: 0 !important;
    padding-right: 15px !important;
    padding-left: 0 !important;
}

/* Districts indentation for RTL */
.filter-check .form-check[style*="margin-left: 25px"] {
    margin-left: 0 !important;
    margin-right: 25px !important;
    padding-right: 15px !important;
}

/* Fix checkbox positioning within card bounds */
.card-body .form-check-input {
    right: 0 !important;
}

.card-body .form-check-label {
    margin-right: 0.2rem !important;
}

/* Sort by section RTL */
.input-group .input-group-text {
    border-left: 0 !important;
    /* border-right: 1px solid #ced4da !important; */
}

.sortby {
    text-align: right !important;
}

/* Accordion buttons */
.btn-block.text-left {
    text-align: right !important;
}

.float-right {
    float: left !important;
}

/* Breadcrumb RTL fixes */
.breadcrumb {
    flex-direction: row-reverse !important;
    justify-content: flex-end !important;
    text-align: right !important;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "\\" !important;
    padding-left: 0 !important;
    padding-right: 0.5rem !important;
    float: right !important;
}

.breadcrumb-item {
    text-align: right !important;
}

/* Page title breadcrumb container */
.page-title-right {
    text-align: left !important;
}

.page-title-box.d-sm-flex {
    flex-direction: row-reverse !important;
}

.page-title-box h4 {
    text-align: right !important;
}

/* Property features list */
.property-features {
    text-align: right;
}

.property-features li {
    text-align: right;
}

/* Gallery and images */
.image-gallery {
    direction: rtl;
}

/* Search filters */
.search-filters {
    text-align: right;
}

/* Mobile filters */
.filter-container {
    right: 0;
    left: auto;
}

.close-filters-mobile {
    left: 20px;
    right: auto;
}

/* Button groups */
.btn-group {
    flex-direction: row-reverse;
}

/* Tooltips */
.tooltip {
    direction: ltr;
}

/* Dropdown positioning fixes */
.nav-item.dropdown .dropdown-menu {
    right: 0;
    left: auto;
    transform: translate(0, 0);
}

/* Custom dropdown toggle positioning */
.custom-dropdown-toggle {
    margin-right: 0.5rem;
    margin-left: 0;
}

/* Container alignment */
.container,
.container-xxl {
    direction: rtl;
}

/* Property card overlay content */
.card-img-overlay {
    text-align: right;
}

.card-img-overlay .px-2 {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

/* Hero section adjustments */
.hero-section {
    text-align: right;
}

/* About section */
.about-section {
    text-align: right;
}

/* Team section */
.team-section {
    text-align: right;
}

/* Contact section */
.contact-section {
    text-align: right;
}

/* Property cards RTL fixes - targeting the specific list in card body */
.card-body .list-inline.d-flex.mb-0.flex-wrap.mr-n5 {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    flex-direction: row-reverse !important;
}

.card-img-overlay .list-inline.mr-n5 {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    flex-direction: row-reverse !important;
}

/* Fix SVG icons spacing in property cards */
.card-body .list-inline.d-flex.mb-0.flex-wrap.mr-n5 .list-inline-item svg,
.card-img-overlay .list-inline.mr-n5 .list-inline-item svg {
    margin-left: 0.25rem !important;
    margin-right: 0 !important;
}

/* Property card footer RTL */
.card-footer.bg-transparent {
    text-align: right !important;
}

/* Related properties RTL icon spacing */
.list-inline-item.mr-5-2 {
    margin-left: 0.75rem !important;
    margin-right: 0 !important;
}

