-- Insert comprehensive spare part categories including Motorcycle, Commercial/Truck, and expanded Vehicle parts
-- This script is idempotent and can be run multiple times safely
-- Uses INSERT IGNORE to skip duplicates

INSERT IGNORE INTO `categories` (`name`, `description`, `isActive`) VALUES
-- ============================================
-- PASSENGER VEHICLE PARTS
-- ============================================

-- ENGINE & POWERTRAIN
('engines', 'Complete engines, engine blocks, cylinder heads', 1),
('engine_components', 'Pistons, rings, crankshafts, camshafts, valves, gaskets', 1),
('transmissions', 'Manual, automatic, CVT transmissions', 1),
('clutch_systems', 'Clutch plates, pressure plates, flywheels', 1),
('drivetrain', 'Drive shafts, axles, differentials, transfer cases', 1),
('turbochargers', 'Turbochargers and superchargers', 1),
('engine_mounts', 'Engine mounts and brackets', 1),
('timing_belts', 'Timing belts and timing chains', 1),
('oil_pans', 'Oil pans and engine sumps', 1),
('valve_covers', 'Valve covers and gaskets', 1),
('camshafts', 'Camshafts and camshaft components', 1),
('crankshafts', 'Crankshafts and crankshaft components', 1),
('connecting_rods', 'Connecting rods and rod bearings', 1),
('pistons', 'Pistons, piston rings, and wrist pins', 1),
('cylinder_heads', 'Cylinder heads and head gaskets', 1),
('intake_manifolds', 'Intake manifolds and plenums', 1),
('exhaust_manifolds', 'Exhaust manifolds and headers', 1),

-- COOLING SYSTEM
('radiators', 'Radiators and cooling system parts', 1),
('cooling_fans', 'Cooling fans and fan assemblies', 1),
('water_pumps', 'Water pumps and components', 1),
('thermostats', 'Thermostats and temperature controls', 1),
('hoses_belts', 'Radiator hoses, heater hoses, timing belts', 1),
('coolant_reservoirs', 'Coolant reservoirs and overflow tanks', 1),
('heater_cores', 'Heater cores and heating systems', 1),
('intercoolers', 'Intercoolers and charge air coolers', 1),
('oil_coolers', 'Oil coolers and transmission coolers', 1),

-- ELECTRICAL & LIGHTING
('headlights', 'Headlights - Halogen, LED, HID, Xenon', 1),
('taillights', 'Taillights and brake lights', 1),
('turn_signals', 'Turn signals and indicators', 1),
('fog_lights', 'Fog lights and auxiliary lighting', 1),
('interior_lights', 'Interior lighting components', 1),
('batteries', 'Car batteries and battery components', 1),
('alternators', 'Alternators and generators', 1),
('starters', 'Starters and starter motors', 1),
('ignition_systems', 'Spark plugs, coils, distributors, ignition modules', 1),
('wiring_harnesses', 'Wiring harnesses and electrical wiring', 1),
('fuses_relays', 'Fuses and relays', 1),
('sensors', 'O2, MAF, MAP, temperature, pressure sensors', 1),
('ecus', 'ECUs and engine control modules', 1),
('voltage_regulators', 'Voltage regulators and rectifiers', 1),
('solenoids', 'Solenoids and actuators', 1),

-- BODY & EXTERIOR
('bumpers', 'Front and rear bumpers', 1),
('fenders', 'Fenders and fender panels', 1),
('hoods', 'Hoods and hood components', 1),
('doors', 'Complete doors, door panels, handles', 1),
('trunk_lids', 'Trunk lids and tailgates', 1),
('quarter_panels', 'Quarter panels and body panels', 1),
('rocker_panels', 'Rocker panels and side panels', 1),
('grilles', 'Grilles and grille components', 1),
('mirrors', 'Side mirrors and rearview mirrors', 1),
('door_handles', 'Door handles and exterior handles', 1),
('window_regulators', 'Window regulators and mechanisms', 1),
('weatherstripping', 'Weatherstripping and seals', 1),
('body_molding', 'Body molding and trim pieces', 1),
('side_skirts', 'Side skirts and body extensions', 1),
('spoilers', 'Spoilers and wings', 1),

