/* === GLOBAL & RESET === */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; font-size: 12.5px; background-color: #B0B0B0; color: #333; height: 100vh; overflow: hidden; display: flex; justify-content: center; align-items: center; }
button { font-family: inherit; cursor: pointer; border: 1px solid #ADADAD; background-color: #E1E1E1; padding: 5px 10px; font-size: inherit; color: #000; }

/* === MAIN CONTAINER === */
.pos-container { display: flex; flex-direction: column; height: 92vh; width: 96vw; max-width: 1200px; max-height: 760px; background-color: #F0F0F0; border: 1px solid #707070; box-shadow: 0 2px 5px rgba(0,0,0,0.2); overflow: hidden; }

/* === TOP BAR === */
.top-bar { display: flex; align-items: stretch; background-color: #333333; color: #fff; border-bottom: 3px solid #FFB300; height: 38px; flex-shrink: 0; }
.top-bar-left { width: 325px; flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; padding: 0 10px; }
.top-bar-right { flex-grow: 1; display: flex; align-items: stretch; justify-content: space-between; border-left: 1px solid #707070; }
.logo-menu { display: flex; align-items: center; }
.logo { height: 30px; padding-top: 2px; margin-right: 20px; object-fit: contain; }
.icon-button { background: none; border: none; color: #fff; font-size: 1.6em; padding: 0 5px; margin: 0; cursor: pointer; display: inline-flex; align-items: center; }
.icon-button.menu-button { margin-left: 8px; }
.ticket-management .icon-button.ticket-add, .ticket-management .icon-button.ticket-remove { padding: 0 20px;  /* 20px a la izquierda y derecha */}
.time-user-block { display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1;}
.status-time { font-family: 'Consolas', 'Courier New', monospace; font-weight: bold; font-size: 1.3em; color: #FFD700; letter-spacing: 0px; }
.status-user { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; font-size: 0.95em; color: #FFFFFF; text-transform: uppercase; }
.ticket-management { display: flex; align-items: stretch; padding: 0 5px; }
.ticket-tabs-container { display: flex; align-items: stretch; gap: 1px; }
.ticket-tab { display: flex; align-items: center; padding: 0 8px; cursor: pointer; border: 1px solid transparent; border-bottom: none; position: relative; }
.ticket-tab.active { background-color: #F0F0F0; border-color: #707070; border-top-left-radius: 3px; border-top-right-radius: 3px; margin-bottom: -1px; z-index: 1; }
.ticket-tab.active .ticket-number { background-color: #000000; color: white; border-radius: 50%; width: 21px; height: 21px; display: inline-flex; justify-content: center; align-items: center; font-size: 1.2em; font-weight: bold; line-height: 1; border: 1px solid #555; margin-right: 5px; }
.ticket-tab.active .ticket-timestamp { font-weight: normal; font-size: 1.0em; color: #333; }
.ticket-tab.inactive { background-color: #4F4F4F; border: 1px solid #666; border-bottom: none; border-top-left-radius: 3px; border-top-right-radius: 3px; }
.ticket-tab.inactive:hover { background-color: #5A5A5A; }
.ticket-tab.inactive .ticket-number { color: #C0C0C0; font-size: 0.95em; font-weight: bold; padding: 0 2px; margin-right: 5px; }
.ticket-tab.inactive .ticket-timestamp { font-weight: normal; font-size: 1.0em; color: #A0A0A0; }
.ticket-tab.oculto {
    display: none;
}
.ticket-controls { display: flex; align-items: center; margin-left: 5px; border-left: 0px solid #555; padding-left: 5px; }
.ticket-controls .icon-button { font-size: 1.2em; padding: 0 3px; color: #D0D0D0; }
.ticket-controls .icon-button:hover { color: #FFFFFF; }
.system-controls { display: flex; align-items: center; padding: 0 10px; gap: 8px; }
.wifi-icon { font-size: 1.4em; color: #B0FFB0; }
.close-button { background-color: #555555; color: #FFFFFF; border: 1px solid #404040; margin-top: 1px; padding-top: 8px; /*padding: 4px 12px;*/ font-weight: bold; font-size: 0.9em; border-radius: 2px; cursor: pointer; text-transform: uppercase; line-height: 1.2; }
.close-button:hover { background-color: #656565; border-color: #505050;}

/* === MAIN CONTENT AREA === */
.main-content { display: flex; flex-grow: 1; overflow: hidden; background-color: #FFFFFF; }

/* === LEFT PANEL === */
.left-panel { width: 325px; display: flex; flex-direction: column; background-color: #FFFFFF; }
.order-area { flex-grow: 1; display: flex; overflow: hidden; position: relative; padding-bottom: 0; }
.order-summary { flex-grow: 1; padding: 8px 10px 5px 10px; overflow-y: hidden; display: flex; flex-direction: column; position: relative; }
.order-item { display: flex; justify-content: space-between; align-items: flex-start; padding: 4px 0; border-bottom: 1px dashed #E0E0E0; font-size: 1em; line-height: 1.3; }
.item-details { display: flex; flex-direction: column; margin-right: 10px; }
.item-name { font-weight: bold; font-size: 0.95em; min-height: 32px;}
.item-qty { font-size: 0.85em; color: #555; margin-top: 1px; }
.item-price { font-weight: bold; font-size: 1em; white-space: nowrap; color: #000; }
/*.ticket-pagination-bar { width: 25px; height: 100%; background-color: #EAEAEA; border-left: 1px solid #DCDCDC; flex-shrink: 0; display: flex; flex-direction: column; justify-content: space-between; align-items: center; padding: 5px 0; box-sizing: border-box; }*/
.ticket-pagination-bar {
    width: 25px;
    height: 100%;
    background-color: #EAEAEA;
    border-left: 1px solid #DCDCDC;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    box-sizing: border-box;
    position: relative; /* Añade esta propiedad */
}
/*.pagination-arrow { width: 100%; text-align: center; cursor: pointer; padding: 2px 0; }*/
.pagination-arrow {
    position: absolute; /* Posicionamiento absoluto */
    width: 100%; /* Ocupar todo el ancho */
    display: flex;
    justify-content: center;
    cursor: pointer;
}
.pagination-arrow i { color: #666; font-size: 1.4em; display: block; pointer-events: none; line-height: 1; }
.pagination-arrow:hover i { color: #333; }
.order-footer { border-top: 1px solid #BDBDBD; padding: 6px 10px; margin-top: auto; display: flex; justify-content: space-between; align-items: center; flex-shrink: 0; background-color: #F5F5F5; }
.discount-info { font-size: 1.2em; font-weight: bold; color: #444; }
.total-section { text-align: right; font-size: 1.3em; font-weight: bold; }
.total-amount { margin-left: 8px; }

/* ============================================ */
/* === Input Panel - SECCIÓN CON CAMBIOS === */
/* ============================================ */
.input-panel {
    flex-shrink: 0;
    border-top: 1px solid #BDBDBD;
    background-color: #EBEBEB;
    padding-bottom: 6px; /* Espacio antes del numpad */
}

/* Input Header (Labels) */
.input-header {
    display: grid;
    grid-template-columns: 82px 70px 60px 1fr; /* Ajustar anchos si es necesario */
    padding: 0 6px; /* Solo padding horizontal */
    height: 20px; /* Altura para las etiquetas */
    align-items: center; /* Centrar etiquetas verticalmente */
    background-color: transparent; /* Sin fondo propio */
    color: #555; /* Color de las etiquetas */
    font-weight: bold;
    font-size: 0.8em;
    margin-bottom: 0; /* Eliminar margen inferior si existe */
}
.input-header span {
    padding: 0 4px; /* Espaciado interno etiquetas */
    white-space: nowrap; /* Evitar que el texto de la etiqueta se parta */
}
/* Alineación específica de etiquetas */
.label-cant { text-align: left; }
.label-pvp, .label-dto { text-align: center; }
.label-codigo { text-align: center; } /* Centrado como en imagen */

/* Input Fields Display Area */
.input-fields {
    display: grid;
    grid-template-columns: 82px 70px 60px 1fr; /* Mismas columnas que header */
    gap: 3px; /* Espacio entre campos */
    padding: 0 6px; /* Padding horizontal igual que header */
}

/* Input Field Individual */
.input-field {
    background-color: #F8F8F8; /* Fondo gris muy claro por defecto */
    border: 1px solid #D0D0D0; /* Borde gris claro */
    border-radius: 2px;
    padding: 4px 6px; /* Padding interno */
    height: 40px; /* Altura de los campos */
    display: flex;
    align-items: center;
    justify-content: flex-end; /* Alinea valor a la derecha por defecto */
    cursor: pointer; /* Indica que se puede hacer clic */
}

.input-field.active {
    border: 1px solid #FF9800;
    background-color: #FFE0B2;
}

.input-field:hover { /* Opcional: ligero feedback visual */
    border-color: #b0b0b0;
}

/* Input Field Activo */
.input-field.active {
    background-color: #FF9900; /* Naranja específico de la imagen */
    border-color: #E68A00; /* Borde naranja más oscuro */
}
.input-field.field-cant.active { justify-content: flex-start; } /* CANT se alinea izq */

/* Valor dentro del campo */
.field-value {
    font-family: 'Consolas', 'Courier New', monospace; /* Fuente tipo monoespaciada */
    font-size: 1.1em; /* Tamaño fuente valor */
    font-weight: bold;
    color: #444; /* Color oscuro por defecto */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%; /* Ocupa el espacio */
    text-align: inherit; /* Hereda alineación de .input-field */
    pointer-events: none; /* Para que el click vaya al .input-field */
}

/* Valor dentro del campo ACTIVO */
.input-field.active .field-value {
    color: #FFFFFF; /* Texto blanco en campo activo */
}

/* Numpad */
.input-controls { display: flex; padding: 3px 6px 0 6px; gap: 6px; margin-top: 6px; /* Espacio sobre el numpad */ }
.action-buttons { display: flex; flex-direction: column; gap: 4px; width: 85px; justify-content: space-between; }
.action-btn, .payment-btn { padding: 18px 5px; text-align: left; font-size: 0.95em; border: 1px solid #B0B0B0; background-color: #E1E1E1; display: flex; align-items: center; gap: 4px; border-radius: 2px; color: #111; }
.action-btn i { width: 14px; color: #444; font-size: 1.1em; }
.payment-btn { background-color: #666666; color: #fff; flex-direction: column; align-items: center; text-align: center; padding: 4px; font-weight: bold; font-size: 0.9em; flex-grow: 1; justify-content: center; gap: 2px; }
.payment-btn:hover { background-color: #777; }
.payment-btn i { font-size: 1.8em; margin-bottom: 0px;}
.payment-btn span { margin-top: -2px; display: block; font-size: 1.5em; font-weight: bold; }
.keypad-area { flex-grow: 1; }
.keypad { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.keypad button { padding: 16px 5px; font-size: 1.2em; font-weight: bold; background-color: #FDFDFD; border: 1px solid #BDBDBD; border-radius: 2px; color: #111; }
.keypad button:active { background-color: #eee; }
.keypad button.control-key { background-color: #DCDCDC; font-size: 1em; font-weight: bold; color: #222; }
.keypad button.ok-key { font-size: 0.9em; }
.keypad button.delete-key { color: #C00000; font-size: 1.3em; padding-top: 14px;}
.keypad button.delete-key i { pointer-events: none; }
/* ============================================ */
/* === FIN Input Panel === */
/* ============================================ */


/* === RIGHT PANEL: PRODUCT CATALOG === */
/* --- ESTILOS DE TU ÚLTIMA VERSIÓN PARA ESTA SECCIÓN --- */
.product-catalog { flex-grow: 1; display: flex; flex-direction: column; background-color: #FFFFFF; overflow: hidden; border-left: 1px solid #707070; }
.category-tabs, .subcategory-tabs { display: flex; flex-wrap: nowrap; overflow-x: auto; background-color: #EBEBEB; border-bottom: 1px solid #C0C0C0; flex-shrink: 0; scrollbar-width: none; /* Firefox */ }
.category-tabs::-webkit-scrollbar, .subcategory-tabs::-webkit-scrollbar { height: 0; display: none; /* WebKit */ }
.tab-btn, .subtab-btn { padding: 8px 14px; border: none; border-right: 1px solid #C8C8C8; background-color: transparent; font-weight: normal; color: #333; font-size: 1em; white-space: nowrap; cursor: pointer; flex-shrink: 0; border-bottom: 1px solid #C0C0C0; margin-bottom: -1px; display: inline-flex; align-items: center; min-height: 35px; }
.tab-btn:last-child, .subtab-btn:last-child { border-right: none; }
.tab-btn.active { background-color: #FFFFFF; border-bottom: 3px solid #FFB300; font-weight: bold; color: #000; margin-bottom: -1px; }
.tab-btn i { margin-right: 4px; font-size: 0.9em;}
.tab-btn:first-child { padding: 8px 20px 8px 26px; }
.subcategory-tabs { background-color: #E0E0E0; min-height: 35px;}
.subtab-btn { font-weight: normal; color: #444; font-size: 1em; border-bottom-color: #C0C0C0; padding-top: 8px; padding-bottom: 8px; padding-left: 12px; padding-right: 12px; }
.subtab-btn.active { background-color: #FFFFFF; color: #000; font-weight: bold; border-bottom-color: #FFFFFF; position: relative; z-index: 1; }
.product-area { flex-grow: 1; display: flex; overflow: hidden; position: relative; background-color: #FFFFFF; }
.product-grid { flex-grow: 1; display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 3px; padding: 3px; overflow: hidden; align-content: flex-start; background-color: #F0F0F0; }
.product-card { border: none; border-radius: 0px; background-color: #FFFFFF; position: relative; height: 96px; display: flex; flex-direction: column; overflow: hidden; cursor: pointer; padding: 2px 0 0 0; }
.product-image-placeholder { width: 100%; height: 60px; display: flex; align-items: center; justify-content: center; color: #999999; font-size: 0.8em; padding: 4px; line-height: 1.1; text-align: center; overflow: hidden; word-break: break-word; flex-shrink: 0; }
.product-image-placeholder span { max-width: 95%; }
.product-image-placeholder img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.product-name { font-weight: normal; color: #111; line-height: 1.1; width: 100%; padding: 2px 4px; flex-grow: 1; font-size: 0.73em; text-transform: uppercase; display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; text-overflow: ellipsis; height: 36px; max-height: 36px; text-align: center; display: flex; flex-direction: column; justify-content: center; }
.product-price { position: absolute; top: 4px; left: 4px; background-color: #5A5A5A; color: #fff; padding: 2px 4px 1px 4px; border-radius: 2px; font-size: 0.85em; font-weight: bold; z-index: 3; }
.product-price.price-zero { background-color: red; }
.scale-icon { position: absolute; top: 4px; right: 4px; color: #666; font-size: 1.1em; background-color: rgba(255, 255, 255, 0.5); padding: 1px; border-radius: 2px; z-index: 3; }
/*.product-pagination-bar { width: 30px; height: 100%; background-color: #EBEBEB; border-left: 1px solid #C8C8C8; flex-shrink: 0; display: flex; flex-direction: column; justify-content: space-between; align-items: center; padding: 5px 0; box-sizing: border-box; }*/
.product-pagination-bar {
    width: 30px;
    height: 100%;
    background-color: #EBEBEB;
    border-left: 1px solid #C8C8C8;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    position: relative; /* Para posicionamiento de elementos internos */
    overflow: hidden; /* Por si acaso */
}
/*.pagination-text { font-size: 0.9em; font-weight: bold; color: #555; text-align: center; line-height: 1.1; flex-grow: 1; display: flex; flex-direction: column; justify-content: center; padding: 4px 0; user-select: none; }*/
.pagination-text {
    position: absolute;
    top: 50%; /* Centrado vertical */
    left: 0;
    width: 100%;
    transform: translateY(-50%); /* Ajuste para centrado perfecto */
    font-size: 0.9em;
    font-weight: bold;
    color: #555;
    text-align: center;
    line-height: 1.1;
    padding: 4px 0;
    user-select: none;
    z-index: 2; /* Para asegurar que esté por encima de las áreas clicables */
}
/* Estilo flechas definido arriba */

.arrow-up {
    top: 0; /* Pegado al borde superior */
    height: calc(50% - 20px); /* Aproximadamente la mitad menos la mitad del texto */
    align-items: flex-start; /* Alinea flecha en la parte superior */
    padding-top: 10px; /* Espacio para la flecha desde el borde superior */
}

.arrow-down {
    bottom: 0; /* Pegado al borde inferior */
    height: calc(50% - 20px); /* Aproximadamente la mitad menos la mitad del texto */
    align-items: flex-end; /* Alinea flecha en la parte inferior */
    padding-bottom: 10px; /* Espacio para la flecha desde el borde inferior */
}

/* === POPUP === */
/*.popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    border: 1px solid #ccc;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    padding: 20px;
    z-index: 1000;
    text-align: center;
    width: 300px;
    border-radius: 8px;
}*/

/* Estilo para el popup */
.popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #333; /* Fondo gris oscuro */
    color: #fff; /* Texto blanco */
    font-size: 1.2em; /* Tamaño de letra más grande */
    border-radius: 8px;
    padding: 20px;
    z-index: 1001; /* Asegurarse de que esté por encima del overlay */
    text-align: center;
    width: 300px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.popup-content p {
    margin-bottom: 20px;
    font-size: 1.2em; /* Tamaño de letra más grande */
    color: #fff; /* Texto blanco */
}

.popup-close {
    background-color: #007BFF;
    color: white;
    border: none;
    padding: 10px 20px;
    font-size: 1em;
    cursor: pointer;
    border-radius: 4px;
    margin-top: 15px;
}

.popup-close:hover {
    background-color: #0056b3;
}

/* Overlay para el fondo oscuro */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7); /* Fondo semiopaco */
    z-index: 1000; /* Debajo del popup */
}

/* Estilo para los botones del popup de confirmación */
.popup-aceptar,
.popup-cancelar {
    background-color: #007BFF; /* Azul bonito */
    color: white;
    border: none;
    padding: 10px 20px;
    font-size: 1em;
    font-weight: bold;
    border-radius: 5px;
    cursor: pointer;
    margin: 5px;
    text-transform: uppercase;
    transition: background-color 0.3s ease;
}

.popup-aceptar:hover,
.popup-cancelar:hover {
    background-color: #0056b3; /* Azul más oscuro al pasar el ratón */
}

/* Estilo para el botón de porcentaje */
.porcentaje-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #007BFF; /* Azul bonito */
    color: white;
    border: none;
    padding: 10px 15px;
    font-size: 1em;
    font-weight: bold;
    border-radius: 5px;
    cursor: pointer;
}

/* Estilo para el icono de la etiqueta */
.porcentaje-btn .fa-tag {
    position: absolute;
    font-size: 2em;
    margin-right: 12px;
    margin-top: 1px;
}

/* Estilo para el símbolo de porcentaje */
.porcentaje-btn .porcentaje-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(45deg); /* Rotar 45 grados */
    font-size: 0.8em;
    font-weight: regular;
    color: #ffffff; /* Azul inverso */
    background-color: transparent;
    border-radius: 50%;
    padding: 2px 5px;
}

/* --- FIN ESTILOS DE TU ÚLTIMA VERSIÓN --- */