Design a SQL query that retrieves the top 5 highest-rated movies from a database with tables "movies" (id, title, release_year, rating) and "reviews" (id, movie_id, reviewer_name, review_text, rating). The result should include the movie title, average rating, and total number of reviews.

SELECT
  movies.title,
  AVG(reviews.rating) AS average_rating,
  COUNT(reviews.id) AS total_reviews
FROM
  movies
JOIN
  reviews ON movies.id = reviews.movie_id
GROUP BY
  movies.id, movies.title
ORDER BY
  average_rating DESC,
  total_reviews DESC
LIMIT 5;