Hi.
This can be achieved by overriding FrontController.php
In the script you will find the call to custom.css
Here you can add a condition so that the CSS is loaded only on a specific controller.
For example: if ($this->context->controller->php_self == 'product') {your css}
You can do the same for JS.