/*=============================================
ESTILOS MEJORADOS PARA EL SISTEMA DE VENTAS
=============================================*/


/* BÃºsqueda rÃ¡pida */
#busquedaRapidaProducto {
    font-size: 16px;
    font-weight: bold;
    border: 2px solid #3c8dbc;
}

#busquedaRapidaProducto:focus {
    border-color: #00a65a;
    box-shadow: 0 0 10px rgba(0, 166, 90, 0.3);
}

#resultadosBusqueda .list-group-item {
    cursor: pointer;
    transition: all 0.2s;
}

#resultadosBusqueda .list-group-item:hover {
    background-color: #3c8dbc;
    color: white;
    transform: translateX(5px);
}

/* Total grande y visible */
#totalVentaDisplay {
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    animation: pulso 2s ease-in-out infinite;
}

@keyframes pulso {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

/* Stock warnings */
.text-danger {
    color: #dd4b39 !important;
    font-weight: bold;
}

.text-warning {
    color: #f39c12 !important;
    font-weight: bold;
}

.text-success {
    color: #00a65a !important;
    font-weight: bold;
}

/* AnimaciÃ³n al agregar productos */
.nuevoProducto .row {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* BotÃ³n quitar producto mejorado */
.quitarProducto {
    transition: all 0.2s;
}

.quitarProducto:hover {
    transform: rotate(90deg) scale(1.2);
}

/* Resumen de venta */
.box-solid.bg-gray-light {
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
}

/* MÃ©todo de pago con iconos */
#nuevoMetodoPago {
    font-size: 14px;
    font-weight: bold;
}

/* Historial del cliente */
#historialCliente {
    border-left: 3px solid #3c8dbc;
    transition: all 0.3s;
}

/* Select2 mejorado */
.select2-container--default .select2-selection--single {
    height: 38px !important;
    border: 1px solid #d2d6de !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 38px !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 36px !important;
}

/* BotÃ³n guardar venta mejorado */
.btn-save-sale {
    font-size: 18px;
    padding: 12px 30px;
    font-weight: bold;
    transition: all 0.3s;
}

.btn-save-sale:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

/* Tabla de productos mejorada */
.tablaVentas tbody tr {
    transition: all 0.2s;
}

.tablaVentas tbody tr:hover {
    background-color: #f9f9f9;
    transform: scale(1.01);
}

/* Labels mejorados */
label {
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    display: block;
}

/* Input groups con mejor espaciado */
.input-group {
    margin-bottom: 0;
}

/* Iconos mÃ¡s grandes en addons */
.input-group-addon {
    min-width: 45px;
}

.input-group-addon i {
    font-size: 16px;
}

/* Responsive mejoras */
@media (max-width: 768px) {
    #totalVentaDisplay {
        font-size: 36px !important;
    }
    
    .nuevoProducto .row {
        gap: 6px !important;
    }
}

/* POS: en horizontal o tablet se ve como escritorio (catÃ¡logo + cuenta) */
body.pos-activo .pos-col-catalogo,
body.pos-activo .pos-col-cuenta {
    position: relative;
    min-height: 1px;
    padding-left: 15px;
    padding-right: 15px;
}
@media (orientation: landscape), (min-width: 768px) {
    body.pos-activo .pos-col-catalogo {
        width: 58.33333333%;
        float: left;
    }
    body.pos-activo .pos-col-cuenta {
        width: 41.66666667%;
        float: left;
    }
    body.pos-activo .pos-products-grid {
        grid-template-columns: repeat(auto-fill, minmax(105px, 1fr));
        gap: 8px;
        max-height: calc(100vh - 170px);
    }
    body.pos-activo .content-wrapper {
        min-height: 100vh;
    }
}
@media (orientation: portrait) and (max-width: 767px) {
    body.pos-activo .pos-col-catalogo,
    body.pos-activo .pos-col-cuenta {
        width: 100%;
        float: none;
    }
}

/* Loading spinner para bÃºsqueda */
.loading-search::after {
    content: "";
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3c8dbc;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translateY(-50%) rotate(0deg); }
    100% { transform: translateY(-50%) rotate(360deg); }
}

/* Mejoras al scrollbar */
#resultadosBusqueda::-webkit-scrollbar {
    width: 8px;
}

#resultadosBusqueda::-webkit-scrollbar-track {
    background: #f1f1f1;
}

#resultadosBusqueda::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

