
/* v163 - Recuperación navegación + modal POS ajustado sin JS */

/* No hay MutationObserver, no hay JS nuevo, no se reescribe el DOM. */

/* Modal nuevo producto desde POS/ticket */
body .pos-modal-backdrop{
  position:fixed!important;
  inset:0!important;
  top:0!important;
  left:0!important;
  right:0!important;
  bottom:0!important;
  min-height:100vh!important;
  min-height:100dvh!important;
  padding:24px 16px!important;
  display:flex!important;
  align-items:flex-start!important;
  justify-content:center!important;
  overflow:auto!important;
  box-sizing:border-box!important;
}

/* Panel más cercano al de Catálogo, sin bloquear navegación */
body .pos-modal-backdrop .new-product-panel{
  width:min(1120px, calc(100vw - 32px))!important;
  max-width:1120px!important;
  max-height:calc(100dvh - 48px)!important;
  margin:0 auto!important;
  padding:0!important;
  border-radius:22px!important;
  background:#fff!important;
  border:1px solid #dfe7f3!important;
  box-shadow:0 26px 75px rgba(15,23,42,.24)!important;
  overflow:hidden!important;
  display:flex!important;
  flex-direction:column!important;
  box-sizing:border-box!important;
}

/* Encabezado */
body .pos-modal-backdrop .new-product-panel > div:first-child{
  flex:0 0 auto!important;
  min-height:64px!important;
  padding:18px 22px!important;
  margin:0!important;
  border-bottom:1px solid #edf2f7!important;
  background:#fff!important;
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:12px!important;
}
body .pos-modal-backdrop .new-product-panel h3{
  margin:0!important;
  color:#0f172a!important;
  font-size:20px!important;
  line-height:1.15!important;
  letter-spacing:-.03em!important;
  font-weight:950!important;
}

/* Botón cerrar limpio sin cambiar texto por JS */
body .pos-modal-backdrop .new-product-panel > div:first-child button{
  min-height:38px!important;
  border-radius:12px!important;
  border:1px solid #d8e2f0!important;
  background:#fff!important;
  color:#102044!important;
  font-weight:850!important;
}

/* Cuerpo en 3 columnas */
body .pos-modal-backdrop .new-product-grid{
  flex:1 1 auto!important;
  min-height:0!important;
  display:grid!important;
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  gap:14px!important;
  padding:22px 30px 96px!important;
  margin:0!important;
  overflow:auto!important;
  max-height:none!important;
  align-items:start!important;
  box-sizing:border-box!important;
}

/* Campos */
body .pos-modal-backdrop .new-product-grid label,
body .pos-modal-backdrop .new-product-grid .cost-field{
  display:flex!important;
  flex-direction:column!important;
  gap:7px!important;
  min-width:0!important;
  margin:0!important;
  color:#3b5585!important;
  font-weight:900!important;
  font-size:12px!important;
}
body .pos-modal-backdrop .new-product-grid label > span,
body .pos-modal-backdrop .new-product-grid .cost-field > span{
  display:block!important;
  margin:0!important;
  color:#6b7a95!important;
  font-size:12px!important;
  line-height:1.15!important;
  font-weight:850!important;
}
body .pos-modal-backdrop .new-product-grid .input,
body .pos-modal-backdrop .new-product-grid input,
body .pos-modal-backdrop .new-product-grid select,
body .pos-modal-backdrop .new-product-grid textarea{
  width:100%!important;
  min-width:0!important;
  min-height:40px!important;
  border-radius:12px!important;
  border:1px solid #d9e3f1!important;
  background:#fff!important;
  color:#102044!important;
  padding:9px 12px!important;
  box-shadow:none!important;
  box-sizing:border-box!important;
}
body .pos-modal-backdrop .new-product-grid textarea{
  min-height:76px!important;
  resize:vertical!important;
}

/* SAT similar a catálogo */
body .pos-modal-backdrop .new-product-grid .sat-mini-card{
  grid-column:1 / span 2!important;
  border-radius:16px!important;
  border:1px solid #dbe6f5!important;
  background:#f8fbff!important;
  padding:13px 14px!important;
  align-self:stretch!important;
  box-sizing:border-box!important;
}
body .pos-modal-backdrop .new-product-grid .sat-mini-grid{
  display:grid!important;
  grid-template-columns:1fr 1.7fr 1fr 1fr!important;
  gap:8px!important;
  margin-top:11px!important;
}
body .pos-modal-backdrop .new-product-grid .sat-mini-grid span{
  min-height:52px!important;
  border-radius:12px!important;
  border:1px solid #dbe6f5!important;
  background:#fff!important;
  padding:8px 10px!important;
  display:flex!important;
  flex-direction:column!important;
  justify-content:center!important;
}

/* Elementos anchos */
body .pos-modal-backdrop .new-product-grid .wide{
  grid-column:1 / -1!important;
}

/* Footer fijo */
body .pos-modal-backdrop .new-product-footer{
  flex:0 0 auto!important;
  position:sticky!important;
  bottom:0!important;
  margin:0!important;
  padding:14px 22px!important;
  border-top:1px solid #edf2f7!important;
  background:#fff!important;
  display:grid!important;
  grid-template-columns:minmax(260px,1fr) auto!important;
  align-items:center!important;
  gap:12px!important;
  z-index:8!important;
  box-sizing:border-box!important;
}
body .pos-modal-backdrop .new-product-footer .footer-actions{
  display:flex!important;
  align-items:center!important;
  justify-content:flex-end!important;
  gap:10px!important;
}
body .pos-modal-backdrop .new-product-footer .btn-primary,
body .pos-modal-backdrop .new-product-footer .btn-secondary{
  min-height:40px!important;
  border-radius:12px!important;
  padding:0 16px!important;
  font-weight:900!important;
}

/* Categoría alineada dentro del input */
body .pos-modal-backdrop .pdv131-category-wrap{
  position:relative!important;
}
body .pos-modal-backdrop .pdv131-category-trigger{
  top:auto!important;
  bottom:1px!important;
  right:1px!important;
  width:44px!important;
  height:38px!important;
  border-radius:0 12px 12px 0!important;
}

@media(max-width:980px){
  body .pos-modal-backdrop .new-product-grid{
    grid-template-columns:1fr 1fr!important;
  }
  body .pos-modal-backdrop .new-product-grid .sat-mini-card{
    grid-column:1 / -1!important;
  }
}
@media(max-width:680px){
  body .pos-modal-backdrop{
    padding:10px!important;
  }
  body .pos-modal-backdrop .new-product-panel{
    width:calc(100vw - 20px)!important;
    max-height:calc(100dvh - 20px)!important;
  }
  body .pos-modal-backdrop .new-product-grid{
    grid-template-columns:1fr!important;
    padding:16px!important;
  }
  body .pos-modal-backdrop .new-product-footer{
    grid-template-columns:1fr!important;
  }
}
