/* Estilos para scanner de productos */

.barcode-container-productos {
    flex-wrap: nowrap !important;
}

.btn-camera-barcode {
    background: none;
    color: #143DD4;
    border: none;
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 8px;
    display: none;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 26px;
    cursor: pointer;
    box-shadow: none;
    box-sizing: border-box;
}

.btn-camera-barcode:hover {
    color: #0f2a9e;
}

.btn-camera-barcode:active {
    color: #0f2a9e;
}

@media (max-width: 768px) {
    .barcode-container-productos {
        gap: 5px;
    }

    #btnCameraProductos {
        display: inline-flex !important;
    }

    .barcode-container-productos .textos_ventasNegrita {
        flex: 1;
        min-width: 0;
    }
}

@media (min-width: 769px) {
    #btnCameraProductos {
        display: none !important;
    }
}

/* Estilos del modal */
#modalScanBarcodeProductos.modal {
    background-color: rgba(0,0,0,0.95) !important;
}

#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 {
    display: none !important;
}

#html5-qrcode-productos video {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

#html5-qrcode-productos > * {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

#html5-qrcode-productos > div:first-child {
    display: none !important;
}


.fila-url-imagen {
    display: flex;
    gap: 5px;
    align-items: center;
    margin-top: 7px;
}

.campo-url-imagen {
    flex: 1;
    min-width: 0;
    height: 30px;
    padding: 0 9px;
    border: 1px solid #cfd8e8;
    border-radius: 6px;
    font-size: 11px;
    color: #2d3748;
}

.btn-url-usar {
    height: 30px;
    padding: 0 12px;
    border: none;
    border-radius: 6px;
    background-color: #B8E6D5;
    color: #2d5a3d;
    font-size: 11px;
    font-weight: 600;
    flex-shrink: 0;
}

.btn-url-google {
    height: 30px;
    padding: 0 11px;
    border: none;
    border-radius: 6px;
    background-color: #B4D7FF;
    color: #1a3a5a;
    font-size: 11px;
    font-weight: 600;
    flex-shrink: 0;
}

.img-prod-lista {
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.img-prod-lista:hover {
    transform: scale(1.06);
    box-shadow: 0 3px 10px rgba(20, 61, 212, 0.22);
}

.img-prod-dialogo {
    width: 480px;
    max-width: calc(100% - 20px);
    margin: 30px auto;
}

.img-prod-contenido {
    border: none;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 12px 36px rgba(15, 42, 158, 0.25);
}

.img-prod-cabecera {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: linear-gradient(135deg, #143DD4, #0f2a9e);
    color: #fff;
}

.img-prod-titulo {
    flex: 1;
    min-width: 0;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: 0.2px;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    word-break: break-word;
}

.img-prod-cerrar {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    font-size: 16px;
    cursor: pointer;
}

.img-prod-cerrar:hover {
    background: rgba(255, 255, 255, 0.28);
}

.img-prod-visor {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    max-height: 52vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f4f6fb;
    overflow: hidden;
}

.img-prod-visor img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

#imgProdVideo {
    display: none;
    position: absolute;
    top: 0;
    left: 50%;
    width: auto;
    height: 100%;
    aspect-ratio: 1 / 1;
    transform: translateX(-50%);
    border-radius: 0;
    object-fit: cover;
    background: #000;
}

.img-prod-disparo {
    display: none;
    position: absolute;
    left: 50%;
    bottom: 18px;
    width: 66px;
    height: 66px;
    transform: translateX(-50%);
    border: 4px solid rgba(255, 255, 255, 0.85);
    border-radius: 50%;
    background: #143DD4;
    color: #fff;
    font-size: 24px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
    cursor: pointer;
}

.img-prod-disparo:active {
    background: #0f2a9e;
}

.img-prod-en-camara #imgProdVideo,
.img-prod-en-camara .img-prod-disparo {
    display: block;
}

.img-prod-en-camara #imgProdVista {
    visibility: hidden;
}

.img-prod-cargando {
    display: none;
    position: absolute;
    inset: 0;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.7);
    color: #143DD4;
    font-size: 34px;
}

.img-prod-cargando.img-prod-cargando-activo {
    display: flex;
}

.img-prod-origenes {
    display: flex;
    gap: 8px;
    padding: 14px 16px 0;
}

.img-prod-origen {
    flex: 1;
    min-width: 0;
    height: 64px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border: none;
    border-radius: 12px;
    background: #eef2fd;
    color: #143DD4;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.img-prod-origen i {
    font-size: 20px;
}

.img-prod-origen:hover {
    background: #dfe6fb;
}

.img-prod-en-camara #imgProdCamara {
    background: #143DD4;
    color: #fff;
}

.img-prod-origen-quitar {
    background: #fdecee;
    color: #c62839;
}

.img-prod-origen-quitar:hover {
    background: #fadadd;
}

.img-prod-origen:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.img-prod-enlace {
    display: flex;
    gap: 8px;
    padding: 12px 16px 0;
}

.img-prod-url {
    flex: 1;
    min-width: 0;
    height: 40px;
    padding: 0 12px;
    border: 1px solid #d5dcec;
    border-radius: 10px;
    font-size: 13px;
    color: #1a2440;
}

.img-prod-url:focus {
    outline: none;
    border-color: #143DD4;
    box-shadow: 0 0 0 3px rgba(20, 61, 212, 0.12);
}

.img-prod-usar {
    flex-shrink: 0;
    height: 40px;
    padding: 0 18px;
    border: none;
    border-radius: 10px;
    background: #143DD4;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.img-prod-usar:hover {
    background: #0f2a9e;
}

.img-prod-usar:disabled {
    opacity: 0.55;
    cursor: wait;
}

.img-prod-pie {
    display: flex;
    gap: 10px;
    padding: 16px;
}

.img-prod-btn {
    flex: 1;
    height: 46px;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.img-prod-btn-cancelar {
    background: #f1f3f8;
    color: #4a5468;
}

.img-prod-btn-cancelar:hover {
    background: #e6e9f1;
}

.img-prod-btn-guardar {
    background: linear-gradient(135deg, #143DD4, #0f2a9e);
    color: #fff;
    box-shadow: 0 4px 12px rgba(20, 61, 212, 0.28);
}

.img-prod-btn-guardar:disabled {
    opacity: 0.45;
    box-shadow: none;
    cursor: not-allowed;
}

input.img-prod-archivo {
    display: none;
}

@media (max-width: 767px) {
    .img-prod-dialogo {
        margin: 10px auto;
    }

    .img-prod-origenes {
        padding: 12px 12px 0;
        gap: 6px;
    }

    .img-prod-enlace {
        padding: 10px 12px 0;
    }

    .img-prod-pie {
        padding: 12px;
    }
}