#resultadosBusqueda::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* STOCK BAJO EN ROJO */
.badge.bg-red {
    background-color: #dd4b39 !important;
    animation: pulsoBadge 1.5s ease-in-out infinite;
}

.badge.bg-yellow {
    background-color: #f39c12 !important;
}

.badge.bg-green {
    background-color: #00a65a !important;
}

@keyframes pulsoBadge {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.1);
    }
}

/* Producto con stock bajo en la tabla */
tr.stock-bajo {
    background-color: #f2dede !important;
}

tr.stock-medio {
    background-color: #fcf8e3 !important;
}

/* Flash verde al agregar producto */
@keyframes flashVerde {
    0% { background-color: transparent; }
    50% { background-color: #d4edda; border-left: 4px solid #28a745; }
    100% { background-color: transparent; border-left: none; }
}

.producto-agregado-flash {
    animation: flashVerde 0.8s ease-out;
}

/* Sonido visual (para cuando no hay sonido real) */
@keyframes ondaSonido {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 166, 90, 0.7);
    }
    70% {
        box-shadow: 0 0 0 20px rgba(0, 166, 90, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 166, 90, 0);
    }
}

.scan-sound-effect {
    animation: ondaSonido 0.6s ease-out;
}

/* BotÃ³n cliente genÃ©rico destacado */
#btnClienteGenerico {
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s;
}

#btnClienteGenerico:hover {
    transform: scale(1.03);
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
}

/*=============================================
MEJORAS ESTÃ‰TICAS ADICIONALES
=============================================*/

/* Quitar cualquier logo/imagen sobre el total */
#totalVentaDisplay::before,
#totalVentaDisplay::after,
.box.bg-gray-light::before,
.box.bg-gray-light::after,
.box-solid.bg-gray-light::before,
.box-solid.bg-gray-light::after,
div[style*="background:#3c8dbc"]::before,
div[style*="background:#3c8dbc"]::after {
    display: none !important;
    content: none !important;
    background-image: none !important;
    background: none !important;
}

/* Asegurar que no hay imÃ¡genes de fondo en el total */
#totalVentaDisplay,
#totalVentaDisplay *,
.box.bg-gray-light,
.box.bg-gray-light * {
    background-image: none !important;
}

/* Inputs de pago mejorados - permitir pegar */
input[type="number"],
input[type="text"] {
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
    user-select: text !important;
}

/* Mejorar campos de entrada de dinero */
.input-group input[type="number"] {
    font-size: 18px;
    font-weight: bold;
    padding: 10px;
    border: 2px solid #d2d6de;
    transition: all 0.3s;
}

.input-group input[type="number"]:focus {
    border-color: #3c8dbc;
    box-shadow: 0 0 8px rgba(60, 141, 188, 0.3);
}

/* BotÃ³n cobrar venta mejorado */
#btnCobrarVenta {
    background: linear-gradient(135deg, #00a65a 0%, #008d4c 100%);
    border: none;
    box-shadow: 0 4px 15px rgba(0, 166, 90, 0.4);
    transition: all 0.3s;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

#btnCobrarVenta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 166, 90, 0.6);
}

#btnCobrarVenta:active {
    transform: translateY(0);
}

/* Caja de total mejorada */
.box.bg-gray-light {
    background: linear-gradient(135deg, #3c8dbc 0%, #2c6a8f 100%) !important;
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
    border: none !important;
}

/* Inputs de bÃºsqueda mejorados */
#busquedaRapidaProducto {
    border: 2px solid #00a65a !important;
    padding: 12px !important;
    font-size: 16px !important;
    transition: all 0.3s !important;
}

#busquedaRapidaProducto:focus {
    border-color: #008d4c !important;
    box-shadow: 0 0 12px rgba(0, 166, 90, 0.4) !important;
    transform: scale(1.02);
}

/* Select mejorado */
.select2-container--default .select2-selection--single {
    border: 2px solid #d2d6de !important;
    border-radius: 4px !important;
    transition: all 0.3s !important;
}

.select2-container--default.select2-container--focus .select2-selection--single {
    border-color: #3c8dbc !important;
    box-shadow: 0 0 8px rgba(60, 141, 188, 0.3) !important;
}

/* Tabla de productos mejorada */
.nuevoProducto {
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.nuevoProducto .row {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-wrap: nowrap !important;
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-left: 3px solid #00a65a !important;
    padding: 4px 6px !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    margin-bottom: 4px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    border-radius: 6px !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03) !important;
    gap: 4px !important;
    transition: all 0.15s ease !important;
}

