/* style.css */

/* -------------------------------------------
   Fonte Padrão e Cores
-------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&display=swap');

:root {
  --cor-primaria: #003865;
}

/* -------------------------------------------
   Reset Geral
-------------------------------------------- */
html, body {
  font-family: 'Poppins', sans-serif;
  margin: 0;
  padding: 0;
  background-color: #f4f4f4;
  max-width: 100%;
  overflow-x: hidden;
  box-sizing: border-box;
}

/* -------------------------------------------
   Tela de Login
-------------------------------------------- */
body.tela-login {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
}

.login-container {
  background-color: #fff;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2), 0 0 0 2px rgba(0, 0, 0, 0.05);
  border: 1px solid #ddd;
  max-width: 400px;
  width: 100%;
  text-align: center;
  margin: auto;
}

.login-form input {
  width: 100%;
  padding: 15px;
  margin: 10px 0;
  border-radius: 5px;
  border: 1px solid #ccc;
  font-size: 20px;
  text-transform: uppercase;
}

.login-form button {
  width: 100%;
  padding: 15px;
  background-color: var(--cor-primaria);
  color: white;
  border: none;
  border-radius: 5px;
  font-size: 18px;
  transition: background-color 0.3s ease;
}

.login-form button:hover {
  background-color: #00679b;
}

/* -------------------------------------------
   Topbar
-------------------------------------------- */
.topbar {
  background-color: var(--cor-primaria);
  color: white;
  min-height: 56px;
  padding: 0 1rem;
}

/* -------------------------------------------
   Sidebar
-------------------------------------------- */
#sidebar.show {
  display: block !important;
  position: fixed;
  z-index: 1050;
  background-color: white;
  height: 100vh;
  top: 0;
  left: 0;
  width: 240px;
  border-right: 1px solid #ddd;
  padding-top: 80px;
  box-shadow: 2px 0 6px rgba(0, 0, 0, 0.1);
}

nav .nav-link {
  font-size: 1.1rem;
  padding: 10px 12px;
  color: var(--cor-primaria);
  font-weight: 500;
  border-radius: 0.375rem;
  transition: background-color 0.2s ease, color 0.2s ease;
}

nav .nav-link:hover,
nav .nav-link:focus {
  color: var(--cor-primaria);
  background-color: rgba(0, 56, 101, 0.1);
  text-decoration: none;
}

nav .nav-link.active {
  background-color: var(--cor-primaria);
  color: white !important;
}

/* -------------------------------------------
   Container Produtos
-------------------------------------------- */
.container-produtos {
  width: 100%;
  max-width: 100vw;
  padding: 0 12px;
  box-sizing: border-box;
  overflow-x: hidden;
}

/* -------------------------------------------
   Cards e Tabela de Produtos
-------------------------------------------- */
.card-produto {
  display: flex;
  align-items: center;
  background-color: #fff;
  border: 1px solid #ccc;
  border-radius: 8px;
  margin-bottom: 1rem;
  padding: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  width: 100%;
}

.card-produto img {
  width: 100px;
  height: 100px;
  object-fit: contain;
  flex-shrink: 0;
}

.card-produto-body {
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex-grow: 1;
}

.card-produto-body .linha {
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.produto-img {
  width: 100px;
  height: 100px;
  object-fit: contain;
  border-radius: 4px;
  background-color: #f8f9fa;
}

.tabela-produtos td:first-child,
.tabela-produtos th:first-child {
  width: 110px;
  min-width: 100px;
  max-width: 110px;
  text-align: center;
  vertical-align: middle;
}

/* -------------------------------------------
   Ícones e Ações
-------------------------------------------- */
.link-produto,
.link-produto-mobile i {
  color: var(--cor-primaria);
  font-size: 1.1rem;
  text-decoration: none;
}

.link-produto:hover {
  color: #005599;
}

.text-warning-custom {
  color: #ffeda1 !important;
}

.text-danger-custom {
  color: #B22222 !important;
}

.text-success {
  color: #3CB371 !important;
}

.text-pendente {
  color: #B22222 !important;
  font-weight: 600;
}

.text-pronto-laranja {
  color: #ffeda1 !important;
  font-weight: 600;
}

.text-pronto-verde {
  color: #3CB371 !important;
  font-weight: 600;
}

/* -------------------------------------------
   Responsividade
-------------------------------------------- */
@media (max-width: 767.98px) {
  .container-produtos {
    padding-left: 18px;
    padding-right: 18px;
  }

  #cardsProdutos {
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  .card-produto {
    margin: 0 0 1rem 0;
    border-radius: 8px;
  }
}

@media (max-width: 576px) {
  .container-fluid {
    padding-left: 4px !important;
    padding-right: 4px !important;
  }

  .container-fluid .row > [class^="col"] {
    padding-left: 4px !important;
    padding-right: 4px !important;
  }
}

/* -------------------------------------------
   Outros Estilos
-------------------------------------------- */
#nomeEmpresa {
  font-weight: 600;
  color: rgb(64, 64, 64);
  font-size: 2rem;
  margin-top: -0.25rem;
  margin-bottom: 1rem;
}

