/* ===================================
   RTL (Right-to-Left) Styles
   For Arabic Language Support
   =================================== */

/* Global RTL */
body {
    direction: rtl;
    text-align: right;
}

/* Typography */
body,
input,
textarea,
button,
select {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, 'Arial', sans-serif;
}

/* Header */
.header-main {
    flex-direction: row-reverse;
}

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

.logo {
    margin-right: 0;
    margin-left: auto;
}

/* Navigation */
.nav-wrapper {
    flex-direction: row-reverse;
}

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

/* Mega Menu */
.mega-menu-container {
    flex-direction: row-reverse;
}

.mega-menu-categories {
    border-right: none;
    border-left: 1px solid #e5e7eb;
}

.mega-category-item {
    flex-direction: row-reverse;
    border-left: none;
    border-right: 3px solid transparent;
}

.mega-category-item.active {
    border-left: none;
    border-right: 3px solid #0d9488;
}

.arrow-right {
    transform: rotate(180deg);
}

/* Product Cards */
.product-card {
    text-align: right;
}

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

/* Badges */
.badge {
    right: auto;
    left: 0.5rem;
}

/* Buttons */
.btn svg:first-child {
    margin-right: 0;
    margin-left: 0.5rem;
}

.btn svg:last-child {
    margin-left: 0;
    margin-right: 0.5rem;
}

/* Forms */
.search-form {
    flex-direction: row-reverse;
}

.search-input {
    text-align: right;
    padding-right: 1rem;
    padding-left: 3rem;
}

.search-button {
    right: auto;
    left: 0;
    border-radius: 0 0.5rem 0.5rem 0;
}

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

.cart-summary {
    text-align: right;
}

/* Breadcrumb */
.breadcrumb {
    flex-direction: row-reverse;
}

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

/* Dropdown Menus */
.dropdown-menu {
    right: auto;
    left: 0;
}

/* Pagination */
.pagination {
    flex-direction: row-reverse;
}

/* Product Grid */
.product-grid {
    direction: rtl;
}

/* Sidebar */
.sidebar {
    margin-right: 0;
    margin-left: 2rem;
}

/* Filters */
.filter-group {
    text-align: right;
}

.checkbox-label {
    flex-direction: row-reverse;
}

.checkbox-label input {
    margin-right: 0;
    margin-left: 0.5rem;
}

/* Price Range */
.price-inputs {
    flex-direction: row-reverse;
}

/* Language Switcher */
.lang-menu {
    right: auto;
    left: 0;
}

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

.check-icon {
    margin-left: 0;
    margin-right: auto;
}

/* Hero Section */
.hero-content {
    text-align: right;
}

.hero-grid {
    direction: rtl;
}

/* Categories Grid */
.categories-grid {
    direction: rtl;
}

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

.footer-grid {
    direction: rtl;
}

.footer-links {
    text-align: right;
}

/* Tables */
table {
    direction: rtl;
}

th,
td {
    text-align: right;
}

/* Modal */
.modal-content {
    direction: rtl;
    text-align: right;
}

/* Toast Notifications */
.toast {
    right: auto;
    left: 1rem;
}

/* Utility Classes Override */
.mr-1 { margin-right: 0; margin-left: 0.25rem; }
.mr-2 { margin-right: 0; margin-left: 0.5rem; }
.mr-3 { margin-right: 0; margin-left: 0.75rem; }
.mr-4 { margin-right: 0; margin-left: 1rem; }

.ml-1 { margin-left: 0; margin-right: 0.25rem; }
.ml-2 { margin-left: 0; margin-right: 0.5rem; }
.ml-3 { margin-left: 0; margin-right: 0.75rem; }
.ml-4 { margin-left: 0; margin-right: 1rem; }

.pr-1 { padding-right: 0; padding-left: 0.25rem; }
.pr-2 { padding-right: 0; padding-left: 0.5rem; }
.pr-3 { padding-right: 0; padding-left: 0.75rem; }
.pr-4 { padding-right: 0; padding-left: 1rem; }

.pl-1 { padding-left: 0; padding-right: 0.25rem; }
.pl-2 { padding-left: 0; padding-right: 0.5rem; }
.pl-3 { padding-left: 0; padding-right: 0.75rem; }
.pl-4 { padding-left: 0; padding-right: 1rem; }

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

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

.rounded-l { border-radius: 0 0.5rem 0.5rem 0; }
.rounded-r { border-radius: 0.5rem 0 0 0.5rem; }

/* Animations RTL */
@keyframes slideInRight {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes slideInLeft {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

/* Mobile Menu RTL */
@media (max-width: 768px) {
    .mobile-menu {
        right: auto;
        left: 0;
    }
    
    .mobile-menu-overlay {
        animation: slideInLeft 0.3s ease-out;
    }
}