body {
    direction: rtl;
}

.owl-carousel {
    direction: ltr;
}

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

.add-to-cart {
    right: auto;
    left: 18px;
}

.add-to-favorite {
    right: auto;
    left: 18px;
}

.code {
    left: auto;
    right: 18px;
}

button#closeDialog,
.add-to-cart-dialog .close-button {
    right: auto;
    top: 16px;
    left: 16px;
}

.pagination {
    direction: ltr;
}

.pagination-container {
    display: flex;
}

.dropdown-menu {
    text-align: right;
}

select {
    direction: ltr;
    text-align: right;
}

option {
    direction: rtl;
    text-align: right;
}

/* RTL Modern UI Adjustments */

/* Cart badge position */
.cart-badge {
    right: auto;
    left: -10px;
}

/* Toast notification slide from left */
#toast-notification {
    animation: toastSlideInRTL 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes toastSlideInRTL {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Toast success/error border */
#toast-notification.toast-success {
    border-left: none;
    border-right: 4px solid var(--success-color);
}

#toast-notification.toast-error {
    border-left: none;
    border-right: 4px solid var(--error-color);
}

/* Cart row fade animation */
.cart-row-fade.removing {
    transform: translateX(30px) scale(0.95);
}

/* Button icons */
.return-button a i,
.submit-button button i {
    margin-right: 0;
    margin-left: 8px;
}

/* View cart widget price border */
.view-cart-info h6#cartPrice {
    padding-left: 0;
    padding-right: 16px;
    border-left: none;
    border-right: 1px solid rgba(255, 255, 255, 0.3);
}

/* Product info alignment */
.product-info {
    padding-inline-start: 16px;
    padding-inline-end: 16px;
    text-align: right;
}

/* Cart content info */
.cart-content-info {
    flex-direction: row-reverse;
}

/* Counter in table */
.products-table .counter {
    direction: ltr;
}

/* Available badge icon */
.available p i {
    margin-right: 0;
    margin-left: 4px;
}

/* RTL What we offer icons */
.what-we-offer i {
    margin-right: 0;
    margin-left: 12px;
}

/* RTL Footer */
.my-footer {
    text-align: right;
}

/* RTL Search icon */
.search-button::after {
    right: auto;
    left: 20px;
}

.search-button input {
    padding: 14px 20px 14px 52px;
}

/* RTL Product Card */
.product-badges {
    left: auto;
    right: 12px;
}

.btn-favorite {
    right: auto;
    left: 12px;
}

.price-old {
    margin-left: 0;
    margin-right: 8px;
}

/* RTL Section title arrow */
.section-title a h2 i {
    margin-left: 0;
    margin-right: 8px;
    transform: rotate(180deg);
}

/* RTL Footer Modern */
.footer-links {
    text-align: center;
}

.coupon-box {
    text-align: right;
}

.footer-nav {
    flex-direction: row-reverse;
}

/* RTL Services */
.service-item {
    text-align: center;
}

/* RTL Product Details Page */
.product-breadcrumb {
    flex-direction: row-reverse;
}

.product-breadcrumb i {
    transform: rotate(180deg);
}

.product-info-section {
    text-align: right;
}

.product-code {
    flex-direction: row-reverse;
}

.unit-details {
    flex-direction: row-reverse;
}

.unit-details .stock-status {
    flex-direction: row-reverse;
}

.quantity-selector {
    direction: ltr;
}

.feature-item {
    flex-direction: row-reverse;
    text-align: right;
}

.features-title {
    text-align: right;
}

/* RTL Auth Pages */
.auth-header {
    text-align: center;
}

.input-with-icon i {
    left: auto;
    right: 16px;
}

.input-with-icon input {
    padding: 14px 48px 14px 16px;
}

.form-footer {
    justify-content: flex-start;
}

.back-link {
    flex-direction: row-reverse;
}

.back-link i {
    transform: rotate(180deg);
}

/* RTL Cart & Checkout */
.item-product {
    flex-direction: row-reverse;
    text-align: right;
}

.item-details {
    text-align: right;
}

.summary-row {
    flex-direction: row-reverse;
}

.btn-continue,
.btn-checkout,
.btn-place-order,
.btn-shop-now,
.back-to-cart {
    flex-direction: row-reverse;
}

.btn-continue i,
.back-to-cart i {
    transform: rotate(180deg);
}

.checkout-card .card-header {
    flex-direction: row-reverse;
}

.address-header {
    flex-direction: row-reverse;
}

.add-address-link {
    flex-direction: row-reverse;
}

.payment-option {
    flex-direction: row-reverse;
}

.payment-option .option-content {
    flex-direction: row-reverse;
}

.existing-order-options {
    flex-direction: row-reverse;
}

