How to switch css files according to devices and button click?

01.
Change

if (($site == 'desktop'){ // code line }

TO

if (($site == 'desktop') && (wp_is_mobile())) { // code line }

02.
and for unset the cookie while the browser is closed give the time as 0 (zero) or blank.
some thing like this.

setcookie( 'button_clicked', $_GET['button_clicked'], 0, COOKIEPATH, COOKIE_DOMAIN);