/* Estilos generales para scanners en todos los módulos */

/* Botón de cámara - común a todos */
.btn-camera-barcode {
    background: linear-gradient(135deg, #143DD4 0%, #0f2a9e 100%);
    color: white;
    border: none;
    padding: 8px 10px;
    border-radius: 6px;
    display: none;
    flex-shrink: 0;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(20, 61, 212, 0.3);
}

.btn-camera-barcode:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(20, 61, 212, 0.5);
}

.btn-camera-barcode:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(20, 61, 212, 0.4);
}

/* Contenedor de código de barras */
.barcode-container-productos,
.barcode-container-inventario,
.barcode-container-kardex,
.barcode-container-pos,
.barcode-container-kardex2,
.barcode-container-ranking,
.barcode-container-detalleproducto,
.barcode-container-agregarproducto {
    flex-wrap: nowrap !important;
}

@media (max-width: 768px) {
    .barcode-container-productos,
    .barcode-container-inventario,
    .barcode-container-kardex,
    .barcode-container-pos,
    .barcode-container-kardex2,
    .barcode-container-ranking,
    .barcode-container-detalleproducto,
    .barcode-container-agregarproducto {
        gap: 5px;
    }

    .barcode-container-productos .textos_ventasNegrita,
    .barcode-container-inventario .textos_ventasNegrita,
    .barcode-container-kardex .textos_ventasNegrita,
    .barcode-container-pos .textos_ventasNegrita,
    .barcode-container-kardex2 .textos_ventasNegrita,
    .barcode-container-ranking .textos_ventasNegrita,
    .barcode-container-detalleproducto .textos_ventasNegrita,
    .barcode-container-agregarproducto div {
        flex: 1;
        min-width: 0;
    }

    #btnCameraProductos,
    #btnCameraInventario,
    #btnCameraKardex,
    #btnCameraPos,
    #btnCameraKardex2,
    #btnCameraRanking,
    #btnCameraDetalleproducto,
    #btnCameraAgregarProducto,
    #btnCameraAgregarProductoDoc {
        display: inline-block !important;
    }
}

@media (min-width: 769px) {
    #btnCameraProductos,
    #btnCameraInventario,
    #btnCameraKardex,
    #btnCameraPos,
    #btnCameraKardex2,
    #btnCameraRanking,
    #btnCameraDetalleproducto,
    #btnCameraAgregarProducto,
    #btnCameraAgregarProductoDoc {
        display: none !important;
    }
}

/* ========== Estilos de Modales Fullscreen ========== */

/* Productos */
#modalScanBarcodeProductos.modal,
#modalScanBarcodeInventario.modal,
#modalScanBarcodeKardex.modal,
#modalScanBarcodePos.modal,
#modalScanBarcodeAgregarProducto.modal,
#modalScanBarcodeAgregarProductoDoc.modal {
    background-color: rgba(0,0,0,0.95) !important;
    z-index: 2000 !important;
}

/* Asegurar que el backdrop del modal anidado esté por encima del modal padre */
#modalScanBarcodeAgregarProducto.modal::before,
#modalScanBarcodeAgregarProductoDoc.modal::before {
    z-index: 1999 !important;
}

/* Scanner containers - común */
#html5-qrcode-productos,
#html5-qrcode-full,
#html5-qrcode-kardex,
#html5-qrcode-pos,
#html5-qrcode-kardex2,
#html5-qrcode-ranking,
#html5-qrcode-detalleproducto,
#html5-qrcode-agregarproducto,
#html5-qrcode-agregarproducto-doc {
    position: relative;
}

