Like I said, Petra itself is not as strict – I personally wore biker shorts (but I wouldn't have worn anything shorter though). You'll be mostly hiking, and even if you take the easiest trail, the main one, it's still better to wear something that is hiking-friendly.