.nuevoProducto .row:before,
.nuevoProducto .row:after {
    display: none !important;
}

.nuevoProducto .row:hover {
    box-shadow: 0 2px 6px rgba(0,0,0,0.07) !important;
    border-color: #cbd5e1 !important;
}

/* Columna de descripción: toma todo el ancho disponible */
.nuevoProducto .row > .col-xs-6 {
    flex: 1 1 auto !important;
    width: auto !important;
    min-width: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    float: none !important;
}

/* Contenedor del nombre y botón quitar */
.nuevoProducto .row > .col-xs-6 > .input-group {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    width: 100% !important;
    gap: 4px !important;
}

.nuevoProducto .row > .col-xs-6 > .input-group:before,
.nuevoProducto .row > .col-xs-6 > .input-group:after {
    display: none !important;
}

.nuevoProducto .row > .col-xs-6 > .input-group > .input-group-addon {
    flex: 0 0 auto !important;
    width: auto !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
}

/* 1. Botón Quitar (X): Compacto y circular (20px) */
.nuevoProducto .quitarProducto {
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    min-height: 20px !important;
    max-width: 20px !important;
    max-height: 20px !important;
    border-radius: 50% !important;
    padding: 0 !important;
    background: #fee2e2 !important;
    border: 1px solid #fca5a5 !important;
    color: #dc2626 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    box-shadow: none !important;
    transition: all 0.15s ease !important;
    flex-shrink: 0 !important;
    margin: 0 !important;
}

.nuevoProducto .quitarProducto i {
    font-size: 9.5px !important;
    line-height: 1 !important;
    color: #dc2626 !important;
}

.nuevoProducto .quitarProducto:hover,
.nuevoProducto .quitarProducto:active {
    background: #dc2626 !important;
    border-color: #b91c1c !important;
    color: #ffffff !important;
    transform: scale(1.1) !important;
}

.nuevoProducto .quitarProducto:hover i,
.nuevoProducto .quitarProducto:active i {
    color: #ffffff !important;
}

/* 2. Contenedor y Nombre del Producto: legible, no truncado agresivamente */
.nuevoProducto .pos-ticket-nombre-wrap,
.nuevoProducto .row > .col-xs-6 > .input-group > div:not(.silla-selector-wrap) {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    padding: 0 2px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
}

.nuevoProducto .pos-ticket-nombre-prod,
.nuevoProducto .pos-ticket-nombre-wrap strong,
.nuevoProducto .row > .col-xs-6 > .input-group > div:not(.silla-selector-wrap) strong {
    font-size: 11.5px !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    white-space: normal !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    line-height: 1.15 !important;
    word-break: break-word !important;
}

.nuevoProducto input.nuevaDescripcionProducto {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    font-size: 11.5px !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    background: transparent !important;
    border: none !important;
    height: 24px !important;
    padding: 0 2px !important;
    box-shadow: none !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* 3. Selector de Silla: ultra compacto en ancho (48px) para no robar espacio */
.nuevoProducto .silla-selector-wrap {
    flex: 0 0 auto !important;
    margin: 0 !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
}

.nuevoProducto .selectSillaProducto {
    height: 22px !important;
    min-height: 22px !important;
    max-height: 22px !important;
    width: 48px !important;
    min-width: 48px !important;
    max-width: 48px !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    color: #15803d !important;
    background: #f0fdf4 !important;
    border: 1px solid #86efac !important;
    border-radius: 4px !important;
    padding: 0 2px !important;
    cursor: pointer !important;
    box-shadow: none !important;
    outline: none !important;
}

.nuevoProducto .selectSillaProducto:focus {
    border-color: #22c55e !important;
}

/* 4. Botones de Acción (Llevar y Nota): formato micro (22px) */
.nuevoProducto .addon-llevar {
    flex: 0 0 auto !important;
    margin: 0 0 0 2px !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 2px !important;
}

.nuevoProducto .addon-llevar .btnMarcarLlevar,
.nuevoProducto .addon-llevar .btnNotaProducto {
    height: 22px !important;
    min-height: 22px !important;
    max-height: 22px !important;
    width: 22px !important;
    min-width: 22px !important;
    max-width: 22px !important;
    font-size: 10px !important;
    padding: 0 !important;
    border-radius: 4px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    border: 1px solid #cbd5e1 !important;
}

.nuevoProducto .addon-llevar .btnMarcarLlevar.btn-warning {
    background: #f59e0b !important;
    border-color: #d97706 !important;
    color: #ffffff !important;
}

/* 5. Columna de Cantidad: caja limpia de 38px */
.nuevoProducto .row > .col-xs-3:not(.ingresoPrecio),
.nuevoProducto .row > .ingresoCantidad {
    flex: 0 0 38px !important;
    width: 38px !important;
    max-width: 38px !important;
    min-width: 38px !important;
    padding: 0 !important;
    margin: 0 0 0 2px !important;
    float: none !important;
}

.nuevoProducto .nuevaCantidadProducto {
    width: 38px !important;
    height: 24px !important;
    min-height: 24px !important;
    max-height: 24px !important;
    text-align: center !important;
    font-size: 13px !important;
    font-weight: 800 !important;
    color: #0f172a !important;
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 4px !important;
    padding: 0 !important;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.03) !important;
}

