Amazon defended its sales practices in state court against accusations from Arizona Attorney General Kris Mayes that its “buy box” function deceives consumers.