
/* ================= GLOBAL ================= */
.add_venta_section *{
    box-sizing: border-box;
    font-family: 'Segoe UI', Roboto, system-ui, sans-serif;
}

/* add_venta_ prefijo - sin clases globales */
.add_venta_container {
    margin: 2rem auto;
    background: #f9fbfd;
    border-radius: 24px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.05);
    padding: 2rem;
}

.add_venta_header {
    border-bottom: 2px solid #e6edf2;
    padding-bottom: 1.2rem;
    margin-bottom: 2rem;
}

.add_venta_header h1 {
    font-size: 1.9rem;
    font-weight: 600;
    color: #0a2c3d;
    margin: 0 0 0.25rem 0;
    letter-spacing: -0.01em;
}

.add_venta_sub {
    color: #5e7a8c;
    font-size: 0.95rem;
    margin: 0;
}

/* tarjeta principal */
.add_venta_card {
    background: white;
    border-radius: 20px;
    padding: 1.8rem 2rem;
    box-shadow: 0 4px 12px rgba(0,20,30,0.02);
    border: 1px solid #e9f0f4;
}

.add_venta_card h2 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #1d4c5e;
    margin-top: 0;
    margin-bottom: 1.8rem;
    border-left: 6px solid #3fa3b6;
    padding-left: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.add_venta_grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.2rem 1.5rem;
    align-items: start;
}

.add_venta_span_2 {
    grid-column: span 2;
}

.add_venta_span_3 {
    grid-column: span 3;
}

.add_venta_field {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.add_venta_field label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #3d6372;
    font-weight: 700;
    margin-bottom: 0.25rem;
}



.add_venta_input,
.add_venta_select,
.add_venta_textarea {
    background: #f3f7fa;
    border: 1.5px solid #e2ecf0;
    border-radius: 12px;
    padding: 0.65rem 1rem;
    font-size: 0.9rem;
    transition: all 0.15s;
    color: #153243;
    font-family: inherit;
    width: 100%;
    box-sizing: border-box;
}

.add_venta_input:focus,
.add_venta_select:focus,
.add_venta_textarea:focus {
    border-color: #3fa3b6;
    background: white;
    outline: none;
    box-shadow: 0 0 0 4px rgba(63,163,182,0.06);
}

/* grupo de medidas horizontal */
.add_venta_medidas_group {
    display: flex;
    gap: 0.5rem;
    width: 100%;
}

.add_venta_medidas_item {
    flex: 1;
}

/* folio y fecha en fila */
.add_venta_folio_row {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    background: #f0f6f9;
    padding: 0.8rem 1.2rem;
    border-radius: 14px;
    margin-top: 0.5rem;
}

.add_venta_folio_box {
    background: white;
    border-radius: 30px;
    padding: 0.3rem 1.2rem;
    border: 1px solid #cbe2e8;
    font-weight: 600;
    color: #1f5e6e;
    font-size: 0.95rem;
}

.add_venta_folio_label {
    font-size: 0.75rem;
    color: #3d6372;
    font-weight: 600;
    text-transform: uppercase;
}

/* botones */
.add_venta_actions {
    display: flex;
    justify-content: flex-end;
    gap: 1.2rem;
    margin-top: 2.2rem;
    padding-top: 1.5rem;
    border-top: 2px solid #e6edf2;
}

.add_venta_btn {
    border: none;
    border-radius: 40px;
    padding: 0.7rem 2.2rem;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: 0.15s;
    background: white;
    border: 1.5px solid transparent;
}

.add_venta_btn_cancel {
    text-decoration: none;
    background: var(--red-background-light);
    color: #3d5f6e;
    border-color: var(--red-background-default);
}

.add_venta_btn_cancel:hover {
    background: var(--red-background-default);
    color: #1f404e;
}

.add_venta_btn_generate {
    background: #1f7f8c;
    color: white;
    box-shadow: 0 8px 16px rgba(31,127,140,0.15);
}

.add_venta_btn_generate:hover {
    background: #146b77;
    transform: translateY(-2px);
}

/* ================= VALIDACIÓN ================= */

.add_venta_required_text{
    display: none;
    color: var(--red-text-default);
    font-size: 0.9rem;
}

.is-visible {
    display: block;
    animation: shakeX 0.4s ease-in-out;
}

@keyframes shakeX {
    0%   { transform: translateX(0); }
    20%  { transform: translateX(-6px); }
    40%  { transform: translateX(6px); }
    60%  { transform: translateX(-4px); }
    80%  { transform: translateX(4px); }
    100% { transform: translateX(0); }
}

.is-invalid {
    border-color: var(--red-background-strong) !important;
    background-color: var(--red-background-light) !important;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15) !important;
}