.nuevoProducto .nuevaCantidadProducto:focus {
    border-color: #00a65a !important;
    background: #ffffff !important;
}

/* 6. Columna de Precio: caja compacta de 72px */
.nuevoProducto .row > .ingresoPrecio {
    flex: 0 0 72px !important;
    width: 72px !important;
    max-width: 72px !important;
    padding: 0 !important;
    margin: 0 0 0 2px !important;
    float: none !important;
}

.nuevoProducto .row > .ingresoPrecio .input-group-addon {
    padding: 0 4px !important;
    font-size: 11px !important;
    min-width: 20px !important;
    background: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
}

.nuevoProducto .nuevoPrecioProducto {
    height: 24px !important;
    min-height: 24px !important;
    max-height: 24px !important;
    font-weight: 700 !important;
    text-align: right !important;
    border-radius: 0 4px 4px 0 !important;
    font-size: 11.5px !important;
    padding: 0 4px !important;
    border-color: #cbd5e1 !important;
}
    box-shadow: 0 3px 8px rgba(217, 83, 79, 0.4);
}

/* Labels mÃ¡s modernos */
label {
    font-weight: 600 !important;
    color: #555 !important;
    text-transform: uppercase;
    font-size: 12px !important;
    letter-spacing: 0.5px;
    margin-bottom: 8px !important;
}

