// data.jsx — catalog, categories, i18n strings, currency formatter. Exported to window.

const CATEGORIES = [
  { id: "terminals", icon: "register", en: "Cashier systems", ar: "أنظمة الكاشير" },
  { id: "printers", icon: "printer", en: "Receipt printers", ar: "طابعات الإيصالات" },
  { id: "scanners", icon: "scan", en: "Barcode scanners", ar: "قارئات الباركود" },
  { id: "drawers", icon: "cash", en: "Cash drawers", ar: "أدراج النقود" },
  { id: "displays", icon: "monitor", en: "Customer displays", ar: "شاشات العملاء" },
  { id: "software", icon: "code", en: "Software", ar: "البرمجيات" },
  { id: "bundles", icon: "boxes", en: "Bundles", ar: "الحزم" },
];

const PRODUCTS = [
  {
    id: "t1-terminal", cat: "terminals", sku: "MT-T1-156", price: 28500, stock: 42, rating: 4.8, reviews: 213,
    badge: { en: "Best seller", ar: "الأكثر مبيعاً", tone: "primary" },
    name: { en: "MegaTech T1 Terminal", ar: "محطة ميجاتك T1" },
    tagline: { en: "15.6\" all-in-one POS", ar: "نقطة بيع متكاملة 15.6 بوصة" },
    specs: [
      { en: "15.6\" capacitive touch", ar: "شاشة لمس سعوية 15.6\"" },
      { en: "Intel Celeron · 8GB RAM", ar: "إنتل سيليرون · 8 جيجا رام" },
      { en: "128GB SSD · fanless", ar: "128 جيجا SSD · بدون مروحة" },
    ],
    desc: { en: "A rugged all-in-one register built for high-volume counters. Bright wide-view touchscreen, sealed against spills, and ready for the MegaTech POS suite out of the box.", ar: "محطة تسجيل متكاملة ومتينة مصممة للعدادات عالية الحركة. شاشة لمس واسعة وساطعة، ومقاومة للانسكابات، وجاهزة لتشغيل نظام ميجاتك لنقاط البيع." },
  },
  {
    id: "t1-mini", cat: "terminals", sku: "MT-T1-116", price: 18900, stock: 30, rating: 4.6, reviews: 88,
    name: { en: "MegaTech T1 Mini", ar: "محطة ميجاتك T1 ميني" },
    tagline: { en: "11.6\" compact terminal", ar: "محطة مدمجة 11.6 بوصة" },
    specs: [
      { en: "11.6\" capacitive touch", ar: "شاشة لمس سعوية 11.6\"" },
      { en: "Quad-core ARM · fanless", ar: "معالج رباعي ARM · بدون مروحة" },
      { en: "Fits tight counters", ar: "مناسبة للعدادات الضيقة" },
    ],
    desc: { en: "The small-footprint register for kiosks, cafés, and pop-ups where counter space is precious but speed still matters.", ar: "محطة تسجيل صغيرة الحجم للأكشاك والمقاهي والمتاجر المؤقتة حيث المساحة ثمينة والسرعة مهمة." },
  },
  {
    id: "flex-tablet", cat: "terminals", sku: "MT-FLEX-10", price: 9750, stock: 60, rating: 4.5, reviews: 142,
    badge: { en: "New", ar: "جديد", tone: "info" },
    name: { en: "MegaTech Flex Tablet POS", ar: "تابلت ميجاتك فليكس" },
    tagline: { en: "10\" Android handheld", ar: "جهاز محمول أندرويد 10 بوصة" },
    specs: [
      { en: "10\" Android 13", ar: "أندرويد 13 · 10 بوصة" },
      { en: "4G + Wi-Fi", ar: "شبكة 4G + واي فاي" },
      { en: "10-hour battery", ar: "بطارية 10 ساعات" },
    ],
    desc: { en: "Take orders tableside or run a full mobile checkout. Snaps into the optional dock to become a fixed register.", ar: "استقبل الطلبات على الطاولة أو شغّل نقطة بيع متنقلة كاملة. يثبّت في القاعدة الاختيارية ليصبح محطة ثابتة." },
  },
  {
    id: "thermal-80", cat: "printers", sku: "MT-TP-80", price: 3450, stock: 120, rating: 4.7, reviews: 309,
    badge: { en: "Best seller", ar: "الأكثر مبيعاً", tone: "primary" },
    name: { en: "ThermalPro 80 Receipt Printer", ar: "طابعة ثيرمال برو 80" },
    tagline: { en: "80mm thermal · 250mm/s", ar: "حرارية 80مم · 250مم/ث" },
    specs: [
      { en: "80mm thermal", ar: "حرارية 80 مم" },
      { en: "250mm/s print speed", ar: "سرعة طباعة 250مم/ث" },
      { en: "USB + LAN", ar: "USB + شبكة" },
    ],
    desc: { en: "Fast, quiet thermal printing with auto-cutter and drawer kick port. Drop-in paper loading keeps lines moving.", ar: "طباعة حرارية سريعة وهادئة مع قاطع تلقائي ومنفذ لفتح الدرج. تحميل ورق سهل يبقي الطابور متحركاً." },
  },
  {
    id: "thermal-58", cat: "printers", sku: "MT-TP-58", price: 1850, stock: 80, rating: 4.4, reviews: 121,
    name: { en: "ThermalPro 58 Mobile", ar: "ثيرمال برو 58 المحمولة" },
    tagline: { en: "58mm Bluetooth printer", ar: "طابعة بلوتوث 58 مم" },
    specs: [
      { en: "58mm thermal", ar: "حرارية 58 مم" },
      { en: "Bluetooth 5.0", ar: "بلوتوث 5.0" },
      { en: "Rechargeable battery", ar: "بطارية قابلة للشحن" },
    ],
    desc: { en: "Pocket-size receipts for delivery drivers and mobile sellers. Pairs in seconds with the Flex tablet.", ar: "إيصالات بحجم الجيب لسائقي التوصيل والبائعين المتنقلين. يقترن خلال ثوانٍ مع تابلت فليكس." },
  },
  {
    id: "kitchen-jet", cat: "printers", sku: "MT-KJ-01", price: 4200, stock: 35, rating: 4.5, reviews: 64,
    name: { en: "KitchenJet Impact Printer", ar: "طابعة كيتشن جيت" },
    tagline: { en: "Kitchen dot-matrix", ar: "طابعة مطبخ نقطية" },
    specs: [
      { en: "Impact dot-matrix", ar: "نقطية تأثيرية" },
      { en: "Splash-resistant", ar: "مقاومة للرذاذ" },
      { en: "LAN connection", ar: "اتصال شبكي" },
    ],
    desc: { en: "Readable tickets in hot, humid kitchens where thermal paper fades. Loud buzzer flags new orders.", ar: "تذاكر واضحة في المطابخ الحارة والرطبة حيث يبهت الورق الحراري. جرس عالٍ ينبّه للطلبات الجديدة." },
  },
  {
    id: "scan-1d", cat: "scanners", sku: "MT-SM-1D", price: 1450, stock: 200, rating: 4.6, reviews: 410,
    name: { en: "ScanMaster 1D Handheld", ar: "سكان ماستر 1D اليدوي" },
    tagline: { en: "1D laser scanner", ar: "ماسح ليزر أحادي البعد" },
    specs: [
      { en: "1D laser", ar: "ليزر أحادي البعد" },
      { en: "USB plug & play", ar: "USB توصيل وتشغيل" },
      { en: "100 scans / sec", ar: "100 مسح / ثانية" },
    ],
    desc: { en: "Reliable everyday barcode reading with a comfortable trigger grip and a stand for hands-free scanning.", ar: "قراءة باركود يومية موثوقة بقبضة مريحة وحامل للمسح بدون استخدام اليدين." },
  },
  {
    id: "scan-2d", cat: "scanners", sku: "MT-SM-2D", price: 2950, stock: 90, rating: 4.8, reviews: 256,
    badge: { en: "Popular", ar: "رائج", tone: "success" },
    name: { en: "ScanMaster 2D Omni", ar: "سكان ماستر 2D أومني" },
    tagline: { en: "2D imager + QR", ar: "ماسح ثنائي الأبعاد + QR" },
    specs: [
      { en: "1D / 2D + QR codes", ar: "أكواد 1D / 2D + QR" },
      { en: "Hands-free stand", ar: "حامل بدون استخدام اليدين" },
      { en: "Reads phone screens", ar: "يقرأ شاشات الهواتف" },
    ],
    desc: { en: "Omnidirectional imaging reads damaged labels and on-screen QR codes instantly — ideal for loyalty and mobile pay.", ar: "تصوير متعدد الاتجاهات يقرأ الملصقات التالفة وأكواد QR على الشاشة فوراً — مثالي للولاء والدفع عبر الجوال." },
  },
  {
    id: "scan-wireless", cat: "scanners", sku: "MT-SM-WL", price: 3650, stock: 55, rating: 4.5, reviews: 97,
    name: { en: "ScanMaster Wireless", ar: "سكان ماستر لاسلكي" },
    tagline: { en: "Cordless 2.4GHz", ar: "لاسلكي 2.4 جيجا" },
    specs: [
      { en: "2.4GHz cordless", ar: "لاسلكي 2.4 جيجا" },
      { en: "30m range", ar: "مدى 30 متر" },
      { en: "Charging cradle", ar: "قاعدة شحن" },
    ],
    desc: { en: "Roam the aisles to scan bulky stock without dragging a cable. Drops onto its cradle to charge and re-pair.", ar: "تنقّل بين الممرات لمسح البضائع الكبيرة دون كابل. يوضع على قاعدته للشحن وإعادة الاقتران." },
  },
  {
    id: "cash-410", cat: "drawers", sku: "MT-SC-410", price: 2250, stock: 70, rating: 4.7, reviews: 178,
    name: { en: "SecureCash 410 Drawer", ar: "درج سكيور كاش 410" },
    tagline: { en: "Heavy-duty steel", ar: "فولاذ متين" },
    specs: [
      { en: "4 bill · 8 coin", ar: "4 فئات أوراق · 8 معدنية" },
      { en: "RJ11 printer trigger", ar: "فتح عبر الطابعة RJ11" },
      { en: "3-position lock", ar: "قفل بثلاث وضعيات" },
    ],
    desc: { en: "A full-size till that opens on receipt print and locks down after hours. Removable coin tray for fast counts.", ar: "درج بحجم كامل يُفتح عند طباعة الإيصال ويُقفل بعد الدوام. صينية عملات قابلة للإزالة لعدّ سريع." },
  },
  {
    id: "cash-compact", cat: "drawers", sku: "MT-SC-CMP", price: 1650, stock: 65, rating: 4.3, reviews: 52,
    name: { en: "SecureCash Compact", ar: "سكيور كاش المدمج" },
    tagline: { en: "Slim cash drawer", ar: "درج نقود نحيف" },
    specs: [
      { en: "3 bill · 6 coin", ar: "3 فئات أوراق · 6 معدنية" },
      { en: "Manual key release", ar: "فتح يدوي بالمفتاح" },
      { en: "Fits compact counters", ar: "مناسب للعدادات الصغيرة" },
    ],
    desc: { en: "A narrow till for tight counters and low-cash environments. Quiet slam-shut action keeps things tidy.", ar: "درج ضيق للعدادات الصغيرة والبيئات قليلة النقد. إغلاق هادئ يبقي كل شيء منظماً." },
  },
  {
    id: "view-10", cat: "displays", sku: "MT-VL-10", price: 4100, stock: 40, rating: 4.6, reviews: 73,
    badge: { en: "New", ar: "جديد", tone: "info" },
    name: { en: "ViewLine 10\" Customer Display", ar: "شاشة العميل فيو لاين 10\"" },
    tagline: { en: "Rear-facing IPS", ar: "شاشة IPS خلفية" },
    specs: [
      { en: "10\" IPS display", ar: "شاشة IPS 10 بوصة" },
      { en: "Order + ad loop", ar: "الطلب + إعلانات" },
      { en: "Mounts to T1", ar: "تركيب على T1" },
    ],
    desc: { en: "Show the running total and promos to the customer while you ring up. Plays an ad loop when the lane is idle.", ar: "اعرض الإجمالي الجاري والعروض للعميل أثناء التسجيل. يعرض إعلانات عند خمول المسار." },
  },
  {
    id: "view-vfd", cat: "displays", sku: "MT-VL-VFD", price: 1950, stock: 50, rating: 4.2, reviews: 41,
    name: { en: "ViewLine Pole VFD", ar: "عمود فيو لاين VFD" },
    tagline: { en: "2-line pole display", ar: "شاشة عمود بسطرين" },
    specs: [
      { en: "2×20 green VFD", ar: "VFD أخضر 2×20" },
      { en: "Adjustable pole", ar: "عمود قابل للتعديل" },
      { en: "USB powered", ar: "تشغيل عبر USB" },
    ],
    desc: { en: "The classic glowing two-line display customers trust. Tall pole keeps the total visible over the counter.", ar: "شاشة السطرين المتوهجة الكلاسيكية التي يثق بها العملاء. عمود مرتفع يُبقي الإجمالي مرئياً." },
  },
  {
    id: "pos-software", cat: "software", sku: "MT-SW-POS", price: 6900, stock: 999, rating: 4.9, reviews: 521, unit: "yr",
    badge: { en: "Subscription", ar: "اشتراك", tone: "primary" },
    name: { en: "MegaTech POS Software", ar: "برنامج ميجاتك لنقاط البيع" },
    tagline: { en: "Per terminal / year", ar: "لكل محطة / سنة" },
    specs: [
      { en: "Cloud sync", ar: "مزامنة سحابية" },
      { en: "Works offline", ar: "يعمل بدون إنترنت" },
      { en: "Multi-branch", ar: "متعدد الفروع" },
    ],
    desc: { en: "The register software that ties the hardware together: catalog, discounts, loyalty, shifts, and live cloud reporting.", ar: "برنامج نقاط البيع الذي يربط الأجهزة معاً: الكتالوج، الخصومات، الولاء، الورديات، والتقارير السحابية الحية." },
  },
  {
    id: "inventory-software", cat: "software", sku: "MT-SW-INV", price: 4200, stock: 999, rating: 4.7, reviews: 198, unit: "yr",
    name: { en: "Inventory + Reports", ar: "المخزون والتقارير" },
    tagline: { en: "Per branch / year", ar: "لكل فرع / سنة" },
    specs: [
      { en: "Real-time stock", ar: "مخزون لحظي" },
      { en: "40+ reports", ar: "أكثر من 40 تقريراً" },
      { en: "Supplier orders", ar: "طلبات الموردين" },
    ],
    desc: { en: "Track every unit across branches, set reorder points, and email purchase orders to suppliers automatically.", ar: "تتبّع كل وحدة عبر الفروع، وحدد نقاط إعادة الطلب، وأرسل أوامر الشراء للموردين تلقائياً." },
  },
  {
    id: "starter-bundle", cat: "bundles", sku: "MT-BND-STR", price: 34900, compareAt: 39900, stock: 25, rating: 4.9, reviews: 86,
    badge: { en: "Save EGP 5,000", ar: "وفّر 5,000 ج.م", tone: "success" },
    name: { en: "Starter Store Bundle", ar: "حزمة المتجر للمبتدئين" },
    tagline: { en: "Everything to open a lane", ar: "كل ما يلزم لفتح مسار بيع" },
    specs: [
      { en: "T1 Terminal", ar: "محطة T1" },
      { en: "ThermalPro 80 + ScanMaster 2D", ar: "ثيرمال برو 80 + سكان ماستر 2D" },
      { en: "SecureCash 410 drawer", ar: "درج سكيور كاش 410" },
    ],
    desc: { en: "A complete checkout lane in one box — terminal, receipt printer, 2D scanner, and cash drawer, pre-configured to work together.", ar: "مسار دفع كامل في صندوق واحد — محطة، طابعة إيصالات، ماسح 2D، ودرج نقود، معدّة مسبقاً للعمل معاً." },
  },
  {
    id: "cafe-bundle", cat: "bundles", sku: "MT-BND-CAF", price: 16500, compareAt: 18900, stock: 32, rating: 4.7, reviews: 54,
    badge: { en: "Bundle", ar: "حزمة", tone: "info" },
    name: { en: "Café Quick-Serve Bundle", ar: "حزمة الخدمة السريعة للمقاهي" },
    tagline: { en: "Mobile-first café kit", ar: "طقم مقهى متنقل" },
    specs: [
      { en: "Flex Tablet POS", ar: "تابلت فليكس" },
      { en: "ThermalPro 58 Mobile", ar: "ثيرمال برو 58 المحمولة" },
      { en: "ViewLine Pole VFD", ar: "عمود فيو لاين VFD" },
    ],
    desc: { en: "A lightweight quick-serve setup: tablet register, mobile printer, and a customer pole — ideal for cafés and food trucks.", ar: "إعداد خدمة سريعة خفيف: محطة تابلت، طابعة محمولة، وعمود عميل — مثالي للمقاهي وعربات الطعام." },
  },
];

