/* Demos de Tereré Estudio — base común (reset, tipografía de sistema, línea de demo, hojas, pedido, toast, firma).
   Cada demo define en su estilos.css los tokens de color: --fondo --texto --texto-2 --linea --superficie --acento --acento-texto
   (más los que necesite) en :root y en @media (prefers-color-scheme: dark). Todo lo de acá usa esos tokens. */
:root {
  --f: Arial, "Helvetica Neue", Helvetica, "Liberation Sans", sans-serif;
  --fondo: #fff; --texto: #141414; --texto-2: #5c5c5c; --linea: #e3e3e3; --superficie: #f5f5f5;
  --acento: #141414; --acento-texto: #fff; --wa: #1f9d55; --ig: #c13584; --radio: 14px;
  --demo-h: 18px;
  color-scheme: light dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--texto) 35%, transparent) transparent; }
body { margin: 0; padding-top: var(--demo-h); font: 400 16px/1.5 var(--f); color: var(--texto); background: var(--fondo); overflow-x: hidden; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { line-height: 1.12; text-wrap: balance; margin: 0; }
p { margin: 0; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--acento); outline-offset: 3px; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ico { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ancho { width: 100%; max-width: 1180px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }

/* Botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 20px; border-radius: 999px; border: 1px solid var(--texto); background: transparent; font-weight: 700; font-size: 15px; text-decoration: none; white-space: nowrap; transition: transform .15s; }
.btn:active { transform: scale(.97); }
.btn-pri { background: var(--acento); color: var(--acento-texto); border-color: var(--acento); }
.btn-wa { background: var(--wa); color: #fff; border-color: var(--wa); }
.btn-wa .ico { stroke: none; fill: #fff; }
.btns { display: flex; gap: 10px; }
.btns > .btn { flex: 1 1 0; min-width: 0; }

/* Línea fina de demo (fija arriba) */
.demo-linea { position: fixed; z-index: 80; inset: 0 0 auto; height: var(--demo-h); display: flex; align-items: center; justify-content: center; background: var(--fondo); border-bottom: 1px solid var(--linea); font-size: 10px; letter-spacing: .08em; }
.demo-linea a { color: var(--texto-2); text-decoration: none; white-space: nowrap; }
.demo-linea a:hover { color: var(--texto); text-decoration: underline; }
@media (min-width: 960px) { .demo-linea { font-size: 11px; } }

/* Hojas (<dialog>): desde abajo en mobile, panel a la derecha en PC */
dialog.hoja { position: fixed; inset: auto 0 0 0; margin: 0; width: 100%; max-width: none; max-height: 88dvh; padding: 0; border: 0; border-radius: 22px 22px 0 0; background: var(--fondo); color: var(--texto); display: flex; flex-direction: column; overflow: hidden; }
dialog.hoja:not([open]) { display: none; }
dialog.hoja::backdrop { background: rgba(0, 0, 0, .45); }
dialog.hoja[open] { animation: hoja-sube .28s ease-out; }
@keyframes hoja-sube { from { transform: translateY(40px); opacity: 0; } }
.hoja-cab { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 16px 12px; border-bottom: 1px solid var(--linea); }
.hoja-cab h2 { font-size: 20px; }
.hoja-cuerpo { padding: 16px; overflow-y: auto; scrollbar-width: none; display: grid; gap: 14px; }
.hoja-pie { padding: 12px 16px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--linea); display: grid; gap: 10px; }
.cerrar { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--linea); background: transparent; display: grid; place-items: center; flex: none; }
@media (min-width: 960px) {
  dialog.hoja { inset: 0 0 0 auto; width: 420px; max-height: none; height: 100dvh; border-radius: 0; }
  dialog.hoja[open] { animation: hoja-lado .28s ease-out; }
  @keyframes hoja-lado { from { transform: translateX(40px); opacity: 0; } }
}

/* Pedido estándar */
.ped-lista { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ped-item { display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; align-items: center; }
.ped-item .ped-img { width: 56px; height: 56px; border-radius: 10px; background: var(--superficie); display: grid; place-items: center; overflow: hidden; }
.ped-item .ped-img svg { width: 48px; height: 48px; }
.ped-item b { display: block; font-size: 14px; }
.ped-item small { color: var(--texto-2); font-size: 12px; }
.ped-quitar { border: 0; background: transparent; color: var(--texto-2); width: 40px; height: 40px; display: grid; place-items: center; }
.ped-vacio { color: var(--texto-2); text-align: center; padding: 18px 0; }
.ped-total { display: flex; justify-content: space-between; font-weight: 700; font-size: 17px; font-variant-numeric: tabular-nums; }
.ped-transf { display: flex; justify-content: space-between; color: var(--texto-2); font-size: 13px; }
.form { display: grid; gap: 10px; }
.form .fila2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form label { display: grid; gap: 4px; font-size: 12px; color: var(--texto-2); letter-spacing: .04em; }
.form input, .form select, .form textarea { min-height: 44px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--linea); background: var(--fondo); font-size: 16px; color: var(--texto); }
.form .check { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; letter-spacing: 0; }
.form .check input { min-height: 0; width: 18px; height: 18px; margin-top: 2px; }
.trampa { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Aviso breve */
.toast { position: fixed; z-index: 90; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); opacity: 0; pointer-events: none; max-width: calc(100vw - 32px); width: max-content; text-align: center; background: var(--texto); color: var(--fondo); padding: 11px 18px; border-radius: 999px; font-size: 14px; transition: opacity .25s, transform .25s; }
.toast.ver { opacity: 1; transform: translate(-50%, 0); }

/* Pie y firma */
.pie { padding-top: 28px; padding-bottom: 28px; border-top: 1px solid var(--linea); display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: center; justify-content: space-between; font-size: 13px; color: var(--texto-2); }
.pie nav { display: flex; gap: 18px; flex-wrap: wrap; }
.pie a { color: var(--texto-2); }
.firma-te { background: #161415; padding: 14px 16px calc(14px + env(safe-area-inset-bottom)); text-align: center; }
.firma-te a { display: inline-flex; align-items: center; gap: 10px; color: #F3E9DA; text-decoration: none; font: 500 14px/1 system-ui, sans-serif; }
.firma-te img { height: 28px; width: auto; opacity: .9; }
.firma-te a:hover img, .firma-te a:focus-visible img { opacity: 1; }
.firma-te a:focus-visible { outline: 2px solid #9FBD2B; outline-offset: 4px; }
@media (max-width: 600px) { .firma-te img { height: 24px; } }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; } }