.is-invalid:focus {
    border-color: var(--red-background-strong) !important;
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.25) !important;
}

/* ///////////////////////////////////////////////////////////////////////////////////////////////////////// */
/* //////////////////////////////////// PRODUCTOS - REDISEÑO ////////////////////////////////////////////// */
/* ///////////////////////////////////////////////////////////////////////////////////////////////////////// */

.add_venta_product_section{
    margin-top: 2.5rem;
}

.add_venta_product_container{
    display:grid;
    grid-template-columns: 1.4fr 1fr;
    gap:2rem;
}

/* panel tipo card */
.add_venta_product_panel{
    background:white;
    border-radius:20px;
    padding:1.8rem 2rem;
    box-shadow: 0 4px 12px rgba(0,20,30,0.03);
    border:1px solid #e9f0f4;
    display:flex;
    flex-direction:column;
    min-height:600px;
}

.add_venta_product_panel h2{
    font-size:1.25rem;
    font-weight:600;
    color:#1d4c5e;
    margin:0 0 1.5rem 0;
    border-left:6px solid #3fa3b6;
    padding-left:1rem;
}

/* header carrito */
.add_venta_product_header{
    display:flex;
    justify-content:space-between;
    align-items:center;
    padding-bottom:1rem;
    border-bottom:1px solid #e6edf2;
    margin-bottom:1.5rem;
}

.add_venta_product_header h3{
    font-size:1.1rem;
    font-weight:600;
    color:#1d4c5e;
    margin:0;
}

.add_venta_product_delete_cart{
    background: var(--red-background-light);
    color: #3d5f6e;
    border:1px solid var(--red-background-default);
    padding:0.45rem 1rem;
    border-radius:30px;
    font-size:0.8rem;
    font-weight:600;
    cursor:pointer;
    transition:.15s;
}

.add_venta_product_delete_cart:hover{
    background: var(--red-background-default);
}

/* ================= BUSCADOR ================= */

.add_venta_product_search_input{
    background:#f3f7fa;
    border:1.5px solid #e2ecf0;
    border-radius:12px;
    padding:0.7rem 1rem;
    font-size:0.9rem;
    transition:.15s;
    width:100%;
}

.add_venta_product_search_input:focus{
    border-color:#3fa3b6;
    background:white;
    outline:none;
    box-shadow:0 0 0 4px rgba(63,163,182,0.06);
}

/* ================= LISTA PRODUCTOS ================= */

.add_venta_product_search_results{
    margin-top:1.2rem;
    display:flex;
    flex-direction:column;
    gap:0.8rem;
    flex:1;
    overflow:auto;
    max-height: 400px;
}

.add_venta_product_search_box{
    display: flex;
    flex-direction: row;
    gap: 0.8rem;
    overflow: auto;
}

.add_venta_filter-dates {
    padding: 10px 18px;
    background-color: #f0f3f8;
    border: none;
    border-radius: 8px;
    color: #555;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.add_venta_product_producto_row{
    background:#f9fbfd;
    border:1px solid #e6edf2;
    border-radius:14px;
    padding:1rem 1.2rem;
    display:flex;
    justify-content:space-between;
    align-items:center;
    transition:.15s;
}

.add_venta_product_producto_row:hover{
    background:white;
    box-shadow:0 4px 10px rgba(0,20,30,0.04);
    transform:translateY(-2px);
}

.add_venta_product_producto_info h4{
    margin:0;
    font-size:0.95rem;
    font-weight:600;
    color:#153243;
}

.add_venta_product_producto_info p{
    margin:3px 0 0;
    font-size:0.8rem;
    color:#5e7a8c;
}

.add_venta_product_producto_side{
    text-align:right;
    font-size:0.9rem;
    font-weight:600;
    color:#1f5e6e;
}

/* botones cantidad */
.add_venta_product_cantidad{
    display:flex;
    gap:6px;
    align-items:center;
}

.add_venta_product_cantidad_btn{
    width:28px;
    height:28px;
    border-radius:8px;
    border:1px solid #dbe5e9;
    background:#f3f7fa;
    cursor:pointer;
    transition:.15s;
}

.add_venta_product_cantidad_btn:hover{
    background:#e3eaee;
}

/* botón agregar estilo primario */
.add_venta_product_btn_agregar{
    margin-top: 2px;
    background: var(--red-background-strong);
    color:white;
    border:none;
    border-radius:30px;
    padding:0.4rem 1rem;
    font-size:0.8rem;
    font-weight:600;
    cursor:pointer;
    transition:.15s;
}

.add_venta_product_btn_agregar:hover{
    transform:translateY(2px);
}

.estatus_disabled{
    background: var(--red-background-light);
}

