.products-header {
    border-radius: 10px 10px 0 0;
    position: sticky;
    top: 0;

    border-bottom: 1px solid #444;
    z-index: 100;
    padding: 12px 15px;


    display: flex;
    align-items: center;
    gap: 15px;
    margin: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}


.dark-mode .products-header .input-group-text {
    background: #2b2f33;
    color: #fff;
    border: 1px solid #444;
}

.dark-mode .products-header .form-control {
    background: #2b2f33;
    color: #fff;
    border: 1px solid #444;
}

.products-header h4 {
    margin: 0;
    font-weight: 700;
    white-space: nowrap;
}

.products-header input {
    flex: 1;
    border-radius: 10px;
}

/* ================================
LAYOUT POS
================================ */

.pos-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 0px;
}

/* ================================
SECCIÓN PRODUCTOS
================================ */

.products-section {
    flex: 2;
    overflow: hidden;
    background: #f9f9f9;
    border-radius: 10px;
    max-height: 85vh;

    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);

    padding: 0;
}

.products-section h2 {
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.dark-mode .products-section h2 {
    color: #ffffff;
}

/* ================================
GRID PRODUCTOS
================================ */

.product-grid {
    margin-top: 0px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 15px;
    padding: 10px 5px 80px;
    /* 🔥 espacio abajo */

    max-height: 80vh;
    /* 🔥 dinámico según pantalla */
    overflow-y: auto;
}

/* ================================
CARD PRODUCTO
================================ */

.product-card {
    position: relative;
    background: #ffffff;
    border-radius: 10px;
    text-align: center;
    padding: 10px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    transition: transform .2s, box-shadow .2s;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 200px;

    overflow: visible;
}


.nombre-producto-wrapper {
    position: relative;
}

.dark-mode .product-card {
    position: relative;
    background: #464c55;
    border-radius: 10px;
    text-align: center;
    padding: 10px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    transition: transform .2s, box-shadow .2s;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 230px;
}


.product-card:hover {
    transform: scale(1.04);
    box-shadow: 0 4px 14px rgba(255, 255, 255, 0.15);
}



body.dark .product-card:hover .nombre-producto {
    background: #96a0afbe;
    color: #f9fafb;
    box-shadow: 0 8px 20px rgba(0,0,0,0.35);
}
.product-card:active {
    transform: scale(.95);
}

.product-card img {
    width: 100%;
    height: 100px;
    object-fit: contain;
    border-radius: 6px;
    margin-bottom: 8px;
}

.dark-mode .product-card img {
    background: rgba(55, 60, 66, 0.51) !important;
}

.dark-mode .products-section {
    background: #464c55;
}

/* ================================
NOMBRE PRODUCTO
================================ */
.nombre-producto {
    font-size: 13px;
    font-weight: 500;
    margin: 0;
    line-height: 1.2;

    /* 🔥 evita que crezca demasiado */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;


    text-overflow: ellipsis;
    cursor: pointer;
    transition: all 0.2s ease;

}


.tooltip-nombre-producto {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #016891;
    color: #fff;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.4;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.18);
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: all 0.2s ease;
    z-index: 50;
    pointer-events: none;
    white-space: normal;
}


.tooltip-nombre-producto::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 16px;
    border-width: 6px;
    border-style: solid;
    border-color: #1f2937 transparent transparent transparent;
}

.nombre-producto-wrapper:hover .tooltip-nombre-producto {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dark-mode .nombre-producto {
    color: #ffffff;
}


.dark-mode #buscarProducto {
    background: #2b2f33;
    color: #fff;
    border: 1px solid #444;
}

.dark-mode #buscarProducto::placeholder {
    color: #aaa;
}

/* ================================
CÓDIGO PRODUCTO
================================ */

.codigo-producto {
    display: block;
    font-size: .7rem;
    color: #666;
    margin-top: 2px;
}

.dark-mode .codigo-producto {
    color: #ffffff;
}

/* ================================
SEPARADOR
================================ */

.separador {
    border-top: 1px solid #ccc;
    margin: 8px 0;
}

/* ================================
PRECIO PRODUCTO
================================ */

.precio-producto {
    font-size: .85rem;
    color: #007b00;
    font-weight: bold;
    margin: 0;
}

.dark-mode .precio-producto {
    color: #67e967;
}

/* ================================
OFERTA BADGE
================================ */

.oferta-container {
    position: absolute;
    top: 5px;
    left: 5px;
}
.oferta-badge {
    background: #e0b701;
    color: white;
    font-size: .7rem;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 5px;

    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 20;
}

