<?php
  /**
   * Rig N Dig - Product Seeder
   * Visit this page in your browser to insert all 120 products.
   * Safe to run multiple times (INSERT IGNORE).
   * DELETE this file after seeding is complete.
   */

  $adminTitle = 'Product Seeder';
  require_once __DIR__ . '/includes/header.php';

  if ($_SESSION['admin_role'] !== 'super_admin') {
      echo '<div class="bg-red-900 border border-red-600 text-red-200 rounded p-4">Access denied. Super Admin only.</div>';
      include __DIR__ . '/includes/footer.php';
      exit;
  }

  $result = null;
  $mapResult = null;

  if ($_SERVER['REQUEST_METHOD'] === 'POST') {
      if (($_POST['confirm'] ?? '') === 'yes') {
      $sql = <<<'RNDISQL'
  -- =====================================================
  -- Rig N Dig — Product Seed Data
  -- Run this in phpMyAdmin > SQL tab
  -- Adds 15+ products per category (8 categories)
  -- Safe to run multiple times (INSERT IGNORE)
  -- =====================================================

  -- ─── PRE-SEED NEW CATEGORIES ─────────────────────────────────────────
  INSERT IGNORE INTO `categories` (`id`, `name`, `slug`, `description`, `icon`, `sort_order`, `image`) VALUES
  (9, 'Asphalt Plant Works & Components', 'asphalt-plant-works', 'Asphalt mixing plants, drying drums, burners, HFO systems, and modular components', '🏭', 9, 'categories/cat-asphalt-plant.png'),
  (10, 'Batching Plants & Components', 'batching-plants', 'Concrete batching plants, twin-shaft mixers, cement silos, weighing bins, and controls', '🏗️', 10, 'categories/cat-batching-plants.png');

  -- ─── CATEGORY 1: API Standard Flanges (cat_id=1) ───────────────────
  -- (2 already exist: api6a-weld-neck-flange-3000psi, blind-flange-asme-b165-cl150)

  INSERT IGNORE INTO `products` (`category_id`,`name`,`slug`,`sku`,`short_description`,`description`,`specifications`,`standards`,`brand`,`origin`,`stock_status`,`is_featured`,`is_active`) VALUES

  (1,'Slip-On Flange ASME B16.5 Class 150','slip-on-flange-b165-cl150','FLG-SO-150-003',
  'Raised face slip-on flange Class 150, carbon steel A105, sizes 1/2" to 24"',
  'Forged carbon steel slip-on flange manufactured to ASME B16.5 Class 150 specifications. Features raised face finish. Available in 1/2" to 24" nominal pipe size. Suitable for low-pressure general service applications.',
  'Material: ASTM A105
Face Type: Raised Face (RF)
Pressure Class: 150#
Size Range: 1/2" to 24" NPS
Finish: 125-250 AARH
Face OD: Per ASME B16.5',
  'ASME B16.5','Premium Grade','Pakistan',
  'in_stock',0,1),

  (1,'Socket Weld Flange Class 3000 ASME B16.11','socket-weld-flange-cl3000','FLG-SW-3000-004',
  'Forged socket weld flanges Class 3000, available 1/4" to 2", carbon steel',
  'High-pressure socket weld flanges for small bore piping. Manufactured from ASTM A105N forged carbon steel. Ideal for instrument connections, hydraulic lines, and high-pressure process piping systems.',
  'Material: ASTM A105N
Class: 3000#
Size Range: 1/4" to 2" NPS
Bore Tolerance: +0.000/-0.002 in
Face: Raised Face
Heat Treatment: Normalized',
  'ASME B16.11, ASME B16.5','Premium Grade','Pakistan',
  'in_stock',0,1),

  (1,'Threaded Flange ASME B16.5 Class 300','threaded-flange-b165-cl300','FLG-TH-300-005',
  'NPT threaded flanges Class 300, carbon steel A105, 1/2" to 6" NPS',
  'Raised face threaded flanges for screwed pipe connections. Full NPT threading per ASME B1.20.1. Used extensively in oil & gas, petrochemical, and water treatment plants. Quick installation without welding.',
  'Material: ASTM A105
Thread: ASME B1.20.1 NPT
Face: Raised Face
Class: 300#
Size Range: 1/2" to 6" NPS
Bolt Circle: Per ASME B16.5',
  'ASME B16.5, ASME B1.20.1','Premium Grade','Pakistan',
  'in_stock',0,1),

  (1,'Lap Joint Flange ASME B16.5 Class 150','lap-joint-flange-cl150','FLG-LJ-150-006',
  'Lap joint (Van Stone) flange Class 150 for use with stub ends, carbon steel',
  'Used with stub end fittings for pipe systems requiring frequent dismantling. Rotates freely around pipe for easy bolt-hole alignment. Economical solution for expensive alloy pipe systems.',
  'Material: ASTM A105
Class: 150#
Face: Flat (mates with stub end)
Size Range: 1/2" to 24"
ID: Matches matching stub end
Finish: 125-250 AARH',
  'ASME B16.5','Premium Grade','Pakistan',
  'in_stock',0,1),

  (1,'API 6A Companion Flange 5000 PSI','api6a-companion-flange-5000psi','FLG-CP-5000-007',
  'API 6A companion flange 5000 PSI, Type 6BX, for wellhead and BOP connections',
  'High-pressure companion flange for wellhead equipment and blowout preventer stacks. Ring type joint face. Manufactured and tested per API Specification 6A. Material traceability documentation included.',
  'Material: AISI 4130 / F22
Working Pressure: 5000 PSI
Type: 6BX (RTJ Face)
PSL: PSL-2
Size Range: 2-1/16" to 13-5/8"
Temp Rating: L-U (-50 to 250°F)',
  'API 6A, API 16A','API Grade','Imported',
  'on_order',1,1),

  (1,'Long Weld Neck Flange (Nozzle Flange)','long-weld-neck-nozzle-flange','FLG-LWN-001-008',
  'Long weld neck (LWN) nozzle flange, pressure vessel nozzle application, ASME B16.5',
  'Long weld neck flanges used as pressure vessel nozzles where smooth bore is required. The extended neck serves as a flow conduit. Manufactured to ASME Section VIII requirements.',
  'Material: ASTM A105 / SA105N
Class: 150# to 2500#
End Connection: Butt weld
Bore: Matching pipe schedule
Length: Custom cut to order
Inspection: 100% UT required',
  'ASME B16.5, ASME VIII Div.1','Premium Grade','Imported',
  'on_order',0,1),

  (1,'ASME B16.47 Series A Large Bore Flange Class 150','large-bore-flange-b1647-serA','FLG-LB-150-009',
  'Large bore flanges ASME B16.47 Series A Class 150, sizes 26" to 60"',
  'Large diameter flanges for pipeline and refinery applications where ASME B16.5 coverage ends (above 24" NPS). Full material certification and dimensional inspection reports supplied.',
  'Material: ASTM A105 / A694 F52
Standard: ASME B16.47 Series A
Class: 150# to 600#
Size Range: 26" to 60" NPS
Face: RF or RTJ
Markings: Per MSS SP-25',
  'ASME B16.47 Series A','Premium Grade','Imported',
  'on_order',0,1),

  (1,'Orifice Flange Pair with Jack Screws','orifice-flange-pair','FLG-OR-300-010',
  'Orifice flange pair Class 300 RF with tapped holes and jack screws for flow measurement',
  'Matched pair orifice flanges for differential pressure flow measurement. Supplied with jack screws, NPT tapped pressure taps (radial or corner), and alignment pins. Complies with AGA-3 / ISO 5167.',
  'Material: ASTM A105
Class: 300# (also 600# & 900# available)
Taps: 1/2" NPT tapped corner taps
Face: Raised Face
Surface Finish: 32-63 µin Ra at bore
Jack Screws: Included',
  'ASME B16.36, AGA-3, ISO 5167','Premium Grade','Pakistan',
  'in_stock',0,1),

  (1,'Spectacle Blind Flange Class 150','spectacle-blind-flange-cl150','FLG-SP-150-011',
  'Spectacle blind (figure-8 blank) Class 150, 2" to 16", full flow and isolation in one piece',
  'Combination spade and spacer (spectacle blind) allows in-line isolation or full flow by 180° rotation. Eliminates need for two separate blinds. Commonly used for plant shutdowns and maintenance isolation.',
  'Material: ASTM A516 Gr.70
Class: 150# to 600#
Size Range: 2" to 16" NPS
Face: Raised Face both sides
Thickness: Per ASME B16.48
HandleWidth: As standard',
  'ASME B16.48','Premium Grade','Pakistan',
  'in_stock',0,1),

  (1,'API 6A Tubing Head Spool Adapter Flange','api6a-tubing-head-flange','FLG-TH-API6A-012',
  'API 6A tubing head spool flange for wellhead assembly, 5000 PSI & 10000 PSI',
  'Tubing head spool adapter flange for wellhead construction. Integral flanges machined from single forging for maximum pressure integrity. Full material certification per API Specification 6A PSL-2.',
  'Material: AISI 4130 / Alloy Steel
WP Rating: 5000 or 10000 PSI
API Type: 6BX RTJ both ends
Bore: Matched to tubing size
PSL: PSL-2
Material Test: Full NACE MR0175',
  'API 6A','API Grade','Imported',
  'on_order',1,1),

  (1,'Reducing Flange ASME B16.5 Class 150','reducing-flange-b165-cl150','FLG-RD-150-013',
  'Concentric reducing flanges Class 150, e.g. 6" x 4", carbon steel, RF face',
  'Reducing flanges allow pipe size changes at flange connections without a separate reducer fitting. One flange with two different bore diameters. Available in all standard reducing combinations per ASME B16.5.',
  'Material: ASTM A105
Class: 150# to 1500#
Face: Raised Face
Combinations: e.g. 6"x4", 8"x6", 10"x8"
Bore: Machine to matching bore
Finish: 125-250 AARH',
  'ASME B16.5','Premium Grade','Pakistan',
  'in_stock',0,1),

  (1,'Plate Flange (Flat Face) Class 150','plate-flange-flat-face-cl150','FLG-PL-150-014',
  'Plate (flat face) flanges Class 150, mild steel IS:2062, for non-critical service',
  'Cost-effective plate flanges for low-pressure, non-critical service like water supply, HVAC, and general utility. Flat face design. Cut from plate then drilled. Not recommended for ASME B16.5 Class 150 or higher pressure service per code.',
  'Material: IS:2062 MS / ASTM A36
Face: Flat Face (FF)
Class: PN 10 / PN 16
Size Range: 1/2" to 48"
Drilling: BS4504 / DIN 2501
Finish: Mill Finish or Painted',
  'BS 4504, DIN 2501','Standard Grade','Pakistan',
  'in_stock',0,1),

  (1,'Weld Neck Flange Class 900 ASME B16.5','weld-neck-flange-cl900','FLG-WN-900-015',
  'Forged weld neck flange Class 900 raised face, 2" to 12", ASTM A105',
  'High-pressure weld neck flange for demanding process applications. Tapered hub transfers stress from flange to pipe. Used in hydrogen service, steam, and high-temperature applications.',
  'Material: ASTM A105 / A182 F11
Class: 900#
Face: Raised Face
Size Range: 1/2" to 12" NPS
Schedule: Sch 80 / Sch 160 bore
Heat Number: Full traceability',
  'ASME B16.5','Premium Grade','Imported',
  'in_stock',1,1);

  -- ─── CATEGORY 2: Pipes & Fittings (cat_id=2) ────────────────────────
  -- (1 already exists: api5l-seamless-pipe-grade-b)

  INSERT IGNORE INTO `products` (`category_id`,`name`,`slug`,`sku`,`short_description`,`description`,`specifications`,`standards`,`brand`,`origin`,`stock_status`,`is_featured`,`is_active`) VALUES

  (2,'ASTM A106 Grade B Seamless Pipe','astm-a106-grb-seamless-pipe','PPE-SML-A106-002',
  'ASTM A106 Gr.B seamless carbon steel pipe, high-temperature service, 1/4" to 24"',
  'Seamless carbon steel pipe for high-temperature fluid service in refineries, petrochemical plants, and power generation. Available in schedule 40, 80, 160, and XXS. Full MTR (Mill Test Report) with each lot.',
  'Material: ASTM A106 Grade B
OD Range: 1/4" to 24" NPS
Schedule: 40 / 80 / 160 / XXS
Heat Treatment: Normalized
Max Temp: 427°C (800°F)
NDE: Hydrostatic test each length',
  'ASTM A106, ASME B36.10','Premium Grade','Imported',
  'in_stock',1,1),

  (2,'API 5L ERW Pipe Grade X42','api5l-erw-pipe-x42','PPE-ERW-X42-003',
  'API 5L ERW pipe Grade X42, electric resistance welded, 2" to 12", for natural gas & oil lines',
  'Electric resistance welded pipe for oil, gas, and water transmission pipelines. API 5L PSL-1 & PSL-2 available. X42 minimum yield strength. Coating options available: FBE, 3LPE, black paint.',
  'Grade: API 5L X42
Type: ERW (Electric Resistance Welded)
OD Range: 2" to 12"
Wall Thickness: Per API 5L Table
End Prep: Beveled to 30° ± 2.5°
PSL: PSL-1 and PSL-2',
  'API 5L, ISO 3183','Premium Grade','Imported',
  'in_stock',0,1),

  (2,'90° Long Radius Elbow ASME B16.9 Sch 40','lr-elbow-90deg-b169-sch40','FTG-EL90-LR-004',
  'Butt weld 90° LR elbow ASME B16.9, carbon steel ASTM A234 WPB, 1/2" to 24"',
  'Long radius 90° butt welding elbow for smooth directional change in piping. R = 1.5D. Manufactured from seamless or welded pipe. Heat number and material grade stamped on each fitting.',
  'Material: ASTM A234 WPB
Radius: 1.5D (Long Radius)
Size Range: 1/2" to 24" NPS
Schedule: Sch 40 / Sch 80
Wall: Min 87.5% of matching pipe
End Finish: Bevel 30° ± 2.5°',
  'ASME B16.9, MSS SP-75','Premium Grade','Pakistan',
  'in_stock',0,1),

  (2,'90° Short Radius Elbow ASME B16.9','sr-elbow-90deg-b169','FTG-EL90-SR-005',
  'Short radius 90° butt weld elbow, R=1D, carbon steel, tight-space applications',
  'Short radius elbows where installation space is limited. R = 1.0D. Suitable for steam, water, oil, and gas service in confined spaces. Not recommended for abrasive slurry service.',
  'Material: ASTM A234 WPB
Radius: 1D (Short Radius)
Size Range: 1/2" to 24" NPS
Schedule: Std / Sch 80
End Prep: Beveled
Application: Tight space piping',
  'ASME B16.9','Premium Grade','Pakistan',
  'in_stock',0,1),

  (2,'45° Long Radius Elbow ASME B16.9','lr-elbow-45deg-b169','FTG-EL45-LR-006',
  '45° LR butt weld elbow carbon steel ASTM A234 WPB, for gradual directional change',
  'Long radius 45° elbows for gradual directional changes. Lower pressure drop compared to 90° elbows. Commonly used in process piping, steam lines, and utility systems.',
  'Material: ASTM A234 WPB
Angle: 45°
Radius: 1.5D
Size Range: 1/2" to 24"
Schedule: Std / 80
Certification: MTR supplied',
  'ASME B16.9','Premium Grade','Pakistan',
  'in_stock',0,1),

  (2,'Equal Tee ASME B16.9 Butt Weld','equal-tee-b169-butt-weld','FTG-TEE-EQ-007',
  'Straight / equal tee butt weld ASME B16.9, carbon steel A234 WPB, all sizes',
  'Equal (straight) tee fitting for creating branch connections in piping systems. All three run sizes equal. Used in process piping, water distribution, and utility systems. Full penetration weld on outlet.',
  'Material: ASTM A234 WPB
Type: Equal (Straight) Tee
Size Range: 1/2" to 24" NPS
Schedule: Std / Sch 80 / 160
Weld End: Beveled 30°
Test: Hydrostatic per ASME B16.9',
  'ASME B16.9','Premium Grade','Pakistan',
  'in_stock',0,1),

  (2,'Reducing Tee ASME B16.9','reducing-tee-b169','FTG-TEE-RD-008',
  'Reducing tee (unequal branch) butt weld, e.g. 6"x6"x4", carbon steel',
  'Reducing tee with smaller branch outlet for piping takeoffs. Available in all standard reducing combinations per ASME B16.9. Run and branch pipe wall thickness maintained at minimum 87.5%.',
  'Material: ASTM A234 WPB
Type: Reducing Tee
Combinations: All standard sizes
Size Range: Run 1" to 24"
Schedule: Std, Sch 80, 160
Markings: Size x Size x Branch',
  'ASME B16.9','Premium Grade','Pakistan',
  'in_stock',0,1),

  (2,'Concentric Reducer ASME B16.9','concentric-reducer-b169','FTG-RDC-CON-009',
  'Concentric reducer butt weld ASME B16.9, for gas and vertical pipe applications',
  'Concentric (coaxial) reducer for reducing pipe bore size. Both ends share the same centerline. Used in vertical piping and gas service where liquid pooling is not a concern. All standard combinations stocked.',
  'Material: ASTM A234 WPB
Type: Concentric Reducer
Size Range: 3/4"x1/2" to 24"x20"
Schedule: Std / Sch 80
Length: Per ASME B16.9 Table
End Prep: Beveled on both ends',
  'ASME B16.9','Premium Grade','Pakistan',
  'in_stock',0,1),

  (2,'Eccentric Reducer ASME B16.9','eccentric-reducer-b169','FTG-RDC-ECC-010',
  'Eccentric reducer butt weld ASME B16.9, flat bottom for pumps and liquid service',
  'Eccentric reducer with one flat side for pump suction lines to prevent air pockets and ensure full bore flow. Flat on bottom (FOB) configuration standard. Essential for proper NPSH in pump installations.',
  'Material: ASTM A234 WPB
Type: Eccentric Reducer
Flat: Flat On Bottom (FOB) standard
Size Range: 3/4"x1/2" to 24"x20"
Schedule: Std / Sch 80
Use: Pump suction lines',
  'ASME B16.9','Premium Grade','Pakistan',
  'in_stock',0,1),

  (2,'Pipe Cap ASME B16.9 Carbon Steel','pipe-cap-b169-cs','FTG-CAP-CS-011',
  'Butt weld pipe cap ASME B16.9 for line termination, all pipe sizes and schedules',
  'Domed end caps for permanently sealing pipe ends in piping systems. Ellipsoidal shape provides optimum pressure containment. Used for hydrostatic testing, line blinding, and permanent termination.',
  'Material: ASTM A234 WPB
Shape: Ellipsoidal (2:1)
Size Range: 1/2" to 24" NPS
Schedule: Std / Sch 80 / 160
Weld End: Beveled 30°
Test: 100% Visual and dimensional',
  'ASME B16.9','Premium Grade','Pakistan',
  'in_stock',0,1),

  (2,'Stub End / Lap Joint ASME B16.9','stub-end-lap-joint-b169','FTG-STB-CS-012',
  'Short and long pattern stub ends ASME B16.9 for use with lap joint flanges',
  'Stub ends (also called lap joint fittings) used with lap joint flanges in systems requiring rotation for easy alignment or frequent dismantling. Available in short (Type A) and long (Type B) patterns.',
  'Material: ASTM A234 WPB
Type: Short (Type A) & Long (Type B)
Size Range: 1/2" to 24"
Schedule: Std / Sch 80
Face Finish: 125-250 AARH
Face OD: Per matching flange',
  'ASME B16.9','Premium Grade','Pakistan',
  'in_stock',0,1),

  (2,'Pipe Cross Fitting ASME B16.9','pipe-cross-fitting-b169','FTG-CRS-EQ-013',
  'Equal cross butt weld fitting ASME B16.9, four-way branch connection',
  'Four-way cross fitting for creating two perpendicular branch connections from a single fitting. High-pressure cross fittings also available in Class 3000 socket weld per ASME B16.11.',
  'Material: ASTM A234 WPB
Type: Equal Cross (4-way)
Size Range: 1/2" to 12" NPS
Schedule: Std / Sch 80
Also available: SW Class 3000 & 6000
End Prep: Beveled 30°',
  'ASME B16.9, ASME B16.11','Premium Grade','Pakistan',
  'in_stock',0,1),

  (2,'ASTM A53 Grade B ERW Black Steel Pipe','astm-a53-grb-erw-pipe','PPE-ERW-A53-014',
  'ASTM A53 Gr.B ERW black steel pipe, general purpose, 1/2" to 26" diameter',
  'General service welded and seamless steel pipe for mechanical and low-pressure fluid service. Black finish (bare steel). Type E (ERW) and Type S (seamless) available. Used in construction, HVAC, and general utilities.',
  'Grade: ASTM A53 Grade B
Type: E (ERW) or S (Seamless)
OD Range: 1/2" to 26"
Schedule: Std, Sch 40, Sch 80
Finish: Black (bare steel)
Max Working Pressure: Per schedule',
  'ASTM A53, ASME B36.10','Standard Grade','Pakistan',
  'in_stock',0,1),

  (2,'Galvanized Steel Pipe ASTM A53','galvanized-steel-pipe-a53','PPE-GALV-A53-015',
  'Hot dip galvanized steel pipe ASTM A53, for water, fire fighting, and utility systems',
  'Hot-dip galvanized inside and outside for corrosion protection in water supply, fire fighting, and general utility service. Threading available in BSP or NPT. Grooved and plain ends also available.',
  'Grade: ASTM A53 Gr.A or B
Finish: Hot-dip galvanized (HDG)
OD Range: 1/2" to 8" NPS
Schedule: Std / Sch 40
Thread: BSP or NPT (on request)
Coating: Min. 600 g/m² zinc',
  'ASTM A53, BS 1387','Standard Grade','Pakistan',
  'in_stock',0,1);

  -- ─── CATEGORY 3: Valves (cat_id=3) ──────────────────────────────────
  -- (2 already exist: gate-valve-api600-class150, ball-valve-api6d-full-bore)

  INSERT IGNORE INTO `products` (`category_id`,`name`,`slug`,`sku`,`short_description`,`description`,`specifications`,`standards`,`brand`,`origin`,`stock_status`,`is_featured`,`is_active`) VALUES

  (3,'Globe Valve API 623 Class 150 Carbon Steel','globe-valve-api623-cl150','VLV-GL-623-003',
  'Globe valve API 623 Class 150, rising stem, bolted bonnet, carbon steel trim',
  'Globe valves for throttling and flow regulation in steam, water, oil, and gas service. Rising stem design provides visual position indication. Renewable disc and seat ring. Multiple trim options available.',
  'Body: ASTM A216 WCB
Trim: API Trim #8 (13Cr)
Class: 150# to 600#
Actuation: Manual handwheel / optional actuator
Bonnet: Bolted
Packing: Graphite flexible',
  'API 623, ASME B16.34, API 598','ProFlow','Imported',
  'in_stock',0,1),

  (3,'Swing Check Valve API 594 Class 150','swing-check-valve-api594','VLV-CHK-SW-004',
  'Wafer/lugged swing check valve API 594, Class 150 to 600, carbon steel, 2" to 24"',
  'Swing check valve for preventing backflow in piping systems. Wafer (lug) body fits between two flanges. Gravity-operated disc. Suitable for horizontal and vertical (upward flow) installation.',
  'Body: ASTM A216 WCB
Disc: A216 WCB with 13Cr hard-facing
Body Style: Wafer / Lugged
Class: 150# to 600#
Size: 2" to 24"
Cracking Pressure: <0.05 bar',
  'API 594, API 598','ProFlow','Imported',
  'in_stock',0,1),

  (3,'Butterfly Valve Double Eccentric API 609','butterfly-valve-api609-double-ecc','VLV-BFY-DE-005',
  'High-performance double eccentric butterfly valve API 609, 3" to 48", lug or wafer',
  'Double offset (double eccentric) butterfly valve for bi-directional shutoff and throttling. Metal or soft seat. Lug, wafer, or flanged body style. Suitable for oil, gas, steam, and chemical service.',
  'Body: Carbon Steel / Ductile Iron
Disc: 316 SS / Duplex SS
Seat: Metal (13Cr) or EPDM/Viton
Size Range: 3" to 48"
Class: 150# to 300#
Actuation: Manual lever / Gear / Pneumatic',
  'API 609, EN 593','ProFlow','Imported',
  'in_stock',0,1),

  (3,'Plug Valve API 599 Lubricated Sleeved','plug-valve-api599','VLV-PLG-599-006',
  'API 599 lubricated plug valve, Class 150 to 600, 1/2" to 12", for sour gas service',
  'Lubricated plug valve with injection fitting for continuous lubrication under pressure. Metal-to-metal seating. Ideal for gas distribution, crude oil, and sour service (NACE). Fire safe per API 607.',
  'Body: ASTM A216 WCB / LCC
Plug: Chrome-plated carbon steel
Class: 150# to 600#
Size Range: 1/2" to 12"
Sour Service: NACE MR0175 compliant
Fire Safe: API 607',
  'API 599, API 607','ProFlow','Imported',
  'on_order',0,1),

  (3,'Pressure Safety Relief Valve API 526','safety-relief-valve-api526','VLV-SRV-526-007',
  'Spring-loaded pressure safety relief valve API 526, flanged inlet/outlet, set pressure 5-300 bar',
  'Full lift spring-operated safety relief valve for overpressure protection of vessels, heat exchangers, and piping. Flanged connections per ASME B16.5. Certified by SIL-rated manufacturer. Available with open or closed bonnet.',
  'Body: Carbon Steel / SS316
Orifice: D through T (API 526)
Set Pressure Range: 5 to 300 bar
Inlet/Outlet: ANSI 150# to 600#
Back Pressure: Conventional or bellows balanced
Certification: NB stamped (PED / CE)',
  'API 526, API 520, ASME PTC 25','FlowSafe','Imported',
  'on_order',1,1),

  (3,'Ball Valve Reduced Bore Class 800 Screwed','ball-valve-rb-cl800-screwed','VLV-BL-800-SW-008',
  'Class 800 screwed end 2-piece ball valve, reduced bore, carbon steel, 1/4" to 2"',
  'Two-piece body screwed end ball valve for instrument and small-bore process connections. Reduced bore, floating ball. Full PTFE seat package. Lockable lever handle. Low operating torque.',
  'Body: ASTM A105 Forged Steel
Ball: 316 SS chrome-plated
Seats/Seals: PTFE/PTFE
Class: 800#
Size Range: 1/4" to 2"
End Connection: NPT / BSP screwed',
  'ASME B16.34, API 608','ProFlow','Imported',
  'in_stock',0,1),

  (3,'Gate Valve Class 800 Socket Weld Forged','gate-valve-cl800-sw-forged','VLV-GT-800-SW-009',
  'Forged gate valve Class 800 socket weld, OS&Y rising stem, 1/2" to 2"',
  'High-pressure forged gate valve for small-bore high-pressure piping. Outside screw and yoke (OS&Y) with rising stem. Full bore. Backseat for stem packing replacement under pressure.',
  'Body: ASTM A105N Forged Carbon Steel
Trim: SS410 Stem / 13Cr seats
Class: 800#
Size Range: 1/4" to 2"
End: Socket Weld (SW)
Bonnet: Bolted',
  'ASME B16.34, BS 5352','ProFlow','Imported',
  'in_stock',0,1),

  (3,'Globe Valve Class 800 Socket Weld Forged','globe-valve-cl800-sw-forged','VLV-GL-800-SW-010',
  'Forged globe valve Class 800 SW ends, Y-pattern, rising stem, 1/4" to 2"',
  'High-pressure forged steel globe valve for throttling and on-off service in small-bore process piping. Y-pattern body provides lower pressure drop. Socket weld ends.',
  'Body: ASTM A105N Forged
Pattern: Y-pattern
Trim: 13Cr disc and seat
Class: 800#
Size Range: 1/4" to 2"
End: Socket Weld or Threaded',
  'ASME B16.34, BS 5352','ProFlow','Imported',
  'in_stock',0,1),

  (3,'Lift Check Valve Class 800 SW Forged','lift-check-valve-cl800-sw','VLV-CHK-LF-011',
  'Forged lift check valve Class 800 socket weld, piston type, vertical or horizontal',
  'Piston-type lift check valve for high-pressure small-bore service. Spring-assisted for vertical or horizontal installation. Fast-acting for surge protection. Forged body for strength.',
  'Body: ASTM A105N Forged
Type: Piston / Lift
Spring: Optional spring assist
Class: 800#
Size Range: 1/4" to 2"
Installation: H or V upward flow',
  'ASME B16.34','ProFlow','Imported',
  'in_stock',0,1),

  (3,'Gate Valve API 600 Class 300 Flanged','gate-valve-api600-cl300','VLV-GT-600-CL300-012',
  'API 600 gate valve Class 300 flanged raised face, OS&Y, wedge type, 2" to 24"',
  'Heavy-duty gate valve for elevated pressure oil, gas, and steam service. Class 300 rating for higher pressure than Class 150. Solid or flexible wedge available. Gear operator on larger sizes.',
  'Body: ASTM A216 WCB / A217 WC6
Trim: API Trim #8 or #12
Class: 300#
Size Range: 2" to 24"
Actuation: Handwheel / Gear / Actuator
Connections: ASME B16.5 RF flanged',
  'API 600, ASME B16.34','ProFlow','Imported',
  'in_stock',1,1),

  (3,'Triple Offset Butterfly Valve Class 150','triple-offset-butterfly-valve','VLV-BFY-TOV-013',
  'Triple offset (triple eccentric) butterfly valve, zero-leakage metal seat, Class 150 to 600',
  'Triple offset butterfly valve achieves zero-leakage metal-to-metal seat. True isolation valve equivalent to gate valve. Suitable for steam, high-temperature, and corrosive service. Long service life with minimal maintenance.',
  'Body: Carbon Steel / SS316
Disc: Alloy 625 or Stellite overlay
Seat: Laminated or solid metal
Class: 150# to 600#
Leakage: Zero (API 598 Class VI)
Size Range: 3" to 60"',
  'API 609, EN 593','ProFlow','Imported',
  'on_order',0,1),

  (3,'Needle Valve High Pressure Instrumentation','needle-valve-hp-instrumentation','VLV-NDL-HP-014',
  'High-pressure needle valve for instrumentation, 6000/10000 PSI, SS316, 1/4" to 1"',
  'Precision needle valve for instrumentation, gauge isolation, and chemical injection service. Fine-threaded needle for accurate flow control. High-pressure rating for wellhead and process instrumentation.',
  'Body: SS316 / Carbon Steel
Rating: 6000 or 10000 PSI
Size Range: 1/4" to 1" NPT
Stem: Non-rotating needle tip
Packing: PTFE / Graphite
Connection: NPT screwed',
  'ASME B16.34','InstruValve','Imported',
  'in_stock',0,1),

  (3,'Pressure Reducing Valve (PRV) Direct Acting','pressure-reducing-valve-prv','VLV-PRV-DA-015',
  'Self-acting pressure reducing valve, 1/2" to 3", set pressure adjustable 0.5 to 16 bar',
  'Direct-acting pressure reducing valve for steam, air, water, and gas service. No external power required. Spring-loaded diaphragm-operated. Downstream pressure maintained ±0.5 bar of set point.',
  'Body: Cast Iron / Bronze / SS
Size Range: 1/2" to 3" BSP
Set Pressure: 0.5 to 16 bar (adjustable)
Inlet Pressure: Up to 25 bar max
Media: Steam, Air, Water, Gas
Adjustment: External spring screw',
  'EN 1567','FlowSafe','Imported',
  'in_stock',0,1);

  -- ─── CATEGORY 4: RTJ Rings & Gaskets (cat_id=4) ─────────────────────
  -- (1 already exists: rtj-oval-gasket-b1620)

  INSERT IGNORE INTO `products` (`category_id`,`name`,`slug`,`sku`,`short_description`,`description`,`specifications`,`standards`,`brand`,`origin`,`stock_status`,`is_featured`,`is_active`) VALUES

  (4,'RTJ Octagonal Ring Gasket ASME B16.20','rtj-octagonal-gasket-b1620','GSK-RTJ-OCT-002',
  'Ring Type Joint octagonal gaskets, soft iron, low-carbon steel, all R and RX numbers',
  'Octagonal cross-section RTJ gaskets provide better sealing than oval rings due to greater contact area. Compatible with oval ring groove flanges. Available in soft iron, low-carbon steel, and 316 SS.',
  'Cross Section: Octagonal
Materials: Soft Iron (HB 90 max) / 316 SS
Size Range: R-11 to R-105 (and RX series)
Hardness: Per API 6A Table
Finish: 63 µin Ra max on seating surfaces
Available: All standard sizes ex-stock',
  'ASME B16.20, API 6A','SealMaster','Pakistan',
  'in_stock',0,1),

  (4,'Spiral Wound Gasket ASME B16.20 with IR & OR','spiral-wound-gasket-b1620-ir-or','GSK-SW-IR-OR-003',
  'Spiral wound gasket ASME B16.20 with inner ring and outer ring, Class 150 to 2500',
  'Premium spiral wound gasket with stainless steel winding and flexible graphite filler. Inner ring prevents buckling. Centering/outer ring ensures correct positioning. Suitable for high-temperature, high-pressure, and cyclic service.',
  'Winding: 316 SS / AISI 304
Filler: Flexible graphite or PTFE
Inner Ring: 316 SS
Outer/Centering Ring: CS with yellow zinc coat
Class: 150# to 2500#
Temp Range: -200°C to +600°C (graphite)',
  'ASME B16.20, EN 13555','SealMaster','Pakistan',
  'in_stock',0,1),

  (4,'Kammprofile (Camprofile) Gasket','kammprofile-camprofile-gasket','GSK-KAM-001-004',
  'Kammprofile gasket with graphite facings, serrated metal core, all standard sizes',
  'Kammprofile gasket features solid metal core with concentric serrations and bonded graphite or PTFE facing. Excellent blow-out resistance and reusability. Suitable for heat exchanger and critical flange connections.',
  'Core Material: SS304 / SS316 / Alloy 625
Facing: Flexible graphite or PTFE
Finish: Serrated 0.4 Ra metal surface
Class: 150# to 2500#
Size Range: 1" to 60"
Temp: Up to 650°C (graphite facing)',
  'EN 13555, ASME PCC-1','SealMaster','Pakistan',
  'in_stock',0,1),

  (4,'Full Face Gasket ASME B16.21 Soft Iron','full-face-gasket-b1621','GSK-FF-NRB-005',
  'Full face gasket ASME B16.21, NBR/EPDM/PTFE, Class 125 to 300, cut to size',
  'Full face rubber or PTFE sheet gaskets for flat-face flanges. Covers entire flange face including bolt holes. Prevents flange face damage. Available in NBR, EPDM, PTFE, and Neoprene sheet material.',
  'Materials: NBR / EPDM / PTFE / Neoprene
Thickness: 1.5 mm / 3.0 mm / 5.0 mm
Class: PN 10 / PN 16 / 150#
Size Range: 1/2" to 36" NPS
Cut: CNC waterjet precision cut
Hardness (rubber): 60±5 Shore A',
  'ASME B16.21, EN 1514-1','SealMaster','Pakistan',
  'in_stock',0,1),

  (4,'API 6A BX Ring Gasket for 6BX Flanges','api6a-bx-ring-gasket','GSK-BX-API6A-006',
  'API 6A BX profile ring gaskets for type 6BX wellhead flanges, 5000-20000 PSI',
  'BX ring gaskets for API 6BX wellhead flanges at extreme pressures (up to 20,000 PSI). Pressure-energized design — higher pressure causes tighter seal. Manufactured to API 6A dimensional requirements.',
  'Profile: BX (Pressure Energized)
Material: Soft Iron (HB 90 max) / Low C Steel
Pressure Rating: 5000 to 20000 PSI
Sizes: BX-151 to BX-174
Hardness: 90 HB max
Compatibility: API 6BX flanges only',
  'API 6A Annex F','SealMaster','Pakistan',
  'in_stock',0,1),

  (4,'API 6A AX Ring Gasket for 6BX Flanges','api6a-ax-ring-gasket','GSK-AX-API6A-007',
  'API 6A AX profile ring gasket for subsea wellhead and 6BX flanges, pressure energized',
  'AX ring gaskets for subsea and high-integrity wellhead flange connections. Narrow contact area provides extremely high unit sealing stress. Used in subsea trees, tubing hangers, and high-pressure surface applications.',
  'Profile: AX (Pressure Energized)
Material: Incoloy 825 / Soft Iron / Alloy 625
Pressure: Up to 20000 PSI
Sizes: AX-39 to AX-85
Application: Subsea / HP wellheads
Traceable to API 6A Annex F',
  'API 6A Annex F','SealMaster','Imported',
  'on_order',0,1),

  (4,'Spiral Wound Gasket PTFE Filler No Ring','spiral-wound-gasket-ptfe','GSK-SW-PTFE-008',
  'Spiral wound gasket SS316/PTFE without inner or outer ring, Class 150, 300, 600',
  'Basic spiral wound gasket with PTFE filler for chemical and corrosive service where graphite is not suitable. No inner or outer ring (for tongue & groove or male & female face flanges).',
  'Winding: 316 SS
Filler: Virgin PTFE
Ring: None (bare SWG)
Class: 150# to 600#
Temp Range: -200°C to +260°C
Compatible: Acids, caustics, chemical service',
  'ASME B16.20','SealMaster','Pakistan',
  'in_stock',0,1),

  (4,'Flexible Graphite Sheet Gasket','graphite-sheet-gasket','GSK-GRF-SHT-009',
  'Compressed flexible graphite sheet gasket, 1.5mm to 3mm, high-temperature service',
  'Expanded flexible graphite sheet gaskets for high-temperature, high-pressure, and chemically aggressive service. Excellent sealing on raised face and flat face flanges. PTFE-coated version for acid service available.',
  'Material: 99% pure flexible graphite
Thickness: 1.0 / 1.5 / 2.0 / 3.0 mm
Temp Range: -200°C to +550°C (in air)
Pressure: Up to 200 bar
SS316 Tanged core: Optional
Inhibited: Anti-oxidation (optional)',
  'DIN 28090, EN 13555','SealMaster','Imported',
  'in_stock',0,1),

  (4,'PTFE Envelope Gasket Full Face','ptfe-envelope-gasket','GSK-PTFE-ENV-010',
  'PTFE envelope gasket with elastomer filler, chemical resistant, 1/2" to 24"',
  'PTFE envelope gasket encases a soft rubber filler core with PTFE cladding on sealing surfaces. Combines the flexibility of rubber with PTFE chemical resistance. Ideal for corrosive chemical service at moderate temperatures.',
  'Inner Core: NBR / EPDM / Silicone
Envelope: Virgin PTFE (min 2mm thick)
Class: PN 10 / PN 16 / 150#
Size Range: 1/2" to 24"
Temp: Up to 200°C
Pressure: Up to 40 bar',
  'DIN 28091','SealMaster','Pakistan',
  'in_stock',0,1),

  (4,'Compressed Non-Asbestos Fiber (CNAFs) Gasket','cnaf-compressed-gasket','GSK-CNF-001-011',
  'CNAF sheet gasket, Klinger / Garlock type, ring cut and full face, all sizes',
  'Compressed non-asbestos fiber (CNAF) gasket cut from premium grade sheet material (equivalent to Klinger C-4400 or Garlock Blue-Gard 3000). Suitable for steam, oil, water, and gas service.',
  'Base: Aramid / Mineral fiber + NBR binder
Thickness: 1.5 / 2.0 / 3.0 mm
Temp: Up to 400°C
Pressure: Up to 100 bar
Equivalent: Klinger C-4400 / Garlock 3000
Cut: Waterjet or die cut',
  'EN 13555, DIN 28090','SealMaster','Pakistan',
  'in_stock',0,1),

  (4,'Manway Gasket Heat Exchanger Large Bore','manway-gasket-heat-exchanger','GSK-MNW-HX-012',
  'Large bore heat exchanger and pressure vessel manway gaskets, custom cut to drawing',
  'Custom manufactured large bore gaskets for heat exchanger bonnets, pressure vessel manways, and separator covers. Available in spiral wound, solid metal, CNAF, and graphite sheet construction to customer drawings.',
  'Material Options: Spiral Wound / CNAF / Graphite / Metal
Manway Sizes: 18" to 60" and custom
Pressure: Up to ASME Class 600
Temp: Per material selection
Drawing Based: Customer drawing or flange dimensions
Lead Time: 7-14 days for custom',
  'ASME PCC-1, EN 13555','SealMaster','Pakistan',
  'on_order',0,1),

  (4,'Metallic Ring Joint Gasket Set R-Type','rtj-ring-gasket-set-r-type','GSK-SET-RTJ-013',
  'Complete RTJ ring gasket kit, R-type oval, soft iron, various sizes for flange package',
  'Pre-packaged RTJ oval ring gasket sets for valve, flange, and pipeline assembly jobs. Sets contain all required ring numbers for a given pipe class and size range. Ideal for shutdown and maintenance kits.',
  'Type: R-Type Oval
Material: Soft Iron (HB 90 max)
Finish: 63 µin Ra on contact faces
Packaging: Sets of 5, 10, or 25 rings
Sizes: R-11 through R-105
Hardness Certification: Included per ring',
  'ASME B16.20, API 6A','SealMaster','Pakistan',
  'in_stock',0,1),

  (4,'Double Jacketed Metal Gasket','double-jacketed-metal-gasket','GSK-DJK-001-014',
  'Double jacketed metallic gasket for heat exchangers, oval or rectangular, all materials',
  'Double jacketed gaskets feature two metal jackets enclosing a soft metal or non-metallic filler. Excellent blow-out resistance. Used on heat exchanger floating head covers, pressure vessel manholes.',
  'Jacket Material: SS316 / CS / Alloy 825
Filler: Soft Iron / Copper / PTFE
Shapes: Round, Oval, Octagonal, Rectangular
Class: Up to ASME 900#
Temp: -200°C to +600°C
Custom: Any size to drawing',
  'ASME B16.20','SealMaster','Pakistan',
  'on_order',0,1),

  (4,'Neoprene Rubber Gasket Sheet Cut','neoprene-rubber-gasket-sheet','GSK-NEO-SHT-015',
  'Neoprene rubber sheet gaskets, oil resistant, 1.5mm to 6mm thick, cut to order',
  'Neoprene rubber gaskets for oil, refrigerant, and general service at moderate temperatures. Available in standard rings or custom shapes. Flame-retardant grades available for plant applications.',
  'Material: Neoprene (CR) rubber
Thickness: 1.5 / 3.0 / 4.5 / 6.0 mm
Hardness: 60 ± 5 Shore A
Temp Range: -40°C to +120°C
Compression Set: < 25% (ISO 815)
Cut: Standard and custom shapes',
  'ASTM D2000','SealMaster','Pakistan',
  'in_stock',0,1);

  -- ─── CATEGORY 5: Mining Equipment Spares (cat_id=5) ─────────────────
  -- (1 already exists: jaw-crusher-wear-parts)

  INSERT IGNORE INTO `products` (`category_id`,`name`,`slug`,`sku`,`short_description`,`description`,`specifications`,`standards`,`brand`,`origin`,`stock_status`,`is_featured`,`is_active`) VALUES

  (5,'Cone Crusher Mantle & Bowl Liner Set','cone-crusher-mantle-bowl-liner','MNG-CC-MBL-002',
  'Manganese steel mantle and bowl liner for cone crushers, all major makes',
  'High manganese steel crushing liners for cone crushers including Metso HP, Sandvik CH/CS, and Terex Cedarapids. Work-hardening manganese steel provides excellent wear life in hard rock applications.',
  'Material: Mn18Cr2 / Mn22Cr2 High Manganese
Hardness: 200 HB (initial) / 550 HB (work hardened)
Compatible: Metso HP, Sandvik CH, Symons, Terex
Surface: Machined to OEM dimensions
Weld On: Backing compound included
Inspection: Full dimensional check',
  'AS2022','HardLife','Imported',
  'in_stock',1,1),

  (5,'Tricone Roller Rock Bit API 7-1','tricone-roller-rock-bit-api71','MNG-TCB-API-003',
  'Tricone roller rock bit API 7-1, IADC classification, various sizes 3-7/8" to 17-1/2"',
  'Three-cone roller bits for oil & gas and water well drilling. Available in sealed bearing (journal) and sealed roller bearing types. Mill tooth (MT) and tungsten carbide insert (TCI) available for all formation types.',
  'IADC Classification: 111 to 837
Sizes Available: 3-7/8" to 17-1/2"
Bearing: Sealed journal / Sealed roller
Inserts: Milled tooth (MT) or TCI
Nozzles: 2 or 3 replaceable nozzles
Thread: API Reg / API IF pin',
  'API 7-1, IADC','DrillTech','Imported',
  'in_stock',1,1),

  (5,'PDC Drill Bit for Oil & Gas Drilling','pdc-drill-bit-oil-gas','MNG-PDC-OG-004',
  'PDC (Polycrystalline Diamond Compact) drill bit, matrix or steel body, all formation types',
  'High-performance PDC bits for oil, gas, and geothermal drilling in soft to medium-hard formations. Longer run life and higher ROP than roller cone bits in suitable formations. Custom blade and cutter geometry available.',
  'Cutters: PDC (Synthetic Diamond)
Body: Matrix or Steel body
Blades: 4 to 7 blade designs
Sizes: 4-3/4" to 12-1/4"
Nozzles: Replaceable tungsten carbide
ROP: 3-10x tricone in suitable formations',
  'API 7-1','DrillTech','Imported',
  'on_order',0,1),

  (5,'Mud Pump Liner & Piston Kit','mud-pump-liner-piston-kit','MNG-MDP-LPK-005',
  'Triplex mud pump liner and piston kit for National, Gardner Denver, and Continental pumps',
  'Replacement liners (cylinders) and pistons for oilfield triplex mud pumps. Chromium-plated steel liners with rubber pistons for extended service life. Available for all major mud pump brands.',
  'Liner Material: Chrome-plated steel
Piston: Nitrile / Polyurethane rubber
Pump Compatibility: National 10-P-130, GD PZ-11, Continental 12-P-160 and more
Liner ID Range: 4" to 7-1/2"
Pressure Rating: Up to 7500 PSI
Liner Surface: 0.0001" chrome tolerance',
  'API 7K','SealPro','Imported',
  'in_stock',0,1),

  (5,'Shale Shaker Screen API RP 13C','shale-shaker-screen-api13c','MNG-SHS-SCR-006',
  'Shale shaker replacement screens, composite frame, API RP 13C compliant, various cuts',
  'Primary solids-control screens for oil & gas drilling fluid processing. Composite frame reduces weight and prevents corrosion. Fine mesh screens from API 20 to API 325 cut point. Available for Swaco, Derrick, Brandt shakers.',
  'Frame: Composite (non-metallic)
Mesh: SS316 wire cloth, API 20-325
Replacement For: Swaco Mongoose, Derrick FLC, Brandt King Cobra
Dimensions: Per original shaker model
Cut Point: Labeled per API RP 13C
Life: 300-600+ running hours (formation dependent)',
  'API RP 13C','CleanDrill','Imported',
  'in_stock',0,1),

  (5,'Drilling Stabilizer Near Bit Integral','drilling-stabilizer-near-bit','MNG-STB-NB-007',
  'Near-bit and string stabilizers for directional and vertical drilling, various OD sizes',
  'Integral blade and welded blade stabilizers to centralize the BHA and control wellbore trajectory. Near-bit, string, and reamer stabilizers available. Hard-facing on blades for abrasion resistance.',
  'Body Material: AISI 4145H Modified
OD Range: 4-3/4" to 12-1/4"
Blade Type: Integral / Welded blade
Blades: 3 or 4 spiraled blades
Hard Face: Tungsten carbide
Thread: API Reg / API IF box x pin',
  'API 7-1','DrillTech','Imported',
  'on_order',0,1),

  (5,'Impact Crusher Blow Bars High Chrome','impact-crusher-blow-bars','MNG-ICR-BLW-008',
  'High chrome and martensitic blow bars for horizontal shaft impact (HSI) crushers',
  'Replacement blow bars for HSI impact crushers in quarrying, recycling, and demolition applications. High chrome (26-28% Cr) for abrasive stone crushing. Martensitic for higher impact loads with less abrasion.',
  'Material: Hi-Chrome 26-28% Cr / Martensitic
Hardness: 58-66 HRC (HiCr) / 46-50 HRC (Mart)
Compatible: Metso Nordberg, Sandvik, Hazemag, Tesab
Weight Range: 30 to 400 kg per bar
Dimensions: Per original crusher model
Lifetime: 50-300 hours (rock dependent)',
  'AS2022','HardLife','Imported',
  'in_stock',0,1),

  (5,'Rock Drill Steel Hex & Round Shank','rock-drill-steel-hex-round','MNG-RDS-001-009',
  'Integral and extension drill steel (rods) for jack hammers and drifters, various lengths',
  'Hex (22mm, 25mm) and round (32mm) rock drill rods for hydraulic and pneumatic rock drills. Forged from high-alloy steel with vacuum-treated and heat-treated to prevent breakage.',
  'Material: B19S / B19S-modified high alloy steel
Types: Hex 22, Hex 25, Round 32 mm shank
Length Range: 1.2 m to 6.1 m
Coupling Thread: R22 / R25 / R28 / T38 / T45
End Hardness: 56-60 HRC
Inspection: Ultrasonic tested each bar',
  'ISO 10208','HardLife','Imported',
  'in_stock',0,1),

  (5,'Crusher Screen Panel Polyurethane & Wire','crusher-screen-panel-pu','MNG-SCR-PNL-010',
  'Polyurethane, rubber, and wire screen panels for vibrating screens, all sizes',
  'Replacement vibrating screen panels for aggregate, mining, and quarry operations. Polyurethane (PU) panels for long life in wet applications. Wire cloth for dry fine screening. Modular design for quick replacement.',
  'Material Options: PU / Rubber / Woven Wire
Aperture Range: 0.1 mm to 100 mm
Panel Size: Modular 305x305 or custom
Attachment: Snap-in / Bolt-down / Tensioned
Life vs Rubber: PU 3-5x rubber life
Application: Coal, aggregates, minerals',
  'ISO 4729','HardLife','Imported',
  'in_stock',0,1),

  (5,'Grinding Mill Liner Rubber & Steel','grinding-mill-liner-set','MNG-GML-RBR-011',
  'SAG, ball, and rod mill liners in rubber, steel, and composite designs',
  'Shell and head liners for grinding mills to protect mill shell and improve grinding efficiency. Rubber liners for lighter grinding duty (noise reduction, lighter weight). Steel and composite for heavy duty.',
  'Material: Rubber / Mn Steel / Composite
For: Ball mill / SAG mill / Rod mill
Hardness (steel): Mn18Cr2
Hardness (rubber): 50-65 Shore D
Fit: Bolt-on, studded, or rail mounted
Drawing Review: Required for first order',
  'AS2022','HardLife','Imported',
  'on_order',0,1),

  (5,'Ball Mill Trunnion Bearing Assembly','ball-mill-trunnion-bearing','MNG-BML-TRN-012',
  'Ball mill trunnion and main bearing assemblies, babbitted white metal and antifriction type',
  'Trunnion bearing assemblies for ball mills, rod mills, and AG/SAG mills. White metal (Babbitt) and antifriction roller bearing types. Custom remanufacturing service available for existing bearings.',
  'Type: White Metal (Babbitt) / Roller Bearing
Babbitt: Lead-free, tin-base 88% Sn
Diameter Range: 400 mm to 3000 mm+
Lubrication: Circulation oil / grease
Machining: Precision bored to mill trunnion
Service: New supply & remanufacture',
  'ISO 12168','SealPro','Imported',
  'on_order',0,1),

  (5,'Drill Collar Monel Non-Magnetic','drill-collar-non-magnetic','MNG-DCL-NMG-013',
  'Non-magnetic drill collar (NMDC) for MWD/LWD operations, API 7-1 connection',
  'Non-magnetic drill collars manufactured from Monel (K-500 or 400) or austenitic stainless steel for MWD, LWD, and directional drilling. Prevents magnetic interference with survey instruments.',
  'Material: Monel K-500 / Austenitic SS
OD Range: 4-3/4" to 8" OD
ID Range: 1-1/2" to 3"
Thread: API Reg / API IF / NC pin x box
Length: 30 ft (9.14 m) or 10 ft test collar
Magnetic Permeability: ≤ 1.01 µ (relative)',
  'API 7-1','DrillTech','Imported',
  'on_order',0,1),

  (5,'Conveyor Belt Vulcanizing Press Portable','conveyor-belt-vulcanizing-press','MNG-CVP-PRT-014',
  'Portable electric conveyor belt vulcanizing press for hot splicing, 600mm to 2400mm',
  'Portable hot vulcanizing press for making permanent belt joints on site. Electric heating with digital temperature control. Hydraulic clamping for even pressure. For steel cord and fabric conveyor belts.',
  'Belt Width: 600 mm to 2400 mm
Heating: Electric (3-phase)
Temperature: Digital PID 0-200°C
Pressure: Hydraulic, 0-16 bar
Voltage: 380V/50Hz or 415V/50Hz
Joint Type: Hot vulcanized splices',
  'ISO 22721','HardLife','Imported',
  'on_order',0,1),

  (5,'Gyratory Crusher Mantle & Concave Set','gyratory-crusher-mantle-concave','MNG-GYC-MNC-015',
  'High manganese steel mantle and concave segments for primary gyratory crushers',
  'Primary gyratory crusher wear liners manufactured from high-manganese steel. Mantle (inner liner) and concave segments (outer liner). Available for all major primary gyratory crushers.',
  'Material: Mn18Cr2 or Mn22Cr2
Hardness: 180-220 HB (as cast)
Work Hardened: 450-550 HB in service
Compatible: Metso Superior, Sandvik CG, FLSmidth
Pieces: Mantle 1-piece + concave segments
Weight: 2,000 to 15,000 kg per set',
  'AS2022','HardLife','Imported',
  'on_order',0,1);

  -- ─── CATEGORY 6: Hydraulic Components (cat_id=6) ────────────────────
  -- (1 already exists: hydraulic-cylinder-repair-kit)

  INSERT IGNORE INTO `products` (`category_id`,`name`,`slug`,`sku`,`short_description`,`description`,`specifications`,`standards`,`brand`,`origin`,`stock_status`,`is_featured`,`is_active`) VALUES

  (6,'Hydraulic Gear Pump Fixed Displacement','hydraulic-gear-pump-fixed','HYD-GRP-FXD-002',
  'External gear hydraulic pump, fixed displacement, 1-200 cc/rev, SAE A/B/C mount',
  'External gear pumps for mobile and industrial hydraulic systems. Low noise, high efficiency. SAE mounting flange and shaft. Suitable for fork lift, construction machinery, truck-mounted cranes, and presses.',
  'Displacement: 1 to 200 cc/rev
Max Speed: 3000 RPM
Max Pressure: 250 bar (continuous)
Peak Pressure: 300 bar
Viscosity: 15-100 cSt (recommended)
Mount: SAE A / B / C flange',
  'ISO 4413, SAE J744','HydroTech','Imported',
  'in_stock',1,1),

  (6,'Hydraulic Piston Pump Variable Displacement','hydraulic-piston-pump-variable','HYD-PST-VAR-003',
  'Axial piston variable displacement hydraulic pump, pressure compensated, 18-250 cc/rev',
  'Variable displacement axial piston pump with pressure compensator and optional load sensing. Used in mobile machinery, industrial presses, and marine hydraulic systems. Equivalent to Bosch-Rexroth A10V or Parker PV series.',
  'Displacement: 18 to 250 cc/rev
Max Speed: 1800-3600 RPM
Max Pressure: 350 bar continuous
Peak: 420 bar
Control: PC / PC+LS / Proportional
Equivalent: Rexroth A10VO, Parker PV, Eaton PVH',
  'ISO 4413','HydroTech','Imported',
  'in_stock',0,1),

  (6,'Hydraulic Directional Control Valve 4/3 Way','hydraulic-directional-control-valve-4-3','HYD-DCV-43-004',
  'Solenoid operated 4/3-way directional control valve, D05/D07, 10-100 L/min, 315 bar',
  'Electro-hydraulic directional control valve for controlling actuator direction and speed. Spring-centered 4/3-way spool. D03 (NG6), D05 (NG10), D07 (NG16) mounting pattern. 12VDC / 24VDC / 110VAC / 220VAC coils.',
  'Type: 4/3 Spring-Centered
Mount: D03 / D05 / D07 (NFPA T3.5.1)
Flow: 30-100 L/min (size dependent)
Max Pressure: 315 bar
Voltage: 12VDC / 24VDC / 110-220VAC
Hysteresis: < 3% of rated flow',
  'ISO 4401, NFPA T3.5.1','HydroTech','Imported',
  'in_stock',0,1),

  (6,'Hydraulic Pressure Relief Valve Direct Acting','hydraulic-pressure-relief-valve','HYD-PRV-DA-005',
  'Direct-acting hydraulic pressure relief valve, adjustable 30-350 bar, cartridge or body mount',
  'Hydraulic system overpressure protection valve. Adjustable spring-set pressure. Cartridge type (SAE, Cetop) or body-mount (inline) configurations. Tamper-proof cap option. Low opening pressure differential.',
  'Type: Direct Acting / Pilot Operated
Adjustment: 30 to 350 bar
Flow: Up to 100 L/min (direct acting)
Peak Flow: Up to 400 L/min (pilot operated)
Port: G3/8" to G1" or Cartridge SAE-10
Override: Manual override option',
  'ISO 6952','HydroTech','Imported',
  'in_stock',0,1),

  (6,'Hydraulic Accumulator Bladder Type','hydraulic-accumulator-bladder','HYD-ACC-BLD-006',
  'Bladder hydraulic accumulator, 0.5L to 100L, 250-400 bar, NBR/FKM bladder',
  'Nitrogen-charged bladder accumulator for energy storage, pulsation dampening, and emergency power in hydraulic systems. Steel or stainless shell. NBR or FKM bladder. Top or bottom repairable.',
  'Volume: 0.5 L to 100 L
Max Working Pressure: 250 / 330 / 400 bar
Bladder: NBR (standard) / FKM (high temp)
Shell: Carbon steel or SS316
Gas: Nitrogen pre-charge
Temp Range: -10°C to +80°C (NBR)',
  'ISO 4413, EN 14359','HydroTech','Imported',
  'in_stock',0,1),

  (6,'Hydraulic Return Line Filter Element','hydraulic-filter-element-return','HYD-FLT-RTL-007',
  'Return line hydraulic filter element 10 micron, various housing sizes, all brands',
  'High-efficiency hydraulic filter elements for return line, pressure line, and suction strainer applications. Glass fiber media for consistent filtration rating. Collapse pressure 25 bar. Available for Parker, Pall, Hydac, and other brands.',
  'Media: Glass fiber (β₁₀ ≥ 200)
Rating: 10 µm absolute (ISO 16889)
Collapse Pressure: 25 bar differential
Flow: 20 to 400 L/min (size dependent)
Compatible: Hydac, Parker, Pall, Internormen
Change Interval: 2000-4000 hours (typical)',
  'ISO 16889, DIN 24550','HydroTech','Imported',
  'in_stock',0,1),

  (6,'Hydraulic Quick Release Coupling Flat Face','hydraulic-quick-coupling-ff','HYD-QRC-FF-008',
  'Flat-face hydraulic quick release coupling, ISO 16028, 1/4" to 1-1/2" BSP/NPT',
  'Spill-free flat-face quick release couplings for hydraulic hose connections. Push-to-connect under residual pressure up to 10 bar. Suitable for agricultural, construction, and utility vehicle applications.',
  'Profile: Flat Face (ISO 16028)
Sizes: 1/4" to 1-1/2" BSP or NPT
Max Working Pressure: 350 bar
Residual Connection: Up to 10 bar
Material: Steel with Zn-Ni plating
Spill: Minimal spill on disconnect',
  'ISO 16028, ISO 7241-1','HydroTech','Imported',
  'in_stock',0,1),

  (6,'Hydraulic Hose Assembly SAE 100R2AT','hydraulic-hose-assembly-r2at','HYD-HOS-R2AT-009',
  'SAE 100R2AT hydraulic hose assembly, 3/8" to 1-1/2", custom crimped with fittings',
  'Double wire braid hydraulic hose assemblies, custom-made to required length with JIC, BSPP, BSPT, or SAE O-ring face seal end fittings. Pressure tested at 1.5x working pressure after crimping.',
  'Hose: SAE 100R2AT / EN 853 2SN
Size Range: 3/8" to 1-1/2"
WP: 250 to 400 bar (size dependent)
Temp: -40°C to +100°C
Fittings: JIC / BSPP / BSPT / ORFS available
Test: Pressure tested post-crimp',
  'SAE J517 100R2, EN 853 2SN','HydroTech','Pakistan',
  'in_stock',0,1),

  (6,'Hydraulic Power Unit (HPU) Custom Built','hydraulic-power-unit-custom','HYD-HPU-CUS-010',
  'Custom engineered hydraulic power unit (HPU), 2 to 200 kW, fixed or variable pump',
  'Custom-fabricated hydraulic power units for industrial presses, cranes, drilling rigs, and process equipment. Complete with reservoir, motor, pump, control manifold, filters, heat exchanger, and gauges. Designed to client specification.',
  'Motor: IE3 3-phase 2-200 kW
Pump: Gear / Piston / Vane (per spec)
Reservoir: 20 to 2000 L carbon steel
Pressure: Up to 350 bar
Flow: 5 to 1000 L/min
Cooling: Air blast or water cooled heat exchanger',
  'ISO 4413','HydroTech','Pakistan',
  'on_order',1,1),

  (6,'Hydraulic Orbital Motor (Gerotor)','hydraulic-orbital-motor-gerotor','HYD-MTR-ORB-011',
  'Orbital hydraulic motor (gerotor/geroler), 50-1000 cc/rev, low speed high torque',
  'Low speed, high torque orbital hydraulic motors for wheel drive, conveyor drive, and mixer applications. Available in disc valve and spool valve versions. SAE mounting face and shaft. Equivalent to White Drive, Danfoss OMT, Eaton Char-Lynn.',
  'Type: Gerotor / Geroler
Displacement: 50 to 1000 cc/rev
Max Speed: 500-750 RPM (full disp.)
Max Torque: 50 to 1500 Nm
Max Pressure: 175-210 bar
Equivalent: Danfoss OMT, White, Char-Lynn',
  'ISO 4413','HydroTech','Imported',
  'in_stock',0,1),

  (6,'Hydraulic Seal Kit Parker / Rexroth Cylinder','hydraulic-seal-kit-parker-rexroth','HYD-SKT-PRX-012',
  'OEM replacement hydraulic cylinder seal kits for Parker, Rexroth, and Enerpac cylinders',
  'Complete seal kits for repair and overhaul of Parker hydraulic cylinders, Bosch-Rexroth mill cylinders, and Enerpac tools. All seals, wipers, O-rings, backup rings, and anti-extrusion rings included.',
  'Compatible Brands: Parker, Rexroth, Enerpac, SPX
Seal Material: NBR / FKM / PTFE
Kit Includes: Piston seal, rod seal, wiper, all O-rings
Bore Range: 25 mm to 500 mm
Temp Rating: -20 to +100°C (NBR)
Compliance: OEM equivalent or OEM parts',
  'ISO 6195, ISO 6194','SealPro','Imported',
  'in_stock',0,1),

  (6,'Hydraulic Proportional Flow Control Valve','hydraulic-proportional-flow-valve','HYD-PFV-001-013',
  'Proportional solenoid-operated flow control valve, 0-100 L/min, NG6/NG10',
  'Electronically controlled proportional flow valve for CNC machine tools, injection molding, and press brakes. Linear relationship between electrical command and flow output. Integrated LVDT position feedback.',
  'Valve Type: Proportional flow control
Mount: NG6 (D03) or NG10 (D05)
Flow: 0-60 L/min (NG6) / 0-100 L/min (NG10)
Control: ±10V or 4-20mA input
Hysteresis: < 0.5%
Feedback: LVDT integrated',
  'ISO 4401, DIN 24340','HydroTech','Imported',
  'on_order',0,1),

  (6,'Hydraulic Vane Pump Fixed Displacement','hydraulic-vane-pump-fixed','HYD-VNP-FXD-014',
  'Fixed displacement hydraulic vane pump, balanced design, 5-200 cc/rev, low noise',
  'Balanced vane pumps for industrial presses, injection molding machines, and machine tools. Low noise output (<65 dBA). Long service life vane cartridge replaceable without removal from circuit.',
  'Displacement: 5 to 200 cc/rev
Max Speed: 1500-3000 RPM
Max Pressure: 175 bar (continuous)
Noise Level: < 65 dBA
Cartridge: Replaceable vane cartridge kit
Mount: SAE A or B / DIN flange',
  'ISO 4413','HydroTech','Imported',
  'in_stock',0,1),

  (6,'Hydraulic High Pressure Hose SAE 100R12','hydraulic-hose-r12-hp','HYD-HOS-R12-015',
  'SAE 100R12 spiral wound 4-wire high pressure hydraulic hose, 3/8" to 1-1/2"',
  'Four-spiral-wire high-pressure hydraulic hose for hammer lines, rock drill feeds, and crane boom hoses. Superior kink resistance. Suitable for pulsating, high-pressure, and high-impulse applications.',
  'Hose: SAE 100R12 / EN856 4SP
Size Range: 3/8" to 1-1/2"
WP: 275 to 420 bar (size dependent)
Burst: 4x working pressure
Temp: -40°C to +120°C
Reinforcement: 4 spiral wire layers',
  'SAE J517 100R12, EN 856 4SP','HydroTech','Imported',
  'in_stock',0,1);

  -- ─── CATEGORY 7: Earth Moving Spares (cat_id=7) ──────────────────────
  -- (2 already exist: excavator-bucket-teeth-adapters, bulldozer-track-shoe)

  INSERT IGNORE INTO `products` (`category_id`,`name`,`slug`,`sku`,`short_description`,`description`,`specifications`,`standards`,`brand`,`origin`,`stock_status`,`is_featured`,`is_active`) VALUES

  (7,'Excavator Boom Bucket Complete Assembly','excavator-bucket-complete','EMV-BKT-CMP-003',
  'Custom-fabricated excavator bucket, rock and earth buckets, 0.5 to 5.0 m³',
  'Heavy-duty welded excavator buckets for rock, earth, and trenching applications. T-1 steel or Hardox 400/450 wear plate. Replaceable wear strips, side cutters, and bolt-on heel shroud. Sized for all major brands.',
  'Capacity: 0.5 to 5.0 m³
Plate: T-1 / Hardox 400 / Hardox 450
Teeth: Esco, Hensley, CAT compatible
Machines: CAT, Komatsu, Hitachi, Volvo, Hyundai
Wear Parts: Replaceable lip, side cutters, wear strips
Custom: Designed to customer machine spec',
  'OEM Compatible','GET Master','Pakistan',
  'on_order',1,1),

  (7,'Dozer Blade Cutting Edge & End Bits','dozer-blade-cutting-edge','EMV-DCE-001-004',
  'Reversible and non-reversible cutting edges for bulldozer blades, all Caterpillar D-series',
  'Cutting edges for bulldozer blades manufactured from boron steel alloy (400-450 HB). Reversible for double the wear life. End bits protect blade corners. Fits CAT D5, D6, D7, D8, D9, D10 and Komatsu D65, D85, D155.',
  'Material: Boron Alloy Steel 400-450 HB
Type: Reversible / Non-reversible
Bolt Pattern: Per OEM drawing
Compatible: CAT D5-D10, Komatsu D65-D475
Thickness: 1" to 2-1/2"
End Bits: Matching end bit sets available',
  'OEM Spec','GET Master','Imported',
  'in_stock',0,1),

  (7,'Motor Grader Blade & End Bits','motor-grader-blade-end-bits','EMV-MGB-001-005',
  'Motor grader moldboard cutting edge and end bits, CAT 120/140/160/16 series',
  'Grader blade cutting edges and end bits for road construction and maintenance. Reversible cutting edge for extended life. Available in standard bolt-on and bolt-down patterns for CAT, Komatsu, Volvo, and CASE graders.',
  'Material: 400-450 HB Boron Steel
Length: 6 ft and 8 ft sections
Thickness: 5/8", 3/4", 7/8", 1"
Bolt Pattern: 2-bolt or 3-bolt pattern
Compatible: CAT 120, 140, 160, 16M; Komatsu GD655, GD705
Reversible: Yes (double wear life)',
  'OEM Spec','GET Master','Imported',
  'in_stock',0,1),

  (7,'Excavator Undercarriage Kit Complete','excavator-undercarriage-kit','EMV-UNK-CMP-006',
  'Complete undercarriage kit: track chain, rollers, idlers, sprockets for excavators',
  'Full undercarriage replacement kit for excavators including sealed and lubricated (SALT) or sealed master link (SML) track chains, bottom rollers, top carriers, front idlers, and sprocket segments. All in one order.',
  'Contains: Track chain + links, bottom rollers (all), top carriers (all), front idler assembly, sprocket segments
Machines: CAT 320/330, Komatsu PC200/300, Hitachi ZX200/300
Link: SALT (Sealed and Lubricated) preferred
Warranty: 2000-3000 operating hours',
  'OEM Compatible','TrackPro','Imported',
  'on_order',1,1),

  (7,'Track Link Chain Assembly (Per Meter)','track-link-chain-assembly','EMV-TRK-LCA-007',
  'Track link chain with master links, per meter or full circuit supply for all excavators',
  'Track chain assemblies for excavators, bulldozers, and crawler cranes. Sealed and lubricated (SALT) pins and bushings. Precision machined links. Master link for field installation. Sold per meter or full circuit.',
  'Type: SALT (Sealed And Lubricated)
Link Material: 40Mn2 / SCM440 alloy steel
Heat Treatment: Carburized and quenched
Pitch: Per OEM specification
Machines: All major makes on request
Sale Unit: Per meter or full circuit',
  'OEM Compatible','TrackPro','Imported',
  'in_stock',0,1),

  (7,'Sprocket Segment Set for Excavators','sprocket-segment-set','EMV-SPR-SEG-008',
  'Sprocket wheel segment sets (4 or 6 segments per wheel) for CAT, Komatsu, Hitachi',
  'Segmented drive sprockets for excavators and bulldozers. Replaced as segments without full wheel removal, reducing downtime. Bolted to hub flanges. Manufactured from alloy steel with surface hardening.',
  'Material: 40CrNiMo Alloy Steel
Heat Treatment: Induction hardened teeth
Hardness: 50-55 HRC tooth surface
Segments per wheel: 4 or 6
Compatible: CAT 320/330/336, PC200/300/400, ZX200/300/450
Bolt Pattern: Per OEM drawing',
  'OEM Compatible','TrackPro','Imported',
  'in_stock',0,1),

  (7,'Front Idler Assembly Excavator','front-idler-assembly-excavator','EMV-IDL-FRT-009',
  'Front and rear idler (tumbler) assemblies for excavators and bulldozers, all sizes',
  'Track front idler assemblies with shell and shaft. Sealed and maintenance-free. Precision track guide ribs to keep track centered. Can be supplied with recoil spring and frame assembly.',
  'Shell Material: 35CrMo alloy steel
Shaft: 40Cr steel, induction hardened
Sealing: Floating metal seals (face seal)
Lubrication: Pre-greased, sealed for life
Compatible: CAT, Komatsu, Hitachi, Liebherr
Recoil Spring: Available as part of assembly',
  'OEM Compatible','TrackPro','Imported',
  'in_stock',0,1),

  (7,'Bottom Roller (Track Roller) Assembly','bottom-roller-track-roller','EMV-BTR-001-010',
  'Single and double flange bottom rollers for excavators and bulldozers',
  'Single-flange and double-flange track bottom rollers. Floating metal-face seals prevent mud and water ingress. Precision-machined tread for smooth track contact. Available for all machines by OEM reference number.',
  'Material Shell: Boron alloy 35CrMo
Shaft: 40Cr induction hardened
Seal: Floating metal face seal
Single Flange: For standard track position
Double Flange: For guide position
Lubrication: Oil bath or grease filled',
  'OEM Compatible','TrackPro','Imported',
  'in_stock',0,1),

  (7,'Hydraulic Breaker Chisel Moil Point & Blunt','hydraulic-breaker-chisel-moil','EMV-BRK-MSL-011',
  'Hydraulic hammer chisel, moil point, and blunt tool for all major hydraulic breaker brands',
  'Replacement working tools for hydraulic hammers/breakers. Moil point for rock splitting, blunt tool for concrete demolition, chisel for trenching. Manufactured from 42CrMo4 or special B27 steel with precise heat treatment.',
  'Material: 42CrMo4 / B27 impact steel
Heat Treatment: Through-hardened 44-52 HRC
Types: Moil point / Chisel / Blunt / Cone / Wedge
Compatible: Furukawa, Atlas Copco, NPK, Indeco, Montabert
Finish: Chrome-plated shaft recommended
Size Range: 45 mm to 200 mm shank OD',
  'OEM Compatible','HardLife','Imported',
  'in_stock',0,1),

  (7,'Loader Bucket Pin & Bushing Kit','loader-bucket-pin-bushing','EMV-LDR-PBK-012',
  'Loader bucket, boom, and arm pin and bushing kits, all major wheel loader brands',
  'Complete pin and bushing kits for wheel loader bucket linkage, boom, and arm pivots. Case-hardened steel pins with grease grooves. Flanged bronze/steel bushings. Seal kits included.',
  'Pin Material: 40CrMnMo case-hardened
Bushing: Flanged bronze or steel with PTFE lining
Seals: Polyurethane lip seals
Compatible: CAT 938-994, Komatsu WA320-WA500, Volvo L90-L350
Hardness: Core 30-40 HRC, Surface 58-62 HRC
Kit: Full pivot kit with hardware',
  'OEM Compatible','TrackPro','Imported',
  'in_stock',0,1),

  (7,'Grader Circle Drive & Ring Gear Parts','grader-circle-ring-gear','EMV-GRD-CRG-013',
  'Motor grader circle ring gear, circle drive motor, drive gear and pinion sets',
  'Circle drive components for motor graders including ring gear (circle), drive pinion gear, and circle drive hydraulic motor. Ring gear manufactured from hardened alloy steel. Compatible with CAT and Komatsu graders.',
  'Ring Gear Material: 42CrMo4 alloy steel, QT
Teeth: Precision hobbed and heat treated
Hardness: 48-55 HRC tooth flanks
Compatible: CAT 120H/140H/160H, Komatsu GD655
Drive Motor: Hydraulic gear motor supplied separately
Pinion: Hardened matching pinion set',
  'OEM Compatible','GET Master','Imported',
  'on_order',0,1),

  (7,'Wheel Loader Bucket Teeth & Adapter (WL type)','wheel-loader-bucket-teeth','EMV-WLT-001-014',
  'Wheel loader bucket teeth and adapter sets, CAT J-series and Esco V-series profile',
  'Bolt-on and weld-on bucket teeth and adapters for wheel loaders. CAT J300, J400, J460, J550 series and Esco Super V profile. Penetrator, long penetrator, and rock chisel tooth points available.',
  'Tooth Profile: CAT J-series / Esco Super V
Material: Alloy steel 42CrMo4
Hardness: 42-52 HRC (through-hardened)
Types: Penetrator / Long Penetrator / Rock Chisel
Adapter: Weld-on or bolt-on adapters
Retainer: Lock pin or hammerless system',
  'OEM Compatible','GET Master','Imported',
  'in_stock',0,1),

  (7,'Carrier Roller (Top Roller) Excavator','carrier-roller-top-roller','EMV-CTR-001-015',
  'Top carrier rollers for excavators and crawlers, single and double flange types',
  'Carrier (top) rollers guide the track chain on the return side. Sealed and oil-lubricated for extended service. Single and double flange designs. Supports track to prevent sagging between drive and idler.',
  'Shell Material: 35CrMo alloy steel
Sealing: Metal-face floating seals
Lubrication: Oil bath lubricated
Flange: Single or double flange
Compatible: CAT 320-390, Komatsu PC200-PC800, Hitachi
Bearing: Sealed taper roller bearings',
  'OEM Compatible','TrackPro','Imported',
  'in_stock',0,1);

  -- ─── CATEGORY 8: Asphalt Machinery Parts (cat_id=8) ─────────────────
  -- (0 already exist)

  INSERT IGNORE INTO `products` (`category_id`,`name`,`slug`,`sku`,`short_description`,`description`,`specifications`,`standards`,`brand`,`origin`,`stock_status`,`is_featured`,`is_active`) VALUES

  (8,'Asphalt Paver Screed Plate & Strike-Off Plate','asphalt-paver-screed-plate','ASP-SCR-PL-001',
  'Asphalt paver screed base plate and strike-off plate, Vögele, CAT, Blaw-Knox models',
  'Screed base plates and strike-off plates for asphalt paving machines. Manufactured from hardened wear-resistant steel. Weld-on or bolt-on replacement types. Key wear part for maintaining mat thickness accuracy.',
  'Material: Hardened 450 HB wear plate
Thickness: 12 mm to 25 mm (model specific)
Compatible: Vögele Super 1300-2100, CAT AP655, Blaw-Knox PF3172
Type: Bolt-on replacement or weld-on fabrication
Surface: Ground and smooth finish
Certification: Dimensional inspection report',
  'OEM Compatible','RoadMaster','Pakistan',
  'in_stock',0,1),

  (8,'Asphalt Plant Drum Liner & Flights','asphalt-drum-liner-flights','ASP-DRM-LNF-002',
  'Drum drier liner segments and lifting flights for asphalt mixing plants',
  'Internal drum liner plates and aggregate lifting flights for parallel and counter-flow drum mix asphalt plants. High chrome cast iron for abrasion resistance. Lifting flights promote aggregate movement and heat exchange.',
  'Liner Material: Chrome iron casting 25-28% Cr
Hardness: 650-700 HB
Flights: Mild steel with hardfacing option
Compatible: Cedarapids, Parker, Barber-Greene, ASTEC drum plants
Flight Design: Segmental, welded or bolt-on
Liner Thickness: 20-30 mm standard',
  'OEM Compatible','RoadMaster','Pakistan',
  'in_stock',0,1),

  (8,'Asphalt Plant Burner Nozzle & Atomizer','asphalt-plant-burner-nozzle','ASP-BRN-NZL-003',
  'Heavy fuel oil (HFO) and diesel burner nozzles for asphalt plant drum dryers',
  'Fuel oil atomizing nozzles and swirlers for rotary drum asphalt plant burners. HFO, diesel, and LPG types available. Matched pairs for dual-stream burners. Clean combustion design reduces NOx emissions.',
  'Fuel Type: HFO / Diesel / LPG
Nozzle: Stainless steel SS316
Atomizer: Swirl or pressure atomization
Flow Rate: 50 to 2000 L/hr (burner dependent)
Compatible: Benninghoven, ASTEC, Parker, Marini burners
Includes: Nozzle + atomizer + electrodes',
  'OEM Compatible','RoadMaster','Imported',
  'in_stock',0,1),

  (8,'Asphalt Paver Rubber Track Pad Set','asphalt-paver-rubber-track-pad','ASP-TRK-PAD-004',
  'Rubber track pads for asphalt pavers and road profilers, bolt-on type',
  'Bolt-on rubber track pads to protect road surfaces while paving. High-hardness NR/NBR rubber bonded to steel substrate. Replaces steel track shoe for road-friendly operation. Compatible with major paver undercarriages.',
  'Rubber: Natural rubber / NBR compound
Hardness: 65-70 Shore A
Backing: Steel plate with drill holes
Attachment: 2-bolt or 4-bolt per pad
Compatible: Vögele, CAT, Dynapac, Blaw-Knox
Set: Full crawler set (48-72 pads per machine)',
  'OEM Compatible','RoadMaster','Imported',
  'in_stock',0,1),

  (8,'Asphalt Plant Mixer Arm & Paddle Set','asphalt-mixer-arm-paddle','ASP-MXR-APD-005',
  'Twin-shaft pug mill mixer arms and paddles for batch mix asphalt plants',
  'Mixing arms and wear-resistant paddle liners for twin-shaft pug mill mixers in batch asphalt plants. High chrome iron casting paddles. Arms made from alloy steel. Full set per mixing shaft supplied.',
  'Paddle Material: Hi-chrome 26-28% Cr casting
Arm Material: Alloy steel 42CrMo4
Hardness: 600-650 HB (paddles)
Compatible: AMMANN, BENNINGHOVEN, ASTEC, Parker batch plant mixers
Attachment: Bolt-on paddles with anti-wear inserts
Set: Complete shaft set (arms + paddles)',
  'OEM Compatible','RoadMaster','Imported',
  'in_stock',0,1),

  (8,'Asphalt Paver Conveyor & Drag Slat Chain','asphalt-paver-conveyor-chain','ASP-CVR-CHN-006',
  'Paver material feed conveyor (drag slat) chain and flight assemblies',
  'Drive and conveyor chain assemblies for asphalt paver material feed system. Hardened chain pins, bushings, and side plates. Drag slat (scraper flight) boards included. Key wear item in paver maintenance.',
  'Chain: Double pitch conveyor chain
Material: Case-hardened alloy steel
Flight: Mild steel slat board or UHMWPE
Compatible: Vögele, CAT AP, Dynapac F-series
Pitch: 1.5" to 3" (machine specific)
Sale: Per meter or full circuit set',
  'OEM Compatible','RoadMaster','Pakistan',
  'in_stock',0,1),

  (8,'Thermal Oil (Hot Oil) Pump for Asphalt Plant','thermal-oil-pump-asphalt','ASP-TOP-001-007',
  'Thermal oil circulation pump for asphalt plant, 350°C rated, mechanical seal type',
  'High-temperature thermal oil circulation pumps for asphalt mixing plant and storage tank heating systems. Carbon graphite mechanical seals. Suitable for Mobiltherm, Shell Thermia, and other heat transfer oils.',
  'Type: Centrifugal hot oil pump
Temp Rating: Up to 350°C
Flow: 5 to 200 m³/hr
Pressure: Up to 10 bar
Mechanical Seal: Carbon graphite (high-temp)
Material: Cast steel casing / Stainless impeller',
  'ISO 2858','RoadMaster','Imported',
  'in_stock',0,1),

  (8,'Asphalt Plant Baghouse Filter Bag','baghouse-filter-bag-asphalt','ASP-BGH-FBG-008',
  'Pulse-jet baghouse dust collector filter bags for asphalt mixing plants, fiberglass & PTFE',
  'Fabric filter bags for asphalt plant baghouse (dust collector) systems. Fiberglass needlefelt with PTFE membrane for high-temperature, high-dust-load applications. Snap-band or sew-in top depending on housing.',
  'Media: Fiberglass needlefelt + PTFE membrane
Temp Rating: Continuous 260°C
Diameter: 127 mm to 160 mm
Length: Per baghouse model (1.5 m to 8 m)
End Cap: Snap-band, sewn collar, or open/closed
Compatible: All standard pulse-jet baghouses',
  'OEM Compatible','CleanDrill','Imported',
  'in_stock',0,1),

  (8,'Asphalt Paver Vibration Motor Eccentric Unit','asphalt-paver-vibration-motor','ASP-VBM-001-009',
  'Hydraulic vibration motor and eccentric weight assembly for asphalt paver screed',
  'Hydraulic orbital motors driving eccentric weight shafts to create screed compaction vibration. High-frequency operation (50-60 Hz). Bearing replaceable without removing from screed. Matched pairs for uniform vibration.',
  'Type: Hydraulic orbital motor
Frequency: 50-60 Hz at rated speed
Motor: 250 cc/rev orbital, BSPP ports
Eccentric: Solid steel counterweight
Mount: Flanged to screed beam
Compatible: Vögele, CAT, Dynapac screeds',
  'OEM Compatible','HydroTech','Imported',
  'in_stock',0,1),

  (8,'Paver Auger & Auger Gearbox Assembly','paver-auger-gearbox-assembly','ASP-AUG-GBX-010',
  'Asphalt paver transverse auger (screw conveyor) and spiral gearbox for material distribution',
  'Auger screws and helical gearboxes for lateral distribution of asphalt mix across the screed width. Left and right-hand helix. Spiral weld-on flights available for worn auger repair. Gearbox with oil bath lubrication.',
  'Auger Dia: 300 mm to 450 mm OD
Material: Abrasion resistant steel 400 HB
Gearbox Type: Helical bevel, 4-12 kW input
Ratio: 10:1 to 25:1 (machine speed dependent)
Compatible: Vögele Super series, CAT AP, Blaw-Knox
Repair Option: Wear flights available separately',
  'OEM Compatible','RoadMaster','Pakistan',
  'in_stock',0,1),

  (8,'Asphalt Plant Drying Drum Chain Drive','asphalt-drum-chain-drive','ASP-DRM-CDR-011',
  'Trunnion ring gear, pinion, and chain drive assembly for asphalt drum mix plant',
  'Drum drive system components including trunnion ring gear, drive pinion, chain drive sprockets, and roller chain for rotating dryer drum. Heat-treated alloy steel for long service life in dusty high-temperature environment.',
  'Ring Gear: Alloy steel 42CrMo4, OD 2-5 m
Pinion: Case-hardened mating pinion
Chain Drive: Heavy duty roller chain #200-#240
Sprockets: Hardened tooth sprockets
Temp: Suitable for 150-200°C ambient
Lubrication: Open gear grease or chain lube',
  'OEM Compatible','RoadMaster','Pakistan',
  'on_order',0,1),

  (8,'Cold Planer (Milling Machine) Drum Bits','cold-planer-milling-drum-bits','ASP-CPL-DBT-012',
  'Road milling/cold planer cutting drum picks, holders, and base plate sets',
  'Cutting picks (bits), bit holders (toolholders), and base plates for road cold planers and surface miners. Round shank picks with brazed tungsten carbide tips. For all major cold planer brands.',
  'Pick Type: Round shank (W-type)
Tip: Brazed tungsten carbide
Grade: K34 or K20 carbide grade
Shank OD: 20 mm / 25 mm standard
Holder: Bolt-on or weld-on type
Compatible: Wirtgen W50-W2200, Bomag, Caterpillar PM',
  'OEM Compatible','HardLife','Imported',
  'in_stock',1,1),

  (8,'Paver Tamper Bar & Heating Element','paver-tamper-bar-heating-element','ASP-TMB-HEL-013',
  'Asphalt paver tamper bar assembly and screed heating element replacement',
  'Tamper bar beam and heating elements for asphalt paver screeds. Tamper bar pre-compacts mat ahead of screed plate. Electric heating elements maintain screed temperature for smooth mat finish.',
  'Tamper Bar: Hardened steel, full replacement
Bar Dimensions: Per machine model
Heating: Electric tubular element 230V/400V
Wattage: 1000-3000W per element
Compatible: Vögele, CAT, DYNAPAC, ABG
Installation: Plug-and-play replacement elements',
  'OEM Compatible','RoadMaster','Imported',
  'in_stock',0,1),

  (8,'Asphalt Batch Plant Dust Filter Screw Conveyor','asphalt-dust-filter-screw-conveyor','ASP-SCW-CCV-014',
  'Dust return screw conveyor (fines auger) for asphalt batch plant baghouse return system',
  'Screw conveyors for transporting collected fines from baghouse dust collector back to the mixing process. CEMA-standard design. Sealed trough with UHMWPE or AR450 lining. Variable speed motor drive.',
  'Diameter: 200 mm to 400 mm screw OD
Length: Custom per plant layout
Material: MS trough with AR450 or UHMWPE liner
Bearing: External sealed pillow block bearings
Drive: 2.2-15 kW motor with gearbox
Capacity: 5-50 tonnes/hour (fines)',
  'CEMA Standard','RoadMaster','Pakistan',
  'on_order',0,1),

  (8,'Asphalt Plant Hot Mix Storage Silo Components','asphalt-hot-mix-silo-parts','ASP-HMS-SLP-015',
  'Hot mix storage silo chute, gate, actuator, and level sensor replacement parts',
  'Wear parts and actuator assemblies for hot mix asphalt storage silos. Telescoping discharge chutes, pneumatically operated gate valves, proximity sensors, and load cells. Keeps silo operating for continuous paving.',
  'Chute: AR450 / Hardox 400 inner liner
Gate: Pneumatic cylinder operated
Seal: High-temp silicone gasket
Sensor: Proximity or load cell type
Actuator: Pneumatic or hydraulic cylinder
Compatible: AMMANN, Parker, Benninghoven, ASTEC silo systems',
  'OEM Compatible','RoadMaster','Pakistan',
  'on_order',0,1);

  -- ─── CATEGORY 9: Asphalt Plant Works & Components (cat_id=9) ─────────
  INSERT IGNORE INTO `products` (`category_id`,`name`,`slug`,`sku`,`short_description`,`description`,`specifications`,`standards`,`brand`,`origin`,`stock_status`,`is_featured`,`is_active`) VALUES
  (9,'Rotary Drying Drum Mixer','rotary-drying-drum-mixer','ASP-PLT-DRM-001',
  'Continuous rotary drying drum mixer for asphalt plant with counter-flow design.',
  'Heavy duty asphalt plant drying drum engineered for maximum heat transfer efficiency and uniform aggregate coating. Features optimized flight configuration and high-efficiency drive rollers.',
  'Capacity: 80 - 120 TPH
Diameter: 1.8 meters
Length: 7.5 meters
Drive System: 4-Wheel Friction Drive
Motor Power: 30 kW
Shell Thickness: 12 mm (Heat Resistant Steel)',
  'ISO 9001, CE','RoadMaster','Imported',
  'on_order',0,1),

  (9,'High-Efficiency HFO Burner System','hfo-burner-system-asphalt','ASP-PLT-BRN-002',
  'Industrial dual-fuel (HFO and Diesel) burner for asphalt plant dryer drums.',
  'Fully automated burner system designed for precise temperature control in asphalt drying drums. Low emission profile with high turndown ratio.',
  'Fuel Types: HFO / Diesel / Gas
Thermal Output: 12 MW
Turndown Ratio: 1:5
Air Fan Motor: 22 kW
Control: Automatic Modulating PLC
Fuel Consumption: 500 - 1200 L/hr',
  'EN 267, CE','FireFlow','Imported',
  'on_order',0,1),

  (9,'Bitumen Decanter & Heating Tank','bitumen-decanter-heating-tank','ASP-PLT-DEC-003',
  'Bitumen drum decanter and melter with thermal oil heating coils.',
  'Thermal oil heated bitumen decanting system for melting solid asphalt binder from standard steel drums. Designed with hydraulic lifters for automated drum loading.',
  'Melting Capacity: 4 - 5 Tons/hr
Drum Capacity: 28 drums per batch
Heating Medium: Thermal Oil
Oil Temp Rating: 250°C
Hydraulic Power: 7.5 kW
Insulation: 50 mm Rockwool',
  'ASME Sec VIII','HeatTech','Pakistan/Imported',
  'in_stock',0,1);

  -- ─── CATEGORY 10: Batching Plants & Components (cat_id=10) ───────────
  INSERT IGNORE INTO `products` (`category_id`,`name`,`slug`,`sku`,`short_description`,`description`,`specifications`,`standards`,`brand`,`origin`,`stock_status`,`is_featured`,`is_active`) VALUES
  (10,'Twin-Shaft Concrete Mixer (Pugmill)','twin-shaft-concrete-mixer-pugmill','CON-PLT-MXR-001',
  'Heavy duty twin-shaft concrete mixer for batching plants, 1.5 m³ capacity.',
  'High-performance concrete mixer with synchronized twin horizontal shafts. Ideal for wet mix concrete batching plants, precast concrete production, and dams.',
  'Discharge Capacity: 1.5 m³ (1500L)
Charging Capacity: 2.25 m³
Motor Power: 2 x 30 kW
Mixing Blade Speed: 24 RPM
Liner Material: High Chrome Cast Iron (20mm)
Max Aggregate Size: 80 mm',
  'DIN 459, CE','ConMix','Imported',
  'in_stock',0,1),

  (10,'Bolted Cement Storage Silo (100-Ton)','bolted-cement-storage-silo-100t','CON-PLT-SLO-002',
  '100-ton capacity bolted steel cement storage silo for easy transport.',
  'Premium modular bolted steel silo for storing cement, fly ash, or bentonite. Easily shipped in standard containers and assembled on site with rubber seals.',
  'Capacity: 100 Tons
Volume: 75 m³
Silo Diameter: 3.0 meters
Shell Thickness: 5 mm / 6 mm
Discharge Height: 1.5 meters
Accessories: Dust filter, safety valve, level sensors',
  'ASME, ISO 9001','SiloPro','Pakistan',
  'in_stock',0,1),

  (10,'Cement Screw Conveyor (Auger)','cement-screw-conveyor-auger','CON-PLT-SCW-003',
  'Industrial cement screw conveyor auger, 219mm diameter, custom lengths.',
  'Helical screw conveyor designed for cement feeding from silos to weigh hoppers. Maintenance-free intermediate bearings and robust gear drive.',
  'Diameter: 219 mm
Max Capacity: 45 Tons/hr
Angle of Incline: 30° - 45°
Motor Power: 7.5 kW
Gearbox Type: Helical Gear Motor
Tube Thickness: 6 mm',
  'CEMA, ISO 9001','SiloPro','Pakistan/Imported',
  'in_stock',0,1),

  (10,'Aggregate Batching Bin & Weigh Hopper','aggregate-batching-bin-weigh-hopper','CON-PLT-BIN-004',
  '4-bin aggregate batcher and weigh hopper with pneumatic discharge gates.',
  'Aggregate storage and dosing bins for sand, gravel, and crushed stone. High-accuracy load cells under the weigh hopper ensure precise concrete mix designs.',
  'Bins: 4 bins x 15 m³ each
Total Capacity: 60 m³
Weighing Hopper Capacity: 3000 kg
Load Cells: 4 x OIML approved shear beam
Pneumatic Cylinders: Festo / Airtac
Belt Conveyor Width: 800 mm',
  'OIML, CE','ConMix','Pakistan',
  'in_stock',0,1),

  (10,'Batching Plant PLC Control Cabin','batching-plant-plc-control-cabin','CON-PLT-CAB-005',
  'Fully automated computer control system cabin for concrete batching plants.',
  'Climate-controlled control cabin equipped with a dual-monitor PC, PLC hardware, and SCADA concrete batching software. Supports multi-recipe management and automatic compensation.',
  'PLC System: Siemens S7-1200
Display: 21.5-inch Dual Monitors
Recipe Storage: Unlimited
Accuracy: Cement ±1%, Water ±1%, Aggregates ±2%
Cabin Dimensions: 2.4m x 1.8m x 2.2m
A/C Unit: Included (1.5 Ton)',
  'IEC 60204, CE','SmartBatch','Imported',
  'on_order',0,1);

RNDISQL;

      $ran = 0;
      $affected = 0;
      $errMsg = '';

      try {
          $port = defined('DB_PORT') ? (int)DB_PORT : 3306;
          $mdb  = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME, $port ?: 3306);
          if ($mdb->connect_errno) {
              $errMsg = 'Connection failed: ' . $mdb->connect_error;
          } else {
              $mdb->set_charset('utf8mb4');
              if ($mdb->multi_query($sql)) {
                  do {
                      $ran++;
                      $affected += $mdb->affected_rows;
                      if ($res = $mdb->store_result()) {
                          $res->free();
                      }
                  } while ($mdb->more_results() && $mdb->next_result());
              }
              if ($mdb->errno && $mdb->errno !== 1062) {
                  $errMsg = 'MySQL error ' . $mdb->errno . ': ' . $mdb->error;
              }
              $mdb->close();
          }
      } catch (Throwable $ex) {
          $errMsg = $ex->getMessage();
      }

      if (empty($errMsg)) {
          updateProductImages();
      }

      // Count how many products now exist
      $totalNow = Database::fetchOne("SELECT COUNT(*) as c FROM products")['c'] ?? 0;

      $result = [
          'ran'      => $ran,
          'affected' => $affected,
          'total'    => $totalNow,
          'error'    => $errMsg,
      ];
      } elseif (($_POST['map_images'] ?? '') === 'yes') {
          $count = updateProductImages();
          $mapResult = ['success' => true, 'count' => $count];
      }
  }

  // Count current products
  $currentCount = Database::fetchOne("SELECT COUNT(*) as c FROM products")['c'] ?? 0;
  $catCounts = Database::fetchAll("SELECT c.name, COUNT(p.id) as cnt FROM categories c LEFT JOIN products p ON p.category_id=c.id GROUP BY c.id ORDER BY c.sort_order");
  ?>

  <div class="max-w-2xl">

    <?php if ($mapResult): ?>
      <div class="bg-green-900 border border-green-600 text-green-200 rounded p-4 mb-6">
        <div class="font-bold text-base mb-1">✅ Image Auto-Mapper Completed!</div>
        <div class="text-sm">Successfully mapped and updated <strong><?= (int)$mapResult['count'] ?></strong> products to their respective images.</div>
      </div>
    <?php endif; ?>

    <?php if ($result): ?>
      <?php if ($result['error']): ?>
        <div class="bg-red-900 border border-red-600 text-red-200 rounded p-4 mb-6 text-sm">
          <strong>Error:</strong> <?= htmlspecialchars($result['error']) ?>
        </div>
      <?php else: ?>
        <div class="bg-green-900 border border-green-600 text-green-200 rounded p-4 mb-6">
          <div class="font-bold text-base mb-1">✅ Seeder ran successfully!</div>
          <div class="text-sm">SQL blocks executed: <strong><?= (int)$result['ran'] ?></strong></div>
          <div class="text-sm">Rows affected (new inserts): <strong><?= (int)$result['affected'] ?></strong></div>
          <div class="text-sm">Total products in catalog now: <strong><?= (int)$result['total'] ?></strong></div>
          <div class="text-xs text-green-400 mt-2">Existing products were skipped (INSERT IGNORE) and auto-mapped to their images.</div>
        </div>
      <?php endif; ?>
    <?php endif; ?>

    <div class="card-dark p-6 mb-6">
      <h2 class="font-semibold text-lg mb-1">Product Seeder</h2>
      <p class="text-sm text-gray-400 mb-4">
        Inserts <strong>110 new products</strong> across all 8 categories (15 per category)
        using <code class="bg-navy-900 px-1 rounded">INSERT IGNORE</code> — completely safe to run multiple times.
      </p>

      <div class="mb-4">
        <div class="text-xs text-gray-400 mb-2">Current product counts per category:</div>
        <table class="data-table text-sm mb-1">
          <thead><tr><th>Category</th><th>Products</th><th>Target</th></tr></thead>
          <tbody>
          <?php foreach ($catCounts as $cat): ?>
            <tr>
              <td><?= htmlspecialchars($cat['name']) ?></td>
              <td class="font-mono <?= $cat['cnt'] >= 15 ? 'text-green-400' : 'text-orange-400' ?>">
                <?= (int)$cat['cnt'] ?>
              </td>
              <td class="text-gray-400 text-xs">≥ 15</td>
            </tr>
          <?php endforeach; ?>
          </tbody>
        </table>
        <div class="text-xs text-gray-400">Total: <strong><?= $currentCount ?></strong> products currently in catalog</div>
      </div>

      <?php if ((int)$currentCount < 100): ?>
      <form method="POST">
        <input type="hidden" name="confirm" value="yes">
        <button type="submit" class="btn-primary"
          onclick="return confirm('Run product seeder? This will insert up to 110 new products. Safe to run multiple times.')">
          ▶ Run Product Seeder Now
        </button>
      </form>
      <?php else: ?>
        <div class="bg-green-900 border border-green-600 text-green-200 rounded p-3 text-sm">
          ✅ Catalog already has <?= $currentCount ?> products — seeder may have already run.
          You can still run it again (duplicates will be skipped).
          <form method="POST" class="mt-2">
            <input type="hidden" name="confirm" value="yes">
            <button type="submit" class="btn-primary text-xs">Run Again (skip duplicates)</button>
          </form>
        </div>
      <?php endif; ?>
      
      <div class="mt-6 pt-6 border-t border-white/5">
        <h3 class="font-semibold text-sm mb-2 text-orange-400">🔗 Image Mapping Diagnostics</h3>
        <p class="text-xs text-gray-400 mb-4">
          If your products or categories are showing a gear emoji instead of their generated photographs, run the auto-mapper to link them to their image files inside <code>uploads/products/</code>.
        </p>
        <form method="POST">
          <input type="hidden" name="map_images" value="yes">
          <button type="submit" class="btn-outline text-xs">
            🔗 Run Image Auto-Mapper
          </button>
        </form>
      </div>
    </div>

    <div class="card-dark p-4 text-xs text-gray-400">
      <strong>Security note:</strong> Delete <code>admin/seed-products.php</code> from your server via FTP or cPanel File Manager after seeding is complete.
    </div>

  </div>

  <?php
  function updateProductImages() {
      $imageFiles = [
          'prod-asphalt-burner.png',
          'prod-asphalt-pump.png',
          'prod-asphalt-screed.png',
          'prod-asphalt.png',
          'prod-ball-valve.png',
          'prod-batching-bin.png',
          'prod-bitumen-decanter.png',
          'prod-blind-flange.png',
          'prod-bucket-tooth.png',
          'prod-butterfly-valve.png',
          'prod-cement-silo.png',
          'prod-check-valve.png',
          'prod-concrete-mixer.png',
          'prod-control-cabin.png',
          'prod-crusher-jaw.png',
          'prod-cutting-edge.png',
          'prod-drill-bit.png',
          'prod-dryer-drum.png',
          'prod-dth-hammer.png',
          'prod-earthmoving.png',
          'prod-elevator-chain.png',
          'prod-flange.png',
          'prod-full-face-gasket.png',
          'prod-gasket.png',
          'prod-gate-valve.png',
          'prod-globe-valve.png',
          'prod-hydraulic-accumulator.png',
          'prod-hydraulic-cylinder.png',
          'prod-hydraulic-hose.png',
          'prod-hydraulic-pump.png',
          'prod-hydraulic-valve.png',
          'prod-hydraulic.png',
          'prod-kammprofile-gasket.png',
          'prod-mining-pump.png',
          'prod-mining.png',
          'prod-needle-valve.png',
          'prod-pipe-elbow.png',
          'prod-pipe-reducer.png',
          'prod-pipe-tee.png',
          'prod-pipe.png',
          'prod-pressure-relief-valve.png',
          'prod-rtj-gasket.png',
          'prod-screw-conveyor.png',
          'prod-slip-on-flange.png',
          'prod-socket-weld-flange.png',
          'prod-spectacle-blind.png',
          'prod-spiral-gasket.png',
          'prod-sprocket.png',
          'prod-steel-pipe.png',
          'prod-track-link.png',
          'prod-track-shoe.png',
          'prod-valve.png',
          'prod-weld-neck-flange.png'
      ];

      $products = Database::fetchAll("SELECT id, category_id, name, slug FROM products");
      $updatedCount = 0;
      foreach ($products as $prod) {
          $slug = $prod['slug'];
          $name = strtolower($prod['name']);
          $catId = (int)$prod['category_id'];
          $chosenImage = '';

          // 1. Try to find match in filenames based on slug or name
          foreach ($imageFiles as $file) {
              $baseName = pathinfo($file, PATHINFO_FILENAME);
              $cleanBase = preg_replace('/^prod-/', '', $baseName);
              
              if ($cleanBase !== '' && (strpos($slug, $cleanBase) !== false || strpos($cleanBase, $slug) !== false || strpos($name, $cleanBase) !== false)) {
                  $chosenImage = 'products/' . $file;
                  break;
              }
          }

          // 2. If no direct match, try keyword matching
          if (!$chosenImage) {
              if (strpos($slug, 'weld-neck') !== false || strpos($name, 'weld neck') !== false) {
                  $chosenImage = 'products/prod-weld-neck-flange.png';
              } elseif (strpos($slug, 'slip-on') !== false || strpos($name, 'slip-on') !== false) {
                  $chosenImage = 'products/prod-slip-on-flange.png';
              } elseif (strpos($slug, 'socket-weld') !== false || strpos($name, 'socket weld') !== false) {
                  $chosenImage = 'products/prod-socket-weld-flange.png';
              } elseif (strpos($slug, 'blind-flange') !== false || strpos($name, 'blind flange') !== false || strpos($slug, 'spectacle-blind') !== false || strpos($name, 'spectacle blind') !== false) {
                  $chosenImage = 'products/prod-spectacle-blind.png';
              } elseif (strpos($slug, 'flange') !== false || strpos($name, 'flange') !== false) {
                  $chosenImage = 'products/prod-flange.png';
              } elseif (strpos($slug, 'elbow') !== false || strpos($name, 'elbow') !== false) {
                  $chosenImage = 'products/prod-pipe-elbow.png';
              } elseif (strpos($slug, 'reducer') !== false || strpos($name, 'reducer') !== false) {
                  $chosenImage = 'products/prod-pipe-reducer.png';
              } elseif (strpos($slug, 'tee') !== false || strpos($name, 'tee') !== false) {
                  $chosenImage = 'products/prod-pipe-tee.png';
              } elseif (strpos($slug, 'pipe') !== false || strpos($name, 'pipe') !== false) {
                  if (strpos($slug, 'steel') !== false || strpos($name, 'steel') !== false) {
                      $chosenImage = 'products/prod-steel-pipe.png';
                  } else {
                      $chosenImage = 'products/prod-pipe.png';
                  }
              } elseif (strpos($slug, 'gate-valve') !== false || strpos($name, 'gate valve') !== false) {
                  $chosenImage = 'products/prod-gate-valve.png';
              } elseif (strpos($slug, 'ball-valve') !== false || strpos($name, 'ball valve') !== false) {
                  $chosenImage = 'products/prod-ball-valve.png';
              } elseif (strpos($slug, 'globe-valve') !== false || strpos($name, 'globe valve') !== false) {
                  $chosenImage = 'products/prod-globe-valve.png';
              } elseif (strpos($slug, 'check-valve') !== false || strpos($name, 'check valve') !== false) {
                  $chosenImage = 'products/prod-check-valve.png';
              } elseif (strpos($slug, 'butterfly-valve') !== false || strpos($name, 'butterfly valve') !== false) {
                  $chosenImage = 'products/prod-butterfly-valve.png';
              } elseif (strpos($slug, 'relief-valve') !== false || strpos($name, 'relief valve') !== false || strpos($slug, 'safety-valve') !== false || strpos($name, 'safety valve') !== false) {
                  $chosenImage = 'products/prod-pressure-relief-valve.png';
              } elseif (strpos($slug, 'needle-valve') !== false || strpos($name, 'needle valve') !== false) {
                  $chosenImage = 'products/prod-needle-valve.png';
              } elseif (strpos($slug, 'valve') !== false || strpos($name, 'valve') !== false) {
                  $chosenImage = 'products/prod-valve.png';
              } elseif (strpos($slug, 'gasket') !== false || strpos($name, 'gasket') !== false || strpos($slug, 'rtj') !== false || strpos($name, 'rtj') !== false) {
                  if (strpos($slug, 'kammprofile') !== false || strpos($name, 'kammprofile') !== false) {
                      $chosenImage = 'products/prod-kammprofile-gasket.png';
                  } elseif (strpos($slug, 'spiral') !== false || strpos($name, 'spiral') !== false) {
                      $chosenImage = 'products/prod-spiral-gasket.png';
                  } elseif (strpos($slug, 'rtj') !== false || strpos($name, 'rtj') !== false) {
                      $chosenImage = 'products/prod-rtj-gasket.png';
                  } else {
                      $chosenImage = 'products/prod-gasket.png';
                  }
              } elseif (strpos($slug, 'full-face') !== false || strpos($name, 'full face') !== false) {
                  $chosenImage = 'products/prod-full-face-gasket.png';
              } elseif (strpos($slug, 'cylinder') !== false || strpos($name, 'cylinder') !== false) {
                  $chosenImage = 'products/prod-hydraulic-cylinder.png';
              } elseif (strpos($slug, 'hydraulic-pump') !== false || strpos($name, 'hydraulic pump') !== false || strpos($slug, 'gear-pump') !== false || strpos($name, 'gear pump') !== false || strpos($slug, 'piston-pump') !== false || strpos($name, 'piston pump') !== false) {
                  $chosenImage = 'products/prod-hydraulic-pump.png';
              } elseif (strpos($slug, 'hydraulic-hose') !== false || strpos($name, 'hydraulic hose') !== false) {
                  $chosenImage = 'products/prod-hydraulic-hose.png';
              } elseif (strpos($slug, 'hydraulic-valve') !== false || strpos($name, 'hydraulic valve') !== false) {
                  $chosenImage = 'products/prod-hydraulic-valve.png';
              } elseif (strpos($slug, 'accumulator') !== false || strpos($name, 'accumulator') !== false) {
                  $chosenImage = 'products/prod-hydraulic-accumulator.png';
              } elseif (strpos($slug, 'hydraulic') !== false || strpos($name, 'hydraulic') !== false) {
                  $chosenImage = 'products/prod-hydraulic.png';
              } elseif (strpos($slug, 'crusher-jaw') !== false || strpos($name, 'crusher jaw') !== false || strpos($slug, 'crusher') !== false || strpos($name, 'crusher') !== false) {
                  $chosenImage = 'products/prod-crusher-jaw.png';
              } elseif (strpos($slug, 'drill') !== false || strpos($name, 'drill') !== false) {
                  $chosenImage = 'products/prod-drill-bit.png';
              } elseif (strpos($slug, 'dth-hammer') !== false || strpos($name, 'dth hammer') !== false) {
                  $chosenImage = 'products/prod-dth-hammer.png';
              } elseif (strpos($slug, 'mining-pump') !== false || strpos($name, 'mining pump') !== false) {
                  $chosenImage = 'products/prod-mining-pump.png';
              } elseif (strpos($slug, 'mining') !== false || strpos($name, 'mining') !== false) {
                  $chosenImage = 'products/prod-mining.png';
              } elseif (strpos($slug, 'asphalt-burner') !== false || strpos($name, 'asphalt burner') !== false) {
                  $chosenImage = 'products/prod-asphalt-burner.png';
              } elseif (strpos($slug, 'asphalt-pump') !== false || strpos($name, 'asphalt pump') !== false) {
                  $chosenImage = 'products/prod-asphalt-pump.png';
              } elseif (strpos($slug, 'asphalt-screed') !== false || strpos($name, 'asphalt screed') !== false) {
                  $chosenImage = 'products/prod-asphalt-screed.png';
              } elseif (strpos($slug, 'asphalt') !== false || strpos($name, 'asphalt') !== false) {
                  $chosenImage = 'products/prod-asphalt.png';
              } elseif (strpos($slug, 'elevator-chain') !== false || strpos($name, 'elevator chain') !== false) {
                  $chosenImage = 'products/prod-elevator-chain.png';
              } elseif (strpos($slug, 'sprocket') !== false || strpos($name, 'sprocket') !== false) {
                  $chosenImage = 'products/prod-sprocket.png';
              } elseif (strpos($slug, 'bucket-tooth') !== false || strpos($name, 'bucket teeth') !== false || strpos($name, 'bucket tooth') !== false) {
                  $chosenImage = 'products/prod-bucket-tooth.png';
              } elseif (strpos($slug, 'cutting-edge') !== false || strpos($name, 'cutting edge') !== false) {
                  $chosenImage = 'products/prod-cutting-edge.png';
              } elseif (strpos($slug, 'track-link') !== false || strpos($name, 'track link') !== false) {
                  $chosenImage = 'products/prod-track-link.png';
              } elseif (strpos($slug, 'track-shoe') !== false || strpos($name, 'track shoe') !== false) {
                  $chosenImage = 'products/prod-track-shoe.png';
              } elseif (strpos($slug, 'earthmoving') !== false || strpos($name, 'earthmoving') !== false) {
                  $chosenImage = 'products/prod-earthmoving.png';
              } elseif (strpos($slug, 'concrete-mixer') !== false || strpos($name, 'concrete mixer') !== false || strpos($slug, 'pugmill') !== false || strpos($name, 'pugmill') !== false) {
                  $chosenImage = 'products/prod-concrete-mixer.png';
              } elseif (strpos($slug, 'cement-silo') !== false || strpos($name, 'cement silo') !== false || strpos($slug, 'storage-silo') !== false || strpos($name, 'storage silo') !== false) {
                  $chosenImage = 'products/prod-cement-silo.png';
              } elseif (strpos($slug, 'screw-conveyor') !== false || strpos($name, 'screw conveyor') !== false || strpos($slug, 'auger') !== false || strpos($name, 'auger') !== false) {
                  $chosenImage = 'products/prod-screw-conveyor.png';
              } elseif (strpos($slug, 'batching-bin') !== false || strpos($name, 'batching bin') !== false || strpos($slug, 'weigh-hopper') !== false || strpos($name, 'weigh hopper') !== false) {
                  $chosenImage = 'products/prod-batching-bin.png';
              } elseif (strpos($slug, 'control-cabin') !== false || strpos($name, 'control cabin') !== false || strpos($slug, 'plc-cabin') !== false || strpos($name, 'plc cabin') !== false) {
                  $chosenImage = 'products/prod-control-cabin.png';
              } elseif (strpos($slug, 'decanter') !== false || strpos($name, 'decanter') !== false) {
                  $chosenImage = 'products/prod-bitumen-decanter.png';
              } elseif (strpos($slug, 'dryer-drum') !== false || strpos($name, 'dryer drum') !== false || strpos($slug, 'drying-drum') !== false || strpos($name, 'drying drum') !== false) {
                  $chosenImage = 'products/prod-dryer-drum.png';
              }
          }

          // 3. Fallback to category-based defaults
          if (!$chosenImage) {
              switch ($catId) {
                  case 1: $chosenImage = 'products/prod-flange.png'; break;
                  case 2: $chosenImage = 'products/prod-pipe.png'; break;
                  case 3: $chosenImage = 'products/prod-valve.png'; break;
                  case 4: $chosenImage = 'products/prod-gasket.png'; break;
                  case 5: $chosenImage = 'products/prod-mining.png'; break;
                  case 6: $chosenImage = 'products/prod-hydraulic.png'; break;
                  case 7: $chosenImage = 'products/prod-earthmoving.png'; break;
                  case 8: $chosenImage = 'products/prod-asphalt.png'; break;
                  case 9: $chosenImage = 'products/prod-dryer-drum.png'; break;
                  case 10: $chosenImage = 'products/prod-concrete-mixer.png'; break;
                  default:
                      $chosenImage = 'products/prod-valve.png'; break;
              }
          }

          Database::execute("UPDATE products SET image = ? WHERE id = ?", [$chosenImage, $prod['id']]);
          $updatedCount++;
      }
      return $updatedCount;
  }
  ?>
  <?php include __DIR__ . '/includes/footer.php'; ?>
  