* {
  box-sizing: border-box;
}

:root {
  --laranja: #f36c0d;
  --laranja-claro: #fff3e9;
  --laranja-hover: #df5b00;
  --texto: #171717;
  --texto-suave: #737373;
  --borda: #e8e8e8;
  --fundo: #f8f8f8;
  --verde: #169447;
  --vermelho: #d83939;
  --sombra: 0 4px 18px rgba(0,0,0,.05);
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  font-family:
    Inter,
    "Segoe UI",
    Arial,
    sans-serif;
  background: #fff;
  color: var(--texto);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.pdv-app {
  width: 100vw;
  height: 100vh;
  display: grid;
  grid-template-rows: 72px 1fr 46px;
  overflow: hidden;
  background: white;
}


/* TOPO */

.pdv-topo {
  height: 72px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 18px;
  border-bottom: 1px solid var(--borda);
  background: white;
  z-index: 10;
}

.btn-voltar {
  width: 42px;
  height: 42px;
  border: 1px solid var(--borda);
  border-radius: 10px;
  display: grid;
  place-items: center;
  text-decoration: none;
  color: #333;
  font-size: 23px;
}

.btn-voltar:hover {
  background: #f4f4f4;
}

.marca-pdv {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 245px;
}

.marca-fogo {
  font-size: 30px;
}

.marca-pdv strong {
  display: block;
  font-size: 16px;
  letter-spacing: -.2px;
}

.marca-pdv small {
  color: var(--laranja);
  font-weight: 800;
  font-size: 11px;
}

.busca-topo {
  flex: 1;
  max-width: 620px;
  height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 0 13px;
  background: #fafafa;
}

.busca-topo:focus-within {
  border-color: var(--laranja);
  background: white;
  box-shadow: 0 0 0 3px rgba(243,108,13,.08);
}

.busca-topo span {
  font-size: 24px;
  color: #777;
}

.busca-topo input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 15px;
}

.btn-comanda-topo {
  min-width: 150px;
  height: 46px;
  border: 1px solid #ddd;
  background: white;
  border-radius: 9px;
  padding: 5px 13px;
}

.btn-comanda-topo:hover {
  border-color: var(--laranja);
}

.btn-comanda-topo small {
  display: block;
  color: #777;
  font-size: 9px;
  font-weight: 700;
}

.btn-comanda-topo strong {
  font-size: 15px;
}

.caixa-status {
  height: 40px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  border-radius: 8px;
  background: #edf9f0;
  color: #14733a;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.caixa-status span {
  width: 9px;
  height: 9px;
  background: #25ad58;
  border-radius: 50%;
}

.relogio-topo {
  min-width: 55px;
  text-align: right;
  font-weight: 800;
}


/* CONTEÚDO */

.pdv-conteudo {
  min-height: 0;
  display: grid;
  grid-template-columns: 145px minmax(430px, 1fr) 430px;
  background: white;
}


/* CATEGORIAS */

.categorias-lateral {
  border-right: 1px solid var(--borda);
  padding: 14px 10px;
  overflow-y: auto;
  background: #fff;
}

.categoria-btn {
  width: 100%;
  min-height: 64px;
  border: 1px solid transparent;
  background: white;
  border-radius: 10px;
  margin-bottom: 8px;
  color: #333;
  padding: 8px 6px;
}

.categoria-btn span {
  display: block;
  font-size: 19px;
  margin-bottom: 5px;
}

.categoria-btn strong {
  display: block;
  font-size: 12px;
}

.categoria-btn:hover {
  background: #f8f8f8;
}

.categoria-btn.ativa {
  background: var(--laranja-claro);
  border-color: #ffc795;
  color: var(--laranja);
}


/* PRODUTOS */

.area-produtos {
  min-width: 0;
  padding: 15px 18px 18px;
  overflow-y: auto;
  background: #fbfbfb;
}

