/* 
 * ملف CSS للاتجاه من اليمين لليسار (RTL) - العربية
 * متجر Notifier للحماية من الحرائق
 */

/* ===============================
   إعدادات أساسية للـ RTL
   =============================== */
body.rtl {
    direction: rtl;
    text-align: right;
}

body.rtl * {
    direction: rtl;
}

/* ===============================
   تعديل Bootstrap للـ RTL
   =============================== */
.rtl .me-1 { margin-right: 0 !important; margin-left: 0.25rem !important; }
.rtl .me-2 { margin-right: 0 !important; margin-left: 0.5rem !important; }
.rtl .me-3 { margin-right: 0 !important; margin-left: 1rem !important; }
.rtl .me-4 { margin-right: 0 !important; margin-left: 1.5rem !important; }
.rtl .me-5 { margin-right: 0 !important; margin-left: 3rem !important; }

.rtl .ms-1 { margin-left: 0 !important; margin-right: 0.25rem !important; }
.rtl .ms-2 { margin-left: 0 !important; margin-right: 0.5rem !important; }
.rtl .ms-3 { margin-left: 0 !important; margin-right: 1rem !important; }
.rtl .ms-4 { margin-left: 0 !important; margin-right: 1.5rem !important; }
.rtl .ms-5 { margin-left: 0 !important; margin-right: 3rem !important; }

.rtl .pe-1 { padding-right: 0.25rem !important; }
.rtl .pe-2 { padding-right: 0.5rem !important; }
.rtl .pe-3 { padding-right: 1rem !important; }
.rtl .pe-4 { padding-right: 1.5rem !important; }
.rtl .pe-5 { padding-right: 3rem !important; }

.rtl .ps-1 { padding-left: 0.25rem !important; }
.rtl .ps-2 { padding-left: 0.5rem !important; }
.rtl .ps-3 { padding-left: 1rem !important; }
.rtl .ps-4 { padding-left: 1.5rem !important; }
.rtl .ps-5 { padding-left: 3rem !important; }

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

/* ===============================
   النماذج والمدخلات
   =============================== */
.rtl .form-control,
.rtl .form-select {
    text-align: right;
}

.rtl .input-group .form-control:not(:last-child) {
    border-left: 1px solid #ced4da;
    border-right: 0;
    border-radius: 0 0.375rem 0.375rem 0;
}

.rtl .input-group .btn:not(:first-child) {
    border-radius: 0.375rem 0 0 0.375rem;
    border-right: 1px solid;
    border-left: 0;
}

.rtl .search-form .form-control {
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    border-left: none;
    border-right: 1px solid #ced4da;
}

.rtl .search-form .btn {
    border-radius: var(--border-radius) 0 0 var(--border-radius);
    border-right: none;
    border-left: 1px solid;
}

/* ===============================
   القوائم المنسدلة
   =============================== */
.rtl .dropdown-menu {
    left: auto;
    right: 0;
}

.rtl .dropdown-submenu .dropdown-menu {
    left: auto;
    right: 100%;
    margin-left: 0;
    margin-right: -1px;
}

.rtl .dropdown-toggle::after {
    margin-left: 0;
    margin-right: 0.255em;
}

/* ===============================
   التنقل والقوائم
   =============================== */
.rtl .nav-pills .nav-link {
    margin-left: 0;
    margin-right: 5px;
}

.rtl .breadcrumb-item + .breadcrumb-item::before {
    content: "/" !important;
    transform: scaleX(-1);
}

.rtl .offcanvas-start {
    left: auto;
    right: 0;
    border-left: 1px solid rgba(0, 0, 0, 0.2);
    border-right: 0;
}

.rtl .offcanvas-end {
    right: auto;
    left: 0;
    border-right: 1px solid rgba(0, 0, 0, 0.2);
    border-left: 0;
}

/* ===============================
   الأزرار والأيقونات
   =============================== */
.rtl .btn-close {
    background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23000'%3e%3cpath d='m.234 8.005 8-8a.5.5 0 0 1 .707.707L1.44 8.005l7.5 7.5a.5.5 0 0 1-.707.707l-8-8a.5.5 0 0 1 0-.707z'/%3e%3c/svg%3e") center/1em auto no-repeat;
}

.rtl .carousel-control-prev {
    left: auto;
    right: 0;
}

.rtl .carousel-control-next {
    right: auto;
    left: 0;
}

