Chandrayan, I think you stated several important reasons bookstores still attract readers and members of a community.
Obviously, the challenge of online books is immense. I am an avid reader and today, many of the books I read are eBooks for two reasons: I can easily check them out from my library and if I don't like an eBook I just stop reading and return it, which is harder to do with a physical book.
I think libraries can serve a similar function to bookstores by providing a community space as well as "free" physical books and eBooks. Still, I agree the independent bookstore is a treasure that deserves to continue to exist.