:root { --rojo: #ED1B24; --primario: #1c2433; --suave: #5b6779; }
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: "Segoe UI", Roboto, Arial, sans-serif; background: linear-gradient(160deg, #f4f6fb, #e6ebf5); min-height: 100vh; display: flex; flex-direction: column; color: var(--primario); }

.kiosco-header { display: flex; align-items: center; gap: 16px; padding: 22px 40px; background: #fff; border-bottom: 4px solid var(--rojo); }
.kiosco-header .logo { width: 52px; height: 52px; background: var(--rojo); border-radius: 10px; position: relative; }
.kiosco-header .logo::before, .kiosco-header .logo::after { content: ""; position: absolute; background: #fff; border-radius: 3px; }
.kiosco-header .logo::before { width: 12px; height: 34px; left: 20px; top: 9px; }
.kiosco-header .logo::after { width: 34px; height: 12px; left: 9px; top: 20px; }
.kiosco-header h1 { font-size: 30px; }
.kiosco-header .empresa { color: var(--suave); font-weight: 600; }
.kiosco-header .locale { margin-left: auto; display: flex; gap: 6px; }
.kiosco-header .locale a { padding: 8px 14px; border-radius: 8px; border: 1px solid #e3e8f0; text-decoration: none; color: var(--suave); font-weight: 700; }
.kiosco-header .locale a.activo { background: var(--primario); color: #fff; }

.kiosco-main { flex: 1; padding: 40px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.kiosco-main h2 { font-size: 32px; margin-bottom: 8px; text-align: center; }
.kiosco-main p.sub { color: var(--suave); font-size: 18px; margin-bottom: 34px; text-align: center; }

.servicios-grid { display: grid; grid-template-columns: repeat(3, minmax(220px, 1fr)); gap: 22px; width: 100%; max-width: 1000px; }
@media (max-width: 820px) { .servicios-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px) { .servicios-grid { grid-template-columns: 1fr; } }
.servicio-btn { border: none; border-radius: 18px; padding: 34px 20px; font-size: 24px; font-weight: 800; color: #fff; cursor: pointer; background: var(--color, var(--rojo)); box-shadow: 0 6px 18px rgba(28,36,51,.14); transition: transform .1s ease, filter .12s ease; }
.servicio-btn:hover { filter: brightness(1.05); }
.servicio-btn:active { transform: scale(.97); }

kendo-ticket, .ticket { display: none; }
.ticket.visible { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.ticket .label { font-size: 22px; color: var(--suave); }
.ticket .codigo { font-size: 120px; font-weight: 900; color: var(--rojo); line-height: 1; }
.ticket .servicio { font-size: 28px; font-weight: 700; margin-top: 10px; }
.ticket .gracias { color: var(--suave); margin-top: 16px; font-size: 18px; }
.ticket button { margin-top: 26px; }

.vacio-kiosco { color: var(--suave); font-size: 18px; text-align: center; }

/* Ventana emergente (modal) táctil y teclado en pantalla */
.kiosco-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    padding: 16px;
    box-sizing: border-box;
}
.kiosco-modal-overlay.activo {
    display: flex;
}
.kiosco-modal-card {
    background: #ffffff;
    border-radius: 26px;
    width: 96%;
    max-width: 920px;
    max-height: 94vh;
    padding: 28px 30px;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(0,0,0,0.06);
    animation: kioscoModalFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
    position: relative;
    overflow-y: auto;
}
@keyframes kioscoModalFadeIn {
    from { opacity: 0; transform: translateY(20px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.kiosco-modal-close {
    position: absolute;
    top: 16px;
    right: 18px;
    background: #f1f5f9;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 19px;
    font-weight: 700;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s, transform 0.1s;
    z-index: 10;
    touch-action: manipulation;
}
.kiosco-modal-close:hover {
    background: #e2e8f0;
    color: #0f172a;
}
.kiosco-modal-close:active {
    transform: scale(0.92);
}

/* Disposición 2 columnas para pantalla táctil */
.kiosco-modal-layout {
    display: flex;
    gap: 24px;
    align-items: stretch;
}
@media (max-width: 820px), (orientation: portrait) {
    .kiosco-modal-layout {
        flex-direction: column;
    }
    .kiosco-modal-card {
        padding: 22px 20px;
        max-width: 600px;
        max-height: 96vh;
    }
}
.kiosco-modal-col-form {
    flex: 1 1 44%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-align: left;
}
.kiosco-modal-col-teclado {
    flex: 1 1 56%;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 20px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-sizing: border-box;
}

.kiosco-modal-header {
    text-align: left;
    margin-bottom: 16px;
    padding-right: 36px;
}
.kiosco-servicio-badge {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.12);
}
.kiosco-modal-title {
    font-size: 22px;
    font-weight: 800;
    color: #1c2433;
    margin-bottom: 4px;
    line-height: 1.25;
}
.kiosco-modal-sub {
    font-size: 14px;
    color: #5b6779;
    line-height: 1.35;
}
.kiosco-input-group {
    margin-bottom: 14px;
    text-align: left;
}
.kiosco-label {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 6px;
    color: #1c2433;
}
.kiosco-input {
    width: 100%;
    padding: 15px 18px;
    font-size: 21px;
    font-weight: 700;
    border-radius: 14px;
    border: 2px solid #e2e8f0;
    background: #f8fafc;
    color: #0f172a;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s, background-color 0.2s, box-shadow 0.2s;
    letter-spacing: 0.5px;
    cursor: pointer;
    touch-action: manipulation;
}
.kiosco-input.activo {
    border-color: var(--rojo);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(237, 27, 36, 0.16);
}

.kiosco-modal-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 14px;
    display: none;
    text-align: center;
}
.kiosco-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 14px;
}
.kiosco-btn-primario {
    border: none;
    border-radius: 14px;
    padding: 15px 20px;
    font-size: 18px;
    font-weight: 800;
    color: #ffffff;
    background: var(--rojo);
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(237, 27, 36, 0.22);
    transition: transform 0.08s ease, filter 0.12s ease;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}
.kiosco-btn-primario:hover { filter: brightness(1.06); }
.kiosco-btn-primario:active { transform: scale(0.97); }
.kiosco-btn-secundario {
    border: 2px solid #cbd5e1;
    border-radius: 14px;
    padding: 12px 20px;
    font-size: 15px;
    font-weight: 700;
    color: #5b6779;
    background: transparent;
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}
.kiosco-btn-secundario:hover {
    background: #f1f5f9;
    color: #1c2433;
}
.kiosco-btn-secundario:active {
    transform: scale(0.98);
}
.kiosco-btn-cancelar {
    border: none;
    background: transparent;
    color: #5b6779;
    font-size: 14px;
    font-weight: 600;
    padding: 6px;
    cursor: pointer;
    text-decoration: underline;
    text-align: center;
    touch-action: manipulation;
}

/* Barra de estado y pestañas del teclado táctil */
.teclado-status-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    gap: 10px;
    flex-wrap: wrap;
}
.teclado-indicador {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #475569;
    background: #e2e8f0;
    padding: 6px 12px;
    border-radius: 20px;
}
.indicador-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
    animation: pulsoIndicador 1.5s infinite;
}
@keyframes pulsoIndicador {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.85); }
}
.indicador-campo {
    color: #0f172a;
    font-weight: 800;
}
.teclado-tabs {
    display: flex;
    gap: 6px;
}
.teclado-tab-btn {
    padding: 7px 12px;
    font-size: 13px;
    font-weight: 700;
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #64748b;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    transition: all 0.12s ease;
    touch-action: manipulation;
}
.teclado-tab-btn.activo {
    background: #1c2433;
    color: #ffffff;
    border-color: #1c2433;
}

/* Teclado Numérico táctil */
.teclado-num-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}
.tecla-btn {
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-radius: 14px;
    height: 58px;
    font-size: 26px;
    font-weight: 800;
    color: #0f172a;
    cursor: pointer;
    box-shadow: 0 3px 6px rgba(0,0,0,0.04);
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    transition: transform 0.05s ease, background 0.08s ease, box-shadow 0.08s ease;
}
.tecla-btn:active {
    transform: scale(0.92);
    background: #e2e8f0;
}
.tecla-btn.tecla-borrar {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #b91c1c;
    font-size: 24px;
}
.tecla-btn.tecla-borrar:active {
    background: #f87171;
    color: #ffffff;
}
.tecla-btn.tecla-aux {
    font-size: 15px;
    font-weight: 700;
    background: #f1f5f9;
    color: #334155;
}

/* Teclado QWERTY táctil */
.teclado-qwerty {
    display: none;
    flex-direction: column;
    gap: 6px;
}
.teclado-qwerty.visible {
    display: flex;
}
.qwerty-row {
    display: flex;
    gap: 5px;
    justify-content: center;
}
.qwerty-key {
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-radius: 10px;
    height: 46px;
    flex: 1;
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.03);
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    transition: transform 0.05s ease, background 0.08s ease;
}
.qwerty-key:active {
    transform: scale(0.92);
    background: #e2e8f0;
}
.qwerty-key.wide {
    flex: 1.5;
    font-size: 13px;
    background: #f1f5f9;
}
.qwerty-key.space {
    flex: 4;
    font-size: 13px;
}
.ticket-datos-cliente {
    margin-top: 14px;
    padding: 10px 20px;
    background: #f1f5f9;
    border-radius: 12px;
    font-size: 17px;
    font-weight: 700;
    color: var(--primario);
    display: none;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: center;
}
