Going into the military will help you get a job as a police officer. You will be mentally and physically prepared for law enforcement training.
As you pointed out, one must be a police officer before becoming a detective. Larger departments give promotional exams, and the process is often governed by the police association's union contract with the agency. If the agency gives military preference points, then, that can help you. If you were a detective in the military, and now the police department's promotional exam is knowledge based, then, yes, that can give you an advantage.
Honestly, because police depts are almost always short of female officers, assuming you meet the criteria, getting in should not be a problem. The promotional process to detective will be very competitive. People take vacation time just to study!
I still think the military experience will be good for you, as it will introduce you to some of the order and discipline also found in police departments. There is another alternative. Some departments, such as San Antonio, have civilian "Evidence Technicians." Look at the first four job titles listed on this link - they are civilian positions. I don't know what other depts do this.
Probation & Parole at Vermont Department of Corrections
Do you have to go to the military to become a detective? No.
When you go into the military you're subjected to testing (ASVAB - Armed Services Vocational Aptitude Battery) to determine the best career fit (MOS - military occupational specialty). This can range from custodian to engineer, infantry to intelligence, etc... You could be manning the 50 caliber machine gun atop a Humvee in the infantry, or developing relationships in foreign countries as a psychological operations soldier. Getting the mos of your choosing is not guaranteed as you have to (1) qualify for the position, and (2) positions must be available.
With that said, going into the military is very helpful if you're pursuing a career in law enforcement. Many law enforcement agencies give preference to military veterans as they've already been subjected to rigorous training and discipline - Massachusetts State Police used to give veterans a 10 point preference on the state police civil servant exam (a non-military individual could score a 97 out of a 100, but the military veteran who scored an 88 will have their score increased to 98 and will be considered first). I always suggest people to consider a career with the Armed Services if you're not really sure where you want to go in life as the military has so much to offer - like retiring with full pension after 20 years of service!
You have a general idea of what you'd like to do with your future. I would encourage you to expand that idea a bit further - do you want to work as a detective in a local police department, work as an investigator for a federal agency such as the FBI/US Marshals/Border Patrol/etc? What about an investigator for the fire department, or with the EPA, state police, or even private investigation? What would you like to investigate - general crimes (burglaries/thefts), drug trafficking, homicides, sex offenses? There's also cyber/fraud/background investigators, and many more. The NFL employs investigators to look into the backgrounds of potential up and coming college players.
I had a college professor who told everyone on the first day of orientation that if you're interested in working as a police officer, including local detectives, to drop out of college (yup, he said to drop out) and apply for a job as a police officer. He explained this stating how you will advance quicker through the ranks if you start early. He then went on to discuss how a college degree will help (even more so if combined with military experience) if you're interested in working at a state or federal level.
So think about what you'd like to do, google the position requirements, and those requirements will help provide guidance in terms of what steps you should take to eventually land that position! If you think of a position of interest but are still uncertain about what steps to take - either write back or submit another question such as "how do I get a job as a (job title)." Good luck!!!
Research the many different types of investigators found in the private sector, local/state/federal law enforcement, and local/state/federal agencies (most investigators are local/state/or federal positions).
When you find different types of investigative positions of interest - google the job description, and see what they experience/education they require. This will provide you with a direction to pursue to eventually land your dream job!
Remember, sometimes you have to work your way up to get your dream job. Might not hurt to look at working as a police dispatcher, which could lead to a position as a police officer, then working up the ranks to become a detective - or even chief of police!
Live and be happy in the moment, but let your future ambitions guide the choices you make (many of your friends may get into drugs and alcohol - they might think it provides happiness in the moment, but what impact would it have on their future? Many investigators are investigated themselves prior to employment to make sure they don't have any serious "skeletons in the closet."