/* ==========================================================================
   SISTEMA RESTAURANTE - HOJA DE ESTILOS ÚNICA
   --------------------------------------------------------------------------
   Sin librerías externas: todo el diseño está aquí (funciona sin internet).
   Organización:
     1. Variables (colores, medidas)        6. Pestañas y píldoras
     2. Base y utilidades                   7. Mesas
     3. Barra superior (encabezado)         8. Menú: categorías y productos
     4. Botones                             9. Orden, servido y totales
     5. Formularios                        10. Ventanas (modales), avisos, carga
                                           11. Inicio de sesión
                                           12. Adaptación a pantallas (responsive)
   Para cambiar los colores de todo el sistema basta editar las variables de la sección 1.
   ========================================================================== */

/* ---------- 1. Variables ---------- */
:root {
    --tinta: #15803d;
    --fondo: #e9f3ec;
    --tarjeta: #ffffff;
    --linea: #d5e5d9;
    --linea-fuerte: #b7d3bf;
    --texto: #0f172a;
    --suave: #64748b;

    --primario: #15803d;
    --primario-osc: #166534;
    --primario-claro: #dcfce7;
    --acento: #f59e0b;

    --exito: #059669;
    --exito-claro: #d1fae5;
    --peligro: #dc2626;
    --peligro-claro: #fee2e2;
    --aviso: #d97706;
    --aviso-claro: #fef3c7;

    --radio: 14px;
    --radio-sm: 10px;
    --sombra: 0 1px 2px rgba(15, 23, 42, .06), 0 4px 14px rgba(15, 23, 42, .06);
    --sombra-fuerte: 0 10px 30px rgba(15, 23, 42, .18);
    --alto-barra: 60px;
    --alto-vistas: 64px;
}