.produtos-cabecalho {
  display: flex;
  justify-content: space-between;
  align-items: end;
  margin-bottom: 14px;
}

.produtos-cabecalho h1 {
  margin: 0 0 3px;
  font-size: 22px;
}

.produtos-cabecalho span {
  font-size: 12px;
  color: #777;
}

.btn-atualizar {
  border: 1px solid #ddd;
  background: white;
  border-radius: 8px;
  padding: 8px 12px;
  color: #555;
}

.produtos-grid {
  display: grid;
  grid-template-columns:
    repeat(auto-fill, minmax(155px, 1fr));
  gap: 12px;
}

.produto-card {
  position: relative;
  min-height: 156px;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  background: white;
  overflow: hidden;
  text-align: left;
  padding: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,.025);
  transition:
    transform .12s ease,
    box-shadow .12s ease,
    border-color .12s ease;
}

.produto-card:hover {
  transform: translateY(-2px);
  border-color: #ffc28f;
  box-shadow: 0 7px 20px rgba(0,0,0,.07);
}

.produto-card:active {
  transform: scale(.98);
}

.produto-visual {
  height: 82px;
  display: grid;
  place-items: center;
  background:
    linear-gradient(
      135deg,
      #fff8f1,
      #fff
    );
  border-bottom: 1px solid #f0f0f0;
}

.produto-visual span {
  font-size: 34px;
}

.produto-dados {
  padding: 10px 11px 11px;
}

