This image released by Prime shows Nicholas Galitzine, left, and...

This image released by Prime shows Nicholas Galitzine, left, and Anne Hathaway in a scene from "The Idea of You." Credit: AP

In the warmly charming rom-com “The Idea of You," Anne Hathaway plays a 40-year-old divorcee and Silver Lake art gallery owner who, after taking her teenage daughter to Coachella, becomes romantically involved with a 24-year-old heartthrob in the boy band August Moon. They first meet after she mistakes his trailer for the bathroom.

There are a few hundred things about this premise that might be farfetched, including the odds of finding love anywhere near the porta johns of a music festival. But one of them is not that a young star like Hayes Campbell ( Nicholas Galitzine ) would fall for a single mom like Solène (Hathaway).

Solène is stylish, unimpressed by Hayes' celebrity and has bangs so perfect they look genetically modified. And, most importantly, she's Anne Hathaway. In the power dynamics of “The Idea of You,” Hayes may be a fictional pop star but Hathaway is a very real movie star. And you don't forget it for a moment in Michael Showalter's lightly appealing showcase of the actor at her resplendent best.

“The Idea of You,” which debuts Thursday on Prime Video, is full of all the kinds of contradictions that can make a rom-com work. The highly glamorous, megawatt-smiling Hathaway is playing a down-to-earth nobody. The showbiz veteran in the movie is played by Galitzine, a less well-known but up-and-coming British actor whose performance in the movie is quite authentic. And even though the whole scenario is undeniably a glossy high-concept Hollywood fairy tale, Showalter gives it enough texture that “The Idea of You” comes off more natural and sincere than you'd expect.

The only thing that really needs to make perfect sense in a movie like “The Idea of You” is the chemistry. The film, penned by Showalter and Jennifer Westfeldt from Robinne Lee's bestseller, takes its time in the early scenes between Solène and Hayes — first at Coachella, then when he stops by her gallery — allowing their rapport to build convincingly, and giving each actor plenty of time to smolder.

Once the steamy hotel-room encounters come in “The Idea of You,” the movie has, if not swept you away, then at least ushered you along on a European trip of sex and room service. At the same time, it stays faithful to its central mission of celebrating middle-aged womanhood. The relationship will eventually cause a social media firestorm, but its main pressure point is whether Solène can stick with Hayes after her ex-husband ( Reid Scott ) cheated on her. This is a fairy tale she deserves.

While Showalter ( "The Big Sick" ) has long showed a great gift for juggling comedy and drama at once, “The Idea of You” leans more fully into wish-fulfillment romance. That can leave less to sustain the film, which has notably neutered some of the things that distinguished the book.

This image released by Prime shows Nicholas Galitzine, left, and...

This image released by Prime shows Nicholas Galitzine, left, and Anne Hathaway in a scene from "The Idea of You." Credit: AP/Alisha Wetherill

The May-December romance has been shrunk a little. In the book, the singer is 20. Given that Galitzine is 29 and the 41-year-old Hathaway is no one's idea of old, this is more like a July-September relationship. In the book, the daughter (Ella Rubin) is a huge admirer of the pop singer, adding to the awkwardness, but in the movie, August Moon is “so 7th grade” to her.

There are surely more interesting and funnier places “The Idea of You" could have gone. But Hathaway and Galitzine are a good enough match that, for a couple hours, it's easy to forget.

But the most convincing thing about “The Idea of You”? August Moon. The movie nails the look and sound of boy bands so well because it went straight to the source. The original songs in the film are by Savan Kotecha and Carl Falk, the producer-songwriters of, among other pop hits, “What Makes You Beautiful," One Direction's debut single.

That connection will probably only further the sense that “The Idea of You" is very nearly “The Idea of Harry Styles.” The filmmakers have distanced the movie from any real-life resemblances. But one thing is for sure: With August Moon following 4(asterisk)Town of “Turning Red” (whose songs were penned by Billie Eilish and Finneas O’Connell ), we are living in the golden age of the fictional boy band.

This image released by Prime shows Ella Rubin, left, and...

This image released by Prime shows Ella Rubin, left, and Anne Hathaway in a scene from "The Idea of You." Credit: AP/Alisha Wetherill

“The Idea of You,” an Amazon MGM Studios release, is rated R by the Motion Picture Association for some language and sexual content. Running time: 115 minutes. Two and a half stars out of four.

SUBSCRIBE

Unlimited Digital AccessOnly 25¢for 6 months

ACT NOWSALE ENDS SOON | CANCEL ANYTIME