/* =========================================================
   REGION: ESTOQUE
   ========================================================= */
table.table--estoque th:nth-child(1),
table.table--estoque td:nth-child(1) {
  width: 7%;
}

.estoque-lotes-produtos {
  display: grid;
  gap: 8px;
  width: 70%;
  margin-bottom: 20px;
  margin-left: auto;
  margin-right: auto;
}

.estoque-lotes-produto {
  display: grid;
  grid-template-columns: minmax(72px, auto) minmax(0, 1fr) minmax(150px, .45fr);
  gap: 12px;
  align-items: center;
  padding: 11px 14px;
  border: 1px solid var(--theme-border);
  border-radius: 8px;
  color: var(--theme-text);
  background: var(--theme-surface);
  text-decoration: none;
  transition: border-color .15s ease, background-color .15s ease;
}

.estoque-lotes-produto:hover,
.estoque-lotes-produto:focus-visible {
  border-color: var(--theme-selection-border);
  color: var(--theme-text-strong);
  background: var(--theme-surface-hover);
  outline: none;
}

.estoque-lotes-produto-codigo,
.estoque-lotes-produto-descricao {
  font-weight: 700;
}

.estoque-lotes-produto-fabricante {
  color: var(--theme-text-muted);
  text-align: right;
}

.estoque-lotes-selecao {
  width: 70%;
  margin-right: auto;
  margin-left: auto;
  padding: 12px 14px;
  border: 1px solid var(--theme-border);
  border-radius: 8px;
  color: var(--theme-text);
  background: var(--theme-surface-muted);
}

table.table--estoque-lotes th:nth-child(1),
table.table--estoque-lotes td:nth-child(1) { width: 25%; }
table.table--estoque-lotes th:nth-child(2),
table.table--estoque-lotes td:nth-child(2),
table.table--estoque-lotes th:nth-child(3),
table.table--estoque-lotes td:nth-child(3),
table.table--estoque-lotes th:nth-child(4),
table.table--estoque-lotes td:nth-child(4) { width: 15%; }
table.table--estoque-lotes th:nth-child(5),
table.table--estoque-lotes td:nth-child(5) { width: 17%; }
table.table--estoque-lotes th:nth-child(6),
table.table--estoque-lotes td:nth-child(6) { width: 13%; }

@media (max-width: 768px), (hover: none), (pointer: coarse) {
  .estoque-lotes-produtos,
  .estoque-lotes-selecao {
    width: 100%;
  }

  .estoque-lotes-produto {
    grid-template-columns: minmax(64px, auto) minmax(0, 1fr);
  }

  .estoque-lotes-produto-fabricante {
    grid-column: 1 / -1;
    text-align: left;
  }

  table.table--estoque-lotes {
    min-width: 0 !important;
    margin-bottom: 0;
  }

  table.table--estoque-lotes thead { display: none; }
  table.table--estoque-lotes,
  table.table--estoque-lotes tbody,
  table.table--estoque-lotes tr,
  table.table--estoque-lotes td {
    display: block;
    width: 100% !important;
  }

  table.table--estoque-lotes tbody {
    display: grid;
    gap: 12px;
    border-top: 0;
  }

  table.table--estoque-lotes tbody tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 12px;
    padding: 12px;
    border: 1px solid var(--theme-border) !important;
    border-radius: 8px;
    background: var(--theme-surface);
    box-shadow: 0 2px 8px var(--theme-shadow);
  }

  table.table--estoque-lotes tbody td {
    width: auto !important;
    min-width: 0;
    padding: 0;
    border: 0;
    text-align: left !important;
  }

  table.table--estoque-lotes .estoque-lote-numero { grid-column: 1 / -1; }
  table.table--estoque-lotes .estoque-lote-quantidade { grid-column: 1 / -1; }
}

table.table--estoque th:nth-child(2),
table.table--estoque td:nth-child(2) {
  width: 31%;
}

