/* =========================
   HEADER / NAV
========================= */

@media (max-width: 768px){
  .content-wrapper {
    margin-left: 0 !important;
    width: 100% !important;
  }
  
 .main-header .logo {
  display: none !important;
}

  .navbar-nav > .user-menu.open > .dropdown-menu{
  position: absolute !important;  /* 🔥 ESTA ES LA CLAVE */
  left: 232px !important;
  transform: none !important;
  top: 100% !important;
  z-index: 9999;

  }


.itemBusquedaProducto{

    display:flex;
    justify-content:space-between;
    align-items:center;

    padding:10px;

    border-bottom:1px solid #ddd;

}

.itemBusquedaProducto:hover{

    background:#f4f4f4;

}


.resultado-item{

    display:flex;
    justify-content:space-between;
    align-items:center;

    padding:10px 0;
    border-bottom:1px solid #ddd;

}

.resultado-info{

    font-size: clamp(12px, 3vw, 16px);
    font-weight: 500;

}

 
}  
  

/* =========================
   DATATABLES GLOBAL MÓVIL (SEGURO)
========================= */
@media (max-width: 768px){

  /* contenedor con scroll natural */
  .dataTables_wrapper{
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* tabla normal (NO fixed) */
  table.dataTable{
    width: 100%;
  }

  /* encabezados */
  table.dataTable thead th{
    font-size: 11px;
    padding: 6px 4px;
    white-space: nowrap;
    text-align: center;
  }

  /* celdas */
  table.dataTable tbody td{
    font-size: 12px;
    padding: 6px 4px;
    white-space: nowrap;
  }

  /* columna acciones */
  table.dataTable td:last-child{
    text-align: center;
    white-space: nowrap;
  }

  /* botones (alineación simple, NO block global) */
  table.dataTable td:last-child .btn{
    margin: 0 2px;
  }

  /* quitar iconos de ordenamiento */
  table.dataTable thead th.sorting:after,
  table.dataTable thead th.sorting:before,
  table.dataTable thead th.sorting_asc:after,
  table.dataTable thead th.sorting_desc:after{
    display: none;
  }

}

/* ESTILO DEL LOGIN */

@media (max-width: 768px){

/* quitar cualquier margen lateral raro */
.wrapper,
.content-wrapper,
.login-box {
    margin-left: 0 !important;
    margin-right: 0 !important;
}


/* CONTENEDOR GENERAL */

.login-page {
    min-height: 100dvh !important; /* 👈 clave para móviles reales */
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 10px; /* 👈 evita que se pegue en pantallas chicas */
}

/* BOTONES */
.login-box-body .btn,
#btnIngresar {
    padding: 10px !important;
    font-size: 14px !important;
    border-radius: 8px;
    width: 100%; /* 👈 mejor UX en móvil */
}

.login-box-body {
    width: 100%;
    max-width: 340px;   /* 👈 controla el ancho real */
    margin: 0 auto;
}

}



/* =========================
   USUARIOS (SOLO MOVIL)
========================= */

