/* ═══════════════════════════════════════════════════
   RTL (Right-to-Left) Stylesheet for Arabic
   Loaded conditionally when LANGUAGE_CODE == 'ar'
   ═══════════════════════════════════════════════════ */

/* ─── Base / Typography ─── */
html[dir="rtl"] {
    font-family: 'Cairo', 'Inter', 'Nunito Sans', sans-serif;
}

html[dir="rtl"] body,
html[dir="rtl"] input,
html[dir="rtl"] textarea,
html[dir="rtl"] select,
html[dir="rtl"] button {
    font-family: 'Cairo', 'Inter', 'Nunito Sans', sans-serif;
}

/* ─── Text Alignment ─── */
html[dir="rtl"] {
    text-align: right;
}

/* ─── Navbar — Top Bar ─── */
html[dir="rtl"] .pn-topbar-left span i {
    margin-right: 0;
    margin-left: 5px;
}

html[dir="rtl"] .pn-lang-switcher {
    margin-left: 0;
    margin-right: 12px;
    padding-left: 0;
    padding-right: 12px;
    border-left: none;
    border-right: 1px solid rgba(255,255,255,.15);
}

/* ─── Navbar — Main Nav ─── */
html[dir="rtl"] .pn-nav > li > a .pn-hot {
    margin-left: 0;
    margin-right: 4px;
}

/* ─── Navbar — Dropdown ─── */
html[dir="rtl"] .pn-dropdown {
    left: auto;
    right: 0;
}

html[dir="rtl"] .pn-dropdown li a:hover {
    padding-left: 20px;
    padding-right: 24px;
}

/* ─── Navbar — Mobile Drawer ─── */
html[dir="rtl"] .pn-mobile-drawer {
    right: auto;
    left: -320px;
    box-shadow: 8px 0 30px rgba(0,0,0,.15);
}

html[dir="rtl"] .pn-mobile-drawer.active {
    left: 0;
    right: auto;
}

html[dir="rtl"] .pn-mobile-sub {
    padding: 0 16px 0 0;
}

html[dir="rtl"] .pn-mobile-sub li a:hover {
    padding-left: 20px;
    padding-right: 24px;
}

/* ─── Footer ─── */
html[dir="rtl"] .pf-footer h4::after {
    left: auto;
    right: 0;
}

html[dir="rtl"] .pf-footer ul li a:hover {
    padding-left: 0;
    padding-right: 6px;
}

html[dir="rtl"] .pf-footer ul li a i.fa-chevron-right::before {
    content: "\f053"; /* chevron-left */
}

/* ─── Bootstrap Grid RTL Fixes ─── */
html[dir="rtl"] .ml-auto,
html[dir="rtl"] .ms-auto {
    margin-left: 0 !important;
    margin-right: auto !important;
}

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

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

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

/* ─── Form Elements ─── */
html[dir="rtl"] input,
html[dir="rtl"] textarea,
html[dir="rtl"] select {
    text-align: right;
}

html[dir="rtl"] input[type="email"],
html[dir="rtl"] input[type="url"],
html[dir="rtl"] input[type="tel"],
html[dir="rtl"] input[type="number"] {
    text-align: left;
    direction: ltr;
}

/* ─── Icons / Buttons spacing ─── */
html[dir="rtl"] .pn-act .pn-badge {
    right: auto;
    left: -3px;
}

html[dir="rtl"] .pn-drawer-actions a i {
    margin-right: 0;
}

/* ─── Hero Section ─── */
html[dir="rtl"] .he-hero-content {
    text-align: right;
}

/* ─── Premium Home Hero (RTL) ─── */
html[dir="rtl"] .premium-home .hero-overlay {
    direction: rtl;
}

html[dir="rtl"] .premium-home .hero-content {
    padding-inline-start: 80px;
    padding-inline-end: 0;
}

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

/* ─── Toast Notifications ─── */
html[dir="rtl"] .toast-container {
    right: auto !important;
    left: 20px !important;
}

/* ─── Section Titles ─── */
html[dir="rtl"] .sec-title {
    text-align: center;
}

/* ─── Breadcrumb ─── */
html[dir="rtl"] .breadcrumb-item + .breadcrumb-item::before {
    content: "\f053"; /* chevron-left in fontawesome */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    float: right;
    padding-right: 0;
    padding-left: .5rem;
}

/* ─── Dashboard Sidebar ─── */
html[dir="rtl"] .dashboard-sidebar {
    border-right: none;
    border-left: 1px solid #e5e7eb;
}

html[dir="rtl"] .dashboard-sidebar a i {
    margin-right: 0;
    margin-left: 10px;
}

/* ─── Cart / Checkout Tables ─── */
html[dir="rtl"] .cart-table th,
html[dir="rtl"] .cart-table td {
    text-align: right;
}

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

/* ─── Blog ─── */
html[dir="rtl"] .blog-card .blog-meta {
    text-align: right;
}

/* ─── Order Details ─── */
html[dir="rtl"] .order-status-badge {
    float: left;
}

/* ─── Misc Utilities ─── */
html[dir="rtl"] .float-right {
    float: left !important;
}

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

/* Icon spacing in links and buttons */
html[dir="rtl"] a > i:first-child,
html[dir="rtl"] button > i:first-child,
html[dir="rtl"] span > i:first-child {
    margin-right: 0;
}

/* ─── Quantity Selector ─── */
html[dir="rtl"] .qty-selector {
    direction: ltr;
}

/* ─── Search Modal ─── */
html[dir="rtl"] #search-input {
    text-align: right;
}

/* ─── Announcement / Trust Bar ─── */
html[dir="rtl"] .he-trust-item i {
    margin-right: 0;
    margin-left: 10px;
}

/* ─── Newsletter ─── */
html[dir="rtl"] .newsletter-input {
    border-radius: 0 30px 30px 0;
}

html[dir="rtl"] .newsletter-btn {
    border-radius: 30px 0 0 30px;
}
