"""Product-type knowledge: POS hardware, POS supplies, retail security, biometric/access control, power."""

POS_SOFTWARE = ("works with most Windows POS software, including M-Pesa-integrated and KRA eTIMS-ready systems")

TYPES_B = [
    # ---------------- POS hardware ----------------
    {
        "key": "pos_terminal", "cats": ["pos-systems"], "match": lambda n: "pos terminal" in n or "pos touch" in n or "inventory pos" in n or "android pos" in n,
        "label": "POS terminal",
        "what": ("A POS (point-of-sale) terminal is the computer at your till. It runs your sales software, shows "
                 "products and prices on a touchscreen, prints receipts, records M-Pesa and cash payments and keeps "
                 "your stock up to date. An all-in-one terminal combines the PC and touchscreen in one sturdy unit "
                 "designed for counters, kitchens and busy shops, with ports for a receipt printer, barcode scanner "
                 "and cash drawer."),
        "features": ["Touchscreen built for all-day counter use", "Ports for receipt printer, barcode scanner, cash drawer and customer display",
                     "Fanless or low-noise designs on many models", "Compact footprint that saves counter space",
                     "Runs Windows POS software; Android models run app-based POS"],
        "uses": ["Supermarkets, minimarts and wholesale shops", "Restaurants, cafés and bars", "Pharmacies and agrovets",
                 "Hardware, electronics and fashion stores", "Hotels' front desks and bars"],
        "choose": ["<strong>Processor:</strong> Core i3 handles a single till well; Core i5 suits busy supermarkets and back-office reporting on the same machine.",
                   "<strong>Storage:</strong> an SSD makes the POS software start and search products quickly.",
                   "<strong>Double-sided screens</strong> show the customer their items and total, improving trust and speed.",
                   "<strong>Android with built-in printer</strong> suits mobile sellers, deliveries and small kiosks.",
                   "<strong>Software:</strong> make sure your POS software supports M-Pesa reconciliation and KRA eTIMS invoicing."],
        "setup": ["Place the terminal on a stable counter near a power socket protected by a UPS.",
                  "Connect the receipt printer (USB/LAN), barcode scanner (USB) and cash drawer (RJ11 to the printer).",
                  "Install your POS software, add products and set up users and tax settings.",
                  "Test a full sale: scan, payment, receipt and drawer opening."],
        "care": ["Clean the touchscreen with a soft, dry or slightly damp cloth.", "Use a UPS to protect against power cuts during sales.",
                 "Back up your POS database daily.", "Keep liquids away from the terminal."],
        "compat": f"This terminal {POS_SOFTWARE}. We can supply and install the full set: printer, scanner, cash drawer and software.",
        "faqs": [("What do I need for a complete POS system?", "A POS terminal, receipt printer, barcode scanner, cash drawer and POS software. A UPS is strongly recommended."),
                 ("Does it work with eTIMS?", "The hardware works with any eTIMS-compliant POS software. Ask us for a recommendation."),
                 ("Do you install POS systems?", "Yes. We install and set up POS hardware and software in Nairobi and can advise on installations elsewhere.")],
    },
    {
        "key": "pos_screen", "cats": ["pos-systems"], "match": lambda n: "touchscreen screen" in n or "pole display" in n or "vfd" in n,
        "label": "POS display",
        "what": ("POS displays show information at the counter. A touchscreen monitor lets the cashier tap products "
                 "instead of using a mouse, and a customer pole display (VFD) shows the item name, price and total "
                 "to the customer, which speeds up checkout and builds trust that they're being charged correctly."),
        "features": ["Designed for counter use", "Clear, bright text visible to customers", "USB or serial connection",
                     "Supported by most retail POS software"],
        "uses": ["Supermarkets and minimarts", "Restaurants and fast food", "Pharmacies and hardware stores"],
        "choose": ["Confirm your POS software supports the display.", "Check the connection type (USB, serial/COM) matches your terminal."],
        "setup": ["Mount or place the display facing the cashier or customer.", "Connect to the POS terminal and install drivers if required.",
                  "Enable the display in your POS software settings and test a sale."],
        "care": ["Clean gently with a dry cloth.", "Route cables away from the cashier's working area."],
        "compat": f"This display {POS_SOFTWARE}.",
        "faqs": [("Why use a customer display?", "It shows customers each item and the total as you scan, reducing disputes and speeding up checkout.")],
    },
    {
        "key": "barcode_scanner", "cats": ["pos-systems"], "match": lambda n: "barcode scanner" in n or "scanners" in n or ("scanner" in n and "barcode" in n),
        "label": "barcode scanner",
        "what": ("A barcode scanner reads product barcodes and types the code into your POS or inventory software "
                 "instantly. It removes typing errors, speeds up checkout and makes stock-taking far quicker. 1D "
                 "scanners read standard product barcodes; 2D scanners also read QR codes, including those on "
                 "phones, KRA eTIMS receipts and event tickets."),
        "features": ["Plug-and-play USB: works like a keyboard, no drivers needed", "Fast, accurate reading of retail barcodes",
                     "2D models also read QR codes from paper and phone screens", "Wireless models free you from the counter for stock-taking",
                     "Hands-free/mountable models scan automatically when an item is presented"],
        "uses": ["Supermarket and shop checkout", "Pharmacy dispensing", "Warehouse receiving and stock-taking",
                 "Library and asset management", "Ticket and QR code verification"],
        "choose": ["<strong>1D or 2D:</strong> choose 2D if you need QR codes or phone screens.",
                   "<strong>Wired or wireless:</strong> wireless suits large items and stock-taking away from the counter.",
                   "<strong>Handheld or hands-free:</strong> hands-free/mountable scanners speed up busy supermarket lanes."],
        "setup": ["Plug the scanner into a USB port (or the wireless receiver).", "Open your POS or a blank Notepad and scan a barcode to test.",
                  "If needed, scan the configuration barcodes in the manual to set the suffix (Enter) or keyboard language."],
        "care": ["Keep the scan window clean.", "Use the stand to avoid drops.", "Charge wireless models daily."],
        "compat": "Works with Windows, Android (via OTG) and macOS, and with any POS, Excel or inventory software that accepts keyboard input.",
        "faqs": [("Does this scanner work with my POS software?", "Yes. It types the barcode like a keyboard, so it works with virtually all POS and inventory software."),
                 ("Can it read QR codes?", "2D scanners read QR codes; 1D scanners read standard product barcodes only.")],
    },
    {
        "key": "receipt_printer", "cats": ["pos-systems"], "match": lambda n: ("receipt printer" in n or "portable printer" in n or "epos thermal" in n) and "adapter" not in n,
        "label": "thermal receipt printer",
        "what": ("A thermal receipt printer prints receipts using heat-sensitive paper, so it needs no ink, toner or "
                 "ribbon, just paper rolls. It is fast, quiet and cheap to run. 80 mm printers are the standard for "
                 "shop and restaurant tills; 58 mm portable Bluetooth printers suit mobile sellers and handheld eTIMS "
                 "invoicing."),
        "features": ["No ink or toner: only thermal paper rolls", "Fast printing, ideal for queues",
                     "Auto-cutter on most 80 mm models", "Cash drawer port (RJ11) opens the drawer automatically on each sale",
                     "USB, LAN or Bluetooth connectivity"],
        "uses": ["Shop and supermarket receipts", "Restaurant bills and kitchen order tickets", "Pharmacy and hardware receipts",
                 "eTIMS invoice printing", "Mobile and delivery sales (portable models)"],
        "choose": ["<strong>Width:</strong> 80 mm for counter tills; 57/58 mm for portable printers.",
                   "<strong>Connection:</strong> USB for one PC; LAN to share across tills or send kitchen orders; Bluetooth for phones and tablets.",
                   "<strong>Cutter:</strong> auto-cut saves time in busy shops."],
        "setup": ["Load the paper roll with the shiny (thermal) side facing the print head.", "Connect USB/LAN/Bluetooth and install the driver.",
                  "Select the printer in your POS software and set the paper width.", "Connect the cash drawer cable to the RJ11 port if you use one."],
        "care": ["Use good-quality thermal paper to protect the print head.", "Clean the print head with alcohol occasionally.",
                 "Store paper away from heat and sunlight."],
        "compat": f"This printer {POS_SOFTWARE}, and portable models work with Android POS and eTIMS apps.",
        "faqs": [("Does a thermal printer need ink?", "No. It prints with heat on thermal paper; you only buy paper rolls."),
                 ("Which paper roll size do I need?", "80 mm for standard counter printers and 57/58 mm for portable printers. We stock both.")],
    },
    {
        "key": "barcode_printer", "cats": ["pos-systems"], "match": lambda n: "barcode printer" in n or "barcode transfer printer" in n or "xp 330" in n,
        "label": "barcode label printer",
        "what": ("A barcode label printer prints product labels, price tags, shelf labels, shipping labels and asset "
                 "tags. Direct-thermal printing needs no ribbon and is ideal for shipping and short-life labels; "
                 "thermal-transfer printing uses a ribbon for durable labels that last for years without fading."),
        "features": ["Prints barcodes, QR codes, prices and text", "Supports label widths up to about 4 inches on most desktop models",
                     "Fast printing for bulk labelling", "Works with free label design software and most inventory systems"],
        "uses": ["Product and price labels for shops", "Courier and e-commerce shipping labels (4×6)", "Warehouse bin and pallet labels",
                 "Asset tags for offices and schools", "Pharmacy and food production labels"],
        "choose": ["<strong>Direct thermal vs thermal transfer:</strong> choose thermal-transfer capable models for long-lasting labels.",
                   "<strong>Resolution:</strong> 203 dpi suits most barcodes; higher dpi prints tiny labels more sharply.",
                   "<strong>Volume:</strong> desktop printers suit shops and small warehouses; industrial printers suit factories."],
        "setup": ["Load the label roll (and ribbon for thermal transfer).", "Install the driver and calibrate the label gap sensor.",
                  "Design labels in BarTender, your POS or Excel, and print a test."],
        "care": ["Clean the print head regularly with alcohol.", "Use quality labels and ribbons sized for your printer."],
        "compat": "Works with Windows label software and most POS/inventory systems. We stock compatible labels and ribbons.",
        "faqs": [("Do I need a ribbon?", "Only for thermal-transfer printing (durable labels). Direct-thermal labels print without a ribbon."),
                 ("Can it print 4×6 courier labels?", "Yes, if the printer supports 4-inch labels, which most desktop barcode printers do.")],
    },
    {
        "key": "cash_drawer", "cats": ["pos-systems"], "match": lambda n: "cash drawer" in n,
        "label": "cash drawer",
        "what": ("An electronic cash drawer keeps your till cash organised and secure. It connects to the receipt "
                 "printer and opens automatically when a sale prints, so cash is only accessible during transactions "
                 "and every opening is linked to a sale in your POS records."),
        "features": ["Opens automatically via the receipt printer (RJ11 cable)", "Separate compartments for notes and coins",
                     "Manual key lock for security", "Heavy-duty steel construction"],
        "uses": ["Supermarkets and shops", "Restaurants and bars", "Pharmacies and hardware stores"],
        "choose": ["Check the number of note and coin compartments you need.", "Confirm your receipt printer has a cash drawer (RJ11) port."],
        "setup": ["Connect the RJ11 cable to the receipt printer's drawer port.", "Enable 'open drawer' in your POS software settings.", "Test with a sale."],
        "care": ["Don't overfill compartments.", "Keep the key secure and lock the drawer when the shop closes."],
        "compat": "Works with standard 80 mm receipt printers that have an RJ11 drawer port.",
        "faqs": [("How does the cash drawer open?", "The receipt printer sends a signal through the RJ11 cable when a sale prints. It can also be opened with the key.")],
    },
    {
        "key": "msr", "cats": ["pos-systems"], "match": lambda n: "magnetic stripe" in n or "msr" in n or "swipe reader" in n,
        "label": "magnetic stripe card reader",
        "what": ("A magnetic stripe reader (MSR) reads the data on loyalty cards, membership cards, staff ID cards and "
                 "gift cards. Reader/writer (encoder) models can also write data to blank cards, so you can create "
                 "your own loyalty, access or membership cards."),
        "features": ["Reads standard magnetic stripe cards", "USB plug-and-play on most models", "Encoder models write to blank cards"],
        "uses": ["Loyalty and membership cards", "Staff ID and canteen cards", "Hotel key cards and access systems"],
        "choose": ["Choose read-only for POS loyalty lookups; a reader/writer if you create cards yourself."],
        "setup": ["Connect via USB.", "Test by swiping a card into Notepad or your software.", "For encoders, install the writing software."],
        "care": ["Keep the read head clean.", "Store cards away from magnets."],
        "compat": "Works with Windows POS and membership software that accepts keyboard input.",
        "faqs": [("Can I create my own loyalty cards?", "Yes, with a reader/writer (encoder) and blank magnetic stripe cards, which we stock.")],
    },
    {
        "key": "power_adapter", "cats": ["pos-systems", "cables-networking", "accessories"], "match": lambda n: "adapter" in n and any(k in n for k in ["pos terminal", "thermal printer", "65w", "35w", "power adapter"]),
        "label": "power adapter",
        "what": ("A replacement power adapter brings a device back into service when the original charger is lost, "
                 "damaged or failing. Using the correct voltage, current and connector protects your device."),
        "features": ["Matched voltage and connector for the device type", "Over-current and short-circuit protection", "Durable cable and plug"],
        "uses": ["Replacing a lost or damaged charger", "A spare adapter for a second location"],
        "choose": ["Match the voltage and connector to your device's label.", "Choose equal or higher wattage/current than the original."],
        "setup": ["Check the device label for voltage and polarity.", "Connect and confirm the device powers on and charges."],
        "care": ["Avoid bending cables sharply at the plug.", "Use a surge protector."],
        "compat": "Tell us your device model and we'll confirm the right adapter before you buy.",
        "faqs": [("Will this adapter work with my device?", "Check the voltage, wattage and connector on your old adapter, or send us a photo and we'll confirm.")],
    },
    # ---------------- POS supplies ----------------
    {
        "key": "labels", "cats": ["pos-supplies"], "match": lambda n: "label" in n and "eas" not in n,
        "label": "label roll",
        "what": ("Self-adhesive labels are used for barcodes, prices, shelf tags, shipping and product information. "
                 "Direct-thermal labels print with heat (no ribbon) in barcode and shipping printers, while price "
                 "labels fit hand-held price guns. Choosing the right size and type keeps printing smooth and labels "
                 "readable."),
        "features": ["Strong permanent adhesive", "Clean white face for crisp barcodes", "Standard core sizes for desktop printers",
                     "Pre-cut with gaps for accurate printer sensing"],
        "uses": ["Product barcodes and price labels", "Courier and e-commerce shipping labels", "Shelf and bin labels",
                 "Asset tags and file labels"],
        "choose": ["<strong>Size:</strong> measure your current label (width × height in mm) or check your software's label template.",
                   "<strong>Printer type:</strong> direct-thermal labels need no ribbon; thermal-transfer labels need a ribbon.",
                   "<strong>Core size:</strong> most desktop printers take 25 mm or 40 mm cores."],
        "setup": ["Load the roll with the labels facing the print head.", "Run label calibration so the printer detects the gaps.",
                  "Set the exact label size in your label software."],
        "care": ["Store rolls in a cool, dry place away from sunlight.", "Direct-thermal labels fade over months in heat; use thermal transfer for long-life labels."],
        "compat": "Fits standard desktop barcode printers such as Xprinter, Zebra and TSC models, or price guns for price labels.",
        "faqs": [("Which label size do I need?", "Measure your existing label or check your label template. Common sizes are 40×30, 50×25, 60×40 and 100×150 mm."),
                 ("Do these labels need a ribbon?", "Direct-thermal labels don't. Thermal-transfer labels need a ribbon for durable printing.")],
    },
    {
        "key": "ribbon", "cats": ["pos-supplies"], "match": lambda n: "ribbon" in n,
        "label": "thermal transfer ribbon",
        "what": ("A thermal transfer ribbon is the 'ink' for barcode printers in thermal-transfer mode. Heat from the "
                 "print head melts ink from the ribbon onto the label. Resin ribbons produce the most durable prints, "
                 "resisting scratches, chemicals, water and heat, which makes them ideal for asset tags, outdoor "
                 "labels, pharmaceutical and industrial labels. Coloured ribbons add colour coding."),
        "features": ["Resin formulation for maximum durability", "Sharp, scannable barcodes", "Standard width and core for desktop printers"],
        "uses": ["Asset and inventory tags", "Chemical and industrial labels", "Colour-coded labels"],
        "choose": ["Match ribbon width to your label width.", "Check the core size and ink side (in/out) for your printer.",
                   "Use resin ribbons with synthetic labels for maximum durability."],
        "setup": ["Load the ribbon and take-up core as shown inside the printer.", "Switch the printer to thermal-transfer mode.", "Print a test label."],
        "care": ["Store away from heat and dust.", "Handle by the cores to avoid creasing."],
        "compat": "Fits desktop thermal-transfer barcode printers that take 110 mm ribbons with 12 mm cores.",
        "faqs": [("What's the difference between wax and resin ribbons?", "Wax is cheapest for paper labels; resin is most durable and suits synthetic labels and harsh environments.")],
    },
    {
        "key": "thermal_roll", "cats": ["pos-supplies", "pos-systems"], "match": lambda n: "thermal paper" in n or "thermal roll" in n or "receipt printer paper" in n,
        "label": "thermal paper roll",
        "what": ("Thermal paper rolls are the paper for receipt printers, card machines and portable eTIMS printers. "
                 "The paper has a heat-sensitive coating, so the printer needs no ink. Rolls must match your printer's "
                 "width (usually 80 mm or 57 mm) and roll diameter."),
        "features": ["Smooth coating for clear, dark printing", "Standard widths for POS and handheld printers", "Consistent winding for jam-free feeding"],
        "uses": ["Shop and supermarket receipts", "Restaurant bills and kitchen orders", "Card machine and eTIMS receipts", "Queue tickets"],
        "choose": ["Match the width (80 mm or 57 mm) and maximum roll diameter to your printer.", "Buy in bulk to save on busy tills."],
        "setup": ["Open the printer cover, drop in the roll with the coated side facing the print head, pull a little paper out and close."],
        "care": ["Store away from heat, sunlight and humidity.", "Receipts fade over time; scan or photocopy important ones."],
        "compat": "Fits standard 80 mm POS printers and 57/58 mm portable and card-machine printers.",
        "faqs": [("How do I know which side to load?", "The coated side faces the print head. Scratch the paper with a fingernail: the side that turns black is the coated side.")],
    },
    {
        "key": "coding_ink", "cats": ["pos-supplies"], "match": lambda n: "ink cartridge" in n,
        "label": "coding printer ink cartridge",
        "what": ("This fast-dry solvent ink cartridge is used in handheld and inline batch coding printers to print "
                 "expiry dates, batch numbers and barcodes directly onto packaging, including non-porous surfaces "
                 "like plastic, glass, metal and coated cartons."),
        "features": ["Fast-drying solvent ink", "Prints on porous and non-porous surfaces", "Sharp, durable coding"],
        "uses": ["Expiry and manufacturing dates", "Batch and lot numbers", "Barcodes and logos on packaging"],
        "choose": ["Confirm the cartridge model matches your coding printer.", "Use solvent ink for non-porous packaging."],
        "setup": ["Insert the cartridge, run a test print and adjust distance to the surface."],
        "care": ["Cap the cartridge when idle to prevent drying.", "Store upright in a cool place."],
        "compat": "Fits handheld coding printers that use this cartridge model; send us your printer model to confirm.",
        "faqs": [("Will the ink smudge on plastic?", "Solvent fast-dry ink is designed to dry quickly and adhere to plastic, glass and metal.")],
    },
    {
        "key": "tape", "cats": ["pos-supplies"], "match": lambda n: "tape" in n,
        "label": "tape",
        "what": ("Packaging and safety tapes help businesses ship, mark and protect goods. Printed fragile tape warns "
                 "couriers to handle parcels carefully, reflective chevron tape improves vehicle and hazard visibility, "
                 "and double-sided tape mounts signs, displays and labels without screws."),
        "features": ["Strong adhesive", "Clear printing or reflective finish", "Standard widths for dispensers"],
        "uses": ["Sealing cartons and parcels", "Marking fragile goods", "Vehicle and site safety marking", "Mounting signs and displays"],
        "choose": ["Choose width and length to match your dispenser and volume."],
        "setup": ["Apply to clean, dry surfaces and press firmly."],
        "care": ["Store away from heat to keep the adhesive fresh."],
        "compat": "Fits standard tape dispensers.",
        "faqs": [("Is reflective tape suitable for vehicles?", "Yes. High-visibility chevron tape is used on trucks, trailers, barriers and hazards to improve visibility at night.")],
    },
    {
        "key": "mag_cards", "cats": ["pos-supplies"], "match": lambda n: "stripe cards" in n,
        "label": "blank magnetic stripe card",
        "what": ("Blank white magnetic stripe cards are PVC cards with a magnetic stripe you can encode with an MSR "
                 "writer and print with a card printer, creating loyalty, membership, access and staff ID cards."),
        "features": ["Standard credit-card (CR80) size", "Printable white PVC surface", "Encodable magnetic stripe"],
        "uses": ["Loyalty and membership cards", "Staff and student ID", "Hotel key cards", "Canteen and access cards"],
        "choose": ["Check your card printer supports CR80 PVC cards.", "Choose the stripe coercivity your encoder supports."],
        "setup": ["Print the design with a card printer.", "Encode the stripe using an MSR writer."],
        "care": ["Keep away from magnets and phones' magnetic accessories."],
        "compat": "Works with standard ID card printers such as Evolis, and MSR605X-type encoders.",
        "faqs": [("Can I print photos on these cards?", "Yes, with an ID card printer.")],
    },
    # ---------------- Retail security ----------------
    {
        "key": "eas_tag", "cats": ["security-equipment"], "match": lambda n: "tag" in n and "detacher" not in n and "gun" not in n,
        "label": "EAS security tag",
        "what": ("EAS (electronic article surveillance) security tags protect merchandise from shoplifting. The tag "
                 "contains a small sensor that triggers an alarm if it passes through the antennas at your exit "
                 "without being removed at the till. Hard tags pin onto clothing, bottle tags lock onto spirits and "
                 "wine, and special tags secure baby formula and other high-value items."),
        "features": ["Reusable hard plastic housing", "Strong locking mechanism removed only with a detacher",
                     "Visible deterrent to would-be shoplifters", "Works with matching EAS antenna systems"],
        "uses": ["Clothing and fashion stores", "Supermarkets (spirits, baby formula, cosmetics)", "Electronics and accessory shops"],
        "choose": ["<strong>Match the technology:</strong> AM (58 kHz) tags work only with AM antennas, and RF/EM tags with their own systems.",
                   "<strong>Product type:</strong> pin tags for clothing, bottle tags for liquor, lanyard tags for bags, shoes and electronics.",
                   "<strong>Detacher:</strong> make sure your till has a compatible detacher."],
        "setup": ["Attach the tag to the item (through seams for clothing).", "Test by walking it through the antennas.", "Remove at the till with the detacher after payment."],
        "care": ["Keep tags away from the antennas when stored.", "Collect tags after each sale for reuse."],
        "compat": "Works with AM 58 kHz EAS antenna systems; confirm your system type before ordering.",
        "faqs": [("Do these tags work with my store's alarm gates?", "They work with AM 58 kHz systems. Check your antenna model or ask us."),
                 ("Are the tags reusable?", "Yes. Hard tags are removed with a detacher at the till and reused.")],
    },
    {
        "key": "eas_label", "cats": ["security-equipment"], "match": lambda n: "soft label" in n or "em strips" in n,
        "label": "EAS security label",
        "what": ("EAS soft labels and strips are thin, disposable security tags that stick onto packaging or hide "
                 "inside books. They trigger the exit alarm unless deactivated at the till. AM soft labels are used "
                 "in supermarkets; EM strips are the standard in libraries because they can be re-activated."),
        "features": ["Thin and discreet", "Low cost per item", "Deactivated at the till", "Self-adhesive"],
        "uses": ["Supermarket packaged goods, cosmetics and medicines", "Library books (EM strips)"],
        "choose": ["AM labels for AM supermarket systems; EM strips for EM library gates."],
        "setup": ["Stick the label on a flat surface or inside packaging.", "Deactivate at the till with a deactivator after payment."],
        "care": ["Store labels away from deactivators and magnets."],
        "compat": "AM labels work with AM 58 kHz systems; EM strips work with EM library systems.",
        "faqs": [("How are labels deactivated?", "At the till, the cashier passes the item over a deactivator pad, which disables the label.")],
    },
    {
        "key": "detacher", "cats": ["security-equipment"], "match": lambda n: "detacher" in n,
        "label": "security tag detacher",
        "what": ("A detacher removes EAS hard tags at the till after the customer pays. Magnetic detachers use a "
                 "strong magnet to release the tag's locking pin; electric models handle super-lock tags; handheld "
                 "models suit specialised tags such as bottle and lanyard tags."),
        "features": ["Strong magnet releases hard tags quickly", "Fixed counter-top or handheld designs",
                     "Electric models open high-security tags"],
        "uses": ["Clothing store tills", "Supermarket checkouts", "Electronics shops"],
        "choose": ["Match the detacher to your tags (standard, super-lock or specialised).", "Counter-mount for busy tills."],
        "setup": ["Fix the detacher at the till, away from the antennas.", "Place the tag dome in the cup and pull the pin out."],
        "care": ["Keep it secured to the counter so it can't be stolen.", "Keep magnetic cards and phones away."],
        "compat": "Works with standard EAS hard tags; super-tag models with super-lock tags.",
        "faqs": [("Can a detacher open any tag?", "No. Standard detachers open standard tags; super-lock tags need a stronger or electric detacher.")],
    },
    {
        "key": "deactivator", "cats": ["security-equipment"], "match": lambda n: "deactivator" in n or "demagnetizer" in n,
        "label": "EAS deactivator",
        "what": ("An EAS deactivator disables soft security labels at the till so paid items don't trigger the exit "
                 "alarm. The cashier simply passes the item over the pad as part of scanning."),
        "features": ["Fast, contactless deactivation", "Counter-mounted pad", "Audible confirmation"],
        "uses": ["Supermarket checkouts", "Pharmacies and cosmetics shops", "Libraries (EM systems)"],
        "choose": ["Match AM, RF or EM technology to your labels and antennas."],
        "setup": ["Mount the pad at the till, at a distance from the exit antennas.", "Connect power and test with a label."],
        "care": ["Keep it at least a few metres from the exit gates.", "Keep magnetic media away."],
        "compat": "Matches the same technology as your soft labels and antennas.",
        "faqs": [("Why does a paid item still trigger the alarm?", "Its label wasn't deactivated. Pass it over the deactivator pad again.")],
    },
    {
        "key": "eas_system", "cats": ["security-equipment"], "match": lambda n: "antitheft system" in n or "anti-shoplifting" in n or "security gate" in n,
        "label": "EAS anti-theft system",
        "what": ("An EAS anti-theft system is the pair of antennas (pedestals) at your entrance that sound an alarm "
                 "when an item with an active tag or label passes through. Combined with tags, labels and a "
                 "detacher/deactivator at the till, it is the most effective way to reduce shoplifting in "
                 "supermarkets, clothing stores, pharmacies and libraries."),
        "features": ["Audible and visual alarm", "Wide detection coverage between pedestals", "Works with reusable tags and disposable labels",
                     "Professional installation and tuning"],
        "uses": ["Supermarkets and minimarts", "Clothing and shoe stores", "Pharmacies and cosmetics shops", "Libraries (EM gates)"],
        "choose": ["<strong>Entrance width:</strong> determines how many pedestals you need.",
                   "<strong>Technology:</strong> AM 58 kHz is the retail standard; EM is the library standard.",
                   "<strong>Budget:</strong> include tags, labels, detacher and deactivator in your plan."],
        "setup": ["Site survey to measure entrances and check for interference.", "Install pedestals and run power and cables.",
                  "Tune the system and train staff."],
        "care": ["Keep metal displays and electronics away from the pedestals.", "Service and re-tune periodically."],
        "compat": "Works with AM (retail) or EM (library) tags and labels of the same technology.",
        "faqs": [("Do you install anti-theft systems?", "Yes, we survey, supply and install EAS systems in Nairobi and can advise for other towns."),
                 ("How many gates do I need?", "It depends on your entrance width; we'll advise after measuring.")],
    },
    {
        "key": "safe", "cats": ["security-equipment"], "match": lambda n: "safe" in n,
        "label": "safe",
        "what": ("A safe protects cash, title deeds, passports, certificates and valuables from theft and, on "
                 "fireproof models, from fire. Business owners use safes to secure daily takings before banking."),
        "features": ["Solid steel body", "Electronic keypad and/or key lock", "Bolt-down mounting holes", "Fire-resistant insulation on fireproof models"],
        "uses": ["Daily cash takings in shops and petrol stations", "Documents and certificates at home and office", "Hotel rooms and offices"],
        "choose": ["Choose fireproof for documents.", "Wall-mounted safes are easier to hide.", "Always bolt the safe down."],
        "setup": ["Choose a hidden location.", "Bolt to the floor or wall.", "Set your personal code and store the override key separately."],
        "care": ["Replace keypad batteries yearly.", "Keep the override key outside the safe."],
        "compat": "Fits homes, offices, shops and hotels.",
        "faqs": [("Is it fireproof?", "Fireproof models are insulated to protect contents in a fire; standard safes protect against theft.")],
    },
    {
        "key": "site_security", "cats": ["security-equipment"], "match": lambda n: any(k in n for k in ["boom barrier", "under vehicle", "super scanner"]),
        "label": "site security equipment",
        "what": ("Site security equipment controls and checks who and what enters your premises. Boom barriers manage "
                 "vehicle access at gates and parking, under-vehicle search mirrors let guards inspect vehicles "
                 "safely, and handheld metal detectors screen people and bags at entrances."),
        "features": ["Designed for daily use by security staff", "Durable construction for outdoor use", "Quick, simple operation"],
        "uses": ["Office parks, malls and estates", "Hotels, hospitals and schools", "Events and government buildings", "Parking lots"],
        "choose": ["Match the equipment to your gate and checkpoint layout.", "Consider access control integration for boom barriers."],
        "setup": ["Boom barriers need professional installation, power and safety loops.", "Train guards on consistent search procedures."],
        "care": ["Service moving parts regularly.", "Charge or replace batteries in handheld detectors."],
        "compat": "Boom barriers can integrate with RFID, card readers and parking systems.",
        "faqs": [("Do you install boom barriers?", "Yes. We supply and install boom barriers and can integrate access control and parking systems.")],
    },
    # ---------------- Biometric & access control ----------------
    {
        "key": "fingerprint_reader", "cats": ["biometric-time-attendance"], "match": lambda n: "hamster" in n or ("biometric" in n and "scanner" in n),
        "label": "USB fingerprint scanner",
        "what": ("A USB fingerprint scanner captures fingerprints into software on your computer. It is used for "
                 "identity verification in banks and SACCOs, KYC and member registration, government enrolment, "
                 "exam and student verification, and secure login. SecuGen Hamster scanners are widely used in "
                 "Kenya for their reliable optical sensors."),
        "features": ["High-quality optical sensor", "USB plug-in", "Works with many identity and enrolment applications via SDK",
                     "Compact, durable design for daily use"],
        "uses": ["Bank and SACCO member verification", "KYC and registration", "Exam and student identification", "Secure computer login"],
        "choose": ["Confirm your software supports the scanner model (SDK compatibility).", "New units carry full warranty; refurbished units cost less."],
        "setup": ["Install the driver.", "Connect via USB and test in your application.", "Enrol fingers following the software prompts."],
        "care": ["Clean the sensor with a soft, dry cloth.", "Avoid scratching the glass."],
        "compat": "Works on Windows with software that supports SecuGen devices; check with your software provider.",
        "faqs": [("Will this scanner work with my software?", "If your software supports SecuGen devices, yes. Ask your vendor or share the software name with us.")],
    },
    {
        "key": "attendance", "cats": ["biometric-time-attendance"], "match": lambda n: "time attendance" in n or "access control terminal" in n or "attendance" in n,
        "label": "biometric time attendance terminal",
        "what": ("A biometric time attendance terminal records when each employee clocks in and out using their "
                 "fingerprint, face or card. Because it identifies the person, no one can sign in for a colleague "
                 "('buddy punching'). Access-control models also open the door for authorised staff. Reports export "
                 "to Excel or payroll software."),
        "features": ["Fingerprint, face, card and/or PIN identification", "Stores thousands of users and records",
                     "TCP/IP network and USB export", "Access-control relay to operate a door lock on access models"],
        "uses": ["Offices, factories and farms", "Schools and hospitals", "Security companies and construction sites", "Door access for server rooms and offices"],
        "choose": ["<strong>Face vs fingerprint:</strong> face is faster and contactless; fingerprint is lower cost.",
                   "<strong>Network:</strong> TCP/IP lets HR pull reports remotely; USB suits single sites.",
                   "<strong>Access control:</strong> choose a model with a lock relay if it will open a door."],
        "setup": ["Mount at shoulder height near the entrance, away from direct sunlight.", "Connect power and network.",
                  "Enrol staff and set shifts in the attendance software.", "Export monthly reports for payroll."],
        "care": ["Clean the sensor/camera regularly.", "Back up attendance data monthly.", "Use a small UPS to protect against outages."],
        "compat": "Works with ZKTeco software and exports to Excel for most payroll systems.",
        "faqs": [("Can attendance data go to payroll?", "Yes. Export to Excel and import into your payroll system."),
                 ("Do you install attendance systems?", "Yes, including door locks and access control wiring.")],
    },
    {
        "key": "hotel_lock", "cats": ["biometric-time-attendance"], "match": lambda n: "hotel" in n,
        "label": "hotel locking system component",
        "what": ("Hotel locking systems let guests open their rooms with key cards issued at reception. The card "
                 "encoder writes room access and check-out time to each card, smart locks read the card, and energy "
                 "saving switches turn room power on only when a card is inserted, cutting electricity costs."),
        "features": ["RFID card access", "Check-in/check-out time control on each card", "Audit trail of door openings",
                     "Energy saving: power only when the room is occupied"],
        "uses": ["Hotels, lodges and guest houses", "Serviced apartments and hostels"],
        "choose": ["Choose locks, encoder and switches from the same system so cards work across all of them.",
                   "Count rooms and staff cards when planning."],
        "setup": ["Install locks on room doors.", "Set up the encoder and software at reception.", "Program staff master cards and test each room."],
        "care": ["Replace lock batteries on schedule.", "Keep spare cards encoded and secure."],
        "compat": "Works as a matched system with compatible RFID cards and hotel software.",
        "faqs": [("How does the energy saving switch work?", "Power in the room only switches on when a card is inserted, so lights and AC go off when guests leave.")],
    },
    {
        "key": "door_hw", "cats": ["biometric-time-attendance"], "match": lambda n: any(k in n for k in ["maglock", "push to exit", "door closure", "door closer"]),
        "label": "access control door hardware",
        "what": ("Access control door hardware completes a secure door: a magnetic lock (maglock) holds the door shut, "
                 "a push-to-exit button lets people leave, and a door closer makes sure the door shuts and locks "
                 "behind every user. Combined with a biometric or card reader, it controls who can enter."),
        "features": ["Electromagnetic holding force for secure doors", "12V operation compatible with access controllers",
                     "Fail-safe operation: unlocks on power loss for fire safety", "Durable for high-traffic doors"],
        "uses": ["Office entrances and server rooms", "Schools and hospitals", "Apartment and estate gates"],
        "choose": ["Choose holding force for your door type.", "Plan power supply and backup battery.", "Use a door closer for reliable locking."],
        "setup": ["Mount the lock on the frame and plate on the door.", "Wire to the access controller and exit button.", "Test fail-safe release."],
        "care": ["Keep the magnet and plate surfaces clean.", "Check the door closer's speed and adjust as needed."],
        "compat": "Works with ZKTeco and most 12V access control terminals.",
        "faqs": [("What happens in a power cut?", "Maglocks are fail-safe: they release when power is lost. Add a backup battery to keep doors secure during outages.")],
    },
    # ---------------- Power ----------------
    {
        "key": "ups", "cats": ["ups-power"], "match": lambda n: "ups" in n,
        "label": "UPS (uninterruptible power supply)",
        "what": ("A UPS keeps your computer or equipment running on battery for several minutes when the power goes "
                 "off, giving you time to save work and shut down safely. It also smooths voltage spikes and dips "
                 "with automatic voltage regulation (AVR), which protects equipment from the power surges common "
                 "in Kenya after outages."),
        "features": ["Battery backup during outages", "Automatic voltage regulation (AVR)", "Surge protection on outlets",
                     "Audible alarm when on battery"],
        "uses": ["Desktop computers and monitors", "POS terminals and receipt printers", "Routers, CCTV DVRs and small servers",
                 "Biometric and access control systems"],
        "choose": ["<strong>Size:</strong> 650VA for one PC and monitor; 850–1100VA for a PC plus router or printer; 1500VA+ for several devices or a small server.",
                   "<strong>Laser printers:</strong> don't connect them to a small UPS; their heating element draws too much power.",
                   "<strong>Backup time:</strong> bigger VA ratings give longer runtime at the same load."],
        "setup": ["Charge the UPS for 8 hours before first use.", "Plug equipment into the battery-backed outlets.",
                  "Test by switching off mains power and confirming devices stay on."],
        "care": ["Keep in a cool, ventilated place.", "Replace the battery every 2–3 years or when runtime drops.",
                 "Don't overload: check the total wattage of your devices."],
        "compat": "Works with computers, POS, routers, CCTV and other electronics within its rated capacity.",
        "faqs": [("How long will a UPS keep my computer on?", "Typically 5–15 minutes for one desktop on a 650–1100VA UPS, enough to save work and shut down."),
                 ("Can I connect a laser printer?", "Not to a small UPS. Laser printers draw high power when heating; plug them into a surge protector instead.")],
    },
    {
        "key": "extension", "cats": ["ups-power"], "match": lambda n: "extension" in n,
        "label": "power extension",
        "what": ("A power extension (multi-plug) gives you extra sockets with a long cable, so you can power several "
                 "devices from one wall socket safely. Quality extensions use proper copper wiring and switches to "
                 "handle everyday office and home loads without overheating."),
        "features": ["Multiple UK-type sockets", "Long cable for flexible placement", "Switched sockets on many models", "Durable housing"],
        "uses": ["Office desks with PC, monitor and phone charger", "Home entertainment setups", "Shops and salons"],
        "choose": ["Choose the number of ways you need, plus one spare.", "Don't connect high-power appliances such as heaters or kettles to the same extension as computers."],
        "setup": ["Plug into a wall socket and route the cable away from walkways."],
        "care": ["Don't daisy-chain extensions.", "Replace if the plug or sockets become loose or discoloured."],
        "compat": "Fits standard Kenyan (UK-type, 3-pin) plugs.",
        "faqs": [("How many devices can I connect?", "As many as there are sockets, as long as the total load stays within the extension's rating (usually 13A).")],
    },
    {
        "key": "power_cable", "cats": ["ups-power"], "match": lambda n: "power cable" in n,
        "label": "computer power cable",
        "what": ("A computer power cable (kettle/C13 cable) connects desktops, monitors, printers and UPS units to the "
                 "wall socket. A good cable with proper copper conductors and a fused plug keeps your equipment safe."),
        "features": ["Standard C13 connector", "UK-type 3-pin fused plug", "Fits desktops, monitors, printers and more"],
        "uses": ["Replacing lost or damaged cables", "Spare cables for offices and cyber cafés"],
        "choose": ["Check the connector on your device (most desktops and monitors use C13)."],
        "setup": ["Plug into the device and the wall or UPS."],
        "care": ["Avoid sharp bends and crushing under furniture."],
        "compat": "Fits most desktop PCs, monitors, printers and UPS units.",
        "faqs": [("Will this fit my monitor?", "If your monitor has the standard three-pin 'kettle' socket, yes.")],
    },
]