/* ---------- 2. Base y utilidades ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--fondo);
    color: var(--texto);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; line-height: 1.2; }
p { margin: 0; }
a { color: var(--primario); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }

.ico { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.2em; }
.ico-lg { width: 1.8em; height: 1.8em; }
.ico-xl { width: 2.6em; height: 2.6em; }

.contenedor { width: 100%; max-width: 1180px; margin: 0 auto; padding: 18px 16px 40px; }
.oculto { display: none !important; }
.solo-lector { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.texto-suave { color: var(--suave); }
.texto-centro { text-align: center; }
.fila { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fila-entre { justify-content: space-between; }
.espacio { height: 14px; }

:focus-visible { outline: 3px solid rgba(21, 128, 61, .45); outline-offset: 2px; }

.titulo-pagina { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.titulo-pagina h1 { font-size: 1.45rem; letter-spacing: -.01em; }
.titulo-pagina p { color: var(--suave); font-size: .92rem; }

.tarjeta { background: var(--tarjeta); border: 1px solid var(--linea); border-radius: var(--radio); box-shadow: var(--sombra); }
.tarjeta-cuerpo { padding: 16px; }
.tarjeta-cab { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--linea); font-weight: 700; }
.tarjeta-cab .ico { color: var(--primario); }

.vacio { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 36px 16px; text-align: center; color: var(--suave); }
.vacio > .ico { width: 2.8em; height: 2.8em; color: var(--linea-fuerte); }
.vacio strong { color: var(--texto); }

.insignia { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; background: var(--linea); color: var(--suave); }
.insignia-exito { background: var(--exito-claro); color: #047857; }
.insignia-peligro { background: var(--peligro-claro); color: #b91c1c; }
.insignia-primario { background: var(--primario-claro); color: var(--primario-osc); }

/* ---------- 3. Barra superior ---------- */
.barra {
    position: sticky; top: 0; z-index: 50;
    background: linear-gradient(135deg, #15803d 0%, #16a34a 50%, #166534 100%);
    border-bottom: 3px solid #4ade80;
    color: #fff;
    box-shadow: 0 2px 14px rgba(10, 36, 19, .35);
}
.barra-in { max-width: 1180px; margin: 0 auto; height: var(--alto-barra); padding: 0 12px; display: flex; align-items: center; gap: 10px; }
.marca { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 800; letter-spacing: .01em; min-width: 0; }
.marca-logo { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: linear-gradient(135deg, var(--acento), #f97316); color: #fff; box-shadow: 0 4px 12px rgba(249, 115, 22, .4); flex: none; }
.marca-logo .ico { width: 22px; height: 22px; }
.marca-img { display: block; height: 44px; width: auto; max-width: 100%; object-fit: contain; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .45)); }
.marca-texto { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.barra-titulo { display: flex; flex-direction: column; min-width: 0; margin-left: 4px; line-height: 1.15; }
.barra-titulo strong { font-size: 1.02rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.barra-titulo small { color: #bbf7d0; font-size: .75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.barra-espacio { flex: 1; }

.btn-barra { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 42px; height: 42px; padding: 0 12px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, .14); background: rgba(255, 255, 255, .08); color: #fff; cursor: pointer; font-weight: 600; font-size: .92rem; transition: background .15s; }
.btn-barra:hover { background: rgba(255, 255, 255, .18); color: #fff; }
.btn-barra .ico { width: 20px; height: 20px; }

.chip-usuario { display: flex; align-items: center; gap: 9px; padding: 4px 12px 4px 4px; border-radius: 999px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .14); max-width: 240px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, #22c55e, #15803d); color: #fff; font-weight: 800; font-size: .85rem; flex: none; }
.chip-usuario span.nombre { font-size: .85rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- 4. Botones ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 18px; border-radius: var(--radio-sm); border: 1px solid transparent; font-weight: 700; font-size: .98rem; cursor: pointer; text-align: center; line-height: 1.1; transition: transform .06s, box-shadow .15s, background .15s, border-color .15s; user-select: none; -webkit-tap-highlight-color: transparent; }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[disabled], .btn.deshabilitado { opacity: .55; cursor: not-allowed; pointer-events: none; }
.btn-primario { background: var(--primario); color: #fff; box-shadow: 0 4px 12px rgba(21, 128, 61, .28); }
.btn-primario:hover { background: var(--primario-osc); color: #fff; }
.btn-exito { background: var(--exito); color: #fff; box-shadow: 0 4px 12px rgba(5, 150, 105, .28); }
.btn-exito:hover { background: #047857; color: #fff; }
.btn-peligro { background: var(--peligro); color: #fff; box-shadow: 0 4px 12px rgba(220, 38, 38, .25); }
.btn-peligro:hover { background: #b91c1c; color: #fff; }
.btn-secundario { background: #fff; color: var(--texto); border-color: var(--linea-fuerte); }
.btn-secundario:hover { background: #f8fafc; border-color: var(--suave); color: var(--texto); }
.btn-suave { background: var(--primario-claro); color: var(--primario-osc); }
.btn-suave:hover { background: #bbf7d0; color: var(--primario-osc); }
.btn-bloque { display: flex; width: 100%; }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: .88rem; border-radius: 9px; }
.btn-lg { min-height: 54px; font-size: 1.05rem; }
.btn-icono { width: 40px; min-height: 40px; padding: 0; }
.btn-icono.btn-sm { width: 34px; min-height: 34px; }
.acciones { display: flex; gap: 10px; flex-wrap: wrap; }
.acciones > * { flex: 1 1 160px; }

/* ---------- 5. Formularios ---------- */
.campo { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.campo > label, .etiqueta { font-weight: 700; font-size: .85rem; color: #334155; }
.control { width: 100%; min-height: 46px; padding: 10px 14px; border: 1px solid var(--linea-fuerte); border-radius: var(--radio-sm); background: #fff; font-size: 16px; transition: border-color .15s, box-shadow .15s; appearance: none; -webkit-appearance: none; }
select.control { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 40px; }
textarea.control { min-height: 84px; resize: vertical; }
.control:focus { outline: none; border-color: var(--primario); box-shadow: 0 0 0 4px rgba(21, 128, 61, .15); }
.control::placeholder { color: #94a3b8; }
.grupo-icono { position: relative; }
.grupo-icono > .ico { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--suave); pointer-events: none; width: 20px; height: 20px; }
.grupo-icono > .control { padding-left: 44px; }
.grupo-icono > .btn-ojo { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border: 0; background: transparent; color: var(--suave); cursor: pointer; border-radius: 8px; display: grid; place-items: center; }
.grupo-icono > .btn-ojo:hover { background: var(--fondo); }
.grupo-icono.con-ojo > .control { padding-right: 48px; }
.ayuda { font-size: .8rem; color: var(--suave); }
.fila-campos { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.buscador { display: flex; gap: 8px; }
.buscador .grupo-icono { flex: 1; }

/* ---------- 6. Pestañas y píldoras ---------- */
.pildoras { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 10px; margin: 0 -2px; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
.pildora { display: inline-flex; align-items: center; gap: 8px; flex: none; min-height: 42px; padding: 0 16px; border-radius: 999px; background: #fff; border: 1px solid var(--linea-fuerte); color: #334155; font-weight: 700; font-size: .92rem; cursor: pointer; white-space: nowrap; transition: all .15s; }
.pildora:hover { border-color: var(--primario); color: var(--primario); }
.pildora.activa { background: var(--primario); border-color: var(--primario); color: #fff; box-shadow: 0 4px 12px rgba(21, 128, 61, .3); }
.pildora.activa:hover { color: #fff; }

.resumen { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.dato { background: #fff; border: 1px solid var(--linea); border-radius: var(--radio); padding: 12px 14px; display: flex; align-items: center; gap: 12px; box-shadow: var(--sombra); }
.dato-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--primario-claro); color: var(--primario-osc); flex: none; }
.dato-ico.verde { background: var(--exito-claro); color: #047857; }
.dato-ico.roja { background: var(--peligro-claro); color: #b91c1c; }
.dato b { display: block; font-size: 1.35rem; line-height: 1; }
.dato small { color: var(--suave); font-size: .78rem; font-weight: 600; }

/* Vistas de la pantalla de mesa (Orden / Servido / Menú / Otros) */
.vistas { display: flex; gap: 6px; padding: 5px; background: #cfe6d6; border-radius: 14px; margin-bottom: 16px; }
.vista { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 10px; border-radius: 10px; font-weight: 700; font-size: .92rem; color: #14532d; cursor: pointer; position: relative; transition: all .15s; }
.vista:hover { color: var(--primario); }
.vista.activa { background: #fff; color: var(--primario-osc); box-shadow: 0 2px 8px rgba(15, 23, 42, .12); }
.vista.deshabilitada { opacity: .4; cursor: not-allowed; pointer-events: none; }
.vista .contador { min-width: 22px; height: 22px; padding: 0 6px; display: inline-grid; place-items: center; border-radius: 999px; background: var(--acento); color: #451a03; font-size: .75rem; font-weight: 800; }

/* ---------- 7. Mesas ---------- */
.grid-mesas { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.mesa { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 14px; min-height: 126px; border-radius: var(--radio); background: #fff; border: 1px solid var(--linea); border-top: 5px solid var(--exito); box-shadow: var(--sombra); color: var(--texto); cursor: pointer; text-align: left; transition: transform .12s, box-shadow .15s, border-color .15s; }
.mesa:hover { transform: translateY(-3px); box-shadow: var(--sombra-fuerte); color: var(--texto); }
.mesa-cab { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mesa-ico { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--exito-claro); color: #047857; }
.mesa-nombre { font-size: 1.15rem; font-weight: 800; line-height: 1.15; word-break: break-word; }
.mesa-estado { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 800; letter-spacing: .02em; text-transform: uppercase; color: #047857; margin-top: auto; }
.mesa-estado::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.mesa.en-uso { border-top-color: var(--peligro); background: linear-gradient(180deg, #fff 0%, #fff5f5 100%); }
.mesa.en-uso .mesa-ico { background: var(--peligro-claro); color: #b91c1c; }
.mesa.en-uso .mesa-estado { color: #b91c1c; }
.mesa.en-uso .mesa-estado::before { animation: latido 1.6s infinite; }
.mesa .etiqueta-fe { position: absolute; top: 10px; right: 10px; }
.mesa.deshabilitada { opacity: .6; cursor: not-allowed; }
@keyframes latido { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }

.crear-personal { display: flex; gap: 10px; align-items: stretch; flex-wrap: wrap; padding: 14px; margin-bottom: 14px; background: #fff; border: 1px dashed var(--linea-fuerte); border-radius: var(--radio); }
.crear-personal .control { flex: 1 1 220px; }

/* ---------- 8. Menú: categorías y productos ---------- */
.grid-categorias { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.categoria { --t-fg: #15803d; --t-bg: #dcfce7; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; min-height: 148px; padding: 16px 10px; text-align: center; border-radius: var(--radio); background: #fff; border: 1px solid var(--linea); box-shadow: var(--sombra); color: var(--texto); font-weight: 800; cursor: pointer; transition: transform .12s, box-shadow .15s, border-color .15s; }
.categoria:hover { transform: translateY(-3px); box-shadow: var(--sombra-fuerte); border-color: var(--t-fg); color: var(--texto); }
.categoria-ico { width: 68px; height: 68px; border-radius: 20px; display: grid; place-items: center; background: var(--t-bg); color: var(--t-fg); }
.categoria-ico .ico { width: 34px; height: 34px; }
.categoria-nombre { font-size: .98rem; line-height: 1.2; word-break: break-word; }
.tono-1 { --t-fg: #15803d; --t-bg: #dcfce7; }
.tono-2 { --t-fg: #4f46e5; --t-bg: #e0e7ff; }
.tono-3 { --t-fg: #b45309; --t-bg: #fef3c7; }
.tono-4 { --t-fg: #be123c; --t-bg: #ffe4e6; }
.tono-5 { --t-fg: #0369a1; --t-bg: #e0f2fe; }
.tono-6 { --t-fg: #7e22ce; --t-bg: #f3e8ff; }
.tono-7 { --t-fg: #4d7c0f; --t-bg: #ecfccb; }
.tono-8 { --t-fg: #c2410c; --t-bg: #ffedd5; }

.cab-categoria { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.cab-categoria .categoria-ico { width: 48px; height: 48px; border-radius: 14px; }
.cab-categoria .categoria-ico .ico { width: 26px; height: 26px; }
.cab-categoria h2 { font-size: 1.2rem; }

.lista-productos { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.producto { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: #fff; border: 1px solid var(--linea); border-radius: var(--radio); cursor: pointer; text-align: left; color: var(--texto); box-shadow: var(--sombra); transition: border-color .15s, transform .1s; }
.producto:hover { border-color: var(--primario); transform: translateY(-1px); color: var(--texto); }
.producto .categoria-ico { width: 46px; height: 46px; border-radius: 13px; flex: none; }
.producto .categoria-ico .ico { width: 24px; height: 24px; }
.producto-info { flex: 1; min-width: 0; }
.producto-info strong { display: block; font-size: .98rem; line-height: 1.25; }
.producto-info small { color: var(--suave); }
.producto-precio { font-weight: 800; color: var(--primario-osc); white-space: nowrap; font-size: 1.02rem; }
.producto-mas { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--primario); color: #fff; flex: none; }

/* ---------- 9. Orden, servido y totales ---------- */
.lineas { display: flex; flex-direction: column; }
.linea { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--linea); }
.linea:last-child { border-bottom: 0; }
.linea-cant { min-width: 42px; height: 42px; padding: 0 8px; display: grid; place-items: center; border-radius: 12px; background: var(--primario-claro); color: var(--primario-osc); font-weight: 800; font-size: 1.05rem; flex: none; }
.linea-info { flex: 1; min-width: 0; }
.linea-info strong { display: block; line-height: 1.25; }
.linea-detalle { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.etiqueta-detalle { font-size: .78rem; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: #f1f5f9; color: #475569; }
.etiqueta-detalle.nota { background: var(--aviso-claro); color: #92400e; }
.linea-acciones { display: flex; gap: 6px; flex: none; }
.linea-monto { font-weight: 800; white-space: nowrap; align-self: center; }

.pie-orden { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; background: #f8fafc; border-top: 1px solid var(--linea); border-radius: 0 0 var(--radio) var(--radio); }
.total { display: flex; justify-content: space-between; align-items: center; font-size: 1.15rem; font-weight: 800; }
.total span:last-child { color: var(--primario-osc); font-size: 1.35rem; }

.opciones-otros { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.opcion-otro { display: flex; align-items: center; gap: 14px; padding: 16px; background: #fff; border: 1px solid var(--linea); border-radius: var(--radio); box-shadow: var(--sombra); cursor: pointer; text-align: left; color: var(--texto); font-weight: 800; transition: transform .12s, border-color .15s, box-shadow .15s; width: 100%; }
.opcion-otro:hover { transform: translateY(-2px); border-color: var(--primario); box-shadow: var(--sombra-fuerte); color: var(--texto); }
.opcion-otro small { display: block; color: var(--suave); font-weight: 500; font-size: .82rem; }
.opcion-otro .categoria-ico { width: 52px; height: 52px; border-radius: 15px; flex: none; }

.fila-mover { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--linea); }
.fila-mover:last-child { border-bottom: 0; }
.fila-mover .linea-info { flex: 1; }
.cantidades { display: flex; gap: 8px; align-items: center; }
.cantidades label { font-size: .72rem; color: var(--suave); font-weight: 700; display: block; text-align: center; }
.cantidades .control { width: 84px; min-height: 42px; text-align: center; padding: 6px; }

/* ---------- 10. Ventanas (modales), avisos y pantalla de carga ---------- */
.modal { position: fixed; inset: 0; z-index: 200; display: none; align-items: flex-end; justify-content: center; padding: 0; }
.modal.abierto { display: flex; }
.modal-fondo { position: absolute; inset: 0; background: rgba(10, 36, 19, .6); backdrop-filter: blur(3px); animation: aparecer .18s ease; }
.modal-caja { position: relative; width: 100%; max-width: 560px; max-height: 94vh; max-height: 94dvh; display: flex; flex-direction: column; background: #fff; border-radius: 22px 22px 0 0; box-shadow: var(--sombra-fuerte); animation: subir .22s ease; overflow: hidden; }
.modal-cab { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--linea); }
.modal-cab h3 { font-size: 1.1rem; display: flex; align-items: center; gap: 10px; }
.modal-cab h3 .ico { color: var(--primario); }
.modal-cuerpo { padding: 18px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.modal-pie { display: flex; gap: 10px; flex-wrap: wrap; padding: 14px 18px; border-top: 1px solid var(--linea); background: #f8fafc; }
.modal-pie > * { flex: 1 1 140px; }
@keyframes aparecer { from { opacity: 0; } to { opacity: 1; } }
@keyframes subir { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }

.confirmar-ico { width: 62px; height: 62px; margin: 0 auto 12px; border-radius: 50%; display: grid; place-items: center; background: var(--aviso-claro); color: var(--aviso); }
.confirmar-ico .ico { width: 32px; height: 32px; }
.confirmar-texto { text-align: center; font-size: 1.05rem; font-weight: 600; padding: 4px 6px 10px; }

.producto-cab { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.producto-cab h4 { font-size: 1.15rem; }
.producto-cab .producto-precio { font-size: 1.2rem; }

.stepper { align-self: flex-start; display: inline-flex; align-items: center; border: 1px solid var(--linea-fuerte); border-radius: 14px; overflow: hidden; background: #fff; }
.stepper button { width: 52px; height: 52px; border: 0; background: #f1f5f9; color: var(--texto); cursor: pointer; display: grid; place-items: center; }
.stepper button:hover { background: var(--primario-claro); color: var(--primario-osc); }
.stepper input { width: 72px; height: 52px; border: 0; text-align: center; font-size: 1.3rem; font-weight: 800; -moz-appearance: textfield; background: transparent; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper input:focus { outline: none; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-block; position: relative; }
.chip input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.chip label { display: inline-flex; align-items: center; gap: 6px; min-height: 42px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--linea-fuerte); background: #fff; font-weight: 600; font-size: .92rem; cursor: pointer; transition: all .15s; }
.chip input:checked + label { background: var(--primario); border-color: var(--primario); color: #fff; box-shadow: 0 3px 10px rgba(21, 128, 61, .3); }
.chip input:checked + label::before { content: "✓"; font-weight: 800; }
.chip input:focus-visible + label { outline: 3px solid rgba(21, 128, 61, .45); outline-offset: 2px; }
.chip.llena input:not(:checked) + label { opacity: .45; }

#avisos { position: fixed; z-index: 400; top: 14px; left: 50%; transform: translateX(-50%); width: min(94vw, 440px); display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.aviso { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border-radius: 14px; background: #fff; border-left: 6px solid var(--exito); box-shadow: var(--sombra-fuerte); font-weight: 600; pointer-events: auto; animation: bajar .25s ease; }
.aviso .ico { width: 24px; height: 24px; margin-top: 1px; color: var(--exito); }
.aviso.error { border-left-color: var(--peligro); }
.aviso.error .ico { color: var(--peligro); }
.aviso.saliendo { opacity: 0; transform: translateY(-10px); transition: all .3s; }
@keyframes bajar { from { transform: translateY(-16px); opacity: 0; } to { transform: none; opacity: 1; } }

#cargando { position: fixed; inset: 0; z-index: 500; display: none; place-items: center; background: rgba(241, 244, 249, .65); backdrop-filter: blur(2px); }
#cargando.activo { display: grid; }
.rueda { width: 54px; height: 54px; border-radius: 50%; border: 5px solid var(--primario-claro); border-top-color: var(--primario); animation: girar .8s linear infinite; }
@keyframes girar { to { transform: rotate(360deg); } }

.subir { position: fixed; right: 16px; bottom: 18px; z-index: 60; width: 46px; height: 46px; border-radius: 50%; border: 0; display: none; place-items: center; background: var(--tinta); color: #fff; box-shadow: var(--sombra-fuerte); cursor: pointer; }
.subir.visible { display: grid; }

/* ---------- 11. Inicio de sesión ---------- */
.login-fondo { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 20px 16px; background: radial-gradient(1200px 600px at 10% -10%, #22c55e 0%, transparent 60%), radial-gradient(900px 500px at 110% 110%, #16a34a 0%, transparent 55%), #15803d; }
.login-caja { width: 100%; max-width: 420px; background: #fff; border-radius: 24px; box-shadow: 0 30px 80px rgba(0, 0, 0, .45); overflow: hidden; }
.login-cab { padding: 26px 26px 20px; text-align: center; background: #fff; color: var(--texto); border-bottom: 4px solid #22c55e; }
.login-logo { display: block; width: 100%; max-width: 300px; height: auto; margin: 0 auto 8px; }
.login-cab .marca-logo { width: 64px; height: 64px; border-radius: 20px; margin: 0 auto 14px; }
.login-cab .marca-logo .ico { width: 34px; height: 34px; }
.login-cab h1 { font-size: 1.5rem; }
.login-cab p { color: var(--suave); font-size: .92rem; margin-top: 4px; }
.login-cuerpo { padding: 26px; }
.login-pie { text-align: center; padding: 0 26px 22px; color: var(--suave); font-size: .8rem; }
.alerta { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radio-sm); font-size: .9rem; font-weight: 600; margin-bottom: 14px; }
.alerta-error { background: var(--peligro-claro); color: #991b1b; }
.alerta-exito { background: var(--exito-claro); color: #065f46; }
.alerta-info { background: #e0f2fe; color: #075985; }

/* ---------- 12. Adaptación a pantallas ---------- */
@media (min-width: 720px) {
    .modal { align-items: center; padding: 20px; }
    .modal-caja { border-radius: 22px; }
    .contenedor { padding: 24px 24px 48px; }
    .grid-mesas { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
    .grid-categorias { grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 14px; }
    .vistas { width: 100%; padding: 6px; gap: 8px; }
    .vista { min-height: 52px; font-size: 1rem; }
}

@media (max-width: 719px) {
    .titulo-pagina h1 { font-size: 1.25rem; }
    .marca-texto { display: none; }
    .marca-img { height: 34px; }
    .chip-usuario span.nombre { display: none; }
    .chip-usuario { padding: 3px; }
    .btn-barra span.texto { display: none; }
    .resumen { gap: 8px; }
    .dato { padding: 10px; gap: 8px; flex-direction: column; text-align: center; }
    .lista-productos { grid-template-columns: 1fr; }
    .fila-campos { grid-template-columns: 1fr; }
    .linea { padding: 12px; }
    .fila-mover { flex-wrap: wrap; }
    /* Las vistas quedan fijas abajo, como una app móvil. */
    .vistas { position: fixed; left: 0; right: 0; bottom: 0; z-index: 70; margin: 0; border-radius: 18px 18px 0 0; padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); background: #fff; box-shadow: 0 -6px 24px rgba(15, 23, 42, .14); }
    .vista { flex-direction: column; gap: 2px; min-height: 52px; font-size: .74rem; }
    .vista .ico { width: 22px; height: 22px; }
    .vista .contador { position: absolute; top: 2px; right: calc(50% - 26px); min-width: 18px; height: 18px; font-size: .68rem; }
    .vista.activa { background: var(--primario-claro); box-shadow: none; }
    .con-vistas { padding-bottom: calc(var(--alto-vistas) + 40px); }
    .subir { bottom: 84px; }
}

@media (max-width: 380px) {
    .grid-mesas, .grid-categorias { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .mesa { padding: 10px; min-height: 112px; }
    .login-cuerpo { padding: 20px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

@media print { .barra, .vistas, .subir, #avisos, #cargando { display: none !important; } }

/* Cajas de cantidad en "Mover": solo se tocan, no se escriben. */
.caja-cant { display: flex; flex-direction: column; align-items: center; min-width: 84px; padding: 6px 10px; border: 1.5px solid var(--linea); border-radius: 12px; background: var(--superficie, #fff); cursor: pointer; font: inherit; color: inherit; }
.caja-cant:active { transform: scale(.97); }
.caja-cant label { font-size: .72rem; color: var(--suave); font-weight: 700; cursor: pointer; }
.caja-cant input { width: 64px; border: 0 !important; background: none !important; text-align: center; font-size: 1.15rem; font-weight: 800; outline: none; cursor: pointer; pointer-events: none; user-select: none; padding: 0; }
.caja-mover { border-color: var(--primario, #2563eb); }

/* Fondo de las pantallas con sesión: verde suave con brillos que combinan con el logo. */
body:not(.login-fondo) {
    background:
        radial-gradient(900px 420px at 8% -5%, rgba(34, 197, 94, .20), transparent 60%),
        radial-gradient(800px 420px at 100% 10%, rgba(21, 128, 61, .14), transparent 60%),
        linear-gradient(180deg, #dcefe2 0%, #e9f3ec 38%, #f2f8f4 100%);
    background-attachment: fixed;
    min-height: 100vh;
}

/* Pie de página */
.pie-pagina { text-align: center; padding: 18px 16px 26px; color: #166534; font-size: .8rem; font-weight: 600; letter-spacing: .02em; }
@media (max-width: 719px) { .con-vistas + .pie-pagina { padding-bottom: calc(var(--alto-vistas) + 34px); } }

/* ---------- Modo aplicación (kiosko) ----------
   Se activa cuando el sistema se abre desde el ícono de la pantalla de inicio: sin barra del navegador
   (el JavaScript pone la clase "app-modo" en <html>). */
html.app-modo, html.app-modo body { overscroll-behavior: none; -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; }
html.app-modo body { -webkit-user-select: none; user-select: none; touch-action: manipulation; }
html.app-modo input, html.app-modo textarea, html.app-modo select { -webkit-user-select: text; user-select: text; }
html.app-modo .barra { padding-top: env(safe-area-inset-top); }
html.app-modo body { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }


/* =====================================================================
   13. CAPA FUTURISTA
   Animaciones y efectos que reaccionan al movimiento (puntero y toque).
   Todo es CSS puro, salvo lo que está en app.js ("Efectos"). Respeta
   prefers-reduced-motion (al final se apagan todas las animaciones).
   Colores: los del logo (verde profundo, verde neón y menta).
   ===================================================================== */
@property --ang { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
:root { --neon: #22c55e; --menta: #bbf7d0; --profundo: #15803d; --px: 50%; --py: 18%; }
::selection { background: rgba(34, 197, 94, .35); }
:focus-visible { outline: 3px solid rgba(34, 197, 94, .65); outline-offset: 2px; }
html { scrollbar-width: thin; scrollbar-color: #22c55e transparent; }

/* ---------- Transición suave entre páginas (login -> inicio -> mesas) ---------- */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-sale .18s cubic-bezier(.4, 0, 1, 1) both; }
::view-transition-new(root) { animation: vt-entra .34s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes vt-sale { to { opacity: 0; transform: scale(.992); } }
@keyframes vt-entra { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Fondo vivo: cuadrícula + auroras + brillo que sigue al dedo/puntero ---------- */
body:not(.login-fondo)::before {
    content: ""; position: fixed; inset: -20%; z-index: -1; pointer-events: none;
    background:
        radial-gradient(560px 560px at 12% 18%, rgba(34, 197, 94, .16), transparent 70%),
        radial-gradient(620px 620px at 88% 78%, rgba(21, 128, 61, .16), transparent 70%);
    animation: deriva 26s ease-in-out infinite alternate;
}
body:not(.login-fondo)::after {
    content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
    background:
        linear-gradient(rgba(21, 128, 61, .07) 1px, transparent 1px) 0 0 / 46px 46px,
        linear-gradient(90deg, rgba(21, 128, 61, .07) 1px, transparent 1px) 0 0 / 46px 46px;
    -webkit-mask-image: radial-gradient(ellipse at 50% 25%, #000 20%, transparent 80%);
    mask-image: radial-gradient(ellipse at 50% 25%, #000 20%, transparent 80%);
}
html::before {
    content: ""; position: fixed; left: 0; top: 0; width: 760px; height: 760px; margin: -380px 0 0 -380px; z-index: -1; pointer-events: none; border-radius: 50%;
    background: radial-gradient(closest-side, rgba(34, 197, 94, .20), transparent); will-change: transform;
    transform: translate3d(var(--tx, 50vw), var(--ty, 18vh), 0);
}
@keyframes deriva { from { transform: translate3d(-2%, -1%, 0) scale(1); } to { transform: translate3d(2%, 2%, 0) scale(1.06); } }

/* ---------- Barra superior: línea de energía que fluye ---------- */
.barra { border-bottom: 0; overflow: hidden; }
.barra::after {
    content: ""; position: absolute; left: 0; bottom: 0; width: 200%; height: 3px; pointer-events: none;
    background: linear-gradient(90deg, #14532d 0%, #22c55e 18%, #bbf7d0 32%, #22c55e 46%, #14532d 50%, #22c55e 68%, #bbf7d0 82%, #22c55e 96%, #14532d 100%);
    animation: flujo 7s linear infinite;
}
@keyframes flujo { to { transform: translateX(-50%); } }
.primera-carga .barra-in { animation: barra-baja .6s cubic-bezier(.2, .9, .3, 1) backwards; }
@keyframes barra-baja { from { transform: translateY(-100%); opacity: 0; } }
.marca-img { transition: transform .35s cubic-bezier(.2, .9, .3, 1.4), filter .35s; }
.marca:hover .marca-img { transform: scale(1.05); filter: drop-shadow(0 0 10px rgba(34, 197, 94, .8)) drop-shadow(0 2px 4px rgba(0, 0, 0, .45)); }
.btn-barra { position: relative; overflow: hidden; transition: background .2s, transform .15s, box-shadow .2s, border-color .2s; }
.btn-barra:hover { transform: translateY(-1px); border-color: rgba(187, 247, 208, .55); box-shadow: 0 0 16px rgba(34, 197, 94, .45); }
.btn-barra:active { transform: scale(.96); }
.avatar { box-shadow: 0 0 0 2px rgba(187, 247, 208, .35), 0 0 14px rgba(34, 197, 94, .6); animation: aura 3.2s ease-in-out infinite; }
@keyframes aura { 50% { box-shadow: 0 0 0 4px rgba(187, 247, 208, .18), 0 0 22px rgba(34, 197, 94, .85); } }

/* ---------- Botones ---------- */
.btn { position: relative; overflow: hidden; transition: transform .15s, box-shadow .25s, background-color .2s, border-color .2s, color .2s; }
.btn:active { transform: scale(.97); }
.btn-primario, .btn-exito { background-image: linear-gradient(135deg, #22c55e 0%, #15803d 55%, #14532d 100%); }
.btn-primario:hover, .btn-exito:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(34, 197, 94, .45), inset 0 0 0 1px rgba(187, 247, 208, .35); }
.btn-primario::after, .btn-exito::after {
    content: ""; position: absolute; top: 0; left: -70%; width: 45%; height: 100%; pointer-events: none;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .42), transparent);
    transform: skewX(-22deg); transition: left .7s cubic-bezier(.2, .8, .2, 1);
}
.btn-primario:hover::after, .btn-exito:hover::after { left: 130%; }
.btn-secundario:hover { border-color: var(--neon); box-shadow: 0 0 0 3px rgba(34, 197, 94, .15), 0 6px 18px rgba(21, 128, 61, .15); transform: translateY(-1px); }
.btn-peligro:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(220, 38, 38, .38); }
.btn .ico { transition: transform .25s cubic-bezier(.2, .9, .3, 1.4); }
.btn:hover .ico { transform: translateX(3px) scale(1.08); }
.btn-icono:hover .ico { transform: scale(1.15) rotate(-6deg); }

/* Onda al tocar (la crea app.js) */
.onda { position: absolute; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; pointer-events: none; background: rgba(255, 255, 255, .55); transform: scale(0); animation: onda .65s ease-out forwards; }
.btn-secundario .onda, .btn-suave .onda, .pildora:not(.activa) .onda, .vista .onda, .stepper .onda, .btn-ojo .onda { background: rgba(34, 197, 94, .35); }
@keyframes onda { to { transform: scale(24); opacity: 0; } }
.pildora, .vista, .stepper button, .btn-ojo, .producto-mas { position: relative; overflow: hidden; }

/* ---------- Pestañas de ubicación (pastillas) ---------- */
.pildora { transition: transform .15s, box-shadow .25s, border-color .2s, color .2s, background-color .2s; }
.pildora:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(21, 128, 61, .2); }
.pildora.activa { background-image: linear-gradient(110deg, #15803d, #22c55e, #15803d); background-size: 220% 100%; }
@keyframes brillo-pildora { 50% { background-position: 100% 0; } }

/* ---------- Pestañas Orden / Servido / Menú / Otros: indicador que se desliza ---------- */
@media (min-width: 720px) { .vistas { position: relative; } }
.vistas { box-shadow: inset 0 0 0 1px rgba(21, 128, 61, .18); }
.vistas.con-ind .vista.activa { background: transparent; box-shadow: none; }
.vistas-ind {
    position: absolute; z-index: 0; left: 0; top: 0; width: 0; height: 0; border-radius: 10px; pointer-events: none;
    background: #fff; box-shadow: 0 3px 12px rgba(15, 23, 42, .15), 0 0 0 1.5px rgba(34, 197, 94, .55), 0 0 18px rgba(34, 197, 94, .25);
    transition: left .42s cubic-bezier(.3, 1.35, .5, 1), top .42s cubic-bezier(.3, 1.35, .5, 1), width .42s cubic-bezier(.3, 1.35, .5, 1), height .42s cubic-bezier(.3, 1.35, .5, 1);
}
.vistas .vista { z-index: 1; transition: color .25s, transform .15s; }
.vistas .vista:active { transform: scale(.96); }
.vista .ico { transition: transform .3s cubic-bezier(.2, .9, .3, 1.5); }
.vista.activa .ico { transform: scale(1.18); }
.vista .contador { animation: pulso-contador 2.4s ease-in-out infinite; }
@keyframes pulso-contador { 50% { transform: scale(1.14); box-shadow: 0 0 0 5px rgba(245, 158, 11, .18); } }

/* ---------- Tarjetas: brillo que sigue al puntero + borde de neón que gira ---------- */
.tarjeta, .dato, .mesa, .categoria, .producto, .opcion-otro { position: relative; isolation: isolate; --mx: 50%; --my: 50%; }
.tarjeta::before, .dato::before, .mesa::before, .categoria::before, .producto::before, .opcion-otro::before {
    content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .3s;
    background: radial-gradient(240px circle at var(--mx) var(--my), rgba(34, 197, 94, .20), transparent 72%);
}
.tarjeta:hover::before, .dato:hover::before, .mesa:hover::before, .categoria:hover::before, .producto:hover::before, .opcion-otro:hover::before,
.mesa:active::before, .categoria:active::before, .producto:active::before, .opcion-otro:active::before { opacity: 1; }
.tarjeta { transition: box-shadow .3s, border-color .3s; }
.tarjeta:hover { border-color: rgba(34, 197, 94, .35); }

.mesa::after, .categoria::after, .producto::after, .opcion-otro::after, .login-caja::after {
    content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 2px; pointer-events: none; opacity: 0; transition: opacity .35s;
    background: conic-gradient(from var(--ang), transparent 0 58%, #14532d 70%, #22c55e 84%, #bbf7d0 96%, transparent 100%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); mask-composite: exclude;
}
.mesa:not(.deshabilitada):hover::after, .categoria:hover::after, .producto:hover::after, .opcion-otro:hover::after,
.mesa:not(.deshabilitada):focus-visible::after, .categoria:focus-visible::after, .producto:focus-visible::after, .opcion-otro:focus-visible::after,
.mesa:not(.deshabilitada):active::after, .categoria:active::after, .producto:active::after, .opcion-otro:active::after { opacity: 1; animation: giro-borde 2.6s linear infinite; }
@keyframes giro-borde { to { --ang: 360deg; } }

.mesa, .categoria, .producto, .opcion-otro { transition: transform .25s cubic-bezier(.2, .9, .3, 1.3), box-shadow .3s, border-color .2s; }
.mesa:not(.deshabilitada):hover, .categoria:hover { transform: translateY(-5px) scale(1.015); box-shadow: 0 16px 34px rgba(10, 36, 19, .2), 0 0 24px rgba(34, 197, 94, .2); }
.mesa:active, .categoria:active, .producto:active, .opcion-otro:active { transform: scale(.97); }
.producto:hover { transform: translateX(4px); box-shadow: 0 8px 22px rgba(10, 36, 19, .14); }
.opcion-otro:hover { box-shadow: 0 12px 28px rgba(10, 36, 19, .18), 0 0 22px rgba(34, 197, 94, .2); }
.categoria-ico { transition: transform .35s cubic-bezier(.2, .9, .3, 1.5), box-shadow .3s; }
.categoria:hover .categoria-ico, .opcion-otro:hover .categoria-ico, .producto:hover .categoria-ico { transform: scale(1.1) rotate(-5deg); box-shadow: 0 0 20px color-mix(in srgb, var(--t-fg, #15803d) 45%, transparent); }
.mesa-ico { transition: transform .35s cubic-bezier(.2, .9, .3, 1.5); }
.mesa:hover .mesa-ico { transform: rotate(-8deg) scale(1.12); }
.producto-mas { transition: transform .3s cubic-bezier(.2, .9, .3, 1.5), box-shadow .3s; }
.producto:hover .producto-mas { transform: rotate(90deg) scale(1.12); box-shadow: 0 0 16px rgba(34, 197, 94, .6); }
.mesa-estado::before { box-shadow: 0 0 0 0 currentColor; }
.mesa.en-uso .mesa-estado::before { animation: radar 1.8s ease-out infinite; }
@keyframes radar { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 55%, transparent); } 80%, 100% { box-shadow: 0 0 0 8px transparent; } }

/* Aparición escalonada de las cuadrículas (solo mientras cargan) */
/* Solo la primera vez que se abre la app: después el contenido aparece quieto, como en una app nativa (nada de "brincos"). */
.primera-carga .grid-mesas > *, .primera-carga .grid-categorias > *, .primera-carga .lista-productos > *, .primera-carga .resumen > *, .primera-carga .opciones-otros > * {
    animation: entra-tarjeta .5s cubic-bezier(.2, .9, .3, 1.1) backwards; animation-delay: calc(var(--i, 0) * 45ms);
}
html.sin-entrada .grid-mesas > *, html.sin-entrada .grid-categorias > *, html.sin-entrada .lista-productos > *, html.sin-entrada .resumen > *,
html.sin-entrada .opciones-otros > *, html.sin-entrada .lineas > .linea, html.sin-entrada .titulo-pagina, html.sin-entrada .barra-in { animation: none !important; }
@keyframes entra-tarjeta { from { opacity: 0; transform: translateY(18px) scale(.94); } }
.primera-carga .lineas > .linea { animation: entra-linea .4s cubic-bezier(.2, .9, .3, 1) backwards; animation-delay: calc(var(--i, 0) * 40ms); }
@keyframes entra-linea { from { opacity: 0; transform: translateX(-14px); } }
.primera-carga .titulo-pagina { animation: entra-titulo .5s cubic-bezier(.2, .9, .3, 1) backwards; }
@keyframes entra-titulo { from { opacity: 0; transform: translateY(-8px); } }
.linea { transition: background .2s; }
.linea:hover { background: linear-gradient(90deg, rgba(34, 197, 94, .08), transparent); }

/* ---------- Campos ---------- */
.control { transition: border-color .2s, box-shadow .25s, background-color .2s; }
.control:focus { box-shadow: 0 0 0 4px rgba(34, 197, 94, .18), 0 0 18px rgba(34, 197, 94, .18); }
.grupo-icono > .ico { transition: color .25s, transform .3s cubic-bezier(.2, .9, .3, 1.5); }
.grupo-icono:focus-within > .ico { color: var(--primario); transform: translateY(-50%) scale(1.18); }
.stepper { transition: box-shadow .25s, border-color .25s; }
.stepper:focus-within, .stepper:hover { border-color: var(--neon); box-shadow: 0 0 0 3px rgba(34, 197, 94, .14); }
.stepper button { transition: background .2s, transform .15s; }
.stepper button:active { transform: scale(.88); }
.chip label { transition: transform .15s, background .2s, border-color .2s, box-shadow .25s, color .2s; }
.chip label:hover { transform: translateY(-2px); border-color: var(--neon); }
.chip input:checked + label { background-image: linear-gradient(135deg, #22c55e, #15803d); }
.chip input:checked + label::before { display: inline-block; animation: sello .35s cubic-bezier(.2, .9, .3, 1.8); }
@keyframes sello { from { transform: scale(0) rotate(-40deg); } }

/* ---------- Ventanas, avisos y carga ---------- */
.modal-fondo { backdrop-filter: blur(7px) saturate(1.2); background: rgba(10, 36, 19, .62); }
.modal-caja { animation: modal-entra .42s cubic-bezier(.2, .9, .3, 1.15); }
.modal-caja::before {
    content: ""; position: absolute; top: 0; left: 0; width: 200%; height: 3px; z-index: 2; pointer-events: none;
    background: linear-gradient(90deg, #14532d, #22c55e, #bbf7d0, #22c55e, #14532d, #22c55e, #bbf7d0, #22c55e, #14532d); animation: flujo 4s linear infinite;
}
@keyframes modal-entra { from { opacity: 0; transform: translateY(46px) scale(.96); } }
@media (min-width: 720px) { @keyframes modal-entra { from { opacity: 0; transform: translateY(24px) scale(.92); } } }
.aviso { position: relative; overflow: hidden; animation: aviso-entra .45s cubic-bezier(.2, .9, .3, 1.3); backdrop-filter: blur(8px); }
.aviso::after { content: ""; position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: var(--exito); transform-origin: left; animation: cuenta-aviso 2.8s linear forwards; }
.aviso.error::after { background: var(--peligro); animation-duration: 5s; }
@keyframes cuenta-aviso { to { transform: scaleX(0); } }
@keyframes aviso-entra { from { opacity: 0; transform: translateY(-24px) scale(.9); } }
.aviso .ico { animation: sello .5s cubic-bezier(.2, .9, .3, 1.8) .1s backwards; }

#cargando { background: rgba(10, 36, 19, .6); backdrop-filter: blur(8px); }
.rueda {
    position: relative; width: 72px; height: 72px; border: 3px solid transparent; border-top-color: #22c55e; border-right-color: #bbf7d0;
    box-shadow: 0 0 28px rgba(34, 197, 94, .55); animation: girar 1s linear infinite;
}
.rueda::before, .rueda::after { content: ""; position: absolute; border-radius: 50%; }
.rueda::before { inset: 8px; border: 3px solid transparent; border-bottom-color: #4ade80; border-left-color: #166534; animation: girar-inverso .75s linear infinite; }
.rueda::after { inset: 21px; background: radial-gradient(circle, #ecfdf5 0%, #22c55e 55%, transparent 72%); animation: nucleo 1.2s ease-in-out infinite; }
@keyframes girar-inverso { to { transform: rotate(-360deg); } }
@keyframes nucleo { 50% { transform: scale(.55); opacity: .6; } }

.subir { transition: transform .25s cubic-bezier(.2, .9, .3, 1.5), box-shadow .25s; }
.subir:hover { transform: translateY(-4px); box-shadow: 0 0 22px rgba(34, 197, 94, .6); }

/* ---------- Bienvenida (la crea app.js al entrar desde el login) ---------- */
.bienvenida {
    position: fixed; inset: 0; z-index: 900; display: grid; place-items: center; text-align: center; color: #fff; overflow: hidden;
    background: radial-gradient(900px 600px at 50% 40%, #14532d 0%, #15803d 70%);
    animation: bienvenida-sale .7s cubic-bezier(.7, 0, .2, 1) 1.15s forwards;
}
.bienvenida::before, .bienvenida::after { content: ""; position: absolute; left: 50%; top: 50%; border-radius: 50%; border: 2px solid rgba(34, 197, 94, .55); transform: translate(-50%, -50%) scale(0); animation: onda-bienvenida 1.6s ease-out infinite; width: 200px; height: 200px; }
.bienvenida::after { animation-delay: .5s; }
.bienvenida-in { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 14px; animation: bienvenida-entra .6s cubic-bezier(.2, .9, .3, 1.2) backwards; }
.bienvenida-globo { width: 96px; height: 96px; border-radius: 50%; box-shadow: 0 0 50px rgba(34, 197, 94, .7); animation: girar-suave 6s linear infinite; }
.bienvenida strong { font-size: 1.5rem; letter-spacing: .01em; }
.bienvenida span { color: var(--menta); font-size: .95rem; }
/* ---------- "Orden enviada" (mismo lenguaje visual que la bienvenida) ---------- */
.bienvenida.fija { z-index: 2000; animation: bienvenida-aparece .35s ease-out backwards; }
.bienvenida.orden { z-index: 2000; }
.bienvenida-check { width: 104px; height: 104px; border-radius: 50%; display: grid; place-items: center; background: rgba(34, 197, 94, .12); box-shadow: 0 0 50px rgba(34, 197, 94, .55); }
.bienvenida-check svg { width: 84px; height: 84px; fill: none; stroke: #4ade80; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.bienvenida-check .c { stroke-dasharray: 145; stroke-dashoffset: 145; animation: trazo-check .7s ease-out .1s forwards; }
.bienvenida-check .v { stroke-dasharray: 44; stroke-dashoffset: 44; animation: trazo-check .45s ease-out .6s forwards; }
@keyframes trazo-check { to { stroke-dashoffset: 0; } }
@keyframes bienvenida-aparece { from { opacity: 0; } }
/* ---------- Cierre de sesión ---------- */
.bienvenida.salida { z-index: 2000; background: radial-gradient(900px 600px at 50% 55%, #16a34a 0%, #166534 72%); }
.bienvenida.salida::before, .bienvenida.salida::after { animation-direction: reverse; }
.bienvenida-power { width: 104px; height: 104px; border-radius: 50%; display: grid; place-items: center; background: rgba(34, 197, 94, .1); animation: latido-power 1.4s ease-in-out infinite; }
.bienvenida-power svg { width: 76px; height: 76px; fill: none; stroke: #86efac; stroke-width: 3.2; stroke-linecap: round; filter: drop-shadow(0 0 8px rgba(74, 222, 128, .8)); }
.bienvenida-power .a { stroke-dasharray: 100; stroke-dashoffset: 100; animation: trazo-check .8s ease-out .1s forwards; }
.bienvenida-power .l { stroke-dasharray: 20; stroke-dashoffset: 20; animation: trazo-check .35s ease-out .55s forwards; }
@keyframes latido-power { 0%, 100% { box-shadow: 0 0 20px rgba(34, 197, 94, .35); } 50% { box-shadow: 0 0 60px rgba(34, 197, 94, .8); } }
/* ---------- Animación de mover productos entre mesas ---------- */
.mover-capa { position: fixed; inset: 0; z-index: 2000; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; color: #fff;
    background: radial-gradient(900px 600px at 50% 45%, #14532d 0%, #166534 72%); animation: bienvenida-aparece .3s ease-out backwards; }
.mover-capa strong { font-size: 1.35rem; margin-top: 10px; }
.mover-capa span { color: var(--menta); font-size: .95rem; max-width: 80vw; }
.mover-escena { position: relative; display: flex; align-items: center; justify-content: space-between; width: min(440px, 86vw); height: 120px; }
.mover-mesa { width: 84px; height: 84px; border-radius: 22px; border: 2px solid rgba(74, 222, 128, .7); background: rgba(34, 197, 94, .12); box-shadow: 0 0 30px rgba(34, 197, 94, .35) inset, 0 0 24px rgba(34, 197, 94, .35); position: relative; flex: none; }
.mover-mesa::after { content: ""; position: absolute; left: 50%; top: 50%; width: 36px; height: 36px; transform: translate(-50%, -50%); border-radius: 50%; border: 3px solid #86efac; }
.mover-mesa.origen { animation: mesa-vacia 1.8s ease-in-out both; }
.mover-mesa.destino { animation: mesa-llena 1.8s ease-in-out both; }
.mover-riel { position: absolute; left: 96px; right: 96px; top: 50%; height: 2px; transform: translateY(-50%); background: repeating-linear-gradient(90deg, rgba(134, 239, 172, .55) 0 8px, transparent 8px 16px); background-size: 16px 2px; animation: riel-corre .6s linear infinite; }
.mover-item { position: absolute; left: 0; top: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #bbf7d0, #22c55e 70%); box-shadow: 0 0 14px rgba(74, 222, 128, .9); opacity: 0;
    animation: item-viaja .95s cubic-bezier(.45, 0, .25, 1) calc(.12s + var(--i) * .11s) forwards; }
.mover-capa.todo .mover-item { width: 14px; height: 14px; margin: -7px 0 0 -7px; animation-duration: .8s; }
.mover-capa.todo.listo .mover-escena { animation: escena-sube .55s cubic-bezier(.7, 0, .3, 1) forwards; }
.mover-capa.todo.listo { animation: bienvenida-sale .6s ease-in .05s forwards; }
.mover-capa.sale { animation: bienvenida-sale .6s ease-in forwards; }
@keyframes item-viaja {
    0% { left: 0; opacity: 0; transform: translateY(0) scale(.4); }
    15% { opacity: 1; transform: translateY(var(--alto)) scale(1); }
    85% { opacity: 1; transform: translateY(calc(var(--alto) * -.6)) scale(1); }
    100% { left: 100%; opacity: 0; transform: translateY(0) scale(.3); }
}
@keyframes riel-corre { to { background-position: 16px 0; } }
@keyframes mesa-vacia { 0% { transform: scale(1); } 20% { transform: scale(1.08); } 100% { transform: scale(1); opacity: .75; } }
@keyframes mesa-llena { 0%, 45% { transform: scale(1); } 70% { transform: scale(1.14); box-shadow: 0 0 40px rgba(74, 222, 128, .8) inset, 0 0 50px rgba(74, 222, 128, .8); } 100% { transform: scale(1); } }
@keyframes escena-sube { to { transform: translateY(-20px) scale(1.1); opacity: 0; } }
/* ---------- Filtro de mesas (tarjetas del resumen) ---------- */
.resumen .dato[role="button"] { cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent; transition: transform .2s cubic-bezier(.2, .9, .3, 1.4), box-shadow .25s, border-color .25s; }
.resumen .dato[role="button"]:hover { transform: translateY(-2px); }
.resumen .dato[role="button"]:active { transform: scale(.97); }
.resumen .dato.filtro-activo { box-shadow: 0 0 0 2px #22c55e, 0 8px 26px rgba(34, 197, 94, .35); }
.mesa.filtro-oculta { display: none !important; }
.filtro-vacio { display: none; text-align: center; padding: 30px 12px; color: var(--texto-suave, #5b6b62); font-weight: 600; }
/* ---------- Cuadros HUD del resumen (Mesas / En uso / Disponibles) ---------- */
.resumen .dato {
    --acento: #4ade80; --acento-rgb: 74, 222, 128;
    background: linear-gradient(145deg, #16a34a 0%, #15803d 60%, #166534 100%); border: 0; color: #fff; padding: 16px 16px 14px; border-radius: 16px; overflow: hidden;
    box-shadow: 0 10px 28px rgba(6, 26, 14, .35), 0 0 0 1px rgba(var(--acento-rgb), .18) inset;
}
.resumen .dato:nth-child(2) { --acento: #fb7185; --acento-rgb: 251, 113, 133; }
.resumen .dato:nth-child(3) { --acento: #34d399; --acento-rgb: 52, 211, 153; }
/* borde de luz que gira */
.resumen .dato::after {
    content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1.5px; pointer-events: none; z-index: 2;
    background: conic-gradient(from var(--ang), transparent 0 55%, rgba(var(--acento-rgb), .95) 78%, transparent 100%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
    opacity: .55; transition: opacity .3s;
}
.resumen .dato:hover::after, .resumen .dato.filtro-activo::after { opacity: 1; animation: giro-borde 2.8s linear infinite; }
.resumen .dato::before { background: radial-gradient(220px circle at var(--mx) var(--my), rgba(var(--acento-rgb), .28), transparent 65%); }
.resumen .dato b { color: #fff; font-size: 1.75rem; font-weight: 800; letter-spacing: .01em; text-shadow: 0 0 16px rgba(var(--acento-rgb), .75); position: relative; z-index: 3; }
.resumen .dato small { color: rgba(255, 255, 255, .72); font-weight: 600; position: relative; z-index: 3; }
.resumen .dato-ico, .resumen .dato-ico.verde, .resumen .dato-ico.roja {
    background: rgba(var(--acento-rgb), .12); color: var(--acento); border-radius: 50%; width: 44px; height: 44px; position: relative; z-index: 3;
    box-shadow: 0 0 0 1px rgba(var(--acento-rgb), .55), 0 0 18px rgba(var(--acento-rgb), .45);
}
/* esquinas tipo HUD */
.resumen .dato > div { position: static; }
.resumen .dato.filtro-activo { box-shadow: 0 0 0 1px rgba(var(--acento-rgb), .9), 0 0 34px rgba(var(--acento-rgb), .45), 0 10px 28px rgba(6, 26, 14, .4); transform: translateY(-2px); }
.resumen .dato.filtro-activo::before { background: radial-gradient(260px circle at 50% 0%, rgba(var(--acento-rgb), .34), transparent 70%); opacity: 1; }
@keyframes latido-ico { 0%, 100% { box-shadow: 0 0 0 1px rgba(var(--acento-rgb), .55), 0 0 14px rgba(var(--acento-rgb), .35); } 50% { box-shadow: 0 0 0 1px rgba(var(--acento-rgb), .9), 0 0 26px rgba(var(--acento-rgb), .7); } }
/* ---------- Rendimiento: capas propias para las pantallas de transición y pausa del fondo mientras están ---------- */
.bienvenida, .mover-capa { contain: paint; backface-visibility: hidden; transform: translateZ(0); }
.bienvenida-in, .mover-escena { will-change: transform, opacity; }
html:has(.bienvenida, .mover-capa) body::before, html:has(.bienvenida, .mover-capa) .barra::after, html:has(.bienvenida, .mover-capa) .avatar,
html:has(.bienvenida, .mover-capa) .login-fondo::before, html:has(.bienvenida, .mover-capa) .login-fondo::after, html:has(.bienvenida, .mover-capa) .login-caja::after,
html:has(.bienvenida, .mover-capa) .mesa-estado::before { animation-play-state: paused !important; }

/* Móvil / pantallas táctiles: menos efectos que repintan en cada cuadro (bordes con @property, máscaras, sombras enormes, desenfoques) */
@media (pointer: coarse), (max-width: 720px) {
    .login-fondo { perspective: none; }
    .login-fondo::before { animation: none; width: 90vmax; height: 90vmax; margin: -45vmax 0 0 -45vmax; }
    .login-fondo::after { animation: none; -webkit-mask-image: none; mask-image: none; opacity: .55; }
    .login-caja { transform: none; transition: none; box-shadow: 0 18px 44px rgba(0, 0, 0, .45), 0 0 40px rgba(34, 197, 94, .25); will-change: transform, opacity; }
    .login-caja::after { animation: none; }
    .login-caja.autenticando { box-shadow: 0 18px 44px rgba(0, 0, 0, .45), 0 0 40px rgba(34, 197, 94, .25); }
    @keyframes login-entra { from { opacity: 0; transform: translateY(28px) scale(.96); } }
    .login-logo { filter: none; }
    .modal-fondo { backdrop-filter: none; background: rgba(10, 36, 19, .72); }
    .aviso { backdrop-filter: none; }
    #cargando { backdrop-filter: none; }
    .bienvenida::after { display: none; }
    .bienvenida-globo, .bienvenida-power { box-shadow: 0 0 26px rgba(34, 197, 94, .6); }
    .bienvenida-check { box-shadow: 0 0 26px rgba(34, 197, 94, .5); }
    .resumen .dato::after { animation: none; }
    body:not(.login-fondo)::before { animation: none; }
    .mesa-estado::before, .mesa.en-uso .mesa-estado::before { animation: none; }
}

/* Modo ligero automático (lo activa app.js si la pantalla no da los cuadros que debería): mismas reducciones que en móvil. */
html.perf-baja .login-fondo { perspective: none; }
html.perf-baja .login-fondo::before { animation: none; width: 90vmax; height: 90vmax; margin: -45vmax 0 0 -45vmax; }
html.perf-baja .login-fondo::after { animation: none; -webkit-mask-image: none; mask-image: none; opacity: .55; }
html.perf-baja .login-caja { transform: none; transition: none; box-shadow: 0 18px 44px rgba(0, 0, 0, .45), 0 0 40px rgba(34, 197, 94, .25); will-change: transform, opacity; }
html.perf-baja .login-caja::after { animation: none; }
html.perf-baja .login-caja.autenticando { box-shadow: 0 18px 44px rgba(0, 0, 0, .45), 0 0 40px rgba(34, 197, 94, .25); }
html.perf-baja .login-logo { filter: none; }
html.perf-baja .modal-fondo { backdrop-filter: none; background: rgba(10, 36, 19, .72); }
html.perf-baja .aviso { backdrop-filter: none; }
html.perf-baja #cargando { backdrop-filter: none; }
html.perf-baja .bienvenida::after { display: none; }
html.perf-baja .bienvenida-globo, html.perf-baja .bienvenida-power { box-shadow: 0 0 26px rgba(34, 197, 94, .6); }
html.perf-baja .bienvenida-check { box-shadow: 0 0 26px rgba(34, 197, 94, .5); }
html.perf-baja .resumen .dato::after { animation: none; }
html.perf-baja body:not(.login-fondo)::before { animation: none; }
html.perf-baja .mesa-estado::before, html.perf-baja .mesa.en-uso .mesa-estado::before { animation: none; }

/* ---------- Navegación suave: barra de progreso fina y salida de las animaciones de espera ---------- */
#progreso-suave { position: fixed; left: 0; top: 0; height: 3px; width: 100%; z-index: 3000; pointer-events: none; transform-origin: 0 50%; transform: scaleX(0); opacity: 0;
    background: linear-gradient(90deg, #14532d, #22c55e, #bbf7d0); box-shadow: 0 0 12px rgba(34, 197, 94, .9); will-change: transform, opacity; }
#progreso-suave.activo { opacity: 1; animation: progreso-avanza 6s cubic-bezier(.1, .7, .2, 1) forwards; }
#progreso-suave.fin { opacity: 0; transform: scaleX(1); transition: transform .2s ease-out, opacity .3s ease .15s; }
@keyframes progreso-avanza { 0% { transform: scaleX(.02); } 25% { transform: scaleX(.55); } 100% { transform: scaleX(.92); } }
.bienvenida.fija.fuera { animation: bienvenida-sale .55s cubic-bezier(.7, 0, .2, 1) forwards; pointer-events: none; }
@keyframes bienvenida-entra { from { opacity: 0; transform: scale(.7); } }
@keyframes bienvenida-sale { to { opacity: 0; transform: scale(1.08); visibility: hidden; } }
@keyframes onda-bienvenida { 0% { transform: translate(-50%, -50%) scale(.2); opacity: 1; } 100% { transform: translate(-50%, -50%) scale(5); opacity: 0; } }
@keyframes girar-suave { to { transform: rotate(360deg); } }

/* ---------- Inicio de sesión ---------- */
.login-fondo { position: relative; overflow: hidden; perspective: 1100px; }
.login-fondo::before {
    content: ""; position: absolute; left: 50%; top: 50%; width: 120vmax; height: 120vmax; margin: -60vmax 0 0 -60vmax; pointer-events: none;
    background: conic-gradient(from 0deg, transparent 0 48%, rgba(34, 197, 94, .16) 62%, transparent 78%, rgba(187, 247, 208, .10) 90%, transparent);
    animation: girar-suave 28s linear infinite;
}
.login-fondo::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background:
        radial-gradient(3px 3px at 12% 22%, rgba(187, 247, 208, .9), transparent), radial-gradient(2px 2px at 82% 14%, rgba(187, 247, 208, .8), transparent),
        radial-gradient(3px 3px at 70% 80%, rgba(34, 197, 94, .9), transparent), radial-gradient(2px 2px at 24% 76%, rgba(187, 247, 208, .7), transparent),
        radial-gradient(2px 2px at 92% 52%, rgba(34, 197, 94, .8), transparent), radial-gradient(3px 3px at 6% 54%, rgba(187, 247, 208, .7), transparent),
        linear-gradient(rgba(34, 197, 94, .08) 1px, transparent 1px) 0 0 / 52px 52px, linear-gradient(90deg, rgba(34, 197, 94, .08) 1px, transparent 1px) 0 0 / 52px 52px;
    -webkit-mask-image: radial-gradient(ellipse at 50% 50%, #000 15%, transparent 78%); mask-image: radial-gradient(ellipse at 50% 50%, #000 15%, transparent 78%);
    animation: flota 9s ease-in-out infinite alternate;
}
@keyframes flota { from { transform: translateY(-10px); } to { transform: translateY(12px); } }
.login-caja {
    position: relative; z-index: 1; border: 1px solid rgba(187, 247, 208, .55);
    box-shadow: 0 30px 80px rgba(0, 0, 0, .5), 0 0 70px rgba(34, 197, 94, .28);
    transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .2s ease-out, box-shadow .4s;
    animation: login-entra .9s cubic-bezier(.2, .9, .3, 1.1) backwards;
}
.login-caja::after { opacity: 1; padding: 2.5px; animation: giro-borde 6s linear infinite; }
@keyframes login-entra { from { opacity: 0; transform: translateY(40px) rotateX(14deg) scale(.92); } }
.login-cab { position: relative; overflow: hidden; }
.login-cab::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(260px circle at 50% 0%, rgba(34, 197, 94, .22), transparent 70%); }
.login-logo { animation: logo-cae 1s cubic-bezier(.2, .9, .3, 1.3) .2s backwards; filter: drop-shadow(0 4px 10px rgba(21, 128, 61, .35)); }
@keyframes logo-cae { from { opacity: 0; transform: translateY(-26px) scale(.8); } }
.login-cab h1, .login-cab p { animation: entra-titulo .6s ease .5s backwards; }
.login-cuerpo .campo, .login-cuerpo .btn { animation: campo-entra .6s cubic-bezier(.2, .9, .3, 1) backwards; }
.login-cuerpo .campo:nth-of-type(1) { animation-delay: .55s; }
.login-cuerpo .campo:nth-of-type(2) { animation-delay: .68s; }
.login-cuerpo .btn { animation-delay: .82s; }
@keyframes campo-entra { from { opacity: 0; transform: translateX(-22px); } }
.login-pie { animation: entra-titulo .6s ease 1s backwards; }
.login-caja:has(.alerta-error) { animation: sacudir .5s cubic-bezier(.36, .07, .19, .97); }
@keyframes sacudir { 15%, 85% { transform: translateX(-3px); } 30%, 70% { transform: translateX(6px); } 45%, 55% { transform: translateX(-8px); } }
.login-caja .alerta { animation: aviso-entra .45s cubic-bezier(.2, .9, .3, 1.3); }

/* Botón "Ingresar" mientras se valida: se convierte en un anillo de carga */
.btn.enviando { pointer-events: none; color: transparent !important; }
.btn.enviando .ico { opacity: 0; }
.btn.enviando::before {
    content: ""; position: absolute; left: 50%; top: 50%; width: 24px; height: 24px; margin: -12px 0 0 -12px; border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, .3); border-top-color: #fff; animation: girar .7s linear infinite;
}
.login-caja.autenticando { box-shadow: 0 30px 80px rgba(0, 0, 0, .5), 0 0 110px rgba(34, 197, 94, .6); }
.login-caja.autenticando .login-cuerpo { transition: opacity .3s; opacity: .85; }

/* =====================================================================
   14. NUEVO DISEÑO ("neo") — se enciende con la clase html.estilo-neo
   Idea: un portal de luz verde entre pantallas (lo único llamativo) y el resto
   sobrio, táctil y nítido: botones con relieve, campos con línea de neón,
   tarjetas con esquinas de "visor", estados con luz. Todo con transform/opacity.
   ===================================================================== */

/* ---------- Portal entre pantallas: la página nueva se abre en círculo desde donde se tocó ---------- */
html.estilo-neo::view-transition-old(root) { animation: neo-vt-sale .38s cubic-bezier(.4, 0, .2, 1) both; }
html.estilo-neo::view-transition-new(root) { animation: neo-vt-entra .55s cubic-bezier(.22, 1, .36, 1) both; }
@keyframes neo-vt-sale { to { opacity: .35; transform: scale(.96); } }
@keyframes neo-vt-entra {
    from { clip-path: circle(0 at var(--vt-x, 50%) var(--vt-y, 50%)); }
    to { clip-path: circle(150vmax at var(--vt-x, 50%) var(--vt-y, 50%)); }
}
/* anillo de luz que acompaña al portal (lo crea app.js) */
.neo-anillo { position: fixed; left: 0; top: 0; width: 80px; height: 80px; margin: -40px 0 0 -40px; border-radius: 50%; pointer-events: none; z-index: 2500;
    border: 2px solid rgba(134, 239, 172, .9); box-shadow: 0 0 24px rgba(34, 197, 94, .8), inset 0 0 18px rgba(34, 197, 94, .5);
    transform: translate3d(var(--ax), var(--ay), 0) scale(.2); opacity: 1; animation: neo-anillo .6s cubic-bezier(.22, 1, .36, 1) forwards; will-change: transform, opacity; }
@keyframes neo-anillo { to { transform: translate3d(var(--ax), var(--ay), 0) scale(14); opacity: 0; } }

/* ---------- Botones principales con relieve (se hunden al tocarlos) ---------- */
html.estilo-neo .btn-primario, html.estilo-neo .btn-exito {
    border: 0; box-shadow: 0 5px 0 #15803d, 0 10px 22px rgba(21, 128, 61, .35), inset 0 1px 0 rgba(255, 255, 255, .25);
    transform: translateY(0); transition: transform .12s cubic-bezier(.3, .7, .4, 1), box-shadow .12s;
}
html.estilo-neo .btn-primario:hover, html.estilo-neo .btn-exito:hover { transform: translateY(-2px); box-shadow: 0 7px 0 #15803d, 0 16px 30px rgba(21, 128, 61, .42), inset 0 1px 0 rgba(255, 255, 255, .3); }
html.estilo-neo .btn-primario:active, html.estilo-neo .btn-exito:active { transform: translateY(4px); box-shadow: 0 1px 0 #15803d, 0 4px 10px rgba(21, 128, 61, .3), inset 0 1px 0 rgba(255, 255, 255, .2); transition-duration: .05s; }
html.estilo-neo .btn-peligro { box-shadow: 0 5px 0 #7f1d1d, 0 10px 22px rgba(220, 38, 38, .3); }
html.estilo-neo .btn-peligro:active { transform: translateY(4px); box-shadow: 0 1px 0 #7f1d1d; }
html.estilo-neo .btn-secundario { box-shadow: 0 3px 0 #cfe6d6; }
html.estilo-neo .btn-secundario:active { transform: translateY(2px); box-shadow: 0 1px 0 #cfe6d6; }

/* ---------- Campos: línea de neón que se dibuja desde el centro ---------- */
html.estilo-neo .grupo-icono::after {
    content: ""; position: absolute; left: 12px; right: 12px; bottom: 0; height: 2px; border-radius: 2px; pointer-events: none;
    background: linear-gradient(90deg, transparent, #22c55e, #bbf7d0, #22c55e, transparent);
    transform: scaleX(0); transition: transform .35s cubic-bezier(.22, 1, .36, 1); box-shadow: 0 0 10px rgba(34, 197, 94, .8);
}
html.estilo-neo .grupo-icono:focus-within::after { transform: scaleX(1); }
html.estilo-neo .control { border-radius: 12px; background: #f8fbf9; }
html.estilo-neo .control:focus { background: #fff; }

/* ---------- Login ---------- */
html.estilo-neo .login-caja { border-radius: 26px; }
html.estilo-neo .login-cab { background: linear-gradient(180deg, #fff 0%, #f3faf5 100%); }
html.estilo-neo .login-cab::after {
    content: ""; position: absolute; top: 0; left: -60%; width: 40%; height: 100%; pointer-events: none;
    background: linear-gradient(100deg, transparent, rgba(187, 247, 208, .55), transparent); transform: skewX(-20deg);
    animation: neo-destello 1.4s cubic-bezier(.4, 0, .2, 1) 1.1s 1 both;
}
@keyframes neo-destello { from { left: -60%; } to { left: 130%; } }
html.estilo-neo .login-cab h1 { letter-spacing: -.01em; }

/* ---------- Tarjetas de mesa: esquinas de visor y estado con luz ---------- */
html.estilo-neo .mesa { border-top-width: 0; border-radius: 16px; overflow: hidden; }
html.estilo-neo .mesa > .mesa-cab::before {
    content: ""; position: absolute; left: 0; top: 0; right: 0; height: 4px; background: linear-gradient(90deg, #059669, #34d399, #059669);
}
html.estilo-neo .mesa.en-uso > .mesa-cab::before { background: linear-gradient(90deg, #b91c1c, #fb7185, #b91c1c); box-shadow: 0 0 14px rgba(244, 63, 94, .6); }
html.estilo-neo .mesa .mesa-estado { padding: 3px 9px 3px 7px; border-radius: 999px; background: rgba(5, 150, 105, .09); align-self: flex-start; }
html.estilo-neo .mesa.en-uso .mesa-estado { background: rgba(220, 38, 38, .09); }
html.estilo-neo .mesa.en-uso .mesa-estado::before { box-shadow: 0 0 8px currentColor; }
/* esquinas tipo visor que aparecen al pasar o tocar */
html.estilo-neo .mesa .mesa-cab::after {
    content: ""; position: absolute; inset: 7px; border-radius: 10px; pointer-events: none; opacity: 0; transform: scale(1.06);
    transition: opacity .25s, transform .3s cubic-bezier(.22, 1, .36, 1);
    background:
        linear-gradient(#22c55e, #22c55e) left top / 14px 2px no-repeat, linear-gradient(#22c55e, #22c55e) left top / 2px 14px no-repeat,
        linear-gradient(#22c55e, #22c55e) right top / 14px 2px no-repeat, linear-gradient(#22c55e, #22c55e) right top / 2px 14px no-repeat,
        linear-gradient(#22c55e, #22c55e) left bottom / 14px 2px no-repeat, linear-gradient(#22c55e, #22c55e) left bottom / 2px 14px no-repeat,
        linear-gradient(#22c55e, #22c55e) right bottom / 14px 2px no-repeat, linear-gradient(#22c55e, #22c55e) right bottom / 2px 14px no-repeat;
}
html.estilo-neo .mesa.en-uso .mesa-cab::after { filter: hue-rotate(-140deg) saturate(1.4); }
html.estilo-neo .mesa:not(.deshabilitada):hover .mesa-cab::after, html.estilo-neo .mesa:active .mesa-cab::after, html.estilo-neo .mesa:focus-visible .mesa-cab::after { opacity: 1; transform: scale(1); }
html.estilo-neo .mesa .mesa-cab { position: static; }
html.estilo-neo .mesa:not(.deshabilitada):active { transform: scale(.95); transition-duration: .08s; }

/* ---------- Categorías y productos ---------- */
html.estilo-neo .categoria { border-radius: 18px; }
html.estilo-neo .categoria-ico { border-radius: 16px; }
html.estilo-neo .producto { border-radius: 16px; }
html.estilo-neo .producto-mas { box-shadow: 0 3px 0 #15803d; transition: transform .12s, box-shadow .12s; }
html.estilo-neo .producto:active .producto-mas { transform: translateY(2px) scale(.92); box-shadow: 0 1px 0 #15803d; }

/* ---------- Pestañas Orden / Servido / Menú / Otros ---------- */
html.estilo-neo .vistas { background: rgba(207, 230, 214, .7); border-radius: 16px; }
html.estilo-neo .vistas-ind { border-radius: 12px; box-shadow: 0 4px 14px rgba(15, 23, 42, .14), 0 0 0 1.5px rgba(34, 197, 94, .6), 0 0 22px rgba(34, 197, 94, .28); }
html.estilo-neo .vistas-ind::after { content: ""; position: absolute; left: 22%; right: 22%; bottom: 4px; height: 2px; border-radius: 2px; background: #22c55e; box-shadow: 0 0 8px #22c55e; }

/* ---------- Líneas de orden y cuenta ---------- */
html.estilo-neo .linea-cant { border-radius: 10px; background: linear-gradient(135deg, #dcfce7, #bbf7d0); color: #14532d; box-shadow: inset 0 0 0 1px rgba(21, 128, 61, .18); }
html.estilo-neo .linea { position: relative; }
html.estilo-neo .linea::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: #22c55e; transform: scaleY(0); transition: transform .25s cubic-bezier(.22, 1, .36, 1); }
html.estilo-neo .linea:hover::before { transform: scaleY(1); }

/* ---------- Ventanas y avisos ---------- */
html.estilo-neo .modal-caja { border-radius: 24px 24px 0 0; }
@media (min-width: 720px) { html.estilo-neo .modal-caja { border-radius: 24px; } }
html.estilo-neo .aviso { border-left: 0; border-radius: 16px; padding-left: 18px; }
html.estilo-neo .aviso::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: linear-gradient(180deg, #22c55e, #15803d); box-shadow: 0 0 12px rgba(34, 197, 94, .7); }

/* ---------- Sensación de aplicación nativa (no de página web) ---------- */
html { background: #15803d; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { overscroll-behavior: none; }                       /* sin "jalar para recargar" ni rebote que muestre el fondo del navegador */
body { -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; touch-action: manipulation; }   /* sin destello azul, sin menú al mantener, sin zoom por doble toque */
/* En la interfaz no se selecciona texto por accidente; en campos y en textos largos sí. */
.barra, .vistas, .btn, .pildora, .mesa, .categoria, .producto, .opcion-otro, .dato, .linea-acciones, .stepper, .caja-cant, .chip label, .modal-pie, .neo-panel { -webkit-user-select: none; user-select: none; }
input, textarea, select, .control, [contenteditable] { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
img { -webkit-user-drag: none; user-select: none; }
a { -webkit-user-drag: none; }
:focus:not(:focus-visible) { outline: none; }
/* Barras de desplazamiento finas como en una app */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: rgba(21, 128, 61, .45); border-radius: 6px; }
::-webkit-scrollbar-track { background: transparent; }
@media (pointer: coarse) { ::-webkit-scrollbar { width: 0; height: 0; } }

/* ---------- Panel para comparar diseños (solo aparece con ?disenio=1) ---------- */
.neo-panel { position: fixed; left: 12px; bottom: 12px; z-index: 2600; display: flex; gap: 4px; padding: 4px; border-radius: 999px;
    background: rgba(10, 36, 19, .92); box-shadow: 0 8px 24px rgba(0, 0, 0, .35), 0 0 0 1px rgba(134, 239, 172, .35); font: 700 12px/1 system-ui, sans-serif; }
.neo-panel button { border: 0; border-radius: 999px; padding: 8px 12px; background: transparent; color: #bbf7d0; cursor: pointer; }
.neo-panel button.on { background: #22c55e; color: #052e16; }

@media (max-width: 719px) {
    .neo-panel { bottom: calc(12px + env(safe-area-inset-bottom)); }
    body:has(.con-vistas) .neo-panel { bottom: calc(var(--alto-vistas) + 22px + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) {
    html.estilo-neo::view-transition-old(root), html.estilo-neo::view-transition-new(root) { animation: none !important; }
    .neo-anillo { display: none; }
}

/* ---------- Sin barra de carga arriba: la app nunca debe parecer una página cargando ---------- */
#progreso-suave { display: none !important; }

/* ---------- Mesas: al pasar el cursor solo un realce sutil (sin borde giratorio, foco, esquinas ni giro del icono) ---------- */
.mesa::before, .mesa::after, html.estilo-neo .mesa .mesa-cab::after { display: none !important; }
.mesa:not(.deshabilitada):hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(10, 36, 19, .12); border-color: rgba(34, 197, 94, .45); }
.mesa.en-uso:not(.deshabilitada):hover { border-color: rgba(220, 38, 38, .35); }
.mesa:hover .mesa-ico { transform: none; }
.mesa { transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.mesa:not(.deshabilitada):active { transform: scale(.97); transition-duration: .08s; }

/* ---------- Ventana que sigue abierta tras una acción: no se vuelve a animar; solo los datos nuevos aparecen suaves ---------- */
.modal.modal-quieto .modal-fondo, .modal.modal-quieto .modal-caja { animation: none !important; }
.dato-nuevo { animation: dato-nuevo .55s cubic-bezier(.22, 1, .36, 1) both; }
input.dato-nuevo, select.dato-nuevo, textarea.dato-nuevo { animation: campo-nuevo 1s ease-out both; }
@keyframes dato-nuevo { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes campo-nuevo { 0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); background-color: #fff; } 25% { box-shadow: 0 0 0 4px rgba(34, 197, 94, .25); background-color: #f0fdf4; } 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); } }

/* ---------- Etiqueta "FE" tocable en la lista de mesas ---------- */
.mesa .fe-editable { cursor: pointer; z-index: 3; padding: 6px 10px; min-width: 40px; text-align: center; transition: transform .15s ease, box-shadow .2s ease, background-color .2s; }
.mesa .fe-editable::after { content: ""; position: absolute; inset: -8px; }    /* área de toque más grande para el dedo */
.mesa .fe-editable:hover { transform: translateY(-1px); box-shadow: 0 0 0 2px rgba(34, 197, 94, .35), 0 4px 10px rgba(21, 128, 61, .25); }
.mesa .fe-editable:active { transform: scale(.92); }
.mesa .fe-editable:focus-visible { outline: 2px solid #22c55e; outline-offset: 2px; }

/* ---------- Pestañas de ubicación: se deslizan con el dedo o la rueda, sin barra visible ---------- */
.pildoras { scrollbar-width: none; -ms-overflow-style: none; scroll-snap-type: x proximity; padding-bottom: 6px; }
.pildoras::-webkit-scrollbar { display: none; width: 0; height: 0; }
.pildoras > * { scroll-snap-align: start; flex-shrink: 0; }

/* Pestañas de ubicación: se deslizan con el dedo, sin la barra de desplazamiento verde debajo */
.pildoras { scrollbar-width: none; -ms-overflow-style: none; padding-bottom: 4px; }
.pildoras::-webkit-scrollbar { display: none; width: 0; height: 0; }

/* ---------- Estado en tiempo real: la tarjeta que cambia "late" una vez ---------- */
.mesa.vivo-cambio { animation: vivo-mesa .95s cubic-bezier(.22, 1, .36, 1); }
.mesa.en-uso.vivo-cambio { animation-name: vivo-mesa-uso; }
.mesa.vivo-cambio .mesa-estado { animation: vivo-pop .6s cubic-bezier(.22, 1, .36, 1); }
.resumen .dato b.vivo-cambio { display: inline-block; animation: vivo-pop .6s cubic-bezier(.22, 1, .36, 1); }
@keyframes vivo-mesa { 0% { transform: scale(1); } 20% { transform: scale(.95); } 50% { transform: scale(1.03); box-shadow: 0 0 0 4px rgba(34, 197, 94, .45), 0 12px 28px rgba(21, 128, 61, .25); } 100% { transform: none; } }
@keyframes vivo-mesa-uso { 0% { transform: scale(1); } 20% { transform: scale(.95); } 50% { transform: scale(1.03); box-shadow: 0 0 0 4px rgba(244, 63, 94, .45), 0 12px 28px rgba(185, 28, 28, .22); } 100% { transform: none; } }
@keyframes vivo-pop { 0% { transform: scale(.6); opacity: .2; } 60% { transform: scale(1.12); opacity: 1; } 100% { transform: none; } }

/* ---------- Orden compartida en tiempo real: producto nuevo y contador ---------- */
.linea.linea-nueva { animation: linea-nueva .8s cubic-bezier(.22, 1, .36, 1); }
@keyframes linea-nueva {
    0% { opacity: 0; transform: translateY(-8px); background-color: rgba(34, 197, 94, .18); }
    35% { opacity: 1; transform: none; background-color: rgba(34, 197, 94, .16); }
    100% { background-color: transparent; }
}
.vista .contador.vivo-cambio { animation: vivo-pop .6s cubic-bezier(.22, 1, .36, 1); }

/* El selector de diseño nunca tapa una ventana abierta ni una animación */
body:has(.modal.abierto) .neo-panel, body:has(.bienvenida) .neo-panel, body:has(.mover-capa) .neo-panel { display: none; }

/* =====================================================================
   Selector de ubicación (SALON / CORRAL / Personales / Todas) como control segmentado:
   un riel suave con las opciones repartidas a lo ancho y la elegida en blanco, como en una app.
   Si no caben, se deslizan con el dedo (sin barra visible). Igual en Inicio y en Mover.
   ===================================================================== */
.pildoras {
    display: flex; gap: 4px; padding: 4px; margin: 0 0 16px; border-radius: 16px; overflow-x: auto;
    background: rgba(207, 230, 214, .72); box-shadow: inset 0 0 0 1px rgba(21, 128, 61, .14);
    scroll-snap-type: x proximity; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.pildoras::-webkit-scrollbar { display: none; }
.pildora, .pildora:hover, .pildora.activa, .pildora.activa:hover {
    flex: 1 0 auto; justify-content: center; gap: 7px; min-height: 42px; padding: 0 14px; border: 0; border-radius: 12px;
    font-size: .88rem; font-weight: 700; letter-spacing: .01em; transform: none; scroll-snap-align: start;
}
.pildora { background: transparent; background-image: none; color: #14532d; box-shadow: none;
    transition: background-color .2s ease, color .2s ease, box-shadow .25s ease; }
.pildora .ico { width: 16px; height: 16px; opacity: .7; transition: opacity .2s, transform .25s cubic-bezier(.22, 1, .36, 1); }
.pildora:hover { background: rgba(255, 255, 255, .55); color: #15803d; box-shadow: none; }
.pildora.activa { background: #fff; background-image: none; color: #15803d;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .12), 0 0 0 1.5px rgba(34, 197, 94, .55); }
.pildora.activa .ico { opacity: 1; transform: scale(1.08); }
.pildora:active { background: rgba(255, 255, 255, .8); }
.pildora .onda { background: rgba(34, 197, 94, .25); }
@media (max-width: 480px) {
    .pildora, .pildora:hover, .pildora.activa, .pildora.activa:hover { padding: 0 10px; gap: 5px; font-size: .82rem; min-height: 40px; }
    .pildora .ico { width: 14px; height: 14px; }
}
.pildora.activa:hover, .pildora.activa:focus { background: #fff; color: #15803d; }
/* Con muchas ubicaciones: el riel se desvanece en el borde por donde hay más opciones para deslizar */
.pildoras.desliza-der { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent); }
.pildoras.desliza-izq { -webkit-mask-image: linear-gradient(90deg, transparent, #000 36px); mask-image: linear-gradient(90deg, transparent, #000 36px); }
.pildoras.desliza-izq.desliza-der { -webkit-mask-image: linear-gradient(90deg, transparent, #000 36px, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(90deg, transparent, #000 36px, #000 calc(100% - 36px), transparent); }
.pildoras { scroll-behavior: smooth; }

/* Ubicación debajo del nombre en la vista "Todas" */
.mesa-ubic { margin-top: -6px; font-size: .74rem; font-weight: 700; letter-spacing: .02em; color: var(--suave, #64748b); text-transform: uppercase; }

/* ---------- Sin saltos: el espacio de la barra de desplazamiento siempre está reservado (la página no se
   corre de lado cuando una pantalla es más corta o más larga) y nunca hay desplazamiento horizontal ---------- */
html { scrollbar-gutter: stable; overflow-x: hidden; overflow-x: clip; }   /* recorta las capas decorativas del fondo (en el celular no deben ensanchar la página) sin bloquear la rueda del mouse */
body { overflow-x: clip; max-width: 100%; }   /* clip: recorta sin volverse contenedor de scroll (la rueda del mouse sigue moviendo la página) */
.contenedor, main { min-width: 0; }
img, svg, video { max-width: 100%; }
/* Pantalla nueva dentro de la mesa (Orden ↔ Menú, categorías ↔ productos): entra con un fundido corto */
.pantalla-entra { animation: pantalla-entra .26s cubic-bezier(.22, 1, .36, 1) both; }
@keyframes pantalla-entra { from { opacity: 0; transform: translate3d(0, 6px, 0); } }

/* ---------- Búsqueda en todo el menú ---------- */
.buscador-menu .grupo-icono { position: relative; flex: 1; }
.buscador-menu .grupo-icono .control { padding-right: 44px; }
.btn-limpiar { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; display: grid; place-items: center;
    border-radius: 10px; color: var(--suave, #64748b); }
.btn-limpiar:hover { background: rgba(21, 128, 61, .08); color: #15803d; }
.btn-limpiar .ico { width: 18px; height: 18px; }
.resultados-resumen { margin: 4px 2px 12px; font-size: .86rem; font-weight: 700; color: var(--suave, #64748b); min-height: 1em; }
.grupo-resultado { margin-bottom: 18px; }
.grupo-cab { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 4px 10px; border: 0; background: none; color: var(--texto, #0f172a); text-align: left; cursor: pointer; }
.grupo-cab .categoria-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--t-bg, #dcfce7); color: var(--t-fg, #15803d); flex: none; }
.grupo-cab .categoria-ico .ico { width: 18px; height: 18px; }
.grupo-nombre { font-weight: 800; font-size: 1rem; }
.grupo-cuenta { margin-left: auto; font-size: .78rem; font-weight: 700; color: var(--suave, #64748b); background: rgba(21, 128, 61, .08); padding: 3px 10px; border-radius: 999px; }
.grupo-cab:hover .grupo-nombre { color: #15803d; text-decoration: underline; text-underline-offset: 3px; }
.producto mark { background: rgba(34, 197, 94, .22); color: inherit; border-radius: 4px; padding: 0 2px; }

/* ---------- Menú en pantallas grandes: tarjetas tranquilas, igual de limpias que en el celular ----------
   Al pasar el cursor solo un realce sutil (sin borde giratorio, halo, giro del icono ni "+" girando). */
.categoria::before, .categoria::after, .producto::before, .producto::after, .opcion-otro::before, .opcion-otro::after { display: none !important; }
.categoria, .producto, .opcion-otro { transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.categoria:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(10, 36, 19, .12); border-color: var(--t-fg); }
.producto:hover { transform: none; box-shadow: 0 6px 16px rgba(10, 36, 19, .10); border-color: var(--primario); }
.opcion-otro:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(10, 36, 19, .12); border-color: var(--primario); }
.categoria:hover .categoria-ico, .opcion-otro:hover .categoria-ico, .producto:hover .categoria-ico { transform: none; box-shadow: none; }
.producto:hover .producto-mas { transform: none; box-shadow: none; }
.categoria:active, .producto:active, .opcion-otro:active { transform: scale(.98); transition-duration: .08s; }

/* Movimiento reducido: sin animaciones (ya estaba, se repite para que gane a todo lo anterior) */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
    .vistas.con-ind .vista.activa { background: #fff; }
    .vistas-ind { display: none; }
    @view-transition { navigation: none; }
}

/* ---------- Instalar como aplicación (pantalla de ingreso) ---------- */
.btn-instalar { margin-top: 12px; }
.btn-instalar .ico { width: 20px; height: 20px; }
.inst-nota { color: var(--suave); font-size: .92rem; line-height: 1.5; margin: 0 0 14px; }
.inst-nota b { color: var(--texto); }
.inst-pasos { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.inst-pasos li { display: grid; grid-template-columns: 30px 1fr; gap: 12px; align-items: start; font-size: .95rem; line-height: 1.5; }
.inst-num { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--primario-claro); color: var(--primario-osc); font-weight: 800; font-size: .9rem; }
.inst-accion { display: flex; width: 100%; margin-top: 8px; word-break: break-all; text-align: center; }

/* =====================================================================================
   15. AYUDA, MANUAL Y CAPACITACIÓN (ayuda.js)
   ===================================================================================== */
html.ayuda-abierta, html.practica-abierta { overflow: hidden; }
html.ayuda-abierta .neo-panel, html.practica-abierta .neo-panel { display: none !important; }

/* Botón "?" en la barra, en el ingreso y en las ventanas */
.btn-ayuda .ico { width: 20px; height: 20px; }
.modal-cab .btn-ayuda-modal { margin-left: auto; font-weight: 800; font-size: 1.05rem; color: var(--primario-osc); }
.modal-cab .btn-ayuda-modal + [data-cerrar] { margin-left: 0; }
.btn-ayuda-login { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin-top: 10px; padding: 10px; border: 0; background: none; color: var(--primario-osc); font: inherit; font-weight: 700; font-size: .92rem; cursor: pointer; border-radius: 10px; transition: background .2s; }
.btn-ayuda-login:hover { background: var(--primario-claro); }
.btn-ayuda-login .ico { width: 18px; height: 18px; }

/* ---------- Panel del manual ---------- */
#ayuda { position: fixed; inset: 0; z-index: 390; display: none; }
#ayuda.visible { display: block; }
.ayuda-fondo { position: absolute; inset: 0; background: rgba(6, 26, 14, .5); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); opacity: 0; transition: opacity .32s ease; }
#ayuda.abierto .ayuda-fondo { opacity: 1; }
.ayuda-hoja { position: absolute; top: 0; right: 0; bottom: 0; width: min(500px, 100%); display: flex; flex-direction: column; background: var(--fondo); box-shadow: -24px 0 70px rgba(4, 20, 10, .32); transform: translate3d(104%, 0, 0); transition: transform .44s cubic-bezier(.22, 1, .36, 1); will-change: transform; }
#ayuda.abierto .ayuda-hoja { transform: none; }
.ayuda-cab { flex: 0 0 auto; padding: calc(16px + env(safe-area-inset-top)) 18px 16px; color: #fff; background: radial-gradient(520px 220px at 0% 0%, rgba(34, 197, 94, .35), transparent 60%), linear-gradient(150deg, #16a34a 0%, #15803d 70%); }
.ayuda-cab-fila { display: flex; align-items: center; gap: 12px; }
.ayuda-cab-ico { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: rgba(34, 197, 94, .18); color: #86efac; box-shadow: inset 0 0 0 1px rgba(134, 239, 172, .3); }
.ayuda-cab-ico .ico { width: 24px; height: 24px; }
.ayuda-cab-txt { flex: 1 1 auto; min-width: 0; }
.ayuda-cab h2 { font-size: 1.2rem; line-height: 1.2; color: #fff; }
.ayuda-donde { margin-top: 3px; font-size: .82rem; color: #bbf7d0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ayuda-cerrar { flex: 0 0 auto; width: 42px; height: 42px; display: grid; place-items: center; border: 0; border-radius: 12px; background: rgba(255, 255, 255, .1); color: #fff; cursor: pointer; transition: background .2s, transform .15s; }
.ayuda-cerrar:hover { background: rgba(255, 255, 255, .2); }
.ayuda-cerrar:active { transform: scale(.94); }
.ayuda-buscar { position: relative; margin-top: 14px; }
.ayuda-buscar > .ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: #64748b; pointer-events: none; }
.ayuda-buscar-campo { width: 100%; height: 46px; padding: 0 14px 0 42px; border: 0; border-radius: 12px; background: #fff; color: var(--texto); font: inherit; font-size: 16px; box-shadow: 0 6px 18px rgba(0, 0, 0, .18); outline: none; transition: box-shadow .2s; -webkit-appearance: none; appearance: none; }
.ayuda-buscar-campo:focus { box-shadow: 0 0 0 3px rgba(34, 197, 94, .55), 0 6px 18px rgba(0, 0, 0, .18); }
.ayuda-cuerpo { flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 16px 16px calc(24px + env(safe-area-inset-bottom)); }
@media (max-width: 640px) {
    .ayuda-hoja { top: auto; left: 0; width: 100%; height: 94vh; height: 94dvh; border-radius: 22px 22px 0 0; transform: translate3d(0, 104%, 0); box-shadow: 0 -20px 60px rgba(4, 20, 10, .35); overflow: hidden; }
    .ayuda-cab { padding-top: 18px; }
    .ayuda-cab::before { content: ""; display: block; width: 44px; height: 5px; margin: -8px auto 12px; border-radius: 99px; background: rgba(255, 255, 255, .35); }
}

/* Tarjeta "Capacitación guiada" */
.ay-practica { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 14px; padding: 18px; margin-bottom: 18px; border-radius: 18px; color: #fff; background: radial-gradient(400px 200px at 100% 0%, rgba(245, 158, 11, .28), transparent 60%), linear-gradient(140deg, #14532d, #15803d); box-shadow: 0 14px 34px rgba(10, 36, 19, .28); animation: ay-entra .45s cubic-bezier(.22, 1, .36, 1) both; }
.ay-practica h3 { color: #fff; font-size: 1.1rem; margin: 8px 0 4px; }
.ay-practica p { color: #d1fae5; font-size: .9rem; line-height: 1.5; }
.ay-practica p b { color: #fff; }
.ay-practica .btn { align-self: flex-start; }
.ay-practica-sello { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; background: #f59e0b; color: #3b2300; font-size: .74rem; font-weight: 800; }

/* Secciones y temas (acordeón) */
.ay-seccion { margin-bottom: 18px; }
.ay-seccion-tit { display: flex; align-items: center; gap: 8px; margin: 0 4px 10px; font-size: .86rem; font-weight: 800; color: var(--primario-osc); }
.ay-seccion-tit .ico { width: 16px; height: 16px; }
.ay-aqui { padding: 12px; margin-left: -4px; margin-right: -4px; border-radius: 18px; background: rgba(34, 197, 94, .1); box-shadow: inset 0 0 0 1px rgba(34, 197, 94, .28); }
.ay-tema { background: #fff; border: 1px solid var(--linea); border-radius: 16px; margin-bottom: 10px; transition: box-shadow .25s, border-color .25s; animation: ay-entra .4s cubic-bezier(.22, 1, .36, 1) both; }
.ay-tema:last-child { margin-bottom: 0; }
.ay-tema.abierto { border-color: var(--linea-fuerte); box-shadow: 0 10px 26px rgba(10, 36, 19, .1); }
.ay-tema-cab { width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 0; background: none; color: var(--texto); font: inherit; font-weight: 700; font-size: .98rem; text-align: left; cursor: pointer; border-radius: 16px; }
.ay-tema-ico { flex: 0 0 auto; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--t-bg, var(--primario-claro)); color: var(--t-fg, var(--primario)); }
.ay-tema-ico .ico { width: 20px; height: 20px; }
.ay-tema-titulo { flex: 1 1 auto; }
.ay-chev { flex: 0 0 auto; color: var(--suave); transition: transform .35s cubic-bezier(.22, 1, .36, 1); }
.ay-chev .ico { width: 18px; height: 18px; }
.ay-tema.abierto .ay-chev { transform: rotate(180deg); }
.ay-tema-cuerpo { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .4s cubic-bezier(.22, 1, .36, 1); }
.ay-tema.abierto .ay-tema-cuerpo { grid-template-rows: 1fr; }
.ay-tema-in { overflow: hidden; min-height: 0; }
.ay-tema-pad { padding: 2px 16px 16px; opacity: 0; transform: translate3d(0, -4px, 0); transition: opacity .3s ease, transform .35s ease; }
.ay-tema.abierto .ay-tema-pad { opacity: 1; transform: none; transition-delay: .06s; }
.ay-intro { color: #334155; font-size: .93rem; line-height: 1.55; margin-bottom: 12px; }
.ay-pasos { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 10px; }
.ay-pasos li { display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: start; font-size: .93rem; line-height: 1.5; color: var(--texto); }
.ay-tema.abierto .ay-pasos li { animation: ay-entra .4s cubic-bezier(.22, 1, .36, 1) both; animation-delay: calc(.08s + var(--n, 0) * .05s); }
.ay-num { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--primario); color: #fff; font-weight: 800; font-size: .82rem; box-shadow: 0 4px 10px rgba(21, 128, 61, .3); }
.ay-nota { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; margin-top: 8px; border-radius: 12px; background: var(--aviso-claro); color: #78350f; font-size: .88rem; line-height: 1.5; }
.ay-nota .ico { flex: 0 0 auto; width: 18px; height: 18px; margin-top: 2px; color: var(--aviso); }
.ay-faq { display: grid; gap: 8px; }
.ay-faq-item { padding: 10px 12px; border-radius: 12px; background: #f8fafc; border: 1px solid var(--linea); }
.ay-faq-item strong { display: block; font-size: .92rem; margin-bottom: 4px; }
.ay-faq-item p { font-size: .88rem; color: #475569; line-height: 1.5; }
.ay-acciones { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.ay-vacio { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 40px 16px; color: var(--suave); animation: ay-entra .35s ease both; }
.ay-vacio .ico { width: 34px; height: 34px; color: var(--linea-fuerte); }
.ay-vacio strong { color: var(--texto); }
.ay-pie { text-align: center; font-size: .82rem; color: var(--suave); margin-top: 8px; }
@keyframes ay-entra { from { opacity: 0; transform: translate3d(0, 8px, 0); } }

/* Captura animada con marco de teléfono */
.ay-captura { margin: 4px 0 16px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.ay-dispositivo { position: relative; }
.ay-pantalla { position: relative; overflow: hidden; background: var(--fondo); transition: height .4s cubic-bezier(.22, 1, .36, 1), opacity .25s ease; }
.ay-pantalla.cambiando { opacity: 0; }
.ay-telefono { width: 244px; padding: 22px 8px 16px; border-radius: 34px; background: linear-gradient(160deg, #1f2937, #0b1410); box-shadow: 0 18px 40px rgba(4, 20, 10, .32), inset 0 0 0 1px rgba(255, 255, 255, .08); }
.ay-telefono::before { content: ""; position: absolute; top: 9px; left: 50%; width: 46px; height: 5px; margin-left: -23px; border-radius: 99px; background: #374151; z-index: 2; }
.ay-telefono::after { content: ""; position: absolute; bottom: 6px; left: 50%; width: 70px; height: 4px; margin-left: -35px; border-radius: 99px; background: #374151; }
.ay-telefono .ay-pantalla { width: 228px; border-radius: 26px; }
.ay-monitor { width: 100%; max-width: 440px; padding: 10px 10px 14px; margin-bottom: 22px; border-radius: 14px; background: linear-gradient(170deg, #1f2937, #0b1410); box-shadow: 0 18px 40px rgba(4, 20, 10, .3), inset 0 0 0 1px rgba(255, 255, 255, .08); }
.ay-monitor::before { content: ""; position: absolute; bottom: 5px; left: 50%; width: 5px; height: 5px; margin-left: -2px; border-radius: 50%; background: #475569; }
.ay-monitor::after { content: ""; position: absolute; bottom: -18px; left: 50%; width: 110px; height: 18px; margin-left: -55px; border-radius: 0 0 10px 10px; background: linear-gradient(180deg, #111827, #374151); clip-path: polygon(14% 0, 86% 0, 100% 100%, 0 100%); }
.ay-monitor .ay-pantalla { width: 100%; border-radius: 6px; }
.ay-marco { position: absolute; left: 0; top: 0; border: 0; transform-origin: 0 0; pointer-events: none; background: var(--fondo); }
.ay-captura figcaption { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; color: var(--suave); font-weight: 600; }
.ay-captura figcaption .ico { width: 14px; height: 14px; animation: ay-gira 2.4s linear infinite; }
@keyframes ay-gira { to { transform: rotate(360deg); } }

/* ---------- Oferta de la primera vez ---------- */
.ayuda-oferta { position: fixed; z-index: 380; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); width: min(560px, calc(100vw - 24px)); display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 18px; background: #fff; box-shadow: 0 22px 60px rgba(4, 20, 10, .28), 0 0 0 1px rgba(34, 197, 94, .25); transform: translate3d(-50%, 140%, 0); opacity: 0; transition: transform .5s cubic-bezier(.22, 1, .36, 1), opacity .35s ease; }
.ayuda-oferta.visible { transform: translate3d(-50%, 0, 0); opacity: 1; }
.ayuda-oferta-ico { flex: 0 0 auto; width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--primario-claro); color: var(--primario); }
.ayuda-oferta-txt { flex: 1 1 auto; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ayuda-oferta-txt strong { font-size: .98rem; }
.ayuda-oferta-txt span { font-size: .86rem; color: var(--suave); line-height: 1.4; }
.ayuda-oferta-acc { flex: 0 0 auto; display: flex; gap: 8px; }
@media (max-width: 720px) {
    .ayuda-oferta { flex-wrap: wrap; bottom: calc(var(--alto-vistas) + 18px + env(safe-area-inset-bottom)); }
    .ayuda-oferta-txt { flex: 1 1 calc(100% - 64px); }
    .ayuda-oferta-acc { width: 100%; }
    .ayuda-oferta-acc .btn { flex: 1 1 0; }
}

/* ---------- Modo práctica ---------- */
#practica { position: fixed; inset: 0; z-index: 2400; display: none; flex-direction: column; background: #166534; opacity: 0; transition: opacity .32s ease; }
#practica.visible { display: flex; }
#practica.abierto { opacity: 1; }
#practica.preguntando { z-index: 190; }
.practica-banda { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; padding: calc(8px + env(safe-area-inset-top)) 12px 8px; color: #fff; background: linear-gradient(90deg, #15803d, #14532d); box-shadow: 0 4px 16px rgba(0, 0, 0, .3); position: relative; z-index: 4; }
.practica-sello { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 99px; background: #f59e0b; color: #3b2300; font-size: .76rem; font-weight: 800; }
.practica-sello .ico { width: 14px; height: 14px; }
.practica-aviso-txt { flex: 1 1 auto; min-width: 0; font-size: .82rem; color: #bbf7d0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.practica-link { border: 0; background: none; color: #fff; font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; padding: 0; }
.practica-salir { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border: 0; border-radius: 10px; background: rgba(255, 255, 255, .12); color: #fff; font: inherit; font-weight: 700; font-size: .86rem; cursor: pointer; transition: background .2s; }
.practica-salir:hover { background: rgba(255, 255, 255, .22); }
.practica-salir .ico { width: 16px; height: 16px; }
.practica-marco { flex: 1 1 auto; position: relative; }
.practica-iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: var(--fondo); }
.tour-bloq { position: fixed; z-index: 5; background: transparent; }
.tour-foco { position: fixed; z-index: 6; pointer-events: none; border-radius: 14px; box-shadow: 0 0 0 200vmax rgba(3, 16, 8, .56), 0 0 0 3px #22c55e, 0 0 26px 4px rgba(34, 197, 94, .5); transition: top .45s cubic-bezier(.22, 1, .36, 1), left .45s cubic-bezier(.22, 1, .36, 1), width .45s cubic-bezier(.22, 1, .36, 1), height .45s cubic-bezier(.22, 1, .36, 1), box-shadow .3s ease; }
.tour-foco.sin-objetivo { box-shadow: 0 0 0 200vmax rgba(3, 16, 8, .56); }
.tour-foco.espera { animation: tour-pulso 1.7s ease-in-out infinite; }
.tour-foco.logrado { box-shadow: 0 0 0 200vmax rgba(3, 16, 8, .4), 0 0 0 4px #4ade80, 0 0 40px 10px rgba(74, 222, 128, .75); animation: none; }
@keyframes tour-pulso { 50% { box-shadow: 0 0 0 200vmax rgba(3, 16, 8, .56), 0 0 0 6px rgba(34, 197, 94, .9), 0 0 38px 10px rgba(34, 197, 94, .45); } }
#practica.libre .tour-foco, #practica.libre .tour-globo, #practica.libre .tour-bloq { display: none; }
.tour-globo { position: fixed; z-index: 7; top: 50%; left: 50%; width: 360px; padding: 16px 16px 14px; border-radius: 18px; background: #fff; color: var(--texto); box-shadow: 0 26px 70px rgba(0, 0, 0, .4), 0 0 0 1px rgba(34, 197, 94, .2); opacity: 0; visibility: hidden; transition: top .45s cubic-bezier(.22, 1, .36, 1), left .45s cubic-bezier(.22, 1, .36, 1), opacity .25s ease, visibility .25s; }
.tour-globo.visible { opacity: 1; visibility: visible; }
.tour-globo.entra > * { animation: ay-entra .38s cubic-bezier(.22, 1, .36, 1) both; }
.tour-globo.entra > :nth-child(2) { animation-delay: .03s; }
.tour-globo.entra > :nth-child(3) { animation-delay: .06s; }
.tour-cab { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.tour-cap { font-size: .74rem; font-weight: 800; color: var(--primario); background: var(--primario-claro); padding: 3px 9px; border-radius: 99px; }
.tour-num { font-size: .76rem; color: var(--suave); font-weight: 600; }
.tour-globo h4 { font-size: 1.05rem; margin-bottom: 6px; }
.tour-globo p { font-size: .93rem; line-height: 1.5; color: #334155; }
.tour-hagalo { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-weight: 700; color: var(--primario-osc) !important; font-size: .86rem !important; }
.tour-hagalo .ico { width: 16px; height: 16px; animation: tour-salta 1.2s ease-in-out infinite; }
@keyframes tour-salta { 50% { transform: translateY(-3px); } }
.tour-barra { height: 4px; margin: 12px 0; border-radius: 99px; background: #e2e8f0; overflow: hidden; }
.tour-barra span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #16a34a, #22c55e); transition: width .5s cubic-bezier(.22, 1, .36, 1); }
.tour-acciones { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.tour-acciones .btn .ico { width: 16px; height: 16px; }
.tour-final { flex-direction: column; align-items: stretch; }
.tour-fila { display: flex; gap: 8px; }
.tour-fila .btn { flex: 1 1 0; }
@media (max-width: 640px) {
    .practica-aviso-txt { font-size: .74rem; }
    .tour-globo { padding: 14px; }
}
html.perf-baja .tour-foco, html.perf-baja .tour-foco.espera { animation: none; box-shadow: 0 0 0 200vmax rgba(3, 16, 8, .56), 0 0 0 3px #22c55e; }
html.perf-baja .ayuda-fondo { -webkit-backdrop-filter: none; backdrop-filter: none; }
@media (prefers-reduced-motion: reduce) {
    .ay-captura figcaption .ico, .tour-foco.espera, .tour-hagalo .ico { animation: none !important; }
}

/* ---------- Conexión segura: aviso en el ingreso y comprobación ---------- */
.banda-segura { display: flex; align-items: center; gap: 12px; padding: 12px; margin-bottom: 16px; border-radius: 14px; background: var(--aviso-claro); box-shadow: inset 0 0 0 1px rgba(217, 119, 6, .25); animation: ay-entra .4s cubic-bezier(.22, 1, .36, 1) both; }
.banda-segura.reinstalar { background: var(--primario-claro); box-shadow: inset 0 0 0 1px rgba(21, 128, 61, .25); }
.banda-segura > div { flex: 1 1 auto; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.banda-segura strong { font-size: .9rem; }
.banda-segura span { font-size: .8rem; color: #64748b; line-height: 1.4; }
.banda-segura-ico { flex: 0 0 auto; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: #fff; color: var(--aviso); }
.banda-segura.reinstalar .banda-segura-ico { color: var(--primario); }
.banda-segura .btn { flex: 0 0 auto; }
.inst-comprobar { margin-top: 18px; }
.inst-resultado { min-height: 1.4em; margin-top: 10px; font-size: .9rem; font-weight: 600; text-align: center; color: var(--suave); transition: color .25s; }
.inst-resultado.ok { color: var(--exito); }
.inst-resultado.error { color: var(--peligro); }
.inst-accion .ico { width: 16px; height: 16px; }

/* =====================================================================================
   16. IDIOMAS (i18n.js)
   ===================================================================================== */
/* Mientras se aplica el idioma elegido la página espera oculta (nunca se ve otro idioma). */
html.i18n-espera body { opacity: 0 !important; }
body { transition: opacity .22s ease; }

/* Fuentes para chino y árabe (las del sistema operativo, sin descargas). */
html[lang="zh-Hans"] body { font-family: system-ui, -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Segoe UI", sans-serif; }
html[lang="ar"] body { font-family: system-ui, -apple-system, "Segoe UI", "Geeza Pro", "Noto Sans Arabic", "Noto Naskh Arabic", Tahoma, sans-serif; }

/* Botón discreto en el pie y en el ingreso */
.pie-pagina { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.idioma-btn { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px 0 10px; border: 1px solid rgba(21, 128, 61, .22); border-radius: 999px; background: rgba(255, 255, 255, .6); color: #166534; font: inherit; font-size: .8rem; font-weight: 600; letter-spacing: 0; cursor: pointer; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); transition: background .2s, border-color .2s, box-shadow .2s, transform .15s; }
.idioma-btn:hover { background: #fff; border-color: rgba(21, 128, 61, .45); box-shadow: 0 4px 14px rgba(10, 36, 19, .1); }
.idioma-btn:active { transform: scale(.97); }
.idioma-btn .ico { width: 16px; height: 16px; }
.idioma-btn .idioma-chev { width: 14px; height: 14px; opacity: .7; }
.login-pie .idioma-btn { display: flex; width: max-content; margin: 0 auto 12px; background: #f8fafc; }

/* Ventana de idiomas */
.modal-idioma .modal-cab h3 .ico { width: 22px; height: 22px; }
.idioma-lista { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.idioma-opcion { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 14px 40px 14px 14px; border: 1.5px solid var(--linea); border-radius: 14px; background: #fff; color: var(--texto); font: inherit; text-align: start; cursor: pointer; transition: border-color .2s, box-shadow .2s, background .2s, transform .15s; animation: ay-entra .38s cubic-bezier(.22, 1, .36, 1) both; animation-delay: calc(var(--n, 0) * .035s); }
.idioma-opcion:hover { border-color: var(--linea-fuerte); box-shadow: 0 6px 16px rgba(10, 36, 19, .08); }
.idioma-opcion:active { transform: scale(.98); }
.idioma-nativo { font-size: 1.02rem; font-weight: 800; }
.idioma-local { font-size: .8rem; color: var(--suave); }
.idioma-check { position: absolute; top: 50%; inset-inline-end: 12px; width: 24px; height: 24px; margin-top: -12px; border-radius: 50%; display: grid; place-items: center; background: var(--primario); color: #fff; transform: scale(0); transition: transform .3s cubic-bezier(.2, .9, .3, 1.4); }
.idioma-check .ico { width: 14px; height: 14px; }
.idioma-opcion.activo { border-color: var(--primario); background: var(--primario-claro); box-shadow: 0 0 0 3px rgba(34, 197, 94, .18); }
.idioma-opcion.activo .idioma-check { transform: scale(1); }
@media (max-width: 380px) { .idioma-lista { grid-template-columns: 1fr; } }

/* Sello que confirma el idioma elegido */
#idiomaSello { position: fixed; z-index: 3100; left: 50%; top: 50%; display: flex; align-items: center; gap: 10px; padding: 14px 22px; border-radius: 999px; background: rgba(10, 36, 19, .92); color: #fff; font-weight: 800; font-size: 1.05rem; box-shadow: 0 20px 50px rgba(0, 0, 0, .35); pointer-events: none; opacity: 0; transform: translate(-50%, -50%) scale(.85); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
#idiomaSello .ico { width: 22px; height: 22px; color: #86efac; }
#idiomaSello.visible { animation: idioma-sello 1.5s cubic-bezier(.22, 1, .36, 1) both; }
#idiomaSello.visible .ico { animation: ay-gira 1.2s cubic-bezier(.22, 1, .36, 1); }
@keyframes idioma-sello { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.85); } 18%, 70% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -50%) scale(.96); } }

/* Cambio de idioma: sin mover nada de lugar. La página nueva se revela con un barrido de luz
   (de izquierda a derecha; en árabe, de derecha a izquierda) mientras la anterior queda quieta debajo. */
html.vt-idioma::view-transition-old(root) { animation: idioma-quieto .7s linear both; }
html.vt-idioma::view-transition-new(root) {
    animation: idioma-revela .7s cubic-bezier(.65, 0, .35, 1) both;
    -webkit-mask-image: linear-gradient(90deg, #000 44%, rgba(0, 0, 0, .55) 50%, transparent 56%);
            mask-image: linear-gradient(90deg, #000 44%, rgba(0, 0, 0, .55) 50%, transparent 56%);
    -webkit-mask-size: 300% 100%; mask-size: 300% 100%;
    -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
}
html.vt-idioma[dir="rtl"]::view-transition-new(root) {
    -webkit-mask-image: linear-gradient(270deg, #000 44%, rgba(0, 0, 0, .55) 50%, transparent 56%);
            mask-image: linear-gradient(270deg, #000 44%, rgba(0, 0, 0, .55) 50%, transparent 56%);
    animation-name: idioma-revela-rtl;
}
@keyframes idioma-quieto { from { opacity: 1; } to { opacity: 1; } }
@keyframes idioma-revela { from { -webkit-mask-position: 100% 0; mask-position: 100% 0; } to { -webkit-mask-position: 0% 0; mask-position: 0% 0; } }
@keyframes idioma-revela-rtl { from { -webkit-mask-position: 0% 0; mask-position: 0% 0; } to { -webkit-mask-position: 100% 0; mask-position: 100% 0; } }

/* Línea de luz que acompaña al barrido (vive solo durante la transición). */
#idiomaBarrido { position: fixed; top: 0; bottom: 0; left: 0; width: 160px; z-index: 3200; pointer-events: none; view-transition-name: idioma-barrido;
    background: linear-gradient(90deg, transparent 0%, rgba(34, 197, 94, .10) 30%, rgba(74, 222, 128, .38) 46%, rgba(220, 252, 231, .95) 50%, rgba(74, 222, 128, .38) 54%, rgba(34, 197, 94, .10) 70%, transparent 100%); }
html:not(.vt-idioma) #idiomaBarrido { display: none; }
::view-transition-group(idioma-barrido) { animation: none; }
::view-transition-old(idioma-barrido) { display: none; }
::view-transition-new(idioma-barrido) { animation: idioma-barre .7s cubic-bezier(.65, 0, .35, 1) both; }
html[dir="rtl"]::view-transition-new(idioma-barrido) { animation-name: idioma-barre-rtl; }
@keyframes idioma-barre { 0% { transform: translateX(-170px); opacity: 0; } 8% { opacity: 1; } 92% { opacity: 1; } 100% { transform: translateX(calc(100vw + 10px)); opacity: 0; } }
@keyframes idioma-barre-rtl { 0% { transform: translateX(calc(100vw + 10px)); opacity: 0; } 8% { opacity: 1; } 92% { opacity: 1; } 100% { transform: translateX(-170px); opacity: 0; } }

/* El sello del idioma aparece sobre la transición sin esperar a que termine. */
html.vt-idioma #idiomaSello { view-transition-name: idioma-sello; }
::view-transition-group(idioma-sello) { animation: none; }
::view-transition-old(idioma-sello) { display: none; }
::view-transition-new(idioma-sello) { animation: none; }

/* Navegadores sin View Transitions: fundido en el lugar, sin desplazamientos. */
html.idioma-saliendo body { opacity: .25; transition: opacity .16s ease; }
html.idioma-entrando body { animation: idioma-aparece .42s ease both; }
@keyframes idioma-aparece { from { opacity: .25; } to { opacity: 1; } }

/* Derecha a izquierda (árabe) */
html[dir="rtl"] svg:has(use[href*="#i-arrow-left"]), html[dir="rtl"] svg:has(use[href*="#i-arrow-right"]) { transform: scaleX(-1); }
html[dir="rtl"] .grupo-icono > .ico { left: auto; right: 13px; }
html[dir="rtl"] .grupo-icono > .control { padding-left: 14px; padding-right: 44px; }
html[dir="rtl"] .grupo-icono > .btn-ojo { right: auto; left: 6px; }
html[dir="rtl"] .grupo-icono.con-ojo > .control { padding-left: 48px; }
html[dir="rtl"] .buscador-menu .grupo-icono .control { padding-left: 44px; }
html[dir="rtl"] .btn-limpiar { right: auto; left: 6px; }
html[dir="rtl"] .ayuda-buscar > .ico { left: auto; right: 14px; }
html[dir="rtl"] .ayuda-buscar-campo { padding: 0 42px 0 14px; }
html[dir="rtl"] .subir { right: auto; left: 16px; }
@media (min-width: 641px) {
    html[dir="rtl"] .ayuda-hoja { right: auto; left: 0; transform: translate3d(-104%, 0, 0); box-shadow: 24px 0 70px rgba(4, 20, 10, .32); }
    html[dir="rtl"] #ayuda.abierto .ayuda-hoja { transform: none; }
}


/* =====================================================================
   15. LIVIANO (0.99.248, el dueño: «el tono verde oscuro es muy fuerte, aclara esos tonos; haz livianas las plantillas»)
   Los verdes de fondo pasan a tonos medios (arriba, en el mismo archivo) y se apagan los efectos que corren siempre
   (fondo animado, línea que fluye, auras y bordes que giran): en un celular o tablet gastan batería y hacen lenta la
   pantalla. Quedan los que dicen algo (la rueda de carga, las transiciones al tocar).
   ===================================================================== */
html::before, body:not(.login-fondo)::before, body:not(.login-fondo)::after { display: none !important; animation: none !important; }
.barra::after, .avatar, .vista .contador, .mesa.en-uso .mesa-estado::before,
.mesa:not(.deshabilitada):active::after, .categoria:active::after, .producto:active::after, .opcion-otro:active::after,
.resumen .dato:hover::after, .resumen .dato.filtro-activo::after, .login-caja::after, .bienvenida-globo, .mover-riel,
.ay-captura figcaption .ico { animation: none !important; }
.avatar { box-shadow: 0 0 0 2px rgba(255, 255, 255, .35); }
.barra { background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%); box-shadow: 0 2px 10px rgba(21, 128, 61, .25); }
html { background: #f0fdf4; }

/* 0.99.278: las fotos de las categorías y los productos (las mismas de la caja). */
.categoria-ico.con-foto { background: #f1f5f9; overflow: hidden; padding: 0; }
.categoria-ico.con-foto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.categoria .categoria-ico.con-foto { width: 96px; height: 96px; border-radius: 22px; }
.producto .categoria-ico.con-foto { width: 60px; height: 60px; border-radius: 14px; }