@media (max-width: 768px){

  .tablaUsuarios th:nth-child(3),
  .tablaUsuarios td:nth-child(3), /* usuario */

  .tablaUsuarios th:nth-child(4),
  .tablaUsuarios td:nth-child(4), /* foto */

  .tablaUsuarios th:nth-child(5),
  .tablaUsuarios td:nth-child(5), /* perfil */

  .tablaUsuarios th:nth-child(6),
  .tablaUsuarios td:nth-child(6), /* estado */

  .tablaUsuarios th:nth-child(7),
  .tablaUsuarios td:nth-child(7) /* último login */
  {
    display: none !important;
  }


/* ESTILOS PARA EL MODAL AGREAGAR USUARIOS VERSION MOVIL */     
    
    .modal-footer .btn {
        min-width: 120px;
        height: 40px;
        font-size: 12px;
    }
    
   .modal-header .close {
        font-size: 25px !important;
        color: #fff !important;
        opacity: 1 !important;
        position: relative;
        top: 20px;
    }
    
      .modal-header .close {
        
        right: 15px;
        top: 10px;
          position: relative;
        z-index: 9999;
    }
    
    .modal-header h4 {
        margin: 0 !important;
        line-height: 1.2;
        position: relative;
        top: -7px; /* 👈 súbelo */
    }
    
    
    .modal-content {
        box-shadow: 0 10px 30px rgba(0,0,0,0.25);
    }
    
/* ESTILOS PARA EL MODAL EDITAR USUARIOS VERSION MOVIL */     

@media (max-width: 768px){
    
    input::placeholder {
    font-size: 13px;
    color: #999;
}

/* compatibilidad navegadores */
input::-webkit-input-placeholder {
    font-size: 13px;
    color: #999;
}

input:-ms-input-placeholder {
    font-size: 13px;
    color: #999;
}

/* ESTILOS PARA EL MODULO CATEGORIAS VERSION MOVIL */   

  .tablas {
    table-layout: fixed !important;
    width: 100% !important;
  }

  /* # */
  .tablas th:nth-child(1),
  .tablas td:nth-child(1){
    width: 25px !important;
    text-align: center;
  }

  /* NOMBRE */
  .tablas th:nth-child(2),
  .tablas td:nth-child(2){
    width: 65% !important;
  }

  /* ACCIONES (CLAVE) */
  .tablas th:nth-child(3),
  .tablas td:nth-child(3){
    width: 70px !important;
    white-space: nowrap;
    display: table-cell !important;
  }
  
}

}
        
/* ESTILOS PARA EL MODULO DE PRODCUTOS VERSION MOVIL */  