.stock-badge{
        background: rgba(6, 82, 112, 0.63);
    color: white;
    font-size: .6rem;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 5px;
    position: absolute;
    top: 10px;
    left: 10px;
}
/* ================================
PRODUCTO DESHABILITADO
================================ */

.product-card.disabled {
    opacity: 0.6;
    pointer-events: none;
    cursor: not-allowed;
}

.product-card.disabled::after {
    content: "Cargando...";
    position: absolute;
    top: 40%;
    left: 0;
    width: 100%;
    text-align: center;
    font-size: .8rem;
    color: #555;
    background: rgba(255, 255, 255, .8);
}

/* ================================
SECCIÓN VENTA
================================ */

.venta-section {
    flex: 2;
    padding: 10px;
    font-size: .85rem;
    max-height: 100vh;
    overflow-y: auto;
}

/* ================================
TABLA PRODUCTOS
================================ */

#lstProductosPuntoVenta td,
#lstProductosPuntoVenta th {
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    max-width: 150px;
}

/* ================================
INPUTS TABLA
================================ */

.iptPrecioVenta,
.iptDescuento {
    width: 70px;
    font-size: .85rem;
}

/* ================================
CHECK EFECTIVO EXACTO
================================ */

#chkEfectivoExacto:checked+#labelChkEfectivo {
    background-color: #71b800;
    color: #fff;
    border-color: #71b800;
}

/* ================================
DARK MODE TABLAS
================================ */

.dark-mode .table-striped {
    color: #ffffff;
}

/* ================================
RESPONSIVE
================================ */

@media (max-width:768px) {

    .products-section,
    .venta-section {
        flex: 100%;
    }

    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 10px;
    }



    .product-card h5,
    .product-card p {
        font-size: .7rem;
    }
}

#buscarProducto {
    font-size: 15px;
    padding: 10px 12px;
}

.dark-mode .product-grid {
    background-color: #464c55;

    color: #ffffff;

}







/* CONTENEDOR PRINCIPAL */
.ui-autocomplete-list {
    max-height: 500px;
    overflow-y: auto;
    overflow-x: hidden;
    border-radius: 12px;
    border: 1px solid #352c2c;
    background: #ffffff;
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
    padding: 8px;
    z-index: 9999 !important;
}

/* ITEM */
.autocomplete-item {
    list-style: none;
    margin-bottom: 8px;
}

/* ENLACE INTERNO */
.autocomplete-item > div {
    display: flex !important;
    align-items: center;
    gap: 12px;
    padding: 10px !important;
    border-radius: 12px !important;
    transition: all 0.2s ease;
}

/* HOVER MODERNO */
.autocomplete-item > div:hover {
    background: #f5f7fa !important;
    transform: scale(1.01);
}

/* IMAGEN */
.autocomplete-item img {
    width: 65px !important;
    height: 65px !important;
    object-fit: cover;
    border-radius: 10px;
}

/* TEXTO */
.autocomplete-item .fw-bold {
    font-size: 15px !important;
}

.autocomplete-item .text-muted {
    font-size: 13px !important;
}

/* SCROLL MÁS BONITO */
.ui-autocomplete-list::-webkit-scrollbar {
    width: 6px;
}

.ui-autocomplete-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 10px;
}


@media (max-width: 768px) {

    .ui-autocomplete-list {
        max-height: 300px;
        padding: 5px;
    }

    .autocomplete-item a {
        flex-direction: row;
        align-items: flex-start;
        padding: 8px !important;
    }

    .autocomplete-item img {
        width: 55px !important;
        height: 55px !important;
    }

    .autocomplete-item .fw-bold {
        font-size: 14px !important;
    }

    .autocomplete-item .text-muted {
        font-size: 12px !important;
    }
}



@keyframes flashRow {
    0%   { background-color: #15ff002d; }   /* amarillo suave */
    50%  { background-color: #15ff002d; }
    100% { background-color: transparent; }
}

.flash-row {
    animation: flashRow 0.5s ease;
}






#tblCotizacionesEditar {
    font-size: 0.875rem;
}

#tblCotizacionesEditar thead th {
    background: #f8f9fa;
    color: #6c757d;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-bottom: 1px solid #dee2e6;
    padding: 12px 10px;
}

#tblCotizacionesEditar tbody td {
    padding: 12px 10px;
    vertical-align: middle;
}