/* Badges de stock mejorados */
.badge {
    padding: 5px 10px;
    font-size: 11px;
    font-weight: bold;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Input group addons modernos */
.input-group-addon {
    background: linear-gradient(135deg, #f4f4f4 0%, #e8e8e8 100%);
    border: 1px solid #d2d6de;
    font-weight: 600;
    color: #555;
}

/* Botones de agregar cliente */
.input-group-addon button {
    transition: all 0.3s;
}

.input-group-addon button:hover {
    transform: scale(1.05);
}

/* Modal de tipo comprobante mejorado */
.tipoComprobante {
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.tipoComprobante::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.tipoComprobante:hover::before {
    width: 300px;
    height: 300px;
}

.tipoComprobante:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

/* AnimaciÃ³n de carga suave */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.box {
    animation: fadeIn 0.5s ease-out;
}

/* Mejorar inputs readonly */
input[readonly] {
    background-color: #f9f9f9 !important;
    cursor: not-allowed;
    border-color: #e0e0e0 !important;
}

/* Atajos de teclado mÃ¡s visibles */
.label {
    padding: 4px 8px;
    font-size: 11px;
    font-weight: bold;
    border-radius: 3px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin: 0 2px;
}

/* ===================================================================
   OPTIMIZACIONES RESPONSIVE PARA TABLETS (COMANDAS DE MESEROS)
   iPad, Tablets Android (768px a 1024px) y Pantallas TÃ¡ctiles
   =================================================================== */

/* Ajustes generales para pantallas tÃ¡ctiles */
@media (max-width: 1024px) {
    /* Inputs con tamaÃ±o adecuado para evitar auto-zoom en iOS/Android */
    input.form-control, select.form-control, textarea.form-control {
        font-size: 16px !important;
        min-height: 42px !important;
    }

    /* Botones con Ã¡rea tÃ¡ctil cÃ³moda (mÃ­nimo 42px) */
    .btn {
        min-height: 40px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 8px 14px;
        font-size: 14px;
        touch-action: manipulation;
    }

    .btn-xs {
        min-height: 32px !important;
        padding: 4px 10px !important;
        font-size: 12px !important;
    }

    /* Barra de categorÃ­as tÃ¡ctil con scroll suave */
    .pos-categories-bar {
        -webkit-overflow-scrolling: touch;
        padding-bottom: 8px;
    }
    
    .btn-categoria-pos {
        padding: 8px 16px !important;
        font-size: 14px !important;
        min-height: 40px !important;
        white-space: nowrap;
    }

    /* Rejilla de productos en tablet landscape */
    .grid-productos-pos, #contenedorProductosPos {
        display: grid !important;
        grid-template-columns: repeat(auto-fill, minmax(135px, 1fr)) !important;
        gap: 10px !important;
    }

    .card-producto-pos {
        min-height: 120px !important;
        padding: 8px !important;
        touch-action: manipulation;
    }

    /* DistribuciÃ³n en Tablets Horizontales (Landscape 850px - 1024px) */
    @media (min-width: 850px) {
        .pos-col-cuenta {
            width: 46% !important;
            float: left !important;
            padding-right: 8px !important;
        }
        .pos-col-catalogo {
            width: 54% !important;
            float: right !important;
            padding-left: 8px !important;
        }
    }

    /* DistribuciÃ³n en Tablets Verticales (Portrait <= 849px) */
    @media (max-width: 849px) {
        .pos-col-cuenta, .pos-col-catalogo {
            width: 100% !important;
            float: none !important;
        }
    }

    .btnAumentarCantidad, .btnDisminuirCantidad {
        min-width: 38px !important;
        min-height: 38px !important;
    }

    .nuevoProducto .quitarProducto {
        width: 26px !important;
        height: 26px !important;
        min-width: 26px !important;
        min-height: 26px !important;
        max-width: 26px !important;
        max-height: 26px !important;
        border-radius: 50% !important;
        padding: 0 !important;
        margin: 0 2px 0 0 !important;
    }

    .nuevoProducto .selectSillaProducto {
        height: 28px !important;
        min-height: 28px !important;
        max-height: 28px !important;
        width: 86px !important;
        min-width: 86px !important;
        max-width: 86px !important;
        font-size: 11.5px !important;
        padding: 2px 6px !important;
    }

    .nuevoProducto .addon-llevar .btnMarcarLlevar {
        height: 28px !important;
        min-height: 28px !important;
        max-height: 28px !important;
        font-size: 11px !important;
        padding: 0 9px !important;
    }

    /* Silenciar toasts de 'Producto agregado' en tablets para no dilatar el trabajo */
    #toast-container > .toast-success {
        display: none !important;
    }

    /* En tablets: ocultar el botÃ³n 'Plano' del formulario porque ya estÃ¡ en el cabezote */
    .btn-volver-plano-pos {
        display: none !important;
    }

    /* Filtros de Reportes y Formularios Adaptables en Tablet */
    .filtro-reportes-grid, .box-body .row {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .filtro-reportes-grid .col-md-3,
    .filtro-reportes-grid .col-md-2,
    .filtro-reportes-grid .col-md-4 {
        flex: 1 1 200px;
        max-width: 100%;
    }

    /* Botones DataTables en Tablet */
    .dt-buttons, .dataTables_wrapper .dt-buttons {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 6px !important;
        margin-bottom: 12px !important;
    }

    .dt-buttons .btn {
        flex: 1 1 auto;
        min-width: 80px;
    }

    /* Tablas responsivas con scroll horizontal suave */
    .dataTables_wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* ===================================================================
   BARRA UNIFICADA DE TIPO DE SERVICIO Y SELECTOR DE MESA (PC Y TABLET)
   =================================================================== */
.barra-servicio-mesa-unificada {
    width: 100% !important;
    margin-bottom: 8px !important;
}

.servicio-mesa-flex-container {
    display: flex !important;
    flex-direction: row !important;
    align-items: stretch !important;
    gap: 6px !important;
    width: 100% !important;
    flex-wrap: nowrap !important;
}

.grupo-tipo-servicio-btns {
    display: inline-flex !important;
    align-items: stretch !important;
    flex: 1.2 1 0 !important;
    margin: 0 !important;
    border-radius: 6px !important;
    overflow: hidden !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06) !important;
    height: 36px !important;
    min-height: 36px !important;
    max-height: 36px !important;
}

.grupo-tipo-servicio-btns .btnTipoServicio {
    flex: 1 1 0 !important;
    height: 36px !important;
    min-height: 36px !important;
    max-height: 36px !important;
    line-height: 34px !important;
    font-size: 11.5px !important;
    font-weight: 700 !important;
    padding: 0 8px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 5px !important;
    white-space: nowrap !important;
    border-radius: 0 !important;
    border: 1px solid #cbd5e1 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}

.grupo-tipo-servicio-btns .btnTipoServicio.btn-primary {
    background: #0f172a !important;
    border-color: #0f172a !important;
    color: #ffffff !important;
}

.item-mesa-contenedor {
    display: inline-flex !important;
    align-items: stretch !important;
    gap: 4px !important;
    flex: 1 1 0 !important;
    margin: 0 !important;
    height: 36px !important;
    min-height: 36px !important;
    max-height: 36px !important;
}

.item-mesa-contenedor #btnTextoMesa {
    height: 36px !important;
    min-height: 36px !important;
    max-height: 36px !important;
    line-height: 34px !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    padding: 0 10px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 5px !important;
    border-radius: 6px !important;
    white-space: nowrap !important;
    flex: 1 1 auto !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08) !important;
    box-sizing: border-box !important;
    margin: 0 !important;
}

#btnAbrirModalTrasladar {
    height: 36px !important;
    min-height: 36px !important;
    max-height: 36px !important;
    line-height: 34px !important;
    padding: 0 10px !important;
    font-size: 11.5px !important;
    font-weight: 700 !important;
    border-radius: 6px !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    flex-shrink: 0 !important;
}

