In California, it is against the law to drink any alcoholic beverages while you are behind the wheel and additionally, you are not supposed to have an opened alcoholic beverage inside your car.
An opened alcoholic beverage can only be carried in the trunk of a vehicle as long as there is an adult of over 21 years of age is present in the car.