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

html[dir="rtl"] .navbar .navbar-brand,
html[dir="rtl"] .navbar .nav-link,
html[dir="rtl"] .sf-card,
html[dir="rtl"] .table,
html[dir="rtl"] .form-control,
html[dir="rtl"] .form-select,
html[dir="rtl"] .form-check-label {
    text-align: right;
}

html[dir="rtl"] .navbar-nav.me-auto {
    margin-right: 0 !important;
    margin-left: auto !important;
}

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

html[dir="rtl"] .sf-breadcrumb {
    direction: rtl;
}

html[dir="rtl"] .sf-breadcrumb .breadcrumb-item + .breadcrumb-item::before {
    float: right;
    padding-left: var(--bs-breadcrumb-item-padding-x);
    padding-right: 0;
}

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

html[dir="rtl"] .sf-card .d-flex.gap-2 {
    flex-direction: row-reverse;
}

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

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

html[dir="rtl"] input,
html[dir="rtl"] textarea,
html[dir="rtl"] select {
    direction: rtl;
}

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

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

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

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

html[dir="rtl"] .ms-1 {
    margin-right: 0.25rem !important;
    margin-left: 0 !important;
}

html[dir="rtl"] .me-1 {
    margin-left: 0.25rem !important;
    margin-right: 0 !important;
}

/* Extended RTL Support for Storefront */

/* Navbar RTL */
html[dir="rtl"] .navbar {
    flex-direction: row-reverse;
}

html[dir="rtl"] .navbar-brand {
    margin-right: auto;
    margin-left: 0;
    padding-left: 0;
    padding-right: 1rem;
}

html[dir="rtl"] .navbar-nav {
    flex-direction: row-reverse;
}

html[dir="rtl"] .navbar-nav .nav-link {
    padding-left: 1rem;
    padding-right: 0;
}

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

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

html[dir="rtl"] .footer-content {
    flex-direction: row-reverse;
}

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

html[dir="rtl"] .footer ul {
    padding-right: 1rem;
    padding-left: 0;
}

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

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

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

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

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

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

html[dir="rtl"] .product-card .product-actions {
    flex-direction: row-reverse;
}

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

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

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

html[dir="rtl"] .cart-summary-row {
    flex-direction: row-reverse;
}

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

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

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

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

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

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

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

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

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

html[dir="rtl"] .search-form .btn {
    margin-right: 10px;
    margin-left: 0;
}

/* Filters RTL */
html[dir="rtl"] .sidebar-filters {
    text-align: right;
}

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

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

/* Breadcrumbs RTL */
html[dir="rtl"] .breadcrumb {
    flex-direction: row-reverse;
}

html[dir="rtl"] .breadcrumb-item {
    padding-left: 0;
    padding-right: 0;
}

html[dir="rtl"] .breadcrumb-item + .breadcrumb-item::before {
    padding-left: 0;
    padding-right: 0.5rem;
    content: "/";
}

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

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

html[dir="rtl"] .btn-group {
    flex-direction: row-reverse;
}

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

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

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

html[dir="rtl"] .input-group {
    flex-direction: row-reverse;
}

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

html[dir="rtl"] .input-group > .form-control {
    order: 2;
}

html[dir="rtl"] .input-group > .input-group-text {
    order: 1;
}

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

html[dir="rtl"] .alert-dismissible .btn-close {
    position: absolute;
    top: 0;
    right: auto;
    left: 0;
    margin-left: 0.75rem;
}

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

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

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

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

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

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

html[dir="rtl"] .modal-footer {
    flex-direction: row-reverse;
}

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

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

html[dir="rtl"] .page-item {
    margin-left: 2px;
    margin-right: 0;
}

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

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

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

/* Utilities RTL */
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-left: 0 !important;
}

html[dir="rtl"] .ms-1 { margin-right: 0.25rem !important; }
html[dir="rtl"] .ms-2 { margin-right: 0.5rem !important; }
html[dir="rtl"] .ms-3 { margin-right: 1rem !important; }
html[dir="rtl"] .ms-4 { margin-right: 1.5rem !important; }
html[dir="rtl"] .ms-5 { margin-right: 3rem !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-right: 0 !important;
}

html[dir="rtl"] .me-1 { margin-left: 0.25rem !important; }
html[dir="rtl"] .me-2 { margin-left: 0.5rem !important; }
html[dir="rtl"] .me-3 { margin-left: 1rem !important; }
html[dir="rtl"] .me-4 { margin-left: 1.5rem !important; }
html[dir="rtl"] .me-5 { margin-left: 3rem !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-left: 0 !important;
}

html[dir="rtl"] .ps-1 { padding-right: 0.25rem !important; }
html[dir="rtl"] .ps-2 { padding-right: 0.5rem !important; }
html[dir="rtl"] .ps-3 { padding-right: 1rem !important; }
html[dir="rtl"] .ps-4 { padding-right: 1.5rem !important; }
html[dir="rtl"] .ps-5 { padding-right: 3rem !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-right: 0 !important;
}

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

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

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

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

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