/* Arrumação, picking, etiquetas de localização, escolha de produto (parte de style.css) */
/* ============================================================
   ARRUMAÇÃO COM LEITOR + ETIQUETAS DE LOCALIZAÇÃO
   ============================================================ */
.scan-barra { display: flex; gap: 8px; margin-bottom: 14px; }
.scan-barra input {
    flex: 1; min-width: 0; padding: 12px 14px; font-size: 16px;
    border: 2px solid var(--borda); border-radius: 10px;
    background: var(--superficie); color: var(--texto);
}
.scan-barra input:focus { outline: none; border-color: var(--verde); }
.scan-camera {
    position: relative; margin-bottom: 14px; border-radius: 12px; overflow: hidden;
    background: #000; max-width: 560px;
}
.scan-camera video { display: block; width: 100%; max-height: 320px; object-fit: cover; }
.scan-mira {
    position: absolute; inset: 22% 12%; border: 2px solid rgba(255,255,255,.85);
    border-radius: 12px; box-shadow: 0 0 0 9999px rgba(0,0,0,.35); pointer-events: none;
}
.scan-camera-estado {
    position: absolute; left: 0; right: 0; bottom: 0; margin: 0; padding: 8px 12px;
    background: rgba(0,0,0,.55); color: #fff; font-size: 13px; text-align: center;
}
.scan-passos { display: flex; flex-direction: column; gap: 10px; }
.scan-passo {
    display: flex; gap: 12px; padding: 12px 14px; border-radius: 10px;
    border: 1px solid var(--borda); background: var(--superficie-2);
}
.scan-passo.feito { border-color: var(--verde); }
.scan-passo h3 { margin: 0 0 6px; font-size: 12px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--texto-2); }
.scan-passo > div { flex: 1; min-width: 0; }
.scan-num {
    flex: 0 0 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
    font-size: 13px; font-weight: 700; background: var(--borda); color: var(--texto);
}
.scan-passo.feito .scan-num { background: var(--verde); color: #fff; }
.scan-vazio { color: var(--texto-2); font-size: 14px; margin-right: 10px; }
.scan-valor { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.scan-valor strong { font-size: 15px; }
.scan-valor span { color: var(--texto-2); font-size: 13px; }
.scan-origens { display: flex; flex-direction: column; gap: 6px; }
.scan-origem {
    display: flex; align-items: center; gap: 10px; padding: 8px 10px; cursor: pointer;
    border: 1px solid var(--borda); border-radius: 8px; background: var(--superficie);
}
.scan-origem.ativa { border-color: var(--verde); box-shadow: 0 0 0 1px var(--verde); }
.scan-origem span:last-child { margin-left: auto; font-weight: 600; }
.scan-historico { margin-top: 18px; }
.scan-historico h3 { font-size: 13px; margin: 0 0 8px; }
.scan-historico ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.scan-historico li { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; }
.scan-historico .h-hora { color: var(--texto-2); }
@media (max-width: 640px) {
    .scan-barra input { font-size: 16px; }
    .scan-camera { max-width: none; }
}

/* Etiquetas de localização: só existem na impressão */
#etiquetas-print { display: none; }
@media print {
    body.imprimir-etiquetas > *:not(#etiquetas-print) { display: none !important; }
    body.imprimir-etiquetas #etiquetas-print {
        display: grid; grid-template-columns: repeat(3, 1fr); gap: 6mm; padding: 4mm;
    }
    .etiqueta-loc {
        break-inside: avoid; display: flex; flex-direction: column; align-items: center; gap: 3mm;
        border: 1.5px solid #000; border-radius: 3mm; padding: 5mm; color: #000; background: #fff;
    }
    .etiqueta-qr { width: 42mm; height: 42mm; }
    .etiqueta-texto { text-align: center; }
    .etiqueta-texto b { display: block; font-size: 20pt; letter-spacing: 1px; }
    .etiqueta-texto span { font-size: 9pt; }
}

/* Lista de produtos (Arrumação › escolher manualmente) */
.pp-combo { margin-top: 10px; border: 1px solid var(--borda); border-radius: 10px; background: var(--superficie); overflow: hidden; }
.pp-combo-input {
    width: 100%; box-sizing: border-box; padding: 12px 14px; font-size: 15px;
    border: 0; border-bottom: 1px solid var(--borda); background: var(--superficie); color: var(--texto);
}
.pp-combo-input:focus { outline: none; box-shadow: inset 0 -2px 0 var(--verde); }
.pp-combo-lista { max-height: 340px; overflow-y: auto; }
.pp-combo-item {
    display: flex; align-items: center; justify-content: space-between; gap: 14px;
    padding: 10px 14px; cursor: pointer; border-bottom: 1px solid var(--borda);
}
.pp-combo-item:last-child { border-bottom: 0; }
.pp-combo-item.ativo { background: var(--superficie-2); box-shadow: inset 3px 0 0 var(--verde); }
.pp-combo-txt { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pp-combo-txt strong { font-size: 14px; line-height: 1.3; }
.pp-combo-txt span { font-size: 12px; color: var(--texto-2); }
.pp-combo-qtd { flex: 0 0 auto; text-align: right; font-size: 13px; white-space: nowrap; }
.pp-combo-qtd b { font-size: 14px; }
.pp-combo-qtd small { color: var(--texto-2); }
.pp-combo-qtd.zero b, .pp-combo-qtd.zero small { color: var(--texto-2); font-weight: 500; }
.pp-combo-qtd em {
    display: inline-block; margin-right: 8px; padding: 2px 8px; border-radius: 999px;
    font-style: normal; font-size: 11px; font-weight: 700; background: #f3e9c8; color: #7a5a00;
}
body.dark .pp-combo-qtd em { background: #3a3317; color: #e6cf7a; }
.pp-combo-vazio { padding: 14px; font-size: 13px; color: var(--texto-2); text-align: center; }

/* A lista de produtos dentro do modal ocupa a largura toda, sem margem */
#modal-body .pp-combo { margin-top: 12px; }
#modal-body .pp-combo-lista { max-height: min(60vh, 460px); }

/* ============================================================
   MODAL "ESCOLHER PRODUTO"
   ============================================================ */
.modal-content:has(.pp-modal) { max-width: 760px; width: 94%; padding: 28px 28px 20px; }
.pp-modal h2 { margin: 0 36px 4px 0; font-size: 20px; }
.pp-sub { margin: 0 0 16px; color: var(--texto-2); font-size: 14px; }
.pp-pesquisa {
    display: flex; align-items: center; gap: 10px; padding: 0 12px;
    border: 2px solid var(--borda); border-radius: 12px; background: var(--superficie-2);
    color: var(--texto-2); transition: border-color .15s, background .15s;
}
.pp-pesquisa:focus-within { border-color: var(--verde); background: var(--superficie); }
.pp-pesquisa input {
    flex: 1; min-width: 0; padding: 13px 0; border: 0; background: transparent;
    font-size: 15px; color: var(--texto); outline: none;
}
.pp-limpar { border: 0; background: none; font-size: 22px; line-height: 1; cursor: pointer; color: var(--texto-2); padding: 0 4px; }
.pp-limpar:hover { color: var(--texto); }
.pp-filtros { display: flex; gap: 8px; margin: 12px 0 4px; flex-wrap: wrap; }
.pp-filtro {
    display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
    border: 1px solid var(--borda); background: var(--superficie); color: var(--texto);
    font-size: 13px; font-weight: 600; cursor: pointer;
}
.pp-filtro span { font-weight: 500; color: var(--texto-2); font-size: 12px; }
.pp-filtro:hover { border-color: var(--verde); }
.pp-filtro.ativo { background: var(--verde); border-color: var(--verde); color: #fff; }
.pp-filtro.ativo span { color: rgba(255,255,255,.8); }
.pp-resumo { margin: 10px 2px 6px; font-size: 12px; color: var(--texto-2); }
.pp-lista {
    max-height: min(52vh, 420px); overflow-y: auto; margin: 0 -6px; padding: 0 6px;
    display: flex; flex-direction: column; gap: 6px;
}
.pp-item {
    display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; align-items: center; gap: 14px;
    padding: 10px 12px; border: 1px solid var(--borda); border-radius: 10px;
    background: var(--superficie); cursor: pointer;
}
.pp-item.ativo { border-color: var(--verde); background: var(--superficie-2); box-shadow: 0 0 0 1px var(--verde); }
.pp-item-marca { display: flex; align-items: center; min-height: 28px; }
.pp-item-txt { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pp-item-txt strong { font-size: 14px; line-height: 1.35; }
.pp-item-txt span { font-size: 12px; color: var(--texto-2); }
.pp-item-qtd { text-align: right; white-space: nowrap; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.pp-item-qtd b { font-size: 15px; }
.pp-item-qtd small { color: var(--texto-2); }
.pp-item-qtd .zero b, .pp-item-qtd .zero small { color: var(--texto-2); font-weight: 500; }
.pp-item-qtd em {
    padding: 2px 8px; border-radius: 999px; font-style: normal; font-size: 11px; font-weight: 700;
    background: #f3e9c8; color: #7a5a00;
}
body.dark .pp-item-qtd em { background: #3a3317; color: #e6cf7a; }
.pp-vazio { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 36px 12px; color: var(--texto-2); }
.pp-vazio b { color: var(--texto); }
.pp-dicas { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--borda); font-size: 12px; color: var(--texto-2); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.pp-dicas kbd {
    padding: 1px 6px; border: 1px solid var(--borda); border-bottom-width: 2px; border-radius: 5px;
    background: var(--superficie-2); font: inherit; font-size: 11px; margin-right: 2px;
}
@media (max-width: 640px) {
    .modal-content:has(.pp-modal) { padding: 22px 16px 16px; }
    .pp-item { grid-template-columns: minmax(0, 1fr) auto; }
    .pp-item-marca { grid-column: 1 / -1; min-height: 0; }
    .pp-dicas { display: none; }
}
.modal-content:has(.pp-modal) { overflow-x: hidden; }
.pp-lista { overflow-x: hidden; }
.pp-item-marca .marca-logo { flex: 0 0 auto; }
.pp-item-marca .marca-texto-chip { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Arrumação: ler o passo com scanner/câmara */
.btn-ler { display: inline-flex; align-items: center; gap: 6px; margin-right: 6px; }
.btn-ler.ativo { background: var(--verde); border-color: var(--verde); color: #fff; animation: lerPulse 1.4s ease-in-out infinite; }
.scan-passo.a-ler { border-color: var(--verde); box-shadow: 0 0 0 2px rgba(83, 87, 53, .25); }
@keyframes lerPulse { 50% { opacity: .75; } }
@media (prefers-reduced-motion: reduce) { .btn-ler.ativo { animation: none; } }
