Facing razor-thin margins, retailers are struggling with architecting the store of the future while keeping costs down.