#menuOverlay {
  position: fixed;
  top: 0;
  left: 240px;
  width: calc(100vw - 240px);
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.4);
  z-index: 1045;
}

#toastAviso .toast {
  background-color: #ffeda1;
  color: #003865;
  font-weight: 600;
  border-radius: 8px;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.15);
}

.footer {
  background-color: #f8f9fa;
  border-top: 1px solid #dee2e6;
  font-size: 0.85rem;
  margin-top: auto;
}

.ruiz-link {
  color: indianred;
  text-decoration: none;
}

.ruiz-link:hover {
  text-decoration: underline;
}

.login-footer {
  position: absolute;
  bottom: 20px;
  left: 0;
  width: 100%;
  text-align: center;
  font-size: 0.85rem;
  color: #6c757d;
}

.btn-primary {
  background-color: var(--cor-primaria);
  border-color: var(--cor-primaria);
  color: white;
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: #005599;
  border-color: #005599;
}

.modal-backdrop.show {
  background-color: rgba(255, 255, 255, 0.7);
}

#imagemModal .modal-content {
  background-color: #fff;
  border-radius: 0.75rem;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
}

.imagem-ampliada {
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
}

.imagem-container-modal {
  height: 50vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.imagem-container-modal img {
  max-height: 100%;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}

/* Ícones de ação - link e lupa */
.link-produto,
.link-produto-mobile i,
.btn-lupa-fiscal {
  color: lightsteelblue !important;
  font-size: 1.1rem;
  text-decoration: none;
}

.link-produto:hover,
.link-produto-mobile i:hover,
.btn-lupa-fiscal:hover {
  color: lightsteelblue !important;
}

#tokenBarraTempo {
  height: 4px;
  background-color: #ffeda1;
  border-radius: 2px;
  margin-top: 4px;
  transition: width 0s;
  width: 0%;
}

/* Círculo do token (cronômetro visual discreto ao lado do número) */
.token-visual-circle {
  stroke: #ffeda1;
  stroke-width: 4;
  fill: none;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  animation: progressToken var(--token-duracao, 15s) linear forwards;
}

/* Container SVG com tamanho fixo */
.token-visual-svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

@keyframes progressToken {
  from {
    stroke-dashoffset: 100;
  }
  to {
    stroke-dashoffset: 0;
  }
}

.user-select-all {
  user-select: all;
  cursor: text;
}

.card-indicador {
  background-color: white;
  padding: 1.5rem;
  border-radius: 0.5rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  height: 100%;
  justify-content: space-between;
}

.card-titulo {
  color: #6c757d;
  font-weight: 600;
  min-height: 48px; /* Para manter altura padrão mesmo com títulos curtos */
  text-align: left;
  font-size: 0.95rem;
}

.card-valor {
  font-size: 2rem;
  font-weight: bold;
  text-align: right;
}

#sidebar {
  position: relative;
}

.sidebar-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  text-align: center;
  font-size: 0.75rem;
  color: #6c757d;
  padding: 10px 5px;
  border-top: 1px solid #ddd;
  background-color: #fff;
}

/* -------------------------------------------
   Botões de alternância de visualização
-------------------------------------------- */
.view-toggle .btn.active {
  background-color: var(--cor-primaria);
  color: white;
  border-color: var(--cor-primaria);
}

.view-toggle .btn:hover:not(.active) {
  background-color: rgba(0, 56, 101, 0.1);
}

.view-toggle .btn:focus {
  box-shadow: none;
}

/* -------------------------------------------
   Cards para visualização desktop
-------------------------------------------- */
.card-produto-grid {
  /* height: 100%; */
  /*height: 300px; /* Exemplo fixo */

  border: 2px solid #dee2e6;
  border-radius: 8px;
  overflow: hidden;
  background-color: #FAFAFA;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  padding-bottom: 10px;
}

.card-produto-grid:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}


.card-produto-grid .card-img-container {
  height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: white;
  border-bottom: 1px solid #f0f0f0;
  padding: 2px;
}

.card-produto-grid .card-img-container img {
  max-height: 250px;
  max-width: 100%;
  object-fit: contain;
}

.card-produto-grid .card-titulo {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 2px;
  overflow: hidden;
  display: -webkit-box;
  /*-webkit-line-clamp: 2;*/
  -webkit-box-orient: vertical;
  height: 60px;
}

.card-produto-grid .card-codigo {
  font-size: 0.95rem;
  font-weight: 600;
  color: #6c757d;
  margin-bottom: 2px;
  height: 15px;
}

.card-produto-grid .card-preco {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 2px;
  height: 15px;
}