-- GLASS & WINDOWS
('windshields', 'Windshields and front glass', 1),
('side_windows', 'Side windows and door glass', 1),
('rear_windows', 'Rear windows and back glass', 1),
('sunroofs', 'Sunroofs and moonroofs', 1),
('window_motors', 'Window motors and regulators', 1),
('windshield_wipers', 'Windshield wipers and wiper blades', 1),
('windshield_washer_pumps', 'Washer pumps and reservoirs', 1),

-- SUSPENSION & STEERING
('shock_absorbers', 'Shock absorbers and struts', 1),
('springs', 'Coil springs and leaf springs', 1),
('control_arms', 'Control arms and suspension arms', 1),
('ball_joints', 'Ball joints and suspension joints', 1),
('tie_rods', 'Tie rods and steering linkages', 1),
('steering_racks', 'Steering racks and power steering pumps', 1),
('power_steering', 'Power steering components', 1),
('sway_bars', 'Sway bars and stabilizer links', 1),
('bushings', 'Bushings and suspension mounts', 1),
('struts', 'Struts and strut assemblies', 1),
('steering_columns', 'Steering columns and components', 1),
('steering_wheels', 'Steering wheels and steering components', 1),
('idler_arms', 'Idler arms and pitman arms', 1),
('rack_and_pinion', 'Rack and pinion assemblies', 1),

-- BRAKES
('brake_pads', 'Brake pads and brake shoes', 1),
('brake_rotors', 'Brake rotors and drums', 1),
('brake_calipers', 'Brake calipers and brake components', 1),
('brake_lines', 'Brake lines and hoses', 1),
('master_cylinders', 'Master cylinders and brake cylinders', 1),
('brake_boosters', 'Brake boosters and assist systems', 1),
('abs_components', 'ABS components and sensors', 1),
('brake_fluid', 'Brake fluid and brake system fluids', 1),
('brake_drums', 'Brake drums and drum brake components', 1),
('parking_brake', 'Parking brake cables and components', 1),

-- WHEELS & TIRES
('wheels', 'Alloy wheels, steel wheels, custom wheels', 1),
('tires', 'All types and sizes of tires', 1),
('wheel_bearings', 'Wheel bearings and hub assemblies', 1),
('hub_assemblies', 'Hub assemblies and wheel hubs', 1),
('lug_nuts', 'Lug nuts, bolts, and wheel hardware', 1),
('wheel_covers', 'Wheel covers and center caps', 1),
('tpms_sensors', 'TPMS sensors and tire pressure monitoring', 1),
('wheel_spacers', 'Wheel spacers and adapters', 1),
('valve_stems', 'Valve stems and tire valves', 1),

-- EXHAUST SYSTEM
('catalytic_converters', 'Catalytic converters and emissions', 1),
('mufflers', 'Mufflers and exhaust silencers', 1),
('exhaust_pipes', 'Exhaust pipes and tubing', 1),
('resonators', 'Resonators and exhaust components', 1),
('oxygen_sensors', 'Oxygen sensors and exhaust sensors', 1),
('exhaust_tips', 'Exhaust tips and tailpipes', 1),
('downpipes', 'Downpipes and exhaust downpipes', 1),
('exhaust_clamps', 'Exhaust clamps and hangers', 1),

-- INTERIOR PARTS
('seats', 'Front and rear seats, seat covers', 1),
('dashboards', 'Dashboards and instrument panels', 1),
('center_consoles', 'Center consoles and console components', 1),
('door_panels', 'Door panels and interior trim', 1),
('headliners', 'Headliners and ceiling components', 1),
('carpet', 'Carpet and floor mats', 1),
('airbags', 'Airbags and safety systems', 1),
('seat_belts', 'Seat belts and restraint systems', 1),
('switches', 'Interior switches and controls', 1),
('gauges', 'Instrument gauges and clusters', 1),
('cup_holders', 'Cup holders and storage compartments', 1),
('glove_boxes', 'Glove boxes and storage compartments', 1),
('sun_visors', 'Sun visors and vanity mirrors', 1),