.btn-volver-plano-pos {
    display: none !important;
}

/* Evitar traducciÃ³n de tÃ©rminos clave en DataTables y botones */
.notranslate, [translate="no"] {
    -webkit-user-select: auto;
    user-select: auto;
}


/* ===== POS en TABLET: un solo filtro (combo), productos compactos ===== */
@media (max-width: 1100px) {
    .pos-category-select-wrap { display: block !important; margin-bottom: 6px !important; }
    .pos-category-select-wrap select { height: 38px !important; min-height: 38px !important; font-size: 14px !important; }
    .pos-categories-bar { display: none !important; }
    .pos-search-box { margin-bottom: 6px !important; }
    .pos-search-box input { height: 38px !important; min-height: 38px !important; }
    .pos-col-catalogo .box-body { padding: 8px !important; }
    .pos-products-grid {
        grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)) !important;
        gap: 6px !important;
        max-height: calc(100vh - 320px) !important;
    }
    .pos-card-img-wrap { height: 40px !important; }
    .pos-card-info { padding: 4px 6px !important; }
    .pos-card-title { font-size: 11px !important; line-height: 1.15 !important; margin: 0 !important; }
    .pos-product-card { border-radius: 8px !important; }
    .pos-catalogo-pager { margin-top: 6px !important; padding-top: 6px !important; font-size: 12px !important; }
    .pos-catalogo-pager .pos-page-btn { min-height: 30px !important; padding: 2px 8px !important; }
}

/* =========================================
   FIJACIÓN DE FOOTER Y SCROLL POS (TABLETS Y COMPUTADORAS DE ESCRITORIO / CAJA)
   Garantiza que la comanda tenga scroll interno en cualquier pantalla (>= 768px)
   y que los botones de Cobrar/Facturar queden SIEMPRE fijados y visibles.
   ========================================= */
