function updateCheckoutStatus(){
  const p = checkoutButton.querySelector("P");
  if (document.querySelector("#meals .selected") === null
  || document.querySelector("#drinks .selected") === null
  || document.querySelector("#desserts .selected") === null){
    checkoutButton.classList.remove("bg-green");
    checkoutButton.classList.add("bg-grey");
    p.innerHTML = "Selecione os 3 itens<br>para fechar o pedido";
    checkoutButton.classList.remove("pointer");
    checkoutButton.disabled = true;
    return;
  }
  p.innerHTML = "Fechar Pedido";
  checkoutButton.disabled = false;
  checkoutButton.classList.add("pointer");
  checkoutButton.classList.remove("bg-grey");
  checkoutButton.classList.add("bg-green");
}
//function that handles the state of the order button
function that handles the state of the order button
function that handles the state of the order button
function updateCheckoutStatus(){
  const p = checkoutButton.querySelector("P");
  if (document.querySelector("#meals .selected") === null
  || document.querySelector("#drinks .selected") === null
  || document.querySelector("#desserts .selected") === null){
    checkoutButton.classList.remove("bg-green");
    checkoutButton.classList.add("bg-grey");
    p.innerHTML = "Selecione os 3 itens<br>para fechar o pedido";
    checkoutButton.classList.remove("pointer");
    checkoutButton.disabled = true;
    return;
  }
  p.innerHTML = "Fechar Pedido";
  checkoutButton.disabled = false;
  checkoutButton.classList.add("pointer");
  checkoutButton.classList.remove("bg-grey");
  checkoutButton.classList.add("bg-green");
}
function updateCheckoutStatus ( ) { const p = checkoutButton . querySelector ( "P" ) ; if ( document . querySelector ( "#meals .selected" ) === null || document . querySelector ( "#drinks .selected" ) === null || document . querySelector ( "#desserts .selected" ) === null ) { checkoutButton . classList . remove ( "bg-green" ) ; checkoutButton . classList . add ( "bg-grey" ) ; p . innerHTML = "Selecione os 3 itens<br>para fechar o pedido" ; checkoutButton . classList . remove ( "pointer" ) ; checkoutButton . disabled = true ; return ; } p . innerHTML = "Fechar Pedido" ; checkoutButton . disabled = false ; checkoutButton . classList . add ( "pointer" ) ; checkoutButton . classList . remove ( "bg-grey" ) ; checkoutButton . classList . add ( "bg-green" ) ; }
function that handles the state of the order button
function that handles the state of the order button