@media (max-width: 768px){

  
    .tablaProductos th:nth-child(1),
    .tablaProductos td:nth-child(1), /* # */

    .tablaProductos th:nth-child(3),
    .tablaProductos td:nth-child(3), /* código */

    .tablaProductos th:nth-child(5),
    .tablaProductos td:nth-child(5), /* categoría */


    .tablaProductos th:nth-child(7),
    .tablaProductos td:nth-child(7), /* precio compra */

    .tablaProductos th:nth-child(9),
    .tablaProductos td:nth-child(9) /* agregado */
    {
        display: none !important;
    }
    
        .tablaProductos th:nth-child(8) {
        font-size: 11px;
    }
    
    .tablaProductos td img {
        width: 30px !important;
        height: auto;
    }
    
    .tablaProductos th:nth-child(6),
.tablaProductos td:nth-child(6){
    width: 50px;
    text-align: center;
    font-size: 11px;
}
    
      .tablaProductos td:nth-child(4) {
        font-size: 11px;      /* más compacto */
        line-height: 1.1;     /* menos espacio vertical */
        max-width: 100px;     /* evita que se expanda */
        white-space: normal;
    }
    
    .tablaProductos th:nth-child(2),
    .tablaProductos td:nth-child(2) {
        width: 40px !important;
        min-width: 40px;
        max-width: 40px;
        padding: 4px !important;
        text-align: center;
    }
    
    .tablaProductos th:nth-child(8),
.tablaProductos td:nth-child(8){
    width: 70px !important;
    max-width: 50px;
    text-align: center;
}

.tabla-productos th:last-child,
.tabla-productos td:last-child {
  width: 90px;
  white-space: nowrap;
  text-align: center;
}

.tablaProductos td:nth-child(8){
    text-align: center;
    font-weight: bold;
}

    /* reducir tamaño de la imagen */
    .tablaProductos td:nth-child(2) img {
        width: 24px !important;
        height: auto;
    }
    
    .tablaProductos th:nth-child(4),
    .tablaProductos td:nth-child(4) {
        max-width: 110px;
        width: 110px;
    }

    .tablaProductos td:nth-child(4) {
        font-size: 11px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    
     .tablaProductos {
        table-layout: fixed !important;
        width: 100% !important;
    }
    
        .tablaProductos thead th{
        font-size: 10px !important;
        padding: 6px 4px !important;
        text-align: center;
        white-space: nowrap;
    }
    
    .tablaProductos thead th.sorting:after,
.tablaProductos thead th.sorting:before,
.tablaProductos thead th.sorting_asc:after,
.tablaProductos thead th.sorting_desc:after{
    display: none !important;
}

    .precio-compra-group{
        display: none !important;
    }

/* ACCIONES PRODUCTOS - FIX DEFINITIVO */
.tablaProductos td:last-child{
    text-align: center !important;
    vertical-align: top !important; /* 🔥 clave */
    padding-top: 6px !important;
}

/* botones uno debajo del otro */
.tablaProductos td:last-child .btn{
    display: block !important;
    margin: 0 auto 4px auto !important;
    width: 30px;
    height: 30px;
    padding: 0 !important;
}

.tabla-scroll{
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tablaProductos{
  min-width: 500px;
}

}
    
    

/* =========================
   CATEGORIAS (SOLO MOVIL)
========================= */

@media (max-width: 768px){

  .tablaCategorias {
    width: 100%;
  }

  /* # */
  .tablaCategorias th:nth-child(1),
  .tablaCategorias td:nth-child(1){
    width: 25px;
    text-align: center;
  }

  /* NOMBRE */
  .tablaCategorias th:nth-child(2),
  .tablaCategorias td:nth-child(2){
    width: auto;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* ACCIONES */
  .tablaCategorias th:nth-child(3),
  .tablaCategorias td:nth-child(3){
    width: 70px;
    text-align: center;
    white-space: nowrap;
  }

  /* BOTONES */
  .tablaCategorias td:nth-child(3) .btn{
    width: 30px;
    height: 30px;
    padding: 0;
    margin: 2px;
  }

}

/* =========================
   CLIENTES (SOLO MOVIL)
========================= */


@media (max-width: 768px){

  /* ❌ OCULTAR TODO MENOS NOMBRE Y ACCIONES */
  .tablaClientes th:nth-child(1),
  .tablaClientes td:nth-child(1),

  .tablaClientes th:nth-child(3),
  .tablaClientes td:nth-child(3),

  .tablaClientes th:nth-child(4),
  .tablaClientes td:nth-child(4),

  .tablaClientes th:nth-child(5),
  .tablaClientes td:nth-child(5),

  .tablaClientes th:nth-child(6),
  .tablaClientes td:nth-child(6),

  .tablaClientes th:nth-child(7),
  .tablaClientes td:nth-child(7),

  .tablaClientes th:nth-child(8),
  .tablaClientes td:nth-child(8),

  .tablaClientes th:nth-child(9),
  .tablaClientes td:nth-child(9){
    display: none !important;
  }

  /* ✅ NOMBRE (columna 2) */
  .tablaClientes th:nth-child(2),
  .tablaClientes td:nth-child(2){
    display: table-cell !important;
    width: auto;
    font-weight: 500;
  }

  .tablaClientes td:nth-child(10){
    display: flex !important;          /* 🔥 cambia layout */
    justify-content: center;
    align-items: center;

  }

  .tablaClientes td:nth-child(10) .btn{
    display: inline-flex !important;
    justify-content: center;
    align-items: center;
    width: 30px;
    height: 30px;
    padding: 0;
     margin: 0 !important; 
     gap: 15px; 
  }

}

/* ESTILOS PARA EL MODULO DE VENTAS VERSION MOVIL */  

@media (max-width: 768px){

.total-mobile {
  font-size: 28px;
  font-weight: bold;
  margin: 15px 0;
}

.botones-mobile .btn {
  font-size: 18px;
  padding: 12px;
}

#listaProductosMobile {
  max-height: 250px;
  overflow-y: auto;
}

  #CorteCajaF7 {
    display: none !important;
  }
  
/* oculto en web */
.botones-mobile-extra {
  display: none;
}

/* forzar móvil (incluye emuladores) */


  .grid-botones {
    display: none !important;
  }

  .botones-mobile-extra {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 15px;
  }

  .botones-mobile-extra button {
    height: 60px;
    font-size: 16px;
    font-weight: bold;
  }

  .botones-mobile-extra .cobrar {
    grid-column: span 2;
    height: 60px;
    font-size: 18px;
  }



.mobile-pago-extra {
  margin-top: 15px;
}

.mobile-pago-extra input {
  height: 50px;
  font-size: 18px;
  text-align: center;
}

#camara{
  
  width: 100%;
  height: 60px;
  background-color:#ffde28;
  border-color:#ffde28;
  border-radius: 6px;
    
}

.modal-scanner .modal-dialog {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
}

.modal-scanner .modal-content {
  height: 100%;
  border-radius: 0;
  background: black;
  
}

.modal-scanner .modal-body {
  height: calc(100% - 60px); /* header */
  padding: 0;
}

#reader {
  width: 100%;
  height: 100%;
}