.card-produto-grid .card-disponibilidade {
  font-size: 1.1rem;
  font-weight: 600;
  height: 15px;
}

.card-produto-grid .card-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #f0f0f0;
}

.resultados-contador {
  font-size: 0.9rem;
  padding: 5px 0;
}

.card-img-container {
  background-color: #fff;
  height: 180px;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.card-img-container img {
  height: 100%;
  width: auto;
  object-fit: contain;
}

.card-disponibilidade-label {
  color: #555;
  font-weight: normal;
  margin-right: 4px;
}

.card-disponibilidade {
  font-weight: 600;
  display: inline-block;
}

.card-produto-grid .card-body > div {
  margin-bottom: 4px; /* Reduz espaçamento entre linhas */
  padding: 15px;

}

.card-label {
  color: #555;
  font-weight: normal;
  margin-right: 5px;
  font-size: 1rem;
}

.card-valor {
  font-size: 1rem;
  font-weight: bold;
  color: #6c757d;
}

@media (max-width: 767.98px) {
  #tabelaProdutosHead {
    display: none !important;
  }
}

@media (max-width: 991.98px) {
  #viewTable,
  #tabelaProdutosHead {
    display: none !important;
  }
}

@media (pointer: coarse) and (max-width: 1400px) {
  #viewTable,
  #tabelaProdutosHead {
    display: none !important;
  }
}

/* Oculta modo tabela e cabeçalho por padrão em dispositivos touch */
@media (pointer: coarse) {
  #viewTable,
  #tabelaProdutosHead {
    display: none !important;
  }
}

/* Reativa modo tabela se o touch estiver em paisagem com largura suficiente */
@media (pointer: coarse) and (orientation: landscape) and (min-width: 992px) {
  #viewTable,
  #tabelaProdutosHead {
    display: block !important;
  }
  #cardsProdutos {
    display: none !important;
  }
}

@media (pointer: coarse) and (orientation: landscape) and (min-width: 992px) {
  html, body {
    min-width: 992px;
    overflow-x: hidden;
  }
}

@media (min-width: 1366px) {
  .row-cols-wide-4 > * {
    flex: 0 0 auto;
    width: 25%;
  }
}

@media (min-width: 1920px) {
  .row-cols-wide-5 > * {
    flex: 0 0 auto;
    width: 20%;
  }
}

@media (min-width: 2560px) {
  .row-cols-wide-8 > * {
    flex: 0 0 auto;
    width: 12.5%;
  }
}

@media (min-width: 3000px) {
  .row-cols-wide-12 > * {
    flex: 0 0 auto;
    width: 8.3333333%;
  }
}

#carrinhoTopo {
  width: 100px;
  /* height: auto ou remova o height */
  background-color: transparent;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: visible; /* garante que a luz 'vaze' */
}

#tokenTopo {
  width: 100px;
  /* height: auto ou remova o height */
  background-color: gold;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: visible; /* garante que a luz 'vaze' */
  transition: max-width 0.3s ease, padding 0.3s ease;

}


#iconeCarrinho {
  color: #003865; /* Azul padrão do sistema */
}

.topbar {
  background-color: var(--cor-primaria);
  color: white;
  height: 56px;
}

#carrinhoTopo {
  width: 100px;
  height: 100%;
  background-color: #ffeda1;
}

#iconeCarrinho {
 /* color: #003865;*/
  color: var(--cor-primaria);
  font-size: 2rem;
}

#tokenTopo.token-expandido span {
  transition: all 0.3s ease-in-out;
}


#tokenTopo.token-expandido {
  width: 170px; /* Triplica */
  padding-right: 12px;
  
}

body.modal-open {
  padding-right: 0 !important;
  overflow-y: scroll !important;
}

.select-bold {
  font-weight: bold;
  color: #495057; /* cinza escuro padrão do Bootstrap */
}

.select-bold {
  font-weight: bold;
  color: #495057;
}


.select-verde {
  color: #3CB371; /* green */ 
  font-weight: bold;
}

.select-vermelho {
  color: #B22222; /* red */
  font-weight: bold;
}

/* -------------------------------------------
   Barra de Totalizadores - Pedidos
-------------------------------------------- */
.barra-totalizadores {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border: 1px solid #dee2e6;
  border-radius: 10px;
  padding: 20px;
  margin: 20px 0;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.totalizador-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 15px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.totalizador-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: white;
}

.totalizador-geral .totalizador-icon {
  background: linear-gradient(45deg, #007bff, #0056b3);
}

.totalizador-pendente .totalizador-icon {
  background: linear-gradient(45deg, #ffc107, #e0a800);
}

.totalizador-info h5 {
  margin: 0;
  font-size: 14px;
  color: #6c757d;
  font-weight: 500;
}

.totalizador-info .valor {
  font-size: 18px;
  font-weight: bold;
  color: #212529;
  margin: 0;
}