/* 1. Reset y Base */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f4f7f6;
    color: #333;
    line-height: 1.6;
}

/* 2. Sección de Botones Superiores (Responsive) */
.section1 {
    display: flex;
    justify-content: center;
    flex-wrap: wrap; /* Permite que los botones bajen si no caben */
    gap: 15px;
    padding: 20px;
    background: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.btn_act_obj {
    flex: 1 1 150px; /* Crece, encoge y tiene un mínimo de 150px */
    max-width: 250px;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #ddd;
    background-color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.btn_act_obj:hover {
    background-color: #0084ff;
    color: white;
    border-color: #0084ff;
    transform: translateY(-2px);
}

/* 3. Área de Trabajo Principal (Layout de 3 columnas) */
.section2, .section3 {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap; /* Clave para el responsive */
    gap: 20px;
    padding: 20px;
}

.clase1, .clase2, .clase3 {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    min-width: 300px; /* Evita que colapsen demasiado */
}

.clase1 { flex: 1; } /* Cédula */
.clase2 { flex: 2; min-height: 200px; } /* Productos */
.clase3 { flex: 1; } /* Buscador */

.clase1, .clase2, .clase3{
    max-height: 250px;
    overflow: hidden;
    overflow-y: scroll;
}

/* 4. Estilos de Inputs y Botones de Cédula */
input[type="text"], input[type="number"], input[type="email"] {
    width: 100%;
    padding: 12px;
    border: 2px solid #eee;
    border-radius: 8px;
    font-size: 16px;
    transition: 0.2s;
}

input[type="text"]:focus, input[type="number"]:focus, input[type="email"]:focus {
    outline: none;
    border-color: #0084ff;
    box-shadow: 0 0 8px rgba(0, 132, 255, 0.2);
}

.clase1_ {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 4 columnas iguales para V, J, E, G */
    gap: 10px;
    margin-top: 15px;
}

.btn_ci_act_obj, .btn_mini {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background: #f9f9f9;
    cursor: pointer;
    text-transform: uppercase;
    font-weight: bold;
}

.btn_mini{
    padding: 30px;
    display: block;
}

/* 5. Modal de Sesión / Nuevo Producto */
.nuevo_producto{
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* Oscurece el fondo */
    backdrop-filter: blur(4px); /* Efecto moderno de desenfoque */
    z-index: 1000;
    display: none; /* Cambiar a flex con JS */
    justify-content: center;
    align-items: center;
}

.form_session {
    background: white;
    padding: 40px;
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 90%;
    max-width: 400px;
    position: relative;
}

.tb_productos_generales{
    width: 100%;
}

.cerrar_btn_nuevo_producto{
    background-color: crimson;
    border: 0px solid transparent;
    color: white;
    padding: 15px;
    border-radius: 150%;
    width: 50px;
    height: 50px;
    position: absolute;
    top: 0;
    right: 0;
    margin: 5px;
    cursor: pointer;
    z-index: 1000   ;
}

a{
    color: black;
    text-decoration: none;
    display: flex;
    font-weight: 400;
}

.elementos_dinamicos_query_productos{
    display: none;
}

.table_shoping{
    background-color: white;
    width: 100%;
    padding: 10px;
    margin: 10px;
    border-radius: 10px;
}

.ci_rif_class{
    background-color: whitesmoke;
    padding: 5px;
    border-radius: 10px;
    margin-top: 10px;
}

.display_ci_rif{
    display: none;
}

/*estilo de canvas*/

/* Contenedor del formulario */
.form_session_scan {
    background: white;
    padding: 40px;
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 90%;
    max-width: 400px;
    position: relative;
    justify-content: center;
    align-items: center;
    max-height: 600px;
    overflow: scroll;
}

/*estilo para canvas 2*/

#video_scan {
    width: 100%;
    max-width: 360px;
    aspect-ratio: 3/4;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
    background: #000;
}

#video_scan video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#canvas_scan {
    display: none; /* Oculto hasta que captures */
}

.scan-overlay {
    position: absolute;
    top: 40%;
    left: 10%;
    width: 80%;
    height: 20%;
    border: 2px solid rgba(0,255,0,0.7);
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0,255,0,0.5);
    pointer-events: none;
}

/* Responsive */
@media (max-width: 400px) {
    .form_session {
        width: 90%;
    }
}

::-webkit-scrollbar-track{ background-color: transparent; }
::-webkit-scrollbar{ width: 4px; }
::-webkit-scrollbar-thumb { background: #0084ff; border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: #7bbfff; }

/* 6. Media Queries (El toque responsive) */

@media (max-width: 1024px) {
    .section2, .section3 {
        flex-direction: column; /* En tablets, las columnas se vuelven filas */
    }
    
    .clase1, .clase2, .clase3 {
        width: 100%; /* Ocupan todo el ancho */
    }
}

@media (max-width: 600px) {
    .section1 {
        padding: 10px;
    }
    
    .btn_act_obj {
        flex: 1 1 100%; /* En móviles pequeños, un botón por fila */
        max-width: 100%;
    }

    .table_shoping{
        width: auto;
    }

    .btn_mini{
        padding: 5px;
    }
}