.radio-option {
    flex-direction: row-reverse;
}

.secure-checkout {
    flex-direction: row-reverse;
}

@media only screen and (max-width: 991px) {
    .item-price::before {
        content: ':السعر';
    }

    .item-quantity::before {
        content: ':الكمية';
    }

    .item-subtotal::before {
        content: ':المجموع';
    }

    .item-action {
        left: 16px;
        right: auto;
    }
}

/* RTL Profile Page */
.profile-nav .nav-item {
    border-left: none;
    border-right: 3px solid transparent;
}

.profile-nav .nav-item.active {
    border-left-color: transparent;
    border-right-color: var(--main-color);
}

.profile-info-grid {
    text-align: right;
}

.info-item {
    flex-direction: row-reverse;
    text-align: right;
}

.action-card {
    flex-direction: row-reverse;
    text-align: right;
}

.action-card > i.fa-chevron-right {
    transform: rotate(180deg);
}

.profile-form .input-with-icon i {
    left: auto;
    right: 16px;
}

.profile-form .input-with-icon input {
    padding: 14px 48px 14px 16px;
}

.btn-edit,
.btn-save {
    flex-direction: row-reverse;
}

@media only screen and (max-width: 991px) {
    .profile-nav .nav-item {
        border-right: none;
        border-bottom: 3px solid transparent;
    }

    .profile-nav .nav-item.active {
        border-right-color: transparent;
        border-bottom-color: var(--main-color);
    }
}

/* RTL Orders Page */
.order-info-item {
    flex-direction: row-reverse;
    text-align: right;
}

.order-card-footer {
    flex-direction: row-reverse;
}

.btn-view-details {
    flex-direction: row-reverse;
}

.btn-view-details i {
    transform: rotate(180deg);
}

/* RTL Order Details Page */
.order-details-page .back-link {
    flex-direction: row-reverse;
}

.order-details-page .back-link i {
    transform: rotate(180deg);
}

.order-title {
    flex-direction: row-reverse;
}

.order-items-card .card-header {
    flex-direction: row-reverse;
}

.order-item {
    direction: rtl;
}

.order-item .item-info {
    text-align: right;
}

.total-row {
    flex-direction: row-reverse;
}

.info-card .card-header {
    flex-direction: row-reverse;
}

.info-row {
    text-align: right;
}

.driver-details {
    flex-direction: row-reverse;
    text-align: right;
}

.timeline {
    padding-left: 0;
    padding-right: 24px;
}

.timeline::before {
    left: auto;
    right: 7px;
}

.timeline-dot {
    left: auto;
    right: -24px;
}

.timeline-content {
    text-align: right;
}

.filter-bar {
    flex-direction: row-reverse;
}

.per-page-form {
    flex-direction: row-reverse;
}

@media only screen and (max-width: 991px) {
    .order-card-footer {
        flex-direction: column;
    }

    .order-item .item-price,
    .order-item .item-quantity,
    .order-item .item-subtotal {
        flex-direction: row-reverse;
        text-align: right;
    }

    .order-item .item-delete {
        right: auto;
        left: 20px;
    }
}

/* RTL User Products Page */
.product-row {
    flex-direction: row-reverse;
}

.product-row .product-info {
    flex-direction: row-reverse;
    text-align: right;
}

.product-row .product-stats {
    flex-direction: row-reverse;
}

/* RTL Points Page */
.points-summary {
    direction: rtl;
}

.summary-card {
    flex-direction: row-reverse;
    text-align: right;
}

.points-info-banner {
    flex-direction: row-reverse;
    text-align: right;
}

.points-card .card-header {
    flex-direction: row-reverse;
}

.point-main {
    flex-direction: row-reverse;
}

.point-date {
    text-align: right;
}

@media only screen and (max-width: 991px) {
    .product-row {
        flex-direction: column;
        align-items: flex-end;
    }

    .product-row .product-stats {
        flex-direction: row-reverse;
    }
}

/* RTL About Page */
.vm-card {
    text-align: right;
}

/* RTL Contact Page */
.contact-info .info-card {
    flex-direction: row-reverse;
    text-align: right;
}

.contact-form-card .card-header {
    text-align: right;
}

.contact-form .btn-submit {
    flex-direction: row-reverse;
}

/* RTL Legal Pages */
.term-item {
    flex-direction: row-reverse;
    text-align: right;
}

.privacy-section {
    text-align: right;
}

.privacy-section .intro-text {
    border-left: none;
    border-right: 4px solid var(--main-color);
}

.registration-notice {
    flex-direction: row-reverse;
    text-align: right;
}

@media only screen and (max-width: 575px) {
    .term-item {
        flex-direction: column;
        align-items: flex-end;
    }
}