table.table--estoque th:nth-child(3),
table.table--estoque td:nth-child(3) {
  width: 14%;
}

table.table--estoque .estoque-col-valor {
  width: 8%;
}

table.table--estoque th:nth-child(7),
table.table--estoque td:nth-child(7),
table.table--estoque th:nth-child(8),
table.table--estoque td:nth-child(8),
table.table--estoque th:nth-child(9),
table.table--estoque td:nth-child(9),
table.table--estoque th:nth-child(10),
table.table--estoque td:nth-child(10) {
  width: 6%;
}

@media (max-width: 576px) {
  .table--estoque {
    min-width: 0 !important;
    margin-bottom: 0;
  }

  .table--estoque thead {
    display: none;
  }

  .table--estoque,
  .table--estoque tbody,
  .table--estoque tr,
  .table--estoque td {
    display: block;
    width: 100% !important;
  }

  .table--estoque tbody {
    display: grid;
    gap: 12px;
    padding: 0;
    border-top: 0;
  }

  .table--estoque tbody tr {
    position: relative;
    isolation: isolate;
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--theme-border) !important;
    border-radius: 12px;
    background: var(--theme-surface);
    box-shadow: 0 2px 8px var(--theme-shadow);
    overflow: hidden;
  }

  .table--estoque tbody tr::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: transparent;
    transition: background-color .15s ease;
  }

  .table--estoque tbody tr:hover::before {
    background: var(--theme-surface-hover);
  }

  .table--estoque.table-hover > tbody > tr:hover > * {
    --bs-table-bg-state: transparent;
    background-color: transparent !important;
  }

  table.table--estoque tbody td {
    width: auto !important;
    max-width: none !important;
    min-width: 0 !important;
    padding: 0;
    border: 0;
    overflow: visible !important;
    text-align: left !important;
  }

  table.table--estoque tbody td.estoque-markup,
  table.table--estoque tbody td.estoque-preco,
  table.table--estoque tbody td.estoque-custo,
  table.table--estoque tbody td.estoque-estq,
  table.table--estoque tbody td.estoque-rsvd,
  table.table--estoque tbody td.estoque-dspn {
    white-space: normal !important;
  }
  table.table--estoque tbody td.estoque-codigo { grid-column: span 2 !important; order: 1; }
  table.table--estoque tbody td.estoque-descricao { grid-column: span 10 !important; order: 2; }
  table.table--estoque tbody td.estoque-informe { grid-column: span 8 !important; order: 3; }
  table.table--estoque tbody td.estoque-tabela { grid-column: span 4 !important; order: 4; }
  table.table--estoque tbody td.estoque-preco { grid-column: span 4 !important; order: 5; }
  table.table--estoque tbody td.estoque-custo { grid-column: span 4 !important; order: 6; }
  table.table--estoque tbody td.estoque-markup { grid-column: span 4 !important; order: 7; }
  table.table--estoque tbody td.estoque-rsvd { grid-column: span 4 !important; order: 8; }
  table.table--estoque tbody td.estoque-estq { grid-column: span 4 !important; order: 9; }
  table.table--estoque tbody td.estoque-dspn { grid-column: span 4 !important; order: 10; }
  .table--estoque td[data-label]::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 3px;
    color: var(--theme-text-muted);
    font-size: .78rem;
    font-weight: 700;
    line-height: 1.2;
  }
  .table--estoque .scroll-col,
  .table--estoque .lg-scroll-col {
    display: block;
    width: 100%;
    max-width: none;
    max-height: none;
    overflow: visible;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  .table--estoque .js-informe,
  .table--estoque .js-tabela {
    width: 100%;
    min-width: 0;
    min-height: 31px;
    color: var(--theme-text);
    border-color: var(--theme-border);
    border-radius: 6px;
    background: var(--theme-input);
  }
}
.estoque-preco-divergente-a7 {
  opacity: .3;
}
