* Goldman Sachs says 23 pct of U.S. refining capacity is shut
* Crude dips despite new Libyan supply outages
* Gasoline hits more than two-year high
* API says U.S. crude inventories fell, EIA report due (Updates prices)
LONDON, Aug 30 (Reuters) - Crude oil slid and gasoline futures hit their highest since mid-2015 on Wednesday as flooding and damage from Tropical Storm Harvey shut over a fifth of U.S. refineries, curbing demand for crude while raising the risk of fuel shortages.
Refineries with output of 4.1 million barrels per day (bpd) were offline on Tuesday, representing 23 percent of U.S. production, Goldman Sachs said. Restarting plants even under the best conditions can take a week or more.
"It will be a while before operations can return to normal and the U.S. refining industry is bracing itself for an extended shutdown," Stephen Brennock of oil broker PVM said.
Brent oil, the international benchmark for crude trading, was down 52 cents at $51.48 a barrel by 1339 GMT. U.S. crude fell 42 cents to $46.02.
In refined products, price movement was more dramatic and gains increased after sources on Wednesday said Total's Port Arthur, Texas, refinery had been shut by a power outage resulting from the storm.
U.S. gasoline futures were up 6.4 percent at $1.8966 a gallon, having hit $1.9022, the highest since July 2015. Diesel futures advanced by 1.8 percent to $1.6960 a gallon, having touched their highest since January at $1.7161.
"Crude is always easier to replace than products," said Olivier Jakob, analyst at Petromatrix. "If the refineries stay shut for more than a week or 10 days, it's going to be very problematic."
Harvey made landfall on Friday as the most powerful hurricane to hit Texas in more than 50 years, resulting in the death of at least 17 people.
In addition to shutting oil refineries, about 1.4 million bpd of U.S. crude production has been disrupted, equivalent to 15 percent of total output, Goldman Sachs said.
The impact of the storm overshadowed the latest weekly figures on U.S. supplies from the American Petroleum Institute (API) and a 360,000-bpd drop in Libya's output due to renewed unrest in the OPEC producer.
U.S. crude inventories fell by 5.78 million barrels last week, the API industry group reported on Tuesday, suggesting a gradual tightening of the U.S. oil market. The figures, however, do not reflect the impact from Harvey.
Traders are awaiting the latest U.S. government inventory report, due at 1430 GMT from the Energy Information Administration, to compare with the API figures.
(Additional reporting by Henning Gloystein; Editing by Dale Hudson and Susan Fenton)