/* Arabic RTL Styles for Commra Theme */

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

html[dir="rtl"] body {
    direction: rtl;
    text-align: right;
    font-family: 'Cairo', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Header RTL */
html[dir="rtl"] .header-top .header-top-left {
    float: right;
}

html[dir="rtl"] .header-top .header-top-right {
    float: left;
}

html[dir="rtl"] .header-top .header-top-right .header-top-right-list {
    float: left;
}

html[dir="rtl"] .header-top .header-top-right .header-top-right-list li {
    float: right;
    margin-left: 0;
    margin-right: 20px;
}

html[dir="rtl"] .header-top .header-top-right .header-top-right-list li:last-child {
    margin-right: 0;
}

/* Logo RTL */
html[dir="rtl"] .header-center .container-fluid .row .col-xl-3 {
    text-align: right;
}

html[dir="rtl"] .header-center .container-fluid .row .col-xl-6 {
    text-align: center;
}

html[dir="rtl"] .header-center .container-fluid .row .col-xl-3:last-child {
    text-align: left;
}

/* Search Box RTL */
html[dir="rtl"] .search-widget .search-form {
    direction: rtl;
}

html[dir="rtl"] .search-widget .search-form input {
    text-align: right;
    padding-right: 15px;
    padding-left: 50px;
}

html[dir="rtl"] .search-widget .search-form .btn-search {
    right: auto;
    left: 0;
}

/* Cart and User Icons RTL */
html[dir="rtl"] .block-cart .cart-title {
    float: right;
}

html[dir="rtl"] .block-cart .cart-title .cart-products-count {
    right: auto;
    left: -10px;
}

html[dir="rtl"] .header-user-info {
    float: left;
}

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

/* Navigation RTL */
html[dir="rtl"] .main-menu .navbar-nav {
    float: right;
}

html[dir="rtl"] .main-menu .navbar-nav > li {
    float: right;
}

html[dir="rtl"] .main-menu .navbar-nav > li > a {
    text-align: right;
}

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

html[dir="rtl"] .main-menu .navbar-nav .dropdown-menu .dropdown-item {
    text-align: right;
}

/* Mega Menu RTL */
html[dir="rtl"] .main-menu .navbar-nav .mega-menu {
    right: 0;
    left: auto;
}

html[dir="rtl"] .main-menu .navbar-nav .mega-menu .mega-menu-content {
    text-align: right;
}

html[dir="rtl"] .main-menu .navbar-nav .mega-menu .mega-menu-content .col-md-3 {
    text-align: right;
}

/* Breadcrumb RTL */
html[dir="rtl"] .breadcrumb {
    text-align: right;
}

html[dir="rtl"] .breadcrumb li {
    float: right;
}

html[dir="rtl"] .breadcrumb li:after {
    content: "\\";
    margin: 0 5px;
}

html[dir="rtl"] .breadcrumb li:last-child:after {
    content: "";
}

/* Sidebar RTL */
html[dir="rtl"] .sidebar {
    float: right;
}

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

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

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

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

html[dir="rtl"] .sidebar .sidebar-block .block-content ul li a {
    text-align: right;
}

/* Product Grid RTL */
html[dir="rtl"] .products-grid {
    direction: rtl;
}

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

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

html[dir="rtl"] .products-grid .product-item .product-info {
    text-align: right;
}

html[dir="rtl"] .products-grid .product-item .product-info .product-title {
    text-align: right;
}

html[dir="rtl"] .products-grid .product-item .product-info .product-price {
    text-align: right;
}

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

html[dir="rtl"] .product-actions .btn {
    margin-left: 5px;
    margin-right: 0;
}

html[dir="rtl"] .product-actions .btn:first-child {
    margin-left: 0;
}

/* Product Details RTL */
html[dir="rtl"] .product-details .product-info {
    text-align: right;
}

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

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

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

/* Forms RTL */
html[dir="rtl"] .form-group {
    text-align: right;
}

html[dir="rtl"] .form-group label {
    text-align: right;
    float: right;
}

html[dir="rtl"] .form-control {
    text-align: right;
    direction: rtl;
}

html[dir="rtl"] .form-control::placeholder {
    text-align: right;
}

html[dir="rtl"] .input-group .form-control {
    text-align: right;
}

html[dir="rtl"] .input-group .input-group-addon {
    right: 0;
    left: auto;
}

/* Buttons RTL */
html[dir="rtl"] .btn {
    text-align: center;
}

html[dir="rtl"] .btn i {
    margin-left: 5px;
    margin-right: 0;
}

html[dir="rtl"] .btn i.fa-arrow-left:before {
    content: "\f061"; /* fa-arrow-right */
}

html[dir="rtl"] .btn i.fa-arrow-right:before {
    content: "\f060"; /* fa-arrow-left */
}

/* Pagination RTL */
html[dir="rtl"] .pagination {
    direction: rtl;
}

html[dir="rtl"] .pagination li {
    float: right;
}

html[dir="rtl"] .pagination .page-item .page-link {
    text-align: center;
}

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

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

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

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

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

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

html[dir="rtl"] .footer .footer-content .footer-block .block-content ul li a {
    text-align: right;
}

/* Social Media RTL */
html[dir="rtl"] .social-media {
    text-align: right;
}

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

html[dir="rtl"] .social-media .social-links a {
    margin-left: 10px;
    margin-right: 0;
}

html[dir="rtl"] .social-media .social-links a:first-child {
    margin-left: 0;
}

/* Newsletter RTL */
html[dir="rtl"] .newsletter-form {
    direction: rtl;
}

html[dir="rtl"] .newsletter-form .input-group {
    direction: rtl;
}

html[dir="rtl"] .newsletter-form .input-group .form-control {
    text-align: right;
}

html[dir="rtl"] .newsletter-form .input-group .input-group-btn {
    right: 0;
    left: auto;
}

/* Slider RTL */
html[dir="rtl"] .slider-container {
    direction: rtl;
}

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

html[dir="rtl"] .slider-container .slider-content .slider-title {
    text-align: right;
}

html[dir="rtl"] .slider-container .slider-content .slider-description {
    text-align: right;
}

html[dir="rtl"] .slider-container .slider-nav {
    direction: rtl;
}

html[dir="rtl"] .slider-container .slider-nav .slider-prev {
    right: 0;
    left: auto;
}

html[dir="rtl"] .slider-container .slider-nav .slider-next {
    right: auto;
    left: 0;
}

/* Categories RTL */
html[dir="rtl"] .categories-grid {
    direction: rtl;
}

html[dir="rtl"] .categories-grid .category-item {
    text-align: right;
}

html[dir="rtl"] .categories-grid .category-item .category-info {
    text-align: right;
}

html[dir="rtl"] .categories-grid .category-item .category-info .category-title {
    text-align: right;
}

/* Brands RTL */
html[dir="rtl"] .brands-slider {
    direction: rtl;
}

html[dir="rtl"] .brands-slider .brand-item {
    text-align: center;
}

/* Blog RTL */
html[dir="rtl"] .blog-grid {
    direction: rtl;
}

html[dir="rtl"] .blog-grid .blog-item {
    text-align: right;
}

html[dir="rtl"] .blog-grid .blog-item .blog-info {
    text-align: right;
}

html[dir="rtl"] .blog-grid .blog-item .blog-info .blog-title {
    text-align: right;
}

html[dir="rtl"] .blog-grid .blog-item .blog-info .blog-excerpt {
    text-align: right;
}

html[dir="rtl"] .blog-grid .blog-item .blog-info .blog-meta {
    text-align: right;
}

/* Cart RTL */
html[dir="rtl"] .cart-table {
    direction: rtl;
}

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

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

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

html[dir="rtl"] .cart-summary .summary-item {
    text-align: right;
}

/* Checkout RTL */
html[dir="rtl"] .checkout-form {
    text-align: right;
}

html[dir="rtl"] .checkout-form .form-section {
    text-align: right;
}

html[dir="rtl"] .checkout-form .form-section .section-title {
    text-align: right;
}

/* Profile RTL */
html[dir="rtl"] .profile-sidebar {
    float: right;
}

html[dir="rtl"] .profile-sidebar .profile-card {
    text-align: right;
}

html[dir="rtl"] .profile-sidebar .profile-menu {
    text-align: right;
}

html[dir="rtl"] .profile-sidebar .profile-menu .nav-pills > li > a {
    text-align: right;
}

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

html[dir="rtl"] .profile-content-card .card-header {
    text-align: right;
}

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

html[dir="rtl"] .profile-content-card .card-footer {
    text-align: right;
}

/* Auth Forms RTL */
html[dir="rtl"] .auth-form {
    text-align: right;
}

html[dir="rtl"] .auth-form .form-title {
    text-align: right;
}

html[dir="rtl"] .auth-form .form-group {
    text-align: right;
}

html[dir="rtl"] .auth-form .form-group label {
    text-align: right;
}

html[dir="rtl"] .auth-form .form-actions {
    text-align: right;
}

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

/* Modal RTL */
html[dir="rtl"] .modal {
    direction: rtl;
}

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

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

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

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

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

html[dir="rtl"] .modal .close {
    float: left;
}

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

html[dir="rtl"] .alert .close {
    float: left;
}

/* Tables RTL */
html[dir="rtl"] .table {
    direction: rtl;
}

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

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

/* Brands/Partners Section RTL */
.brands-rtl .block-brand-op11 {
    direction: rtl;
    text-align: right;
}

.brands-rtl .owl-carousel {
    direction: rtl;
}

.brands-rtl .owl-nav {
    direction: rtl;
}

.brands-rtl .owl-nav .owl-prev {
    right: 0;
    left: auto;
    float: right;
}

.brands-rtl .owl-nav .owl-next {
    right: auto;
    left: 0;
    float: left;
}

.brands-rtl .owl-nav .owl-prev:before {
    content: "\f054"; /* fa-chevron-right */
}

.brands-rtl .owl-nav .owl-next:before {
    content: "\f053"; /* fa-chevron-left */
}

.brands-rtl .brand-item {
    text-align: center;
}

.brands-rtl .brand-logo {
    margin: 0 auto;
}

/* Brands carousel specific RTL fixes */
.owl-carousel.brands-carousel.owl-rtl .owl-item {
    float: right;
}

.owl-carousel.brands-carousel.owl-rtl .owl-nav .owl-prev {
    right: 0;
    left: auto;
}

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

/* Main Slider RTL Styles */
.slider-rtl .block-section-top11 {
    direction: rtl;
}

.slider-rtl .block-slide-main {
    direction: rtl;
}

.slider-rtl .owl-carousel.main-slider {
    direction: rtl;
}

.slider-rtl .owl-nav {
    direction: rtl;
}

.slider-rtl .owl-nav .owl-prev {
    right: 20px;
    left: auto;
}

.slider-rtl .owl-nav .owl-next {
    right: auto;
    left: 20px;
}

.slider-rtl .description {
    text-align: right !important;
    right: 50px !important;
    left: auto !important;
}

.slider-rtl .title {
    font-family: 'Cairo', 'Tajawal', sans-serif !important;
    text-align: right !important;
}

.slider-rtl .view-opt11 {
    direction: rtl !important;
}

.slider-rtl .view-opt11 i {
    margin-right: 8px !important;
    margin-left: 0 !important;
}

/* Main slider carousel specific RTL fixes */
.owl-carousel.main-slider.owl-rtl .owl-item {
    float: right;
}

.owl-carousel.main-slider.owl-rtl .owl-nav .owl-prev {
    right: 20px;
    left: auto;
}

.owl-carousel.main-slider.owl-rtl .owl-nav .owl-next {
    right: auto;
    left: 20px;
}

.owl-carousel.main-slider.owl-rtl .description {
    text-align: right;
    right: 50px;
    left: auto;
}

/* Responsive Design */
@media (max-width: 767px) {
 /* Header RTL */
.rtl-header {
    direction: rtl;
    text-align: right;
}

.rtl-header .nav-right-rtl {
    float: right;
}

.rtl-header .nav-left-rtl {
    float: left;
}

/* Header Top RTL Simple Fixes */
.rtl-header .header-top {
    direction: rtl;
}

.rtl-header .switcher-language .dropdown-menu {
    right: 0 !important;
    left: auto !important;
    text-align: right;
}

/* Force Font Awesome icons to display in RTL */
.rtl-header .switcher-language .fa,
html[dir="rtl"] .switcher-language .fa {
    display: inline-block !important;
    font-family: "FontAwesome" !important;
    font-style: normal !important;
    font-weight: normal !important;
    line-height: 1 !important;
    text-rendering: auto !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Specific icon content for RTL */
.rtl-header .switcher-language .fa-globe:before,
html[dir="rtl"] .switcher-language .fa-globe:before {
    content: "\f0ac" !important;
    display: inline-block !important;
}

.rtl-header .switcher-language .fa-angle-down:before,
html[dir="rtl"] .switcher-language .fa-angle-down:before {
    content: "\f107" !important;
    display: inline-block !important;
}

.rtl-header .switcher-language .fa-check:before,
html[dir="rtl"] .switcher-language .fa-check:before {
    content: "\f00c" !important;
    display: inline-block !important;
}

.rtl-header .nav-right-rtl {
    text-align: right;
}

.rtl-header .nav-left-rtl {
    text-align: left;
}

.rtl-footer .footer-column-rtl {
    text-align: right;
}

.brands-rtl .owl-nav {
    position: relative;
    text-align: center;
    margin-top: 20px;
}

.brands-rtl .owl-nav .owl-prev,
.brands-rtl .owl-nav .owl-next {
    position: relative;
    display: inline-block;
    float: none;
    margin: 0 10px;
}
    .brands-rtl .owl-nav {
        position: relative;
        text-align: center;
        margin-top: 20px;
    }
    
    .brands-rtl .owl-nav .owl-prev,
    .brands-rtl .owl-nav .owl-next {
        position: relative;
        display: inline-block;
        float: none;
        margin: 0 10px;
    }
}

@media (max-width: 768px) {
    html[dir="rtl"] .header-top .header-top-left,
    html[dir="rtl"] .header-top .header-top-right {
        float: none;
        text-align: center;
    }
    
    html[dir="rtl"] .main-menu .navbar-nav {
        float: none;
    }
    
    html[dir="rtl"] .main-menu .navbar-nav > li {
        float: none;
    }
    
    html[dir="rtl"] .sidebar {
        float: none;
        margin-bottom: 30px;
    }
    
    html[dir="rtl"] .profile-sidebar {
        float: none;
        margin-bottom: 20px;
    }
}

/* Custom Arabic Font */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;600;700&display=swap');

html[dir="rtl"] * {
    font-family: 'Cairo', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Fix for Arabic Numbers */
html[dir="rtl"] .price,
html[dir="rtl"] .number,
html[dir="rtl"] .quantity {
    direction: ltr;
    display: inline-block;
}

/* Fix for Icons in RTL */
html[dir="rtl"] .fa-chevron-left:before {
    content: "\f054"; /* fa-chevron-right */
}

html[dir="rtl"] .fa-chevron-right:before {
    content: "\f053"; /* fa-chevron-left */
}

html[dir="rtl"] .fa-angle-left:before {
    content: "\f105"; /* fa-angle-right */
}

html[dir="rtl"] .fa-angle-right:before {
    content: "\f104"; /* fa-angle-left */
}

/* Language Switcher RTL */
html[dir="rtl"] .language-switcher {
    text-align: right;
}

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

/* Search Results RTL */
html[dir="rtl"] .search-results {
    text-align: right;
}

html[dir="rtl"] .search-results .result-item {
    text-align: right;
}

/* Gallery RTL */
html[dir="rtl"] .gallery-grid {
    direction: rtl;
}

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

html[dir="rtl"] .gallery-item .gallery-info {
    text-align: right;
}

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

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

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

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

/* Loading Spinner RTL */
html[dir="rtl"] .loading-spinner {
    direction: ltr; /* Keep spinner direction LTR */
}

/* Fix for Bootstrap Components in RTL */
html[dir="rtl"] .dropdown-menu {
    right: 0;
    left: auto;
}

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

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

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

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

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

html[dir="rtl"] .ml-1 { margin-right: 0.25rem !important; margin-left: 0 !important; }
html[dir="rtl"] .ml-2 { margin-right: 0.5rem !important; margin-left: 0 !important; }
html[dir="rtl"] .ml-3 { margin-right: 1rem !important; margin-left: 0 !important; }
html[dir="rtl"] .ml-4 { margin-right: 1.5rem !important; margin-left: 0 !important; }
html[dir="rtl"] .ml-5 { margin-right: 3rem !important; margin-left: 0 !important; }

html[dir="rtl"] .mr-1 { margin-left: 0.25rem !important; margin-right: 0 !important; }
html[dir="rtl"] .mr-2 { margin-left: 0.5rem !important; margin-right: 0 !important; }
html[dir="rtl"] .mr-3 { margin-left: 1rem !important; margin-right: 0 !important; }
html[dir="rtl"] .mr-4 { margin-left: 1.5rem !important; margin-right: 0 !important; }
html[dir="rtl"] .mr-5 { margin-left: 3rem !important; margin-right: 0 !important; }

html[dir="rtl"] .pl-1 { padding-right: 0.25rem !important; padding-left: 0 !important; }
html[dir="rtl"] .pl-2 { padding-right: 0.5rem !important; padding-left: 0 !important; }
html[dir="rtl"] .pl-3 { padding-right: 1rem !important; padding-left: 0 !important; }
html[dir="rtl"] .pl-4 { padding-right: 1.5rem !important; padding-left: 0 !important; }
html[dir="rtl"] .pl-5 { padding-right: 3rem !important; padding-left: 0 !important; }

html[dir="rtl"] .pr-1 { padding-left: 0.25rem !important; padding-right: 0 !important; }
html[dir="rtl"] .pr-2 { padding-left: 0.5rem !important; padding-right: 0 !important; }
html[dir="rtl"] .pr-3 { padding-left: 1rem !important; padding-right: 0 !important; }
html[dir="rtl"] .pr-4 { padding-left: 1.5rem !important; padding-right: 0 !important; }
html[dir="rtl"] .pr-5 { padding-left: 3rem !important; padding-right: 0 !important; }

@media (max-width: 991px) {
    .nav-mind .block-nav-menu {
            right: -90px !important;
        }
}
