/* Regla crítica indispensable para visibilidad de modales y submenús */
.hidden {
  display: none !important;
}

/* Estilos complementarios y animaciones */
@keyframes pulse-subtle {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.pulse-warn {
  animation: pulse-subtle 2s infinite ease-in-out;
}

/* Barras de progreso con gradiente y transiciones suaves */
.progress-bar-fill {
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.4s ease;
}

/* Scrollbar personalizada para fondo blanco / tema claro */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #f8fafc;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* ============================================================== */
/* ESTILOS DE IMPRESIÓN Y EXPORTACIÓN A PDF                       */
/* ============================================================== */
@media print {
  /* Ocultar elementos de la interfaz interactiva */
  body * {
    visibility: hidden !important;
  }
  
  /* Hacer visible únicamente la hoja de reporte / documento */
  #modal-view-pdf,
  #modal-view-pdf *,
  #pdf-preview-sheet,
  #pdf-preview-sheet * {
    visibility: visible !important;
  }

  #modal-view-pdf {
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    height: auto !important;
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    display: block !important;
    overflow: visible !important;
    z-index: 999999 !important;
  }

  #modal-view-pdf-header {
    display: none !important;
  }

  #modal-view-pdf-body {
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    max-height: none !important;
    overflow: visible !important;
  }

  #pdf-preview-sheet {
    position: relative !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    min-height: auto !important;
    box-shadow: none !important;
    border: none !important;
    margin: 0 !important;
    padding: 10mm 12mm !important;
    background: #ffffff !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  @page {
    size: A4 portrait;
    margin: 0;
  }
}

/* ============================================================== */
/* ESTILOS Y MEJORAS DE RESPONSIVIDAD (MÓVIL, TABLET Y PC)        */
/* ============================================================== */

/* Desplazamiento fluido táctil y con rueda de mouse en todas las tablas y contenedores */
.overflow-x-auto {
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: auto;
  overscroll-behavior-y: auto;
}
.overflow-y-auto,
.overflow-auto {
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: auto;
}

/* Optimizaciones para pantallas móviles y tablets */
@media (max-width: 768px) {
  /* Prevenir zoom no deseado al enfocar campos en dispositivos móviles */
  input[type="text"],
  input[type="number"],
  input[type="password"],
  input[type="date"],
  input[type="email"],
  select,
  textarea {
    font-size: 14px !important;
  }

  /* Optimizar respuesta táctil rápida sin retardo de 300ms */
  button, 
  .btn,
  a[role="button"] {
    touch-action: manipulation;
  }

  /* Asegurar que modales se adapten y no sobrepasen la pantalla del móvil */
  .fixed.inset-0 > div[class*="max-w-"] {
    max-height: 94vh !important;
    width: 95vw !important;
  }
}

/* ============================================================== */
/* JERARQUÍA DE MODALES SUPERPUESTOS (PROVEEDORES SOBRE OC / MOV)  */
/* ============================================================== */
#modal-supplier,
#modal-supplier-detail {
  z-index: 150 !important;
}