-- AIR CONDITIONING & HEATING
('ac_compressors', 'AC compressors and components', 1),
('condensers', 'AC condensers and heat exchangers', 1),
('evaporators', 'Evaporators and AC components', 1),
('blower_motors', 'Blower motors and fan motors', 1),
('ac_hoses', 'AC hoses and refrigerant lines', 1),
('ac_dryers', 'AC receivers and dryers', 1),
('expansion_valves', 'Expansion valves and AC controls', 1),
('ac_switches', 'AC switches and controls', 1),

-- FUEL SYSTEM
('fuel_pumps', 'Fuel pumps and fuel delivery', 1),
('fuel_injectors', 'Fuel injectors and injection systems', 1),
('fuel_filters', 'Fuel filters and fuel system filters', 1),
('fuel_tanks', 'Fuel tanks and fuel storage', 1),
('fuel_lines', 'Fuel lines and fuel hoses', 1),
('throttle_bodies', 'Throttle bodies and throttle components', 1),
('carburetors', 'Carburetors for older vehicles', 1),
('fuel_pressure_regulators', 'Fuel pressure regulators', 1),
('fuel_caps', 'Fuel caps and fuel tank components', 1),

-- TRANSMISSION & DRIVETRAIN
('transmission_mounts', 'Transmission mounts and brackets', 1),
('cv_joints', 'CV joints and CV boots', 1),
('universal_joints', 'Universal joints and U-joints', 1),
('transfer_cases', 'Transfer cases for 4WD/AWD vehicles', 1),
('differentials', 'Differentials and differential components', 1),
('transmission_pans', 'Transmission pans and filters', 1),
('torque_converters', 'Torque converters and components', 1),
('transmission_valves', 'Transmission valves and solenoids', 1),

-- FILTERS & FLUIDS
('oil_filters', 'Oil filters and engine filters', 1),
('air_filters', 'Air filters and intake filters', 1),
('cabin_air_filters', 'Cabin air filters and interior filters', 1),
('transmission_filters', 'Transmission filters and fluid filters', 1),
('engine_oil', 'Engine oil and motor oil', 1),
('transmission_fluid', 'Transmission fluid and ATF', 1),
('coolant', 'Coolant and antifreeze', 1),
('power_steering_fluid', 'Power steering fluid', 1),
('brake_fluid', 'Brake fluid and brake system fluids', 1),

-- LUBRICATION
('grease', 'Grease and lubricants', 1),
('gear_oil', 'Gear oil and differential fluid', 1),

-- ACCESSORIES & CUSTOMIZATION
('body_kits', 'Body kits and aerodynamic parts', 1),
('running_boards', 'Running boards and step bars', 1),
('roof_racks', 'Roof racks and cargo systems', 1),
('tow_hooks', 'Tow hooks and towing equipment', 1),
('license_plate_frames', 'License plate frames and holders', 1),
('emblems', 'Emblems and badges', 1),
('mud_flaps', 'Mud flaps and splash guards', 1),
('car_covers', 'Car covers and protection', 1),
('floor_mats', 'Floor mats and cargo liners', 1),
('seat_covers', 'Seat covers and upholstery', 1),

-- SAFETY & SECURITY
('alarms', 'Car alarms and security systems', 1),
('immobilizers', 'Immobilizers and anti-theft devices', 1),
('backup_cameras', 'Backup cameras and parking sensors', 1),
('dash_cams', 'Dash cameras and recording systems', 1),

-- TOOLS & EQUIPMENT
('jacks', 'Jacks and lifting equipment', 1),
('tools', 'Automotive tools and equipment', 1),

-- MISCELLANEOUS
('other', 'Other spare parts and custom parts', 1),
('fasteners', 'Bolts, nuts, screws, and fasteners', 1),
('gaskets', 'Gaskets and seals', 1),
('hoses', 'Various hoses and tubing', 1),
('clamps', 'Hose clamps and fasteners', 1),

-- ============================================
-- MOTORCYCLE PARTS
-- ============================================