.rtl .carousel-control-prev-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23fff'%3e%3cpath d='m.234 8.005 8-8a.5.5 0 0 1 .707.707L1.44 8.005l7.5 7.5a.5.5 0 0 1-.707.707l-8-8a.5.5 0 0 1 0-.707z'/%3e%3c/svg%3e");
}

.rtl .carousel-control-next-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23fff'%3e%3cpath d='M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0zM4.5 7.5a.5.5 0 0 0 0 1h5.793l-2.147 2.146a.5.5 0 0 0 .708.708l3-3a.5.5 0 0 0 0-.708l-3-3a.5.5 0 1 0-.708.708L10.293 7.5H4.5z'/%3e%3c/svg%3e");
}

/* ===============================
   عربة التسوق والكمية
   =============================== */
.rtl .quantity-controls button:first-child {
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
}

.rtl .quantity-controls button:last-child {
    border-radius: var(--border-radius) 0 0 var(--border-radius);
}

.rtl .quantity-controls input {
    border-right: 0;
    border-left: 1px solid #dee2e6;
}

/* ===============================
   البطاقات والمنتجات
   =============================== */
.rtl .product-badges {
    right: auto;
    left: 0;
}

.rtl .product-actions {
    left: auto;
    right: 0;
}

.rtl .card-img-overlay {
    right: auto;
    left: 0;
}

/* ===============================
   الجداول
   =============================== */
.rtl .table th,
.rtl .table td {
    text-align: right;
}

.rtl .table-responsive {
    direction: rtl;
}

/* ===============================
   التنبيهات والرسائل
   =============================== */
.rtl .alert-dismissible .btn-close {
    left: 0;
    right: auto;
    padding-left: 0.75rem;
    padding-right: 1.25rem;
}

.rtl .toast {
    left: auto;
    right: 0;
}

/* ===============================
   التقييم والنجوم
   =============================== */
.rtl .rating-stars {
    direction: ltr;
    justify-content: flex-end;
}

/* ===============================
   التصفح (Pagination)
   =============================== */
.rtl .page-link {
    margin-left: 0;
    margin-right: 2px;
}

.rtl .pagination .page-item:first-child .page-link {
    margin-right: 0;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
}

.rtl .pagination .page-item:last-child .page-link {
    border-radius: var(--border-radius) 0 0 var(--border-radius);
}

/* ===============================
   الفوتر
   =============================== */
.rtl .footer-links {
    text-align: right;
}

.rtl .social-icons {
    justify-content: flex-end;
}

/* ===============================
   أزرار الطفو
   =============================== */
.rtl .back-to-top {
    right: auto;
    left: 20px;
}

.rtl .whatsapp-float {
    right: auto;
    left: 20px;
}

/* ===============================
   التعديلات المخصصة للعربية
   =============================== */
.rtl h1, .rtl h2, .rtl h3, .rtl h4, .rtl h5, .rtl h6 {
    font-weight: 700;
}

.rtl .display-1, .rtl .display-2, .rtl .display-3, .rtl .display-4 {
    font-weight: 700;
}

.rtl .lead {
    font-weight: 400;
}

.rtl .small, .rtl small {
    font-weight: 400;
}

/* تحسين قراءة النصوص العربية */
.rtl p {
    line-height: 1.8;
}

.rtl .card-text {
    line-height: 1.7;
}

.rtl .list-unstyled li {
    line-height: 1.8;
}

/* ===============================
   تعديلات خاصة بالأرقام
   =============================== */
.rtl .price,
.rtl .amount,
.rtl .number,
.rtl .badge,
.rtl .pagination,
.rtl .rating-stars {
    direction: ltr;
    unicode-bidi: embed;
}

.rtl .quantity-input {
    direction: ltr;
    text-align: center;
}

/* ===============================
   تحسينات للجوال
   =============================== */
@media (max-width: 768px) {
    .rtl .back-to-top {
        left: 15px;
        right: auto;
    }
    
    .rtl .whatsapp-float {
        left: 15px;
        right: auto;
    }
    
    .rtl .offcanvas-start {
        left: auto;
        right: 0;
    }
    
    .rtl .search-form {
        direction: rtl;
    }
    
    .rtl .navbar-toggler {
        border: none;
    }
}

/* ===============================
   إصلاحات خاصة للـ RTL
   =============================== */
.rtl .d-flex {
    direction: rtl;
}

.rtl .justify-content-between {
    direction: rtl;
}

.rtl .align-items-center {
    direction: rtl;
}

/* تصحيح ترتيب العناصر في الـ Flexbox */
.rtl .flex-row-reverse {
    flex-direction: row !important;
}

.rtl .flex-row {
    flex-direction: row-reverse !important;
}