#tblCotizacionesEditar tbody tr {
    transition: all 0.15s ease;
}

#tblCotizacionesEditar tbody tr:hover {
    background-color: #f8f9fa;
}

#tblCotizacionesEditar .cliente-cotizacion {
    max-width: 280px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
    vertical-align: middle;
}

#tblCotizacionesEditar .btn-editar-cotizacion {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

#tblCotizacionesEditar_wrapper .dataTables_filter input {
    border-radius: 8px;
    border: 1px solid #dee2e6;
    padding: 6px 12px;
    margin-left: 6px;
}

#tblCotizacionesEditar_wrapper .dataTables_length select {
    border-radius: 8px;
    border: 1px solid #dee2e6;
    padding: 5px 28px 5px 10px;
}

#tblCotizacionesEditar_wrapper .dataTables_info {
    color: #6c757d;
    font-size: 0.8rem;
}

#tblCotizacionesEditar_wrapper .dataTables_paginate .paginate_button {
    border-radius: 6px !important;
}



/* =========================================================
   LISTADO DE PRODUCTOS - PUNTO DE VENTA
   ========================================================= */

#lstProductosPuntoVenta {
    border-collapse: separate !important;
    border-spacing: 0;
    font-size: 14px;
    margin: 0 !important;
}

/* Encabezado */
#lstProductosPuntoVenta thead th {
    background-color: var(--color-general, #007bff);
    color: #fff;
    border: 0 !important;
    padding: 12px 10px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    vertical-align: middle;
}

/* Bordes redondeados superiores */
#lstProductosPuntoVenta thead th:first-child {
    border-top-left-radius: 8px;
}

#lstProductosPuntoVenta thead th:last-child {
    border-top-right-radius: 8px;
}

/* Filas */
#lstProductosPuntoVenta tbody tr {
    background-color: #fff;
    transition: background-color .15s ease;
}

/* Hover */
#lstProductosPuntoVenta tbody tr:hover {
    background-color: #f5f9ff !important;
}

/* Celdas */
#lstProductosPuntoVenta tbody td {
    border-bottom: 1px solid #edf0f2 !important;
    border-top: 0 !important;
    padding: 9px 10px;
    vertical-align: middle;
}

/* Producto */
#lstProductosPuntoVenta tbody td:nth-child(7) {
    font-weight: 600;
    color: #343a40;
}

/* Precio */
#lstProductosPuntoVenta tbody td:nth-child(9),
#lstProductosPuntoVenta tbody td:nth-child(10) {
    font-weight: 500;
    white-space: nowrap;
}

/* Total */
#lstProductosPuntoVenta tbody td:nth-child(11) {
    font-weight: 700;
    color: #1f2d3d;
    white-space: nowrap;
}

/* Cantidad */
#lstProductosPuntoVenta tbody td:nth-child(8) {
    font-weight: 600;
}

/* Imagen del producto */
#lstProductosPuntoVenta tbody td img {
    width: 42px;
    height: 42px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background: #f8f9fa;
    padding: 2px;
}

/* Botones de opciones */
#lstProductosPuntoVenta tbody td .btn {
    border-radius: 6px;
    margin: 1px;
}

/* Inputs dentro de la tabla */
#lstProductosPuntoVenta tbody input {
    border-radius: 6px;
    border: 1px solid #ced4da;
    font-size: 13px;
}

#lstProductosPuntoVenta tbody input:focus {
    border-color: var(--color-general, #007bff);
    box-shadow: 0 0 0 2px rgba(0, 123, 255, .10);
}

/* Selects */
#lstProductosPuntoVenta tbody select {
    border-radius: 6px;
    font-size: 13px;
}

/* DataTables */
#lstProductosPuntoVenta_wrapper {
    width: 100%;
}

#lstProductosPuntoVenta_wrapper .dataTables_info {
    font-size: 12px;
    color: #6c757d;
}

#lstProductosPuntoVenta_wrapper .dataTables_paginate {
    font-size: 12px;
}

/* Quitar separación visual innecesaria */
#lstProductosPuntoVenta_wrapper .dataTables_filter,
#lstProductosPuntoVenta_wrapper .dataTables_length {
    margin-bottom: 8px;
}

/* Scroll horizontal */
#lstProductosPuntoVenta_wrapper .dataTables_scrollBody {
    border: 0 !important;
}

/* Última fila */
#lstProductosPuntoVenta tbody tr:last-child td {
    border-bottom: 0 !important;
}


