Levi Strauss posts surprise profit as online sales surge