-- MOTORCYCLE ENGINE
('motorcycle_engines', 'Complete motorcycle engines and engine blocks', 1),
('motorcycle_cylinders', 'Motorcycle cylinders and cylinder heads', 1),
('motorcycle_pistons', 'Motorcycle pistons, rings, and wrist pins', 1),
('motorcycle_crankshafts', 'Motorcycle crankshafts and components', 1),
('motorcycle_camshafts', 'Motorcycle camshafts and timing components', 1),
('motorcycle_carburetors', 'Motorcycle carburetors and fuel systems', 1),
('motorcycle_fuel_injectors', 'Motorcycle fuel injectors and EFI systems', 1),
('motorcycle_air_filters', 'Motorcycle air filters and intake systems', 1),
('motorcycle_exhaust_systems', 'Motorcycle exhaust pipes, mufflers, and headers', 1),
('motorcycle_radiators', 'Motorcycle radiators and cooling systems', 1),
('motorcycle_oil_pumps', 'Motorcycle oil pumps and lubrication systems', 1),

-- MOTORCYCLE TRANSMISSION & DRIVETRAIN
('motorcycle_transmissions', 'Motorcycle transmissions and gearboxes', 1),
('motorcycle_clutches', 'Motorcycle clutch plates, baskets, and springs', 1),
('motorcycle_chains', 'Motorcycle drive chains and chain components', 1),
('motorcycle_sprockets', 'Motorcycle sprockets - front and rear', 1),
('motorcycle_belts', 'Motorcycle drive belts and belt drive systems', 1),
('motorcycle_shafts', 'Motorcycle drive shafts and final drives', 1),
('motorcycle_gears', 'Motorcycle transmission gears and components', 1),

-- MOTORCYCLE ELECTRICAL
('motorcycle_batteries', 'Motorcycle batteries and battery components', 1),
('motorcycle_alternators', 'Motorcycle alternators and charging systems', 1),
('motorcycle_starters', 'Motorcycle starters and starter motors', 1),
('motorcycle_ignition', 'Motorcycle ignition coils, spark plugs, and CDI units', 1),
('motorcycle_ecus', 'Motorcycle ECUs and engine management systems', 1),
('motorcycle_wiring', 'Motorcycle wiring harnesses and electrical components', 1),
('motorcycle_lights', 'Motorcycle headlights, taillights, and turn signals', 1),
('motorcycle_switches', 'Motorcycle switches and controls', 1),
('motorcycle_sensors', 'Motorcycle sensors - speed, temperature, pressure', 1),

-- MOTORCYCLE SUSPENSION
('motorcycle_forks', 'Motorcycle front forks and fork components', 1),
('motorcycle_shocks', 'Motorcycle rear shocks and shock absorbers', 1),
('motorcycle_springs', 'Motorcycle suspension springs', 1),
('motorcycle_triple_trees', 'Motorcycle triple trees and steering stems', 1),
('motorcycle_swingarms', 'Motorcycle swingarms and rear suspension', 1),
('motorcycle_linkages', 'Motorcycle suspension linkages and components', 1),

-- MOTORCYCLE BRAKES
('motorcycle_brake_pads', 'Motorcycle brake pads and brake shoes', 1),
('motorcycle_brake_rotors', 'Motorcycle brake rotors and discs', 1),
('motorcycle_brake_calipers', 'Motorcycle brake calipers and components', 1),
('motorcycle_brake_lines', 'Motorcycle brake lines and hoses', 1),
('motorcycle_brake_levers', 'Motorcycle brake levers and master cylinders', 1),
('motorcycle_abs', 'Motorcycle ABS systems and components', 1),

-- MOTORCYCLE WHEELS & TIRES
('motorcycle_wheels', 'Motorcycle wheels - alloy, spoked, and cast', 1),
('motorcycle_tires', 'Motorcycle tires - front and rear', 1),
('motorcycle_rims', 'Motorcycle rims and wheel components', 1),
('motorcycle_hubs', 'Motorcycle wheel hubs and bearings', 1),
('motorcycle_axles', 'Motorcycle axles and axle components', 1),
('motorcycle_tubes', 'Motorcycle inner tubes and tire accessories', 1),

