An isogeometric boundary element method for three-dimensional doubly-periodic layered structures in electromagnetics