#html5-qrcode-productos .html5-qrcode-element-hr,
#html5-qrcode-productos .html5-qrcode-controls,
#html5-qrcode-productos button,
#html5-qrcode-productos select,
#html5-qrcode-productos .html5-qrcode-button-element,
#html5-qrcode-productos .html5-qrcode-scanner-status,
#html5-qrcode-full .html5-qrcode-element-hr,
#html5-qrcode-full .html5-qrcode-controls,
#html5-qrcode-full button,
#html5-qrcode-full select,
#html5-qrcode-full .html5-qrcode-button-element,
#html5-qrcode-full .html5-qrcode-scanner-status,
#html5-qrcode-kardex .html5-qrcode-element-hr,
#html5-qrcode-kardex .html5-qrcode-controls,
#html5-qrcode-kardex button,
#html5-qrcode-kardex select,
#html5-qrcode-kardex .html5-qrcode-button-element,
#html5-qrcode-kardex .html5-qrcode-scanner-status,
#html5-qrcode-pos .html5-qrcode-element-hr,
#html5-qrcode-pos .html5-qrcode-controls,
#html5-qrcode-pos button,
#html5-qrcode-pos select,
#html5-qrcode-pos .html5-qrcode-button-element,
#html5-qrcode-pos .html5-qrcode-scanner-status,
#html5-qrcode-kardex2 .html5-qrcode-element-hr,
#html5-qrcode-kardex2 .html5-qrcode-controls,
#html5-qrcode-kardex2 button,
#html5-qrcode-kardex2 select,
#html5-qrcode-kardex2 .html5-qrcode-button-element,
#html5-qrcode-kardex2 .html5-qrcode-scanner-status,
#html5-qrcode-ranking .html5-qrcode-element-hr,
#html5-qrcode-ranking .html5-qrcode-controls,
#html5-qrcode-ranking button,
#html5-qrcode-ranking select,
#html5-qrcode-ranking .html5-qrcode-button-element,
#html5-qrcode-ranking .html5-qrcode-scanner-status,
#html5-qrcode-detalleproducto .html5-qrcode-element-hr,
#html5-qrcode-detalleproducto .html5-qrcode-controls,
#html5-qrcode-detalleproducto button,
#html5-qrcode-detalleproducto select,
#html5-qrcode-detalleproducto .html5-qrcode-button-element,
#html5-qrcode-detalleproducto .html5-qrcode-scanner-status,
#html5-qrcode-agregarproducto .html5-qrcode-element-hr,
#html5-qrcode-agregarproducto .html5-qrcode-controls,
#html5-qrcode-agregarproducto button,
#html5-qrcode-agregarproducto select,
#html5-qrcode-agregarproducto .html5-qrcode-button-element,
#html5-qrcode-agregarproducto .html5-qrcode-scanner-status,
#html5-qrcode-agregarproducto-doc .html5-qrcode-element-hr,
#html5-qrcode-agregarproducto-doc .html5-qrcode-controls,
#html5-qrcode-agregarproducto-doc button,
#html5-qrcode-agregarproducto-doc select,
#html5-qrcode-agregarproducto-doc .html5-qrcode-button-element,
#html5-qrcode-agregarproducto-doc .html5-qrcode-scanner-status {
    display: none !important;
}

#html5-qrcode-productos video,
#html5-qrcode-full video,
#html5-qrcode-kardex video,
#html5-qrcode-pos video,
#html5-qrcode-kardex2 video,
#html5-qrcode-ranking video,
#html5-qrcode-detalleproducto video,
#html5-qrcode-agregarproducto video,
#html5-qrcode-agregarproducto-doc video {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

#html5-qrcode-productos > *,
#html5-qrcode-full > *,
#html5-qrcode-kardex > *,
#html5-qrcode-pos > *,
#html5-qrcode-kardex2 > *,
#html5-qrcode-ranking > *,
#html5-qrcode-detalleproducto > *,
#html5-qrcode-agregarproducto > *,
#html5-qrcode-agregarproducto-doc > * {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

#html5-qrcode-productos > div:first-child,
#html5-qrcode-full > div:first-child,
#html5-qrcode-kardex > div:first-child,
#html5-qrcode-pos > div:first-child,
#html5-qrcode-kardex2 > div:first-child,
#html5-qrcode-ranking > div:first-child,
#html5-qrcode-detalleproducto > div:first-child,
#html5-qrcode-agregarproducto > div:first-child,
#html5-qrcode-agregarproducto-doc > div:first-child {
    display: none !important;
}

/* Modal anidado - asegurar visibilidad */
#modalScanBarcodeAgregarProducto .modal-body,
#modalScanBarcodeAgregarProductoDoc .modal-body {
    z-index: 2000 !important;
}

#modalScanBarcodeAgregarProducto .modal-header,
#modalScanBarcodeAgregarProductoDoc .modal-header {
    z-index: 2001 !important;
}