@media (min-width: 768px) {
    /* El .box se convierte en columna flex con altura exacta a la ventana */
    body.pos-activo .pos-col-cuenta > .box,
    body.pos-activo .pos-col-cuenta .box-success {
        display: flex !important;
        flex-direction: column !important;
        height: calc(100vh - 125px) !important;
        max-height: calc(100vh - 125px) !important;
        margin-bottom: 0 !important;
        overflow: hidden !important;
        position: relative !important;
    }
    /* El formulario ocupa todo el alto y es flex column */
    body.pos-activo .pos-col-cuenta .formularioVenta {
        display: flex !important;
        flex-direction: column !important;
        flex: 1 1 auto !important;
        min-height: 0 !important;
        height: 100% !important;
        overflow: hidden !important;
    }
    /* El box-body crece y hace scroll internamente */
    body.pos-activo .pos-col-cuenta > .box > .box-body,
    body.pos-activo .pos-col-cuenta .formularioVenta > .box-body {
        flex: 1 1 auto !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        min-height: 0 !important;
        padding: 8px 10px !important;
    }
    body.pos-activo .pos-col-cuenta .formularioVenta .box-body > .box {
        margin-bottom: 0 !important;
        border: none !important;
        box-shadow: none !important;
        background: transparent !important;
    }
    /* El box-footer NO hace scroll, SIEMPRE visible al fondo */
    body.pos-activo .pos-col-cuenta .box-footer {
        flex: 0 0 auto !important;
        position: relative !important;
        background: #fff !important;
        padding: 8px 10px !important;
        z-index: 100 !important;
        box-shadow: 0 -4px 12px rgba(0,0,0,0.15) !important;
        border-top: 2px solid #cbd5e1 !important;
    }
    body.pos-activo #btnCobrarVenta,
    body.pos-activo #btnAdminComanda,
    body.pos-activo #btnEnviarComanda {
        font-size: 13px !important;
        font-weight: 700 !important;
        padding: 8px 4px !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        border-radius: 5px !important;
    }
    body.pos-activo .nuevoProducto {
        max-height: 380px !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        scrollbar-width: thin !important;
        margin-bottom: 6px !important;
    }
}

/* Ocultar visualmente la nota en la lista de productos agregados */
.bloque-comentario-item {
    display: none !important;
}

/* ===================================================================
   MEJORA DE LEGIBILIDAD Y CONTRASTE EN ALERTAS (TOASTR)
   Evita transparencias donde se trasluzca el fondo y usa contraste sólido
   =================================================================== */
#toast-container {
    z-index: 9999999 !important;
}

#toast-container > div {
    opacity: 1 !important;
    min-width: 330px !important;
    max-width: 440px !important;
    width: auto !important;
    border-radius: 8px !important;
    padding: 14px 16px 14px 50px !important;
    box-shadow: 0 10px 25px -4px rgba(0, 0, 0, 0.45), 0 4px 8px -2px rgba(0, 0, 0, 0.3) !important;
    color: #ffffff !important;
    background-repeat: no-repeat !important;
    background-position: 14px 16px !important;
}

#toast-container > div:hover {
    opacity: 1 !important;
    box-shadow: 0 14px 28px -4px rgba(0, 0, 0, 0.6) !important;
}

#toast-container > .toast-title {
    font-size: 15px !important;
    font-weight: 800 !important;
    letter-spacing: 0.3px !important;
    margin-bottom: 4px !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5) !important;
}

#toast-container > .toast-message {
    font-size: 13px !important;
    line-height: 1.45 !important;
    font-weight: 600 !important;
    color: #ffffff !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5) !important;
}

/* Advertencia / Inventario Bajo: Fondo ámbar oscuro sólido con borde amarillo brillante */
#toast-container > .toast-warning {
    background-color: #9a3412 !important; /* Ámbar terracota oscuro de alto contraste */
    border-left: 6px solid #facc15 !important;
}
#toast-container > .toast-warning .toast-title {
    color: #fef08a !important;
}

/* Error / Sin Stock / Sin existencias: Fondo rojo oscuro sólido con borde carmesí claro */
#toast-container > .toast-error {
    background-color: #991b1b !important; /* Rojo oscuro de alto contraste */
    border-left: 6px solid #fca5a5 !important;
}
#toast-container > .toast-error .toast-title {
    color: #fecaca !important;
}

/* Información: Fondo azul oscuro sólido */
#toast-container > .toast-info {
    background-color: #075985 !important;
    border-left: 6px solid #7dd3fc !important;
}
#toast-container > .toast-info .toast-title {
    color: #bae6fd !important;
}

/* Éxito: Fondo verde bosque sólido */
#toast-container > .toast-success {
    background-color: #166534 !important;
    border-left: 6px solid #86efac !important;
}

/* Botón de cierre nítido y accesible */
#toast-container .toast-close-button {
    font-size: 22px !important;
    font-weight: 800 !important;
    color: #ffffff !important;
    opacity: 0.9 !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6) !important;
    top: -4px !important;
    right: -2px !important;
}
#toast-container .toast-close-button:hover {
    opacity: 1 !important;
    color: #fef08a !important;
}

/* Barra de progreso de tiempo */
#toast-container .toast-progress {
    height: 4px !important;
    background-color: #ffffff !important;
    opacity: 0.55 !important;
}




