/* Eliminado overlay del selector de PV: se muestra el select nativo */
/* Eliminar flechas de los campos de entrada numérica */
/* Para Chrome, Safari, Edge, Opera */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Para Firefox */
input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

/* Estilos para mejorar la visualización y el contraste */
body {
  background-color: #e9ecef !important;
  transition: background-color 0.3s ease;
}

/* Estilos base para elementos de formulario */
.form-control, .form-select {
  background-color: #f9fbfd !important;
  border: 1px solid #ced4da;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
  border-radius: 0.375rem;
}

/* Efectos de foco mejorados */
.form-control:focus, .form-select:focus {
  background-color: #fff !important;
  border-color: #86b7fe;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
  transform: translateY(-1px);
}

/* Efectos hover */
.form-control:hover, .form-select:hover {
  border-color: #adb5bd;
  background-color: #ffffff !important;
}

/* Estilos para tarjetas */
.card {
  background-color: #ffffff;
  border: none;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  border-radius: 0.5rem;
  transition: all 0.3s ease;
}

.card:hover {
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

/* Estilos para tablas */
.table {
  background-color: #ffffff;
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  transition: all 0.3s ease;
}

.table thead {
  background-color: #f1f4f8;
}

/* Efecto hover para filas de tabla */
.table tbody tr {
  transition: background-color 0.2s ease;
}

.table tbody tr:hover {
  background-color: rgba(13, 110, 253, 0.05);
}

/* Estilos para botones */
.btn {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Estilos para elementos de navegación */
.nav-link, .dropdown-item {
  transition: all 0.2s ease;
}

.nav-link:hover, .dropdown-item:hover {
  background-color: rgba(13, 110, 253, 0.1);
  transform: translateX(3px);
}

/* Transiciones para alertas y mensajes */
.alert {
  transition: opacity 0.5s ease;
  border-radius: 0.5rem;
}

/* Mejora general de interactividad */
a, button, input, select, textarea {
  transition: all 0.2s ease;
}

/* Estilo para totales en tabla de existencias - amarillo más suave */
.table-warning-soft {
  background-color: #fff9e6 !important; /* Amarillo más suave */
  border-color: #f5e8a3 !important;
}

.bg-warning-soft {
  background-color: #fff3cd !important; /* Amarillo aún más suave */
}

/* Estilos para celda diagonal en tabla de existencias */
.celda-diagonal {
  position: relative !important;
  padding: 8px !important;
  height: 60px !important;
  width: auto !important;
  min-width: 120px !important;
  max-width: 180px !important;
  background-color: #f8f9fa !important;
  border: 1px solid #dee2e6 !important;
}

/* Estilos para tabla de existencias con mejor espaciado */

/* Estilos para tabla de existencias con mejor espaciado */
.tabla-existencias, 
.table.table-bordered.tabla-existencias {
  width: auto !important;
  max-width: 900px !important;
  margin: 0 auto !important;
  font-size: 14px !important;
  border: 2px solid #000000 !important; /* Borde exterior con mismo grosor que diagonal */
  border-collapse: separate !important; /* Volver a separate para resolver problemas de visualización */
  border-spacing: 0 !important;
  background-color: #ffffff !important; /* Fondo blanco */
  outline: 2px solid #000000 !important; /* Agregar un outline para reforzar el borde exterior */
  outline-offset: 0px !important;
}

/* Estilo para asegurar que el borde exterior se vea */
table.tabla-existencias {
  border: 2px solid #000000 !important;
  outline: 2px solid #000000 !important;
}

/* Asegurar que los bordes internos sean visibles */
.tabla-existencias th,
.tabla-existencias td,
.table-bordered.tabla-existencias th,
.table-bordered.tabla-existencias td {
  border: 1px solid #888888 !important; /* Líneas internas más oscuras */
  background-color: #ffffff !important; /* Fondo blanco para todas las celdas */
}

/* Reforzar específicamente el borde de cada celda en todas direcciones */
.tabla-existencias th,
.tabla-existencias td {
  border-top: 1px solid #888888 !important;
  border-bottom: 1px solid #888888 !important;
  border-left: 1px solid #888888 !important;
  border-right: 1px solid #888888 !important;
}

/* Asegurar que Bootstrap no elimine los bordes internos */
.table-bordered.tabla-existencias > :not(caption) > * > * {
  border: 1px solid #888888 !important;
}

/* Asegurar que la primera fila tenga borde superior visible */
.tabla-existencias thead tr:first-child th {
  border-top: 1px solid #888888 !important;
}

/* Asegurar que la última fila tenga borde inferior visible */
.tabla-existencias tbody tr:last-child td {
  border-bottom: 1px solid #888888 !important;
}

.tabla-existencias th:first-child {
  width: auto !important;
  min-width: 120px !important;
  max-width: 180px !important;
  background-color: #ffffff !important;
}

.tabla-existencias th:last-child {
  width: 90px !important;
  min-width: 90px !important;
  max-width: 90px !important;
  font-size: 13px;
  font-weight: 700 !important;
  background-color: #ffffff !important;
}

.tabla-existencias th:not(:first-child):not(:last-child) {
  width: 70px !important;
  min-width: 70px !important;
  max-width: 70px !important;
  text-align: center !important;
  font-size: 14px;
  font-weight: 700 !important;
  padding: 10px 6px !important;
  transition: background-color 0.2s ease !important;
  background-color: #ffffff !important;
}

.tabla-existencias td:first-child {
  width: auto !important;
  min-width: 120px !important;
  max-width: 180px !important;
  font-size: 13px;
  text-align: center !important;
  font-weight: 700 !important;
  padding: 10px 8px !important;
  transition: background-color 0.2s ease !important;
  background-color: #ffffff !important;
}

.tabla-existencias td:last-child {
  width: 90px !important;
  min-width: 90px !important;
  max-width: 90px !important;
  font-size: 13px;
  text-align: center !important;
  font-weight: 700 !important;
  padding: 10px 6px !important;
  background-color: #ffffff !important;
}

.tabla-existencias td:not(:first-child):not(:last-child) {
  width: 70px !important;
  min-width: 70px !important;
  max-width: 70px !important;
  text-align: center !important;
  font-size: 13px;
  padding: 10px 6px !important;
  transition: background-color 0.2s ease !important;
  background-color: #ffffff !important;
}

/* Efectos hover para resaltar encabezados de fila y columna - AZUL SUAVE */
.tabla-existencias tbody td:not(:first-child):not(:last-child):hover {
  background-color: rgba(13, 110, 253, 0.15) !important;
  transform: scale(1.01) !important;
}

/* Contenedor de tabla responsive con mejor espaciado */
.tabla-existencias-container {
  overflow-x: auto;
  display: flex;
  justify-content: center;
  padding: 0 20px;
  margin: 20px 0;
}

/* Estilos adicionales para texto en negrita */
.tabla-existencias .table-warning-soft {
  font-weight: 700 !important;
  background-color: #fff9e6 !important; /* Mantener el color amarillo suave para totales */
}

/* Fondo blanco para celdas de totales cuando no tienen la clase warning-soft */
.tabla-existencias .bg-warning-soft {
  background-color: #fff3cd !important; /* Mantener el color para totales generales */
}

/* Clase para resaltar encabezados al hacer hover - AZUL SUAVE */
.hover-header-highlight {
  background-color: rgba(13, 110, 253, 0.15) !important;
  font-weight: 900 !important;
  transform: scale(1.02) !important;
  transition: all 0.2s ease !important;
}

/* Reglas específicas para hover de encabezados */
.tabla-existencias thead th[style*="background-color"] {
  background-color: rgba(13, 110, 253, 0.15) !important;
}

.tabla-existencias td:first-child[style*="background-color"] {
  background-color: rgba(13, 110, 253, 0.15) !important;
}

/* Clase para forzar limpieza de background cuando sea necesario */
.tabla-existencias .no-hover-bg {
  background-color: transparent !important;
}

/* Asegurar que elementos sin style específico mantengan fondo original */
.tabla-existencias thead th:not([style*="background-color"]),
.tabla-existencias tbody td:first-child:not([style*="background-color"]) {
  background-color: #ffffff !important;
}

/* Estilos específicos para checkboxes - Solución para checkboxes invisibles */
.form-check-input {
    appearance: auto !important;
    -webkit-appearance: auto !important;
    -moz-appearance: auto !important;
    display: inline-block !important;
    width: 1rem !important;
    height: 1rem !important;
    margin-top: 0.25em !important;
    vertical-align: top !important;
    background-color: #fff !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    background-size: contain !important;
    border: 1px solid rgba(0, 0, 0, 0.25) !important;
    border-radius: 0.25em !important;
    transition: background-color 0.15s ease-in-out, background-position 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out !important;
}

.form-check-input:checked {
    background-color: #0d6efd !important;
    border-color: #0d6efd !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/%3e%3c/svg%3e") !important;
}

.form-check-input:focus {
    border-color: #86b7fe !important;
    outline: 0 !important;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25) !important;
}

.form-check-input:disabled {
    opacity: 0.6 !important;
    pointer-events: none !important;
}

.form-check-label {
    cursor: pointer !important;
    margin-left: 0.5rem !important;
}

/* Asegurar que los checkboxes sean visibles en todos los navegadores */
input[type="checkbox"] {
    appearance: auto !important;
    -webkit-appearance: auto !important;
    -moz-appearance: auto !important;
    display: inline-block !important;
    width: 1rem !important;
    height: 1rem !important;
    margin: 0.25em 0.5em 0.25em 0 !important;
    vertical-align: middle !important;
    background-color: #fff !important;
    border: 1px solid #adb5bd !important;
    border-radius: 0.25em !important;
    transition: all 0.15s ease-in-out !important;
}

input[type="checkbox"]:checked {
    background-color: #0d6efd !important;
    border-color: #0d6efd !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/%3e%3c/svg%3e") !important;
}

input[type="checkbox"]:focus {
    border-color: #86b7fe !important;
    outline: 0 !important;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25) !important;
}

