/* RTL (Arabic) Overrides */

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

/* Flip layouts */
html[dir="rtl"] .header-inner { flex-direction: row-reverse; }
html[dir="rtl"] .logo { flex-direction: row-reverse; }
html[dir="rtl"] .search-bar { direction: rtl; }
html[dir="rtl"] .search-bar input { text-align: right; padding: 0 24px !important; }
html[dir="rtl"] .search-bar button { order: -1; }
html[dir="rtl"] .header-actions { flex-direction: row-reverse; }
html[dir="rtl"] .cart-btn { flex-direction: row-reverse; }
html[dir="rtl"] .cart-info { text-align: right; }
html[dir="rtl"] .cart-badge { right: auto !important; left: -10px !important; }

/* Nav */
html[dir="rtl"] .nav-inner { direction: rtl; }
html[dir="rtl"] .dropdown-menu { left: auto; right: 0; text-align: right; }
html[dir="rtl"] .dropdown-menu a:hover { padding-left: 20px; padding-right: 28px; }

/* Section titles - natural RTL direction, NO row-reverse */
html[dir="rtl"] .section-title { direction: rtl; }
html[dir="rtl"] .section-title h2 { padding-left: 0 !important; padding-right: 16px !important; border-left: none !important; border-right: 4px solid var(--primary) !important; }
html[dir="rtl"] .section-title h2::before { left: auto !important; right: 0 !important; }

/* Product cards */
html[dir="rtl"] .product-body { text-align: right; }
html[dir="rtl"] .badge-new { left: auto !important; right: 10px !important; }
html[dir="rtl"] .badge-promo { right: auto !important; left: 10px !important; }
html[dir="rtl"] .product-price { flex-direction: row-reverse; justify-content: flex-end; }

/* Trust badges */
html[dir="rtl"] .trust-item { flex-direction: row-reverse; text-align: right; }
@media (max-width: 420px) {
    html[dir="rtl"] .trust-item { flex-direction: column !important; text-align: center !important; }
}

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

/* Product detail */
html[dir="rtl"] .product-detail { direction: rtl; }
html[dir="rtl"] .product-info { text-align: right; }
html[dir="rtl"] .product-meta { flex-direction: row-reverse; }
html[dir="rtl"] .product-meta span { flex-direction: row-reverse; }
html[dir="rtl"] .benefits-box { border-left: none; border-right: 4px solid var(--primary); }
html[dir="rtl"] .qty-control { direction: ltr; }

/* Cart */
html[dir="rtl"] .cart-item { flex-direction: row-reverse; }
html[dir="rtl"] .cart-item-info { text-align: right; }
html[dir="rtl"] .cart-summary-row,
html[dir="rtl"] .cart-summary-total { flex-direction: row-reverse; }

/* Checkout */
html[dir="rtl"] .checkout-grid { direction: rtl; }
html[dir="rtl"] .checkout-form { text-align: right; }
html[dir="rtl"] .form-group label { text-align: right; }
html[dir="rtl"] .form-group input,
html[dir="rtl"] .form-group select,
html[dir="rtl"] .form-group textarea { text-align: right; }
html[dir="rtl"] .order-summary { text-align: right; }
html[dir="rtl"] .order-item { flex-direction: row-reverse; }
html[dir="rtl"] .payment-option { flex-direction: row-reverse; }

/* Footer */
html[dir="rtl"] .footer-inner { direction: rtl; }
html[dir="rtl"] .footer-col { text-align: right; }
html[dir="rtl"] .footer-col h3::after { left: auto; right: 0; }
html[dir="rtl"] .footer-contact p { flex-direction: row-reverse; }
html[dir="rtl"] .footer-col ul li a:hover { padding-left: 0; padding-right: 8px; }
html[dir="rtl"] .social-links { flex-direction: row-reverse; }

/* Announcement */
html[dir="rtl"] .close-ann { right: auto !important; left: 16px !important; }

/* Mobile drawer */
html[dir="rtl"] .mobile-nav-drawer { right: auto; left: -300px; }
html[dir="rtl"] .mobile-nav-drawer.open { left: 0; right: auto; }
html[dir="rtl"] .mobile-nav-header { flex-direction: row-reverse; }
html[dir="rtl"] .mobile-nav-items a { flex-direction: row-reverse; text-align: right; }
html[dir="rtl"] .mobile-nav-items .mn-sub a { padding-left: 20px; padding-right: 52px; }
html[dir="rtl"] .mobile-nav-footer a { flex-direction: row-reverse; text-align: right; }

/* Stats */
html[dir="rtl"] .stats-grid { direction: rtl; }

/* Categories */
html[dir="rtl"] .categories-grid { direction: rtl; }

/* Scroll buttons - no row-reverse, natural RTL handles it */

/* WhatsApp */
html[dir="rtl"] .whatsapp-float { right: auto !important; left: 24px !important; }
html[dir="rtl"] .back-to-top { left: auto !important; right: 24px !important; }
@media (max-width: 768px) {
    html[dir="rtl"] .whatsapp-float { left: 16px !important; right: auto !important; }
    html[dir="rtl"] .back-to-top { right: 16px !important; left: auto !important; }
}

/* Flash messages */
html[dir="rtl"] .flash-message { flex-direction: row-reverse; }

/* Font override for Arabic */
html[dir="rtl"] body { font-family: 'Cairo', 'Segoe UI', Tahoma, sans-serif; }
html[dir="rtl"] .hero-banner h1 { font-family: 'Cairo', sans-serif; }

/* Language switcher */
html[dir="rtl"] .lang-switch { flex-direction: row-reverse; }
.lang-switch:hover { background: #f0ebe5 !important; }
@media (max-width: 600px) {
    .lang-label { display: none !important; }
    .lang-switch { padding: 8px 10px !important; }
}

/* Search on mobile RTL */
@media (max-width: 768px) {
    html[dir="rtl"] .mobile-menu-btn { order: -1; }
}
html[dir="rtl"] .scroll-btns { flex-direction: row-reverse; }
