Imagine civilians legally packing pistols as they stroll the streets of San Francisco and Los Angeles. Or health care that is harder for Californians to obtain or even afford. Or air in the Central Valley with higher concentrations of methane gas, or county jails across the state that have no recourse but to allow federal agents inside for an immigration search.

None of these changes is guaranteed. But they’re all potential effects of a rightward shift in the U.S. Supreme Court, with the addition of President Trump’s newest nominee, Brett Kavanaugh, a federal appeals court judge in Washington, D.C.

“We tend to be somewhat spoiled in California,” said Margaret Russell, a constitutional law professor at Santa Clara University. “We think we’re not like the rest of the country. All these state law protections. Lawsuits against the Trump administration on the environment, sanctuary cities, the right to control our own jurisdiction.

“The Supreme Court may not see it that way.”

The court already struck down two California laws in the closing days of its 2017-18 term last month, both on 5-4 rulings with the support of Justice Anthony Kennedy, the Californian whose retirement has opened a seat for Kavanaugh,

One law required hundreds of antiabortion crisis pregnancy centers to post notices telling patients the state made abortions available at little or no cost for low-income women. The second law, in California and 21 other states, allowed unions of government employees to collect fees from nonmembers for the cost of representing them in disputes over wages and working conditions. The rulings said both laws violated freedom of speech.

Much of the controversy over Kavanaugh’s nomination has focused on the possibility that the court would overturn, or severely limit, the constitutional right to abortion established by the Roe vs. Wade ruling in 1973.

Such a decision would have little direct impact on California, which has its own abortion-rights laws, a state court ruling to fund Medi-Cal abortions for poor women, and an independent guarantee of privacy rights under the state Constitution. Access to reproductive care could be limited, however, because of funding cuts proposed by Trump’s administration.

The situation is somewhat different for gay rights, established nationwide by a series of rulings authored by Kennedy culminating in the 5-4 decision in 2015 granting same-sex couples the right to marry.

Even if the marriage ruling is overturned, an outcome most legal commentators don’t expect, it wouldn’t prevent California from conducting same-sex weddings under its own laws. But religious conservatives are looking for a newly constituted court to recognize faith-based exceptions to gay-rights laws, an issue the justices left unresolved last term in the case of a baker who refused to make a wedding cake for a gay couple. And the court could also allow other states to withhold adoption rights and other marital benefits from same-sex spouses. Those laws would apply to marriages performed in California, despite the state’s laws granting same-sex couples the same rights as other married couples.

“If California thinks married couples should get the same rights, same-sex or not, its ability to give couples those rights depends on whether other states will respect those rights when people get there,” said Pamela Karlan, a Stanford law professor and former Justice Department attorney under President Barack Obama.

A more direct confrontation may involve gun laws. The Supreme Court, with Kennedy’s support, declared a constitutional right to possess handguns in the home for self-defense in a 5-4 ruling in 2008 but has steered clear of other firearms issues since then. One case the court refused to consider was a challenge to a California law that requires a local law enforcement permit to carry a gun outside the home, permits that are unavailable in most of the state’s urban areas.

That could change with the addition of Kavanaugh, who signaled a broad view of the Second Amendment when he wrote a dissenting opinion in 2011 that would have found a constitutional right to own semiautomatic rifles.

The court’s most conservative justices seemed willing to consider more challenges to gun-control laws in California and other states, but apparently were uncertain whether Kennedy would go along, said David Levine, a law professor at UC Hastings in San Francisco. With the addition of Kavanaugh, he said, a number of California laws could be vulnerable — the permit requirement for being armed in public, a one-gun-a-month purchase limit, waiting periods for sales, and a ban on large-capacity semiautomatics.

The new court could also affect the cost and availability of medical care with rulings on the continued viability of the national health care law sponsored by Obama.

The court narrowly upheld most of the law in 2012, with Chief Justice John Roberts casting the deciding vote. Kavanaugh’s arrival wouldn’t change that result — Kennedy voted to overturn the entire law — but congressional Republicans have eliminated the law’s mandate to buy insurance, and Trump administration funding cuts have cast a cloud over the law’s future. A new lawsuit by 20 Republican-majority states, and backed by the Trump administration, seeking to strike down the law, could return the issue to the high court.

Meanwhile, California Attorney General Xavier Becerra and his counterparts in other Democratic states are suing the Trump administration over numerous regulatory changes, including a rollback of Obama’s limits on methane gas emissions from oil and gas wells on federal lands, a case that could affect air quality in many areas. Another suit challenges the administration’s plan to add a question on U.S. citizenship to the 2020 census, a change that could reduce congressional representation in states like California with large immigrant populations. Both cases could reach the Supreme Court.

California is also making its own effort to reduce emissions of climate-changing greenhouse gases, and recently reported reaching a goal it had set for 2020. But the state could be undermined if the Supreme Court reconsiders and rolls back its 2007 decision requiring the Environmental Protection Agency to regulate greenhouse gases. That ruling was adopted by a 5-4 court majority that included Kennedy. Kavanaugh has sought to limit the authority of regulatory agencies and has ruled against EPA air-pollution regulations.

But perhaps the state’s most contentious current legal dispute with the Trump administration involves sanctuary laws, which limit local law enforcement cooperation with immigration officers and bar police from keeping immigrants in jail so that federal agents can pick them up.

A federal judge in Sacramento has upheld most of California’s sanctuary state laws in a case involving a suit by the Trump administration, blocking only a statute that prohibited private employers from allowing immigration agents to enter their workplaces. Another judge in San Francisco has left local ordinances intact and denied the administration’s request to strip federal funding from sanctuary cities. Similar suits are pending in other states, and the underlying issue — whether federal authority over immigration overrides state and local control over police, jails and municipal affairs — seems destined for Supreme Court resolution.

Looking to recent history, legal commentators said, some of the court’s most conservative justices have weighed in on the side of the states. A 5-4 ruling in 1997 prohibiting the federal government from requiring local police to conduct background checks for gun sales was written by Justice Antonin Scalia, who said the government could not “commandeer” states to enforce its laws.

“If they’re going to be at all principled, this is a states-rights issue,” said Levine of UC Hastings, referring to the sanctuary cases.

The key to those cases, said Stanford’s Karlan, is “whether justices who thought it was commandeering to demand that the sheriff’s department do background checks for guns won’t find it when the federal government tries to use states for immigration enforcement.”

Bob Egelko is a San Francisco Chronicle staff writer. Email: begelko@sfchronicle.com Twitter: @BobEgelko