/* =========================
   VENTAS (SOLO MOVIL)
========================= */


.modal-mobile .modal-footer{
  display: flex;
  gap: 10px;
}

.modal-mobile .modal-footer .btn{
  flex: 1;
  height: 55px;
  font-size: 18px;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;

  padding: 0 !important;
  margin: 0 !important;

  line-height: 1 !important;
}


#codigoBarrasVenta_mobile{
    width: 100% !important;
    max-width: 100% !important;
    padding: 12px;
    text-align: center;
}


#inputCambio_mobile{
  color: #007bff !important; /* 🔵 azul */
  font-weight: bold;         /* opcional, se ve mejor */
  font-size: 21px;           /* opcional, más visible */
}


}

/* =========================
   REPORTE VENTAS (SOLO MOVIL)
========================= */

@media (max-width: 768px){

  /* reset */
  .tablaHistorialVentas th,
  .tablaHistorialVentas td{
    display: none !important;
  }

  /* 💰 TOTAL */
  .tablaHistorialVentas th:nth-child(7),
  .tablaHistorialVentas td:nth-child(7){
    display: table-cell !important;
    font-size: 15px;
    font-weight: bold;
    color: #28a745;
    text-align: center;
  }


  /* ⚙ ACCIONES */
  .tablaHistorialVentas th:nth-child(9),
  .tablaHistorialVentas td:nth-child(9){
    display: table-cell !important;
    white-space: nowrap;
    text-align: center;
  }
  
    .modal .table th:nth-child(3),
  .modal .table td:nth-child(3){
    display: none;
  }
  
  .modal .table td:nth-child(2),
.modal .table th:nth-child(2){
  text-align: center;
}

}

/* =========================
   REPORTE ADMISTRAR VENTAS (SOLO MOVIL)
========================= */


@media (max-width: 768px){

  .tablaReporteVentas thead th:nth-child(1),
  .tablaReporteVentas tbody td:nth-child(1){
    display: none !important;
  }
  


}

/* =========================
   REPORTE HISTORIAL CAJAS (SOLO MOVIL)
========================= */
@media (max-width: 768px){

  .table{
    width: 100% !important;
    table-layout: auto !important;
  }

  .table th,
  .table td{
    white-space: nowrap;
    font-size: 12px;
  }

  .dataTables_wrapper{
    overflow-x: auto;
  }

}



@media (max-width: 1024px){

    .btn-mobile-pos{

        width: 100%;

        min-height: clamp(48px, 6vw, 68px);

        font-size: clamp(15px, 2vw, 22px);

        font-weight: 600;

        border-radius: clamp(6px, 1vw, 12px);

        margin-bottom: 12px;

        letter-spacing: 0.5px;

    }

}



