WASHINGTON—U.S. retail sales unexpectedly increased in June as demand for goods remained strong even as spending is shifting back to services. The rebound in sales reported by the Commerce Department on Friday was despite purchases of motor vehicles declining again because of a lack of supply caused by a global semiconductor shortage. The scarcity of new motor vehicles is boosting demand for used cars and trucks, helping to fuel inflation. Retail sales rose 0.6 percent last month. Data for May was revised down to show sales falling 1.7 percent instead of declining 1.3 percent as previously reported. Economists polled by Reuters had forecast retail sales dropping 0.4 percent. Sales surged 18.0 percent compared to June last year and are now well above their pre-pandemic level. Demand shifted to goods like electronics and motor vehicles during the pandemic as millions of people worked from home, took online classes and avoided public …