Master advanced SQL querying techniques to manipulate, aggregate, and analyze complex datasets effectively.
Write a SQL query utilizing window functions to calculate the running total of sales and the moving average for each product category.