Transporting Firearms Legally
In California, this must be done in a specific manner or else you will be subject to punishment under Penal Code Section 25400.
All handguns must be locked and stored in a lockable container during transportation. The trunk of your car does meet this standard, so a handgun can be kept unloaded in the trunk of a non-locking container (cloth pistol case, holster, etc.).
Per the California DOJ, long guns (rifles and shotguns) are not covered under Penal Code 25400, so they are not required to be transported in a locked container. But, they do need to be unloaded to be lawfully transported.
If you have a long gun that is defined as an assault weapon, different provisions are in place that must be followed, which are found in Penal Code 25610.