/* ==========================================
   RTL - TOP BAR (Contact Bar)
   ========================================== */
.top-bar-content {
    flex-direction: row-reverse;
}

.contact-links {
    flex-direction: row-reverse;
}

.contact-link {
    flex-direction: row-reverse;
}

.social-links {
    flex-direction: row-reverse;
}

/* ==========================================
   RTL - MAIN HEADER (Navbar)
   ========================================== */
.main-header .navbar-brand {
    margin-right: 0;
    margin-left: auto;
}

.main-nav {
    flex-direction: row-reverse;
}

.main-nav .nav-link {
    flex-direction: row-reverse;
}

.nav-actions {
    flex-direction: row-reverse;
}

.nav-actions .nav-link {
    flex-direction: row-reverse;
}

/* User Dropdown RTL */
.user-dropdown .nav-link {
    flex-direction: row-reverse;
}

.user-header {
    align-items: flex-end !important;
    text-align: right;
}

.user-menu.dropdown-menu .dropdown-item {
    flex-direction: row-reverse;
    text-align: right;
}

.user-menu.dropdown-menu {
    text-align: right;
}

/* Addresses Dropdown RTL */
.addresses-menu .dropdown-header {
    flex-direction: row-reverse;
}

.address-content {
    flex-direction: row-reverse;
    text-align: right;
}

.btn-add-address {
    flex-direction: row-reverse;
}

/* Notifications Dropdown RTL */
.notifications-menu .dropdown-header {
    flex-direction: row-reverse;
}

.notification-item {
    flex-direction: row-reverse;
    text-align: right;
}

/* Cart Badge RTL */
.cart-badge {
    right: auto;
    left: -4px;
}

.notification-badge {
    right: auto;
    left: 2px;
}

/* Login Button RTL */
.btn-login {
    flex-direction: row-reverse;
}

/* Mobile RTL */
@media only screen and (max-width: 992px) {
    .main-nav .nav-link,
    .nav-actions .nav-link {
        flex-direction: row-reverse;
        text-align: right;
    }

    .cart-nav .cart-link {
        flex-direction: row-reverse;
    }

    .cart-badge {
        margin-left: 0;
        margin-right: auto;
    }
}

/* ==========================================
   RTL - MODERN DIALOG
   ========================================== */
.dialog-header {
    flex-direction: row-reverse;
}

.dialog-close {
    right: auto;
    left: 16px;
}

.dialog-form .input-with-icon i {
    left: auto;
    right: 14px;
}

.dialog-form .input-with-icon input {
    padding: 12px 44px 12px 14px;
}

.dialog-actions {
    flex-direction: row-reverse;
}

.dialog-actions .btn-submit {
    flex-direction: row-reverse;
}

/* RTL - Map Dialog */
.map-search i {
    left: auto;
    right: 14px;
}

.map-search input {
    padding: 12px 40px 12px 14px;
}

.map-hint {
    flex-direction: row-reverse;
}

/* ==========================================
   RTL - ABOUT US PAGE
   ========================================== */
.vm-card {
    flex-direction: row-reverse;
}

.vm-content {
    text-align: right;
}

.about-cta {
    flex-direction: row-reverse;
}

.about-cta .cta-content {
    text-align: right;
}

.about-cta .cta-button {
    flex-direction: row-reverse;
}

/* ==========================================
   RTL - LEGAL PAGES (Privacy & Terms)
   ========================================== */
.legal-section .intro-text {
    border-left: none;
    border-right: 4px solid var(--main);
}

.term-header {
    flex-direction: row-reverse;
}

.registration-card {
    flex-direction: row-reverse;
    text-align: right;
}

.legal-contact {
    flex-direction: row-reverse;
    text-align: right;
}

.legal-contact .contact-link {
    margin-left: 0;
    margin-right: auto;
}

@media only screen and (max-width: 768px) {
    .legal-contact {
        flex-direction: column;
        text-align: center;
    }

    .legal-contact .contact-link {
        margin-right: 0;
    }

    .registration-card {
        flex-direction: column;
        text-align: center;
    }
}

/* ==========================================
   RTL - FLOATING CART WIDGET MOBILE
   ========================================== */
@media only screen and (max-width: 576px) {
    .view-cart {
        left: auto;
        right: 16px;
        transform: none;
    }

    @keyframes cartWidgetSlideUp {
        from {
            transform: translateY(100px);
            opacity: 0;
        }
        to {
            transform: translateY(0);
            opacity: 1;
        }
    }
}

/* RTL - Dialog close button mobile */
@media only screen and (max-width: 768px) {
    button#closeDialog,
    .add-to-cart-dialog .close-button {
        right: auto;
        left: 12px;
    }
}