.produto-dados small {
  display: block;
  font-size: 9px;
  color: #999;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}

.produto-dados strong {
  min-height: 34px;
  display: block;
  font-size: 13px;
  line-height: 1.25;
}

.produto-preco {
  display: block;
  margin-top: 6px;
  font-weight: 800;
  font-size: 15px;
}

.produto-adicionar {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 29px;
  height: 29px;
  border-radius: 50%;
  border: none;
  background: var(--laranja);
  color: white;
  font-size: 20px;
  line-height: 29px;
  text-align: center;
  box-shadow: 0 3px 10px rgba(243,108,13,.22);
}


/* PAINEL DO PEDIDO */

.pedido-painel {
  min-height: 0;
  display: grid;
  grid-template-rows:
    auto
    minmax(150px, 1fr)
    auto
    auto;
  border-left: 1px solid var(--borda);
  background: white;
}

.pedido-cabecalho {
  min-height: 82px;
  padding: 15px 17px;
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid var(--borda);
}

.pedido-cabecalho small {
  font-size: 9px;
  color: #888;
  font-weight: 700;
}

.pedido-cabecalho h2 {
  margin: 3px 0 2px;
  font-size: 20px;
}

.pedido-cabecalho span {
  color: #777;
  font-size: 12px;
}

.btn-trocar-comanda {
  width: 37px;
  height: 37px;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: white;
  font-size: 18px;
}

.pedido-itens {
  overflow-y: auto;
  padding: 0 15px;
}

.pedido-itens table {
  width: 100%;
  border-collapse: collapse;
}

.pedido-itens th {
  position: sticky;
  top: 0;
  background: white;
  z-index: 2;
  text-align: left;
  font-size: 10px;
  color: #888;
  padding: 10px 4px;
  border-bottom: 1px solid #eee;
}

.pedido-itens td {
  padding: 10px 4px;
  border-bottom: 1px solid #f0f0f0;
  font-size: 12px;
  vertical-align: middle;
}

.item-nome {
  font-weight: 700;
}

.item-obs {
  display: block;
  margin-top: 2px;
  color: #999;
  font-size: 9px;
}

.item-quantidade {
  text-align: center;
  font-weight: 700;
}

.item-total {
  white-space: nowrap;
  font-weight: 700;
}

.btn-remover-item {
  width: 27px;
  height: 27px;
  border: 0;
  border-radius: 6px;
  background: #fff1f1;
  color: var(--vermelho);
  font-weight: 900;
}

.pedido-vazio {
  height: 140px;
  text-align: center;
  color: #999;
}

.pedido-resumo {
  padding: 12px 18px;
  border-top: 1px solid var(--borda);
  border-bottom: 1px solid var(--borda);
}

.pedido-resumo > div {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 3px 0;
  font-size: 12px;
}

.pago-linha {
  color: #23824a;
}

.total-linha {
  margin-top: 7px;
  padding-top: 10px !important;
  border-top: 1px dashed #ddd;
  align-items: center;
}

.total-linha span {
  font-size: 16px;
  font-weight: 800;
}

.total-linha strong {
  color: var(--laranja);
  font-size: 27px;
}

.restante-linha {
  margin-top: 2px;
}

.restante-linha strong {
  font-size: 15px;
}


/* PAGAMENTO */

.pagamento-area {
  padding: 13px 17px 15px;
}

.titulo-pagamento {
  font-size: 9px;
  color: #777;
  font-weight: 800;
}

.formas-pagamento {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
  margin-top: 8px;
}

.forma-pagamento {
  min-height: 56px;
  border: 1px solid #dedede;
  background: white;
  border-radius: 9px;
  font-size: 10px;
  font-weight: 700;
  padding: 5px 3px;
}

.forma-pagamento span {
  display: block;
  font-size: 17px;
  color: #555;
  margin-bottom: 3px;
}

.forma-pagamento:hover {
  border-color: #ffc18d;
}

.forma-pagamento.ativa {
  color: var(--laranja);
  background: var(--laranja-claro);
  border-color: var(--laranja);
}

.forma-pagamento.ativa span {
  color: var(--laranja);
}

.dinheiro-box {
  margin-top: 10px;
  padding: 10px;
  background: #f8f8f8;
  border-radius: 9px;
}

.dinheiro-box label {
  display: block;
  font-size: 10px;
  color: #777;
  margin-bottom: 5px;
}

.dinheiro-box input {
  width: 100%;
  height: 39px;
  border: 1px solid #ddd;
  border-radius: 7px;
  text-align: right;
  padding: 0 10px;
  background: white;
  font-weight: 800;
}

.troco-linha {
  margin-top: 7px;
  display: flex;
  justify-content: space-between;
  font-size: 12px;
}

.troco-linha strong {
  color: var(--verde);
}

.btn-finalizar {
  width: 100%;
  height: 53px;
  border: 0;
  border-radius: 10px;
  background: var(--laranja);
  color: white;
  display: grid;
  grid-template-columns: 30px 1fr 30px;
  align-items: center;
  padding: 0 14px;
  margin-top: 10px;
}

.btn-finalizar:hover:not(:disabled) {
  background: var(--laranja-hover);
}

.btn-finalizar:disabled {
  background: #d7d7d7;
  color: #888;
  cursor: not-allowed;
}

.btn-finalizar span {
  font-size: 20px;
}

.btn-finalizar strong {
  font-size: 14px;
}

.btn-finalizar small {
  font-size: 9px;
}


/* RODAPÉ */

.atalhos-rodape {
  height: 46px;
  display: flex;
  align-items: center;
  gap: 27px;
  padding: 0 18px;
  border-top: 1px solid var(--borda);
  background: #fafafa;
  font-size: 11px;
  color: #666;
}

.atalhos-rodape span {
  display: flex;
  align-items: center;
  gap: 7px;
}

kbd {
  min-width: 28px;
  border: 1px solid #d2d2d2;
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 3px 6px;
  background: white;
  color: #444;
  text-align: center;
  font-family: inherit;
  font-weight: 700;
}

.atalho-direita {
  margin-left: auto;
}


/* MODAL */

.modal-fundo {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,.34);
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal-fundo[hidden] {
  display: none;
}

.modal-comandas {
  width: min(680px, 96vw);
  max-height: 84vh;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  border-radius: 16px;
  background: white;
  box-shadow: 0 24px 70px rgba(0,0,0,.25);
  overflow: hidden;
}

.modal-topo {
  padding: 18px 20px 13px;
  display: flex;
  justify-content: space-between;
}

.modal-topo small {
  color: var(--laranja);
  font-weight: 800;
}

.modal-topo h2 {
  margin: 2px 0 0;
}

.modal-topo button {
  border: 0;
  background: transparent;
  font-size: 28px;
}

.modal-busca {
  padding: 0 20px 13px;
}

.modal-busca input {
  width: 100%;
  height: 43px;
  border: 1px solid #ddd;
  border-radius: 9px;
  padding: 0 12px;
  outline: none;
}

.modal-busca input:focus {
  border-color: var(--laranja);
}

.lista-comandas {
  min-height: 160px;
  overflow-y: auto;
  padding: 0 20px 15px;
}

.comanda-opcao {
  width: 100%;
  min-height: 62px;
  border: 1px solid #e5e5e5;
  background: white;
  border-radius: 10px;
  padding: 10px 13px;
  margin-bottom: 7px;
  display: flex;
  justify-content: space-between;
  text-align: left;
}

.comanda-opcao:hover {
  border-color: var(--laranja);
  background: #fffaf6;
}

.comanda-opcao strong {
  display: block;
}

.comanda-opcao small {
  display: block;
  color: #777;
  margin-top: 3px;
}

.comanda-opcao b {
  color: var(--laranja);
}

.comanda-manual {
  padding: 13px 20px 18px;
  border-top: 1px solid #eee;
  display: grid;
  grid-template-columns: auto 1fr 90px;
  align-items: center;
  gap: 9px;
}

.comanda-manual span {
  font-size: 11px;
  color: #777;
}

.comanda-manual input {
  height: 38px;
  border: 1px solid #ddd;
  border-radius: 7px;
  padding: 0 10px;
}

.comanda-manual button {
  height: 38px;
  border: 0;
  border-radius: 7px;
  background: var(--laranja);
  color: white;
  font-weight: 700;
}

.carregando {
  text-align: center;
  padding: 40px;
  color: #999;
}


/* TOAST */

.toast-pdv {
  position: fixed;
  z-index: 2000;
  left: 50%;
  bottom: 60px;
  transform: translate(-50%, 20px);
  background: #222;
  color: white;
  padding: 11px 16px;
  border-radius: 8px;
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transition: .2s;
}

.toast-pdv.visivel {
  opacity: 1;
  transform: translate(-50%, 0);
}


/* RESPONSIVO */

@media (max-width: 1180px) {

  .pdv-conteudo {
    grid-template-columns:
      110px minmax(350px,1fr) 390px;
  }

  .marca-pdv {
    min-width: 190px;
  }

  .marca-pdv strong {
    font-size: 13px;
  }

  .caixa-status {
    display: none;
  }
}

@media (max-width: 850px) {

  .pdv-app {
    height: auto;
    min-height: 100vh;
    overflow: visible;
    display: block;
  }

  .pdv-topo {
    position: sticky;
    top: 0;
  }

  .marca-pdv {
    min-width: auto;
  }

  .marca-pdv div,
  .relogio-topo {
    display: none;
  }

  .btn-comanda-topo {
    min-width: 105px;
  }

  .pdv-conteudo {
    display: block;
  }

  .categorias-lateral {
    display: flex;
    gap: 6px;
    padding: 8px;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid #eee;
  }

  #listaCategorias {
    display: flex;
    gap: 6px;
  }

  .categoria-btn {
    min-width: 88px;
    min-height: 50px;
    margin: 0;
  }

  .categoria-btn span {
    display: none;
  }

  .area-produtos {
    min-height: 420px;
  }

  .pedido-painel {
    border-left: 0;
    border-top: 5px solid #f2f2f2;
  }

  .pedido-itens {
    max-height: 320px;
  }

  .atalhos-rodape {
    display: none;
  }
}
