Trade deficit widens to $27 bn as imports hit a high