/* تصحيح النصوص والروابط */
.rtl a {
    direction: rtl;
}

.rtl .navbar-brand {
    margin-right: 0;
    margin-left: 1rem;
}

/* تصحيح القوائم */
.rtl .list-group-item {
    text-align: right;
}

.rtl .list-inline {
    direction: rtl;
}

.rtl .list-inline-item {
    margin-right: 0;
    margin-left: 0.5rem;
}

.rtl .list-inline-item:not(:last-child) {
    margin-left: 0.5rem;
    margin-right: 0;
}

/* ===============================
   تحسينات خاصة بالخطوط العربية
   =============================== */
.rtl {
    font-feature-settings: "liga" 1, "kern" 1;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* تحسين المسافات بين الحروف */
.rtl h1, .rtl h2, .rtl h3 {
    letter-spacing: -0.025em;
}

.rtl .display-1, .rtl .display-2 {
    letter-spacing: -0.05em;
}

/* ===============================
   إصلاحات للمكونات المخصصة
   =============================== */
.rtl .hero-buttons .btn {
    margin-left: 0;
    margin-right: 1rem;
}

.rtl .hero-buttons .btn:last-child {
    margin-right: 0;
}

.rtl .feature-icon {
    text-align: center;
}

.rtl .category-card {
    text-align: center;
}

.rtl .product-meta {
    direction: rtl;
}

.rtl .cart-actions .btn {
    margin-left: 0;
    margin-right: 0.5rem;
}

.rtl .cart-actions .btn:last-child {
    margin-right: 0;
}

/* ===============================
   تصحيحات نهائية
   =============================== */
.rtl .container,
.rtl .container-fluid,
.rtl .container-lg,
.rtl .container-md,
.rtl .container-sm,
.rtl .container-xl,
.rtl .container-xxl {
    direction: rtl;
}

.rtl .row {
    direction: rtl;
}

.rtl .col,
.rtl .col-1,
.rtl .col-2,
.rtl .col-3,
.rtl .col-4,
.rtl .col-5,
.rtl .col-6,
.rtl .col-7,
.rtl .col-8,
.rtl .col-9,
.rtl .col-10,
.rtl .col-11,
.rtl .col-12,
.rtl .col-auto,
.rtl .col-lg,
.rtl .col-lg-1,
.rtl .col-lg-2,
.rtl .col-lg-3,
.rtl .col-lg-4,
.rtl .col-lg-5,
.rtl .col-lg-6,
.rtl .col-lg-7,
.rtl .col-lg-8,
.rtl .col-lg-9,
.rtl .col-lg-10,
.rtl .col-lg-11,
.rtl .col-lg-12,
.rtl .col-lg-auto,
.rtl .col-md,
.rtl .col-md-1,
.rtl .col-md-2,
.rtl .col-md-3,
.rtl .col-md-4,
.rtl .col-md-5,
.rtl .col-md-6,
.rtl .col-md-7,
.rtl .col-md-8,
.rtl .col-md-9,
.rtl .col-md-10,
.rtl .col-md-11,
.rtl .col-md-12,
.rtl .col-md-auto,
.rtl .col-sm,
.rtl .col-sm-1,
.rtl .col-sm-2,
.rtl .col-sm-3,
.rtl .col-sm-4,
.rtl .col-sm-5,
.rtl .col-sm-6,
.rtl .col-sm-7,
.rtl .col-sm-8,
.rtl .col-sm-9,
.rtl .col-sm-10,
.rtl .col-sm-11,
.rtl .col-sm-12,
.rtl .col-sm-auto,
.rtl .col-xl,
.rtl .col-xl-1,
.rtl .col-xl-2,
.rtl .col-xl-3,
.rtl .col-xl-4,
.rtl .col-xl-5,
.rtl .col-xl-6,
.rtl .col-xl-7,
.rtl .col-xl-8,
.rtl .col-xl-9,
.rtl .col-xl-10,
.rtl .col-xl-11,
.rtl .col-xl-12,
.rtl .col-xl-auto,
.rtl .col-xxl,
.rtl .col-xxl-1,
.rtl .col-xxl-2,
.rtl .col-xxl-3,
.rtl .col-xxl-4,
.rtl .col-xxl-5,
.rtl .col-xxl-6,
.rtl .col-xxl-7,
.rtl .col-xxl-8,
.rtl .col-xxl-9,
.rtl .col-xxl-10,
.rtl .col-xxl-11,
.rtl .col-xxl-12,
.rtl .col-xxl-auto {
    direction: rtl;
}