/* Estilos específicos para los checkboxes de características */
.toggle-caracteristica,
.toggle-valor {
    appearance: auto !important;
    -webkit-appearance: auto !important;
    -moz-appearance: auto !important;
    display: inline-block !important;
    width: 1rem !important;
    height: 1rem !important;
    margin: 0.25em 0.5em 0.25em 0 !important;
    vertical-align: middle !important;
    background-color: #fff !important;
    border: 1px solid #adb5bd !important;
    border-radius: 0.25em !important;
    transition: all 0.15s ease-in-out !important;
}

.toggle-caracteristica:checked,
.toggle-valor:checked {
    background-color: #0d6efd !important;
    border-color: #0d6efd !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/%3e%3c/svg%3e") !important;
}

.toggle-caracteristica:focus,
.toggle-valor:focus {
    border-color: #86b7fe !important;
    outline: 0 !important;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25) !important;
}

/* Asegurar que los checkboxes sean visibles en el contenedor de valores */
.valores-container .form-check {
    display: flex !important;
    align-items: center !important;
    margin-bottom: 0.5rem !important;
}

.valores-container .form-check-input {
    flex-shrink: 0 !important;
    margin-right: 0.5rem !important;
}

.valores-container .form-check-label {
    flex-grow: 1 !important;
    cursor: pointer !important;
}
