/* Iteración 8: Inventario con la línea administrativa (barra superior, tabla, panel lateral) y buscador con sugerencias. */

.inv-busqueda { padding: 14px 16px; box-shadow: none; border: 1px solid var(--borde); display: grid; gap: 12px; }
.inv-busqueda .bus-form { margin: 0; }
.inv-busqueda .buscador { gap: 10px; }
.inv-rapidos { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-toggle { background: #fff; border: 1px solid #d9dade; font-size: 13.5px; min-height: 34px; padding: 5px 13px; }
.chip-toggle:hover { border-color: #b9bac2; }
.chip-toggle.chip-activo { background: var(--rojo-suave); color: #a42124; border-color: var(--rojo-borde); font-weight: 700; }
.chip-toggle .ico { width: 15px; height: 15px; }
.inv-cabeza { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.inv-cabeza .conteo { margin: 0; }
.inv-vista { display: inline-flex; padding: 3px; gap: 3px; background: #ececf0; border-radius: 10px; }
.inv-vista-btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 8px; font-size: 13.5px; font-weight: 500; color: var(--texto-2); text-decoration: none; }
.inv-vista-btn:hover { color: var(--texto); }
.inv-vista-btn.activa { background: #fff; color: var(--texto); font-weight: 700; box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }
.inv-vista-btn .ico { width: 16px; height: 16px; }

/* ---------- Tabla de productos ---------- */
.inv-tabla td { white-space: normal; }
.inv-prod { display: flex; align-items: center; gap: 12px; min-width: 280px; max-width: 460px; }
.inv-prod .prod-img { width: 52px; height: 52px; border-radius: 10px; }
.inv-prod .prod-img-ico { width: 24px; height: 24px; }
.inv-prod-txt { display: grid; min-width: 0; }
.inv-prod-txt .folio { font-weight: 700; color: var(--texto); text-decoration: none; }
.inv-prod-txt .folio:hover { color: #b3261e; text-decoration: underline; }
.inv-np { color: var(--texto-2); }
.inv-desc { color: var(--texto-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 360px; }
.inv-accion { width: 52px; }
.inv-accion .boton-circulo { width: 40px; height: 40px; }

/* ---------- Combo de sugerencias ---------- */
.sug { position: relative; flex: 1; min-width: 0; }
.sug .buscar-campo { width: 100%; }
.sug.cargando .buscar-campo { background-image: linear-gradient(90deg, transparent, rgba(192, 48, 45, .12), transparent); background-size: 200% 100%; animation: sug-carga 1s linear infinite; }
@keyframes sug-carga { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.sug-lista { position: absolute; z-index: 45; left: 0; right: 0; top: calc(100% + 6px); max-height: min(70vh, 560px); overflow-y: auto; background: #fff;
  border: 1px solid var(--borde); border-radius: 14px; box-shadow: var(--sombra-alta); padding: 6px; }
.sug-lista[hidden] { display: none; }
.sug-titulo { padding: 10px 10px 4px; font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--texto-2); }
.sug-op { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 10px; color: var(--texto); text-decoration: none; }
.sug-op.activa, .sug-op:hover { background: #f4f5f7; text-decoration: none; }
.sug-op.activa { box-shadow: inset 3px 0 0 var(--rojo); }
.sug-img { position: relative; display: inline-flex; width: 42px; height: 42px; flex: none; border-radius: 9px; background: #f3f3f5; overflow: hidden; }
.sug-img img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.sug-img.sin-imagen::after { content: ""; position: absolute; inset: 11px; border: 2px solid #c9c9d0; border-radius: 4px; }
.sug-texto { flex: 1; min-width: 0; display: grid; }
.sug-texto strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sug-texto small { font-size: 12px; color: var(--texto-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sug-lado { display: grid; justify-items: end; gap: 2px; flex: none; }
.sug-stock { font-size: 11.5px; font-weight: 600; padding: 1px 7px; border-radius: 99px; }
.sug-stock.tono-rojo { background: #fde8e7; color: #a42124; }
.sug-stock.tono-ambar { background: var(--ambar-suave); color: #7a4500; }
.sug-stock.tono-verde { background: var(--verde-suave); color: #22632a; }
.sug-filtros { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 6px 8px; }
.sug-filtro { display: inline-grid; gap: 0; padding: 6px 12px; border: 1px solid #e0e1e6; border-radius: 10px; background: #fff; }
.sug-filtro small { font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--texto-2); }
.sug-filtro span { font-weight: 600; font-size: 13.5px; }
.sug-filtro.activa, .sug-filtro:hover { border-color: var(--rojo); background: var(--rojo-suave); box-shadow: none; }
.sug-todos { margin-top: 4px; border-top: 1px solid #f0f0f3; border-radius: 0 0 10px 10px; color: #b3261e; font-weight: 600; }
.sug-todos .ico, .sug-reciente .ico { color: var(--texto-2); }
@media (prefers-reduced-motion: reduce) { .sug.cargando .buscar-campo { animation: none; } }

/* ---------- Panel lateral del producto ---------- */
.pp-img .prod-img { width: 100%; height: 200px; border-radius: 14px; }
.pp-familia { margin: 0 0 2px; font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: #b3261e; }
.pp .vp-cabeza h2 { font-size: 17px; line-height: 1.3; }
.pp-agregar { display: flex; align-items: flex-end; gap: 10px; }
.pp-agregar .campo-cant { width: 96px; margin: 0; }
.pp-agregar .boton { flex: 1; justify-content: center; min-height: 44px; }
.pp-datos { grid-template-columns: 1fr 1fr; }
.pp-apl li > span:last-child { white-space: nowrap; }

@media (max-width: 759px) {
  .inv-tabla td[data-etq="Producto"] { display: flex; text-align: left; padding-bottom: 8px; }
  .inv-tabla td[data-etq="Producto"]::before { display: none; }
  .inv-tabla td[data-etq=""]::before { display: none; }
  .inv-tabla td.inv-accion { width: auto; justify-content: flex-end; }
  .inv-prod { min-width: 0; max-width: none; }
  .inv-desc { max-width: 60vw; }
  .sug-lista { max-height: 60vh; }
  .sug-lado small { display: none; }
}

/* Iteración 13: claves equivalentes (competencia / otras marcas) */
.campo-equivalencias { grid-column: 1 / -1; }
.campo-equivalencias textarea { min-height: 56px; resize: vertical; font: inherit; }
.campo-equivalencias small { font-size: 12px; color: var(--texto-2); }
.dato-equivalencias { grid-column: 1 / -1; }
.dato-equivalencias dd { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-eq { font-size: 12.5px; padding: 3px 10px; text-decoration: none; }
.campo-equivalencias textarea::placeholder { text-transform: none; }
.chip-eq-catalogo { display: inline-flex; align-items: center; gap: 4px; background: var(--verde-suave); color: #22632a; border-color: transparent; }
.chip-eq-catalogo small { font-size: 11px; font-weight: 500; margin-left: 2px; }
.eq-buscador .campo-ico { margin-top: 4px; }
.eq-resultados:empty { display: none; }
.eq-lista { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; max-height: 300px; overflow-y: auto; }
.eq-opcion { width: 100%; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "np nombre mas" "np info mas"; gap: 0 12px; align-items: center;
  padding: 8px 12px; border: 1px solid var(--borde); border-radius: 10px; background: #fff; text-align: left; font: inherit; cursor: pointer; }
.eq-opcion:hover:not([disabled]) { border-color: var(--rojo); background: #fffafa; }
.eq-opcion strong { grid-area: np; }
.eq-opcion > span:not(.eq-mas) { grid-area: nombre; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.eq-opcion small { grid-area: info; font-size: 12px; color: var(--texto-2); }
.eq-mas { grid-area: mas; display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; color: var(--rojo); }
.eq-opcion.agregada { opacity: .55; cursor: default; }
.eq-opcion.agregada .eq-mas { color: #22632a; }
.eq-opcion.agregada .eq-mas::after { content: " ✓"; }