/* ================= CARRITO ================= */

.add_venta_product_items_list{
    display:flex;
    flex-direction:column;
    gap:0.7rem;
    flex:1;
    overflow:auto;
    max-height: 300px;
}

.add_venta_product_item_row{
    background:#f9fbfd;
    border:1px solid #e6edf2;
    border-radius:14px;
    padding:0.8rem 1rem;
    display:grid;
    grid-template-columns: 1fr auto auto auto;
    gap:10px;
    align-items:center;
}

.add_venta_product_btn_remove{
    background: var(--red-background-light);
    border:1px solid var(--red-background-default);
    color:#3d5f6e;
    border-radius:20px;
    padding:0.3rem 0.8rem;
    font-size:0.75rem;
    cursor:pointer;
    transition:.15s;
}

.add_venta_product_btn_remove:hover{
    background: var(--red-background-default);
}

/* ================= TOTALES ================= */

.add_venta_product_totales_block{
    margin-top:1.5rem;
    padding-top:1.2rem;
    border-top:1px solid #e6edf2;
    display:flex;
    flex-direction:column;
    gap:1rem;
}

.add_venta_product_total_box{
    width:100%;
    background: var(--red-background-default);
    border-radius:14px;
    padding:0.9rem 1.2rem;
    color:white;
    font-weight:600;
    display:flex;
    justify-content:space-between;
}

.add_venta_product_total_subbox{
    width: 100%;
    display:flex;
    flex-direction:row;
    gap:0.3rem;
}

.add_venta_product_select_pago{
    background:#f3f7fa;
    border:1.5px solid #e2ecf0;
    border-radius:12px;
    padding:0.65rem 1rem;
}

.add_venta_product_btn_guardar{
    background: var(--red-background-default);
    border:none;
    border-radius:40px;
    padding:0.8rem;
    font-weight:600;
    color:white;
    cursor:pointer;
    transition:.15s;
    box-shadow:0 8px 16px rgba(220,38,38,0.15);
}

.add_venta_product_btn_guardar:hover{
    background: var(--red-background-strong);
    transform:translateY(-2px);
}


/* ================= 1366px ================= */
@media (max-width: 1366px){

    .add_venta_container{
        padding:1.8rem;
    }

    .add_venta_grid{
        gap:1rem 1.2rem;
    }

    .add_venta_product_container{
        gap:1.5rem;
    }

    .add_venta_product_panel{
        min-height:550px;
    }

}


/* ================= 1200px ================= */
@media (max-width:1200px){

    .add_venta_grid{
        grid-template-columns: repeat(2,1fr);
    }

    .add_venta_span_3{
        grid-column: span 2;
    }

    .add_venta_product_container{
        grid-template-columns:1fr;
    }

    .add_venta_product_panel{
        min-height:auto;
    }

}


/* ================= 1024px ================= */
@media (max-width:1024px){

    .add_venta_container{
        padding:1.5rem;
    }

    .add_venta_header h1{
        font-size:1.6rem;
    }

    .add_venta_grid{
        grid-template-columns:1fr;
    }

    .add_venta_span_2,
    .add_venta_span_3{
        grid-column: span 1;
    }

    .add_venta_folio_row{
        flex-direction:column;
        align-items:flex-start;
        gap:0.8rem;
    }

    .add_venta_actions{
        flex-direction:column;
        align-items:stretch;
    }

    .add_venta_btn{
        width:100%;
    }

}


/* ================= 768px ================= */
@media (max-width:768px){
    
    .add_venta_product_search_box{
        flex-direction:column;        
    }

    .add_venta_container{
        margin:1rem;
        padding:1.2rem;
        border-radius:18px;
    }

    .add_venta_card{
        padding:1.3rem;
    }

    .add_venta_card h2{
        font-size:1.1rem;
    }

    .add_venta_product_producto_row{
        flex-direction:column;
        align-items:flex-start;
        gap:0.6rem;
    }

    .add_venta_product_producto_side{
        text-align:left;
    }

    .add_venta_product_item_row{
        grid-template-columns:1fr;
        gap:6px;
    }

    .add_venta_product_total_subbox{
        flex-direction:column;
    }

}


/* ================= 480px ================= */
@media (max-width:480px){

    .add_venta_header h1{
        font-size:1.3rem;
    }

    .add_venta_sub{
        font-size:0.85rem;
    }

    .add_venta_input,
    .add_venta_select,
    .add_venta_textarea{
        font-size:0.85rem;
        padding:0.55rem 0.8rem;
    }

    .add_venta_product_btn_agregar,
    .add_venta_product_btn_remove{
        width:100%;
        text-align:center;
    }

    .add_venta_product_total_box{
        font-size:0.9rem;
    }

}