-- MOTORCYCLE BODY & FAIRINGS
('motorcycle_fairings', 'Motorcycle fairings and body panels', 1),
('motorcycle_tanks', 'Motorcycle fuel tanks and tank components', 1),
('motorcycle_fenders', 'Motorcycle fenders - front and rear', 1),
('motorcycle_seats', 'Motorcycle seats and seat covers', 1),
('motorcycle_handlebars', 'Motorcycle handlebars and handlebar components', 1),
('motorcycle_grips', 'Motorcycle grips and throttle tubes', 1),
('motorcycle_pegs', 'Motorcycle footpegs and passenger pegs', 1),
('motorcycle_mirrors', 'Motorcycle mirrors and mirror components', 1),
('motorcycle_windscreens', 'Motorcycle windscreens and windshields', 1),
('motorcycle_cowls', 'Motorcycle cowls and body covers', 1),

-- MOTORCYCLE ACCESSORIES
('motorcycle_luggage', 'Motorcycle luggage - saddlebags, tank bags, tail bags', 1),
('motorcycle_crash_bars', 'Motorcycle crash bars and engine guards', 1),
('motorcycle_stands', 'Motorcycle stands - center stands, side stands', 1),
('motorcycle_locks', 'Motorcycle locks and security devices', 1),
('motorcycle_covers', 'Motorcycle covers and protection', 1),
('motorcycle_phone_mounts', 'Motorcycle phone mounts and GPS mounts', 1),

-- ============================================
-- COMMERCIAL VEHICLE & TRUCK PARTS
-- ============================================

-- COMMERCIAL ENGINE & POWERTRAIN
('truck_engines', 'Commercial truck engines and heavy-duty engines', 1),
('truck_transmissions', 'Commercial truck transmissions - manual and automatic', 1),
('truck_clutches', 'Heavy-duty truck clutches and components', 1),
('truck_turbochargers', 'Commercial truck turbochargers and superchargers', 1),
('truck_engine_mounts', 'Heavy-duty engine mounts and brackets', 1),
('truck_radiators', 'Commercial truck radiators and cooling systems', 1),
('truck_intercoolers', 'Truck intercoolers and charge air coolers', 1),

-- COMMERCIAL DRIVETRAIN
('truck_differentials', 'Commercial truck differentials and rear ends', 1),
('truck_axles', 'Commercial truck axles - front, rear, and drive axles', 1),
('truck_drive_shafts', 'Commercial truck drive shafts and U-joints', 1),
('truck_transfer_cases', 'Commercial truck transfer cases for 4WD/AWD', 1),
('truck_power_divider', 'Truck power dividers and inter-axle differentials', 1),
('truck_wheel_ends', 'Commercial truck wheel ends and hub assemblies', 1),

-- COMMERCIAL SUSPENSION
('truck_springs', 'Commercial truck springs - leaf springs and air springs', 1),
('truck_shocks', 'Commercial truck shock absorbers and dampers', 1),
('truck_air_suspension', 'Commercial truck air suspension systems and components', 1),
('truck_torque_rods', 'Commercial truck torque rods and suspension links', 1),
('truck_bushings', 'Heavy-duty truck bushings and suspension mounts', 1),
('truck_king_pins', 'Commercial truck king pins and steering components', 1),

-- COMMERCIAL BRAKES
('truck_brake_pads', 'Commercial truck brake pads and brake blocks', 1),
('truck_brake_drums', 'Commercial truck brake drums and components', 1),
('truck_brake_rotors', 'Commercial truck brake rotors and discs', 1),
('truck_brake_chambers', 'Commercial truck brake chambers and air brakes', 1),
('truck_brake_valves', 'Commercial truck brake valves and air brake systems', 1),
('truck_brake_compressors', 'Commercial truck air compressors and brake systems', 1),
('truck_abs', 'Commercial truck ABS systems and wheel speed sensors', 1),
('truck_parking_brake', 'Commercial truck parking brakes and components', 1),

