Foraging costs drive female resistance to a sensory trap