:root{--rojo:#b3261e;--verde:#2e7d32;--crema:#fff8ec;--borde:#e3d6bd;--texto:#2b2118;--gris:#6f6455}
*{box-sizing:border-box}
body{margin:0;font:16px/1.4 system-ui,sans-serif;background:var(--crema);color:var(--texto)}
header.top{background:var(--rojo);color:#fff;display:flex;flex-wrap:wrap;gap:.25rem 1rem;align-items:center;padding:.6rem 1rem}
header.top a{color:#fff;text-decoration:none;font-weight:600;padding:.3rem .5rem;border-radius:6px}
header.top a:hover{background:rgba(255,255,255,.2)}
header.top .marca{font-size:1.1rem;margin-right:auto}
main{max-width:980px;margin:0 auto;padding:1rem}
h1,h2{margin:.2rem 0 .8rem}
.card{background:#fff;border:1px solid var(--borde);border-radius:10px;padding:1rem;margin-bottom:1rem}
.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:.6rem}
.btn,button{font:inherit;font-weight:600;border:0;border-radius:8px;padding:.7rem 1rem;background:var(--rojo);color:#fff;cursor:pointer;text-decoration:none;display:inline-block;text-align:center}
.btn.verde,button.verde{background:var(--verde)}
.btn.gris,button.gris{background:#8a7f6e}
.btn.chico,button.chico{padding:.35rem .7rem;font-size:.9rem}
.btn.borde,button.borde{background:#fff;color:var(--rojo);border:2px solid var(--rojo)}
input,select,textarea{font:inherit;padding:.6rem;border:1px solid var(--borde);border-radius:8px;width:100%;background:#fff}
label{display:block;font-weight:600;margin:.6rem 0 .2rem}
table{width:100%;border-collapse:collapse}
th,td{text-align:left;padding:.45rem .4rem;border-bottom:1px solid var(--borde)}
td.n,th.n{text-align:right;font-variant-numeric:tabular-nums}
.msg{padding:.7rem 1rem;border-radius:8px;margin-bottom:.6rem;background:#e8f5e9;border:1px solid #a5d6a7}
.msg.error{background:#fdecea;border-color:#f5a39b}
.badge{display:inline-block;padding:.1rem .5rem;border-radius:99px;font-size:.8rem;font-weight:700;background:#eee}
.badge.bajo{background:#fdecea;color:var(--rojo)}
.muted{color:var(--gris)}
.row{display:flex;gap:.6rem;flex-wrap:wrap;align-items:end}
.row>*{flex:1 1 140px}
.barra{background:var(--rojo);height:14px;border-radius:4px;min-width:2px}
.kpis{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:.6rem;margin-bottom:1rem}
.kpi{background:#fff;border:1px solid var(--borde);border-radius:10px;padding:.8rem}
.kpi b{display:block;font-size:1.4rem}
/* tomar pedido */
.pos{display:grid;gap:1rem;grid-template-columns:1fr}
@media(min-width:800px){.pos{grid-template-columns:2fr 1fr}.carrito{position:sticky;top:1rem;align-self:start}}
.tabs{display:flex;gap:.4rem;overflow-x:auto;margin-bottom:.6rem}
.tabs button{background:#fff;color:var(--texto);border:1px solid var(--borde);white-space:nowrap}
.tabs button.activa{background:var(--rojo);color:#fff}
.prod{background:#fff;color:var(--texto);border:1px solid var(--borde);min-height:84px;display:flex;flex-direction:column;justify-content:space-between;text-align:left}
.prod small{color:var(--gris)}
.modal{position:fixed;inset:0;background:rgba(0,0,0,.5);display:none;align-items:flex-end;justify-content:center;z-index:10}
.modal.abierto{display:flex}
.modal .hoja{background:#fff;width:100%;max-width:520px;max-height:90vh;overflow:auto;border-radius:14px 14px 0 0;padding:1rem}
.opt{display:flex;align-items:center;gap:.6rem;padding:.5rem 0;border-bottom:1px solid var(--borde);font-weight:400;margin:0}
.opt input{width:auto}
.linea{display:flex;justify-content:space-between;gap:.5rem;padding:.4rem 0;border-bottom:1px dashed var(--borde)}
.linea small{display:block;color:var(--gris)}
.total{font-size:1.4rem;font-weight:800;display:flex;justify-content:space-between;margin:.6rem 0}
/* agotados */
.tog{background:#fff;color:var(--texto);border:2px solid var(--verde);min-height:64px;display:flex;flex-direction:column;align-items:flex-start;gap:.2rem;text-align:left}
.tog small{font-weight:700;color:var(--verde)}
.tog.no{background:#fdecea;border-color:var(--rojo);text-decoration:line-through;color:var(--gris)}
.tog.no small{color:var(--rojo);text-decoration:none}
/* pedido recién llegado */
.pedido.nuevo .card{animation:llega 3s ease-out}
@keyframes llega{0%,60%{background:#fff3b0;border-color:#e0a800}100%{background:#fff}}