-- COMMERCIAL WHEELS & TIRES
('truck_wheels', 'Commercial truck wheels - steel and aluminum', 1),
('truck_tires', 'Commercial truck tires - steer, drive, and trailer tires', 1),
('truck_wheel_bearings', 'Commercial truck wheel bearings and hub assemblies', 1),
('truck_hub_assemblies', 'Commercial truck hub assemblies and components', 1),
('truck_rims', 'Commercial truck rims and wheel components', 1),
('truck_tire_chains', 'Commercial truck tire chains and traction devices', 1),

-- COMMERCIAL STEERING
('truck_steering_gears', 'Commercial truck steering gears and boxes', 1),
('truck_power_steering', 'Commercial truck power steering pumps and systems', 1),
('truck_steering_columns', 'Commercial truck steering columns and components', 1),
('truck_drag_links', 'Commercial truck drag links and steering linkages', 1),
('truck_tie_rods', 'Commercial truck tie rods and steering components', 1),

-- COMMERCIAL ELECTRICAL
('truck_alternators', 'Commercial truck alternators and charging systems', 1),
('truck_starters', 'Commercial truck starters and starter motors', 1),
('truck_batteries', 'Commercial truck batteries and battery systems', 1),
('truck_lights', 'Commercial truck lights - headlights, taillights, marker lights', 1),
('truck_wiring', 'Commercial truck wiring harnesses and electrical components', 1),
('truck_sensors', 'Commercial truck sensors and monitoring systems', 1),
('truck_ecus', 'Commercial truck ECUs and engine management', 1),

-- COMMERCIAL BODY & CAB
('truck_cabs', 'Commercial truck cabs and cab components', 1),
('truck_hoods', 'Commercial truck hoods and hood components', 1),
('truck_fenders', 'Commercial truck fenders and body panels', 1),
('truck_doors', 'Commercial truck doors and door components', 1),
('truck_mirrors', 'Commercial truck mirrors and mirror systems', 1),
('truck_bumpers', 'Commercial truck bumpers and bumper components', 1),
('truck_grilles', 'Commercial truck grilles and grille components', 1),
('truck_windshields', 'Commercial truck windshields and glass', 1),

-- COMMERCIAL FUEL SYSTEM
('truck_fuel_tanks', 'Commercial truck fuel tanks and tank systems', 1),
('truck_fuel_pumps', 'Commercial truck fuel pumps and delivery systems', 1),
('truck_fuel_filters', 'Commercial truck fuel filters and water separators', 1),
('truck_fuel_injectors', 'Commercial truck fuel injectors and injection systems', 1),

-- COMMERCIAL EXHAUST
('truck_exhaust_systems', 'Commercial truck exhaust systems and components', 1),
('truck_mufflers', 'Commercial truck mufflers and exhaust silencers', 1),
('truck_dpf', 'Commercial truck DPF systems and diesel particulate filters', 1),
('truck_scr', 'Commercial truck SCR systems and selective catalytic reduction', 1),
('truck_egr', 'Commercial truck EGR systems and exhaust gas recirculation', 1),

-- COMMERCIAL AIR SYSTEM
('truck_air_compressors', 'Commercial truck air compressors and air systems', 1),
('truck_air_dryers', 'Commercial truck air dryers and air system components', 1),
('truck_air_tanks', 'Commercial truck air tanks and reservoirs', 1),
('truck_air_valves', 'Commercial truck air valves and control valves', 1),

-- COMMERCIAL TOWING & HITCHES
('truck_hitches', 'Commercial truck hitches and towing equipment', 1),
('truck_fifth_wheels', 'Commercial truck fifth wheels and coupling systems', 1),
('truck_pintle_hooks', 'Commercial truck pintle hooks and towing components', 1),
('truck_trailer_brakes', 'Commercial truck trailer brake systems', 1),

-- COMMERCIAL ACCESSORIES
('truck_tool_boxes', 'Commercial truck tool boxes and storage', 1),
('truck_tarps', 'Commercial truck tarps and cargo covers', 1),
('truck_mud_flaps', 'Commercial truck mud flaps and splash guards', 1),
('truck_light_bars', 'Commercial truck light bars and auxiliary lighting', 1),
('truck_winches', 'Commercial truck winches and recovery equipment', 1);