// ---- i18n ----
const STRINGS = {
  en: {
    dir: "ltr",
    announce: "Free nationwide delivery on orders over EGP 5,000 · 2-year hardware warranty",
    navProducts: "Products", navSolutions: "Solutions", navSupport: "Support", navPricing: "Pricing", navContact: "Contact / Support",
    search: "Search terminals, printers, scanners…",
    storefront: "Storefront", admin: "Admin", signIn: "Sign in",
    signOut: "Sign out", account: "My account", myOrders: "My orders", adminConsole: "Admin console", savedItems: "Saved items",
    loginTitle: "Sign in to MegaTech", loginSub: "Access your orders, saved systems, and admin tools.",
    emailLabel: "Work email", passwordLabel: "Password", rememberMe: "Keep me signed in", forgot: "Forgot password?",
    createTitle: "Create your account", createSub: "Set up a MegaTech business account in under a minute.",
    noAccount: "New to MegaTech?", haveAccount: "Already have an account?", createLink: "Create one", signInLink: "Sign in",
    signInCta: "Sign in", createCta: "Create account", nameLabel: "Full name", confirmLabel: "Confirm password",
    invalidCreds: "Email or password is incorrect.", pwMismatch: "Passwords don't match.", orDivider: "or use a demo account",
    demoTitle: "Demo accounts", roleAdmin: "Administrator", roleCustomer: "Customer", useAccount: "Use this account",
    continueGoogle: "Continue with Google", orEmail: "or continue with email",
    continuePhone: "Continue with phone",
    phoneTitle: "Sign in with your phone", phoneSub: "We'll send a one-time code to your WhatsApp.",
    phoneNumLabel: "Phone number", sendOtp: "Send code on WhatsApp",
    otpTitle: "Enter the code", otpSubA: "We sent a 6-digit code to", otpSubB: "on WhatsApp.",
    verifyOtp: "Verify & continue", changeNumber: "Change number", resendCode: "Resend code", resendIn: "Resend in",
    otpWrong: "That code isn't right. Check WhatsApp and try again.", phoneInvalid: "Enter a valid phone number.",
    otpSentToast: "Code sent on WhatsApp", demoCodeNote: "Prototype: your code is",
    completeTitle: "Complete your account", completeSub: "You're new here. Tell us a bit about you to finish setting up your account.",
    activityLabel: "Activity name", activityHint: "Your shop, restaurant, or business name.", finishAccount: "Finish & continue",
    signedInToast: "Signed in", signedOutToast: "Signed out", welcome: "Welcome",
    loginAside: "One account for hardware, software, and support.",
    loginPt1: "Track orders and schedule on-site installation", loginPt2: "Save systems and reorder in one click", loginPt3: "Admins manage the catalog from the back-office",
    adminBadge: "Admin", needAdmin: "Sign in with an administrator account to open the console.",
    heroOverline: "Retail technology, deployed in days",
    heroTitle: "MegaTech. Faster sales, higher profits, easier management.",
    heroSub: "Goodbye to complexity. Welcome the future of seamless management with MegaTech — built to stay ahead of your expectations and meet every one of your daily needs.",
    browse: "Browse systems", talkSales: "Talk to sales",
    statDeployed: "Lanes deployed", statUptime: "Uptime SLA", statSupport: "Support",
    trustWarranty: "1-year warranty", trustShipping: "Free delivery > EGP 5,000", trustSupport: "24/7 support", trustReturns: "30-day returns",
    shopByCat: "Shop by category", allProducts: "All products", catalog: "Catalog",
    sortBy: "Sort", sortFeatured: "Featured", sortPriceLow: "Price: low to high", sortPriceHigh: "Price: high to low", sortRating: "Top rated",
    resultsOne: "product", resultsMany: "products",
    addToCart: "Add to cart", added: "Added", viewDetails: "View details", details: "Details",
    inStock: "In stock", lowStock: "Low stock", outOfStock: "Out of stock", unitsLeft: "left",
    from: "from", perYear: "/ yr", specs: "Key specs", whatsIncluded: "What's included", overview: "Overview",
    quantity: "Quantity", sku: "SKU", category: "Category", relatedTitle: "Pairs well with",
    backToCatalog: "Back to catalog",
    // cart
    cartTitle: "Your order", cartEmpty: "Your cart is empty", cartEmptySub: "Browse systems and add hardware to build an order.",
    startShopping: "Browse systems", remove: "Remove", subtotal: "Subtotal", vat: "VAT (14%)", shipping: "Shipping", free: "Free", total: "Total",
    proceed: "Proceed to checkout", createOrder: "Create order", continueShopping: "Continue shopping",
    items: "items", item: "item",
    // checkout
    checkout: "Checkout", contactInfo: "Contact", shippingInfo: "Delivery", payment: "Payment", review: "Review",
    businessName: "Business name", fullName: "Contact name", email: "Email", phone: "Phone",
    address: "Street address", city: "City", governorate: "Governorate", placeOrder: "Place order",
    payCard: "Credit / debit card", payInvoice: "Invoice on account", payCod: "Cash on delivery",
    cardNumber: "Card number", expiry: "Expiry", cvc: "CVC", orderSummary: "Order summary",
    orderPlaced: "Order received.", orderPlacedSub: "Your order is in. A MegaTech specialist will contact you on WhatsApp shortly to confirm the details and arrange delivery, installation, and payment.",
    orderNotes: "Order notes",
    orderNumber: "Order number", backToStore: "Back to store", continueLabel: "Continue", back: "Back",
    // admin
    adminProducts: "Products", adminTitle: "Product management", adminSub: "Manage your hardware and software catalog.",
    addProduct: "Add product", newProduct: "New product", editProduct: "Edit product",
    productName: "Product name", priceEGP: "Price (EGP)", stockLevel: "Stock level", productImage: "Product image",
    descLabel: "Description", saveProduct: "Save product", cancel: "Cancel", saving: "Saving…", saved: "Product saved",
    thName: "Product", thCat: "Category", thPrice: "Price", thStock: "Stock", thStatus: "Status", thActions: "",
    searchProducts: "Search products…", allCats: "All categories", active: "Active", draft: "Draft",
    required: "Required", uploadHint: "Drag an image here or click to upload", compareAt: "Compare-at price (optional)",
    statusLabel: "Status", totalProducts: "products", lowStockCount: "low stock", outCount: "out of stock",
    dashboard: "Dashboard", inventory: "Inventory", orders: "Orders", customers: "Customers", settings: "Settings",
    categoriesTab: "Categories", categoriesTitle: "Category management", categoriesSub: "Organize your catalog into categories.",
    addCategory: "Add category", newCategory: "New category", editCategory: "Edit category",
    catNameEn: "Name (English)", catNameAr: "Name (Arabic)", catIconLabel: "Icon", saveCategory: "Save category",
    catSaved: "Category saved", catDeleted: "Category removed", catInUse: "Can't delete — products still use this category.",
    addNewCategory: "Add new category", catProductsCount: "products", catProductCount: "product", noCategories: "No categories yet. Add your first one.",
    formIntro: "Fill in the details below. Fields marked with an asterisk are required.",
    skuLabel: "SKU", richBold: "Bold", richList: "List", taglineLabel: "Short tagline",
    layoutModal: "Slide-over", layoutPage: "Full page",
    // footer
    footerTag: "Technological Solutions For Everyone",
    fHardware: "Hardware", fSolutions: "Solutions", fCompany: "Company", fSupport: "Support",
    rights: "© 2026 MegaTech. All rights reserved.",
  },
  ar: {
    dir: "rtl",
    announce: "توصيل مجاني لكل المحافظات للطلبات فوق 5,000 ج.م · ضمان عامين على الأجهزة",
    navProducts: "المنتجات", navSolutions: "الحلول", navSupport: "الدعم", navPricing: "الأسعار", navContact: "اتصل بنا / الدعم",
    search: "ابحث عن محطات، طابعات، ماسحات…",
    storefront: "المتجر", admin: "الإدارة", signIn: "تسجيل الدخول",
    signOut: "تسجيل الخروج", account: "حسابي", myOrders: "طلباتي", adminConsole: "لوحة الإدارة", savedItems: "المحفوظات",
    loginTitle: "تسجيل الدخول إلى ميجاتك", loginSub: "ادخل لطلباتك وأنظمتك المحفوظة وأدوات الإدارة.",
    emailLabel: "البريد الإلكتروني للعمل", passwordLabel: "كلمة المرور", rememberMe: "إبقائي مسجلاً", forgot: "نسيت كلمة المرور؟",
    createTitle: "إنشاء حسابك", createSub: "أنشئ حساب أعمال في ميجاتك خلال أقل من دقيقة.",
    noAccount: "جديد في ميجاتك؟", haveAccount: "لديك حساب بالفعل؟", createLink: "أنشئ حساباً", signInLink: "سجّل الدخول",
    signInCta: "تسجيل الدخول", createCta: "إنشاء حساب", nameLabel: "الاسم الكامل", confirmLabel: "تأكيد كلمة المرور",
    invalidCreds: "البريد أو كلمة المرور غير صحيحة.", pwMismatch: "كلمتا المرور غير متطابقتين.", orDivider: "أو استخدم حساباً تجريبياً",
    demoTitle: "حسابات تجريبية", roleAdmin: "مدير", roleCustomer: "عميل", useAccount: "استخدم هذا الحساب",
    continueGoogle: "المتابعة باستخدام Google", orEmail: "أو المتابعة بالبريد الإلكتروني",
    continuePhone: "المتابعة برقم الهاتف",
    phoneTitle: "تسجيل الدخول برقم هاتفك", phoneSub: "سنرسل رمزاً لمرة واحدة إلى واتساب.",
    phoneNumLabel: "رقم الهاتف", sendOtp: "أرسل الرمز عبر واتساب",
    otpTitle: "أدخل الرمز", otpSubA: "أرسلنا رمزاً من 6 أرقام إلى", otpSubB: "عبر واتساب.",
    verifyOtp: "تحقق ومتابعة", changeNumber: "تغيير الرقم", resendCode: "إعادة إرسال الرمز", resendIn: "إعادة الإرسال خلال",
    otpWrong: "الرمز غير صحيح. تحقق من واتساب وحاول مجدداً.", phoneInvalid: "أدخل رقم هاتف صحيح.",
    otpSentToast: "تم إرسال الرمز عبر واتساب", demoCodeNote: "نموذج تجريبي: رمزك هو",
    completeTitle: "أكمل حسابك", completeSub: "أنت جديد هنا. أخبرنا قليلاً عنك لإكمال إنشاء حسابك.",
    activityLabel: "اسم النشاط", activityHint: "اسم متجرك أو مطعمك أو نشاطك.", finishAccount: "إنهاء ومتابعة",
    signedInToast: "تم تسجيل الدخول", signedOutToast: "تم تسجيل الخروج", welcome: "مرحباً",
    loginAside: "حساب واحد للأجهزة والبرمجيات والدعم.",
    loginPt1: "تتبّع الطلبات وجدولة التركيب في الموقع", loginPt2: "احفظ الأنظمة وأعد الطلب بنقرة واحدة", loginPt3: "يدير المسؤولون الكتالوج من لوحة الإدارة",
    adminBadge: "مدير", needAdmin: "سجّل الدخول بحساب مدير لفتح اللوحة.",
    heroOverline: "تقنية التجزئة، جاهزة خلال أيام",
    heroTitle: "ميجاتك.. مبيعات أسرع، أرباح أكثر، وإدارة أسهل.",
    heroSub: "وداعاً للتعقيد! رحّب بمستقبل الإدارة السلسة مع نظام ميجاتك.. صُمم ليسبق توقعاتك ويلبي كافة احتياجاتك اليومية.",
    browse: "تصفّح الأنظمة", talkSales: "تحدث مع المبيعات",
    statDeployed: "مسار بيع مُركّب", statUptime: "ضمان التشغيل", statSupport: "الدعم",
    trustWarranty: "ضمان عام", trustShipping: "توصيل مجاني > 5,000 ج.م", trustSupport: "دعم 24/7", trustReturns: "إرجاع خلال 30 يوماً",
    shopByCat: "تسوّق حسب الفئة", allProducts: "كل المنتجات", catalog: "الكتالوج",
    sortBy: "ترتيب", sortFeatured: "مميّز", sortPriceLow: "السعر: من الأقل", sortPriceHigh: "السعر: من الأعلى", sortRating: "الأعلى تقييماً",
    resultsOne: "منتج", resultsMany: "منتجات",
    addToCart: "أضف للسلة", added: "تمت الإضافة", viewDetails: "عرض التفاصيل", details: "التفاصيل",
    inStock: "متوفر", lowStock: "كمية محدودة", outOfStock: "غير متوفر", unitsLeft: "متبقّي",
    from: "من", perYear: "/ سنة", specs: "أهم المواصفات", whatsIncluded: "المحتويات", overview: "نظرة عامة",
    quantity: "الكمية", sku: "الرمز", category: "الفئة", relatedTitle: "يتكامل مع",
    backToCatalog: "العودة للكتالوج",
    cartTitle: "طلبك", cartEmpty: "سلتك فارغة", cartEmptySub: "تصفّح الأنظمة وأضف الأجهزة لبناء طلب.",
    startShopping: "تصفّح الأنظمة", remove: "إزالة", subtotal: "المجموع الفرعي", vat: "ضريبة (14%)", shipping: "الشحن", free: "مجاني", total: "الإجمالي",
    proceed: "متابعة للدفع", createOrder: "إنشاء الطلب", continueShopping: "متابعة التسوق",
    items: "عناصر", item: "عنصر",
    checkout: "الدفع", contactInfo: "التواصل", shippingInfo: "التوصيل", payment: "الدفع", review: "المراجعة",
    businessName: "اسم النشاط", fullName: "اسم المسؤول", email: "البريد الإلكتروني", phone: "الهاتف",
    address: "عنوان الشارع", city: "المدينة", governorate: "المحافظة", placeOrder: "تأكيد الطلب",
    payCard: "بطاقة ائتمان / خصم", payInvoice: "فاتورة آجلة", payCod: "الدفع عند الاستلام",
    cardNumber: "رقم البطاقة", expiry: "الانتهاء", cvc: "CVC", orderSummary: "ملخص الطلب",
    orderPlaced: "تم استلام الطلب.", orderPlacedSub: "تم تسجيل طلبك. سيتواصل معك مختص من ميجاتك عبر واتساب قريباً لتأكيد التفاصيل وترتيب التوصيل والتركيب والدفع.",
    orderNotes: "ملاحظات الطلب",
    orderNumber: "رقم الطلب", backToStore: "العودة للمتجر", continueLabel: "متابعة", back: "رجوع",
    adminProducts: "المنتجات", adminTitle: "إدارة المنتجات", adminSub: "أدر كتالوج الأجهزة والبرمجيات.",
    addProduct: "إضافة منتج", newProduct: "منتج جديد", editProduct: "تعديل منتج",
    productName: "اسم المنتج", priceEGP: "السعر (ج.م)", stockLevel: "مستوى المخزون", productImage: "صورة المنتج",
    descLabel: "الوصف", saveProduct: "حفظ المنتج", cancel: "إلغاء", saving: "جارٍ الحفظ…", saved: "تم حفظ المنتج",
    thName: "المنتج", thCat: "الفئة", thPrice: "السعر", thStock: "المخزون", thStatus: "الحالة", thActions: "",
    searchProducts: "ابحث في المنتجات…", allCats: "كل الفئات", active: "نشط", draft: "مسودة",
    required: "مطلوب", uploadHint: "اسحب صورة هنا أو انقر للرفع", compareAt: "سعر المقارنة (اختياري)",
    statusLabel: "الحالة", totalProducts: "منتج", lowStockCount: "كمية محدودة", outCount: "غير متوفر",
    dashboard: "لوحة التحكم", inventory: "المخزون", orders: "الطلبات", customers: "العملاء", settings: "الإعدادات",
    categoriesTab: "الفئات", categoriesTitle: "إدارة الفئات", categoriesSub: "نظّم كتالوجك إلى فئات.",
    addCategory: "إضافة فئة", newCategory: "فئة جديدة", editCategory: "تعديل فئة",
    catNameEn: "الاسم (إنجليزي)", catNameAr: "الاسم (عربي)", catIconLabel: "الأيقونة", saveCategory: "حفظ الفئة",
    catSaved: "تم حفظ الفئة", catDeleted: "تم حذف الفئة", catInUse: "لا يمكن الحذف — هناك منتجات تستخدم هذه الفئة.",
    addNewCategory: "إضافة فئة جديدة", catProductsCount: "منتجات", catProductCount: "منتج", noCategories: "لا توجد فئات بعد. أضف أول فئة.",
    formIntro: "املأ التفاصيل أدناه. الحقول المعلّمة بنجمة مطلوبة.",
    skuLabel: "الرمز", richBold: "غامق", richList: "قائمة", taglineLabel: "وصف مختصر",
    layoutModal: "لوحة جانبية", layoutPage: "صفحة كاملة",
    footerTag: "حلول تقنية للجميع",
    fHardware: "الأجهزة", fSolutions: "الحلول", fCompany: "الشركة", fSupport: "الدعم",
    rights: "© 2026 ميجاتك. جميع الحقوق محفوظة.",
  },
};

function fmtMoney(amount, lang = "en") {
  const n = Math.round(amount).toLocaleString("en-US");
  return lang === "ar" ? `${n} ج.م` : `EGP ${n}`;
}

function catName(catId, lang) {
  const c = CATEGORIES.find((x) => x.id === catId);
  return c ? c[lang] : catId;
}

Object.assign(window, { CATEGORIES, PRODUCTS, STRINGS, fmtMoney, catName });
