/* =========================================================
   CARNICERÍA PREMIUM · ESTILOS
   Diseño de app de delivery: Poppins redondeada, naranja
   vivo sobre blanco, rojo carnicero solo para acentos.
   ========================================================= */
:root {
  --naranja: #FF6A13;
  --naranja-2: #F2540A;
  --naranja-suave: #FFF1E7;
  --naranja-borde: #FFD9C2;
  --rojo: #E0312B;
  --rojo-suave: #FDECEB;
  --blanco: #FFFFFF;
  --fondo: #FFF8F3;
  --tinta: #2B1A10;
  --tinta-2: #6E5547;
  --tinta-3: #A6907F;
  --linea: #F1E2D7;
  --verde: #1E9E5A;
  --verde-suave: #E6F6EE;
  --azul: #1F6FD6;
  --azul-suave: #E8F0FC;
  --sombra: 0 6px 20px rgba(120, 50, 10, .10);
  --sombra-fuerte: 0 14px 34px rgba(242, 84, 10, .28);
  --radio: 20px;
  --radio-s: 12px;
  --fuente: "Poppins", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body {
  font-family: var(--fuente);
  background: var(--fondo);
  color: var(--tinta);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; }
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; line-height: 1.15; text-wrap: balance; letter-spacing: -.01em; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--naranja); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- Botones animados ---------- */
.btn {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 999px; padding: 13px 22px;
  font-weight: 600; font-size: 15px; letter-spacing: .01em;
  background: var(--naranja); color: #fff;
  box-shadow: 0 6px 16px rgba(255, 106, 19, .35);
  transition: transform .18s cubic-bezier(.3,1.6,.6,1), box-shadow .2s, background .2s, opacity .2s;
  user-select: none; text-decoration: none;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--sombra-fuerte); }
.btn:active { transform: scale(.94); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.blanco { background: #fff; color: var(--naranja-2); box-shadow: var(--sombra); border: 1.5px solid var(--naranja-borde); }
.btn.rojo { background: var(--rojo); box-shadow: 0 6px 16px rgba(224, 49, 43, .3); }
.btn.verde { background: var(--verde); box-shadow: 0 6px 16px rgba(30, 158, 90, .3); }
.btn.wa { background: #25D366; color: #fff; box-shadow: 0 6px 16px rgba(37, 211, 102, .35); }
.btn.wa svg rect { fill: transparent; }
.btn.azul { background: var(--azul); box-shadow: 0 6px 16px rgba(31, 111, 214, .3); }
.btn.gris { background: #F3ECE6; color: var(--tinta); box-shadow: none; }
.btn.chico { padding: 8px 14px; font-size: 13px; }
.btn.ancho { width: 100%; }
.btn .onda {
  position: absolute; border-radius: 50%; transform: scale(0);
  background: rgba(255,255,255,.55); animation: onda .6s ease-out; pointer-events: none;
}
.btn.blanco .onda, .btn.gris .onda { background: rgba(255,106,19,.25); }
@keyframes onda { to { transform: scale(4); opacity: 0; } }

.icono-btn {
  width: 42px; height: 42px; border-radius: 50%; border: 0;
  display: grid; place-items: center; font-size: 18px;
  background: #fff; color: var(--tinta); box-shadow: var(--sombra);
  transition: transform .18s cubic-bezier(.3,1.6,.6,1);
}
.icono-btn:active { transform: scale(.88); }
.icono-btn svg { width: 20px; height: 20px; }

/* ---------- Campos ---------- */
.campo { display: grid; gap: 6px; }
.campo label { font-size: 13px; font-weight: 600; color: var(--tinta-2); }
.input {
  width: 100%; border: 1.5px solid var(--linea); background: #fff; border-radius: 14px;
  padding: 12px 14px; outline: none; transition: border-color .2s, box-shadow .2s;
}
.input:focus { border-color: var(--naranja); box-shadow: 0 0 0 4px rgba(255,106,19,.14); }
textarea.input { resize: vertical; min-height: 70px; }
.ayuda { font-size: 12px; color: var(--tinta-3); }
.error { font-size: 13px; color: var(--rojo); font-weight: 500; }

/* ---------- Chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1.5px solid var(--naranja-borde); background: #fff; color: var(--naranja-2);
  border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 500;
  transition: transform .15s, background .2s, color .2s;
}
.chip:active { transform: scale(.92); }
.chip.on { background: var(--naranja); border-color: var(--naranja); color: #fff; }

/* ---------- Píldoras de estado ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.gris { background: #F1EBE6; color: #7A6658; }
.pill.naranja { background: var(--naranja-suave); color: var(--naranja-2); }
.pill.azul { background: var(--azul-suave); color: var(--azul); }
.pill.verde { background: var(--verde-suave); color: var(--verde); }
.pill.rojo { background: var(--rojo-suave); color: var(--rojo); }

/* ---------- Hoja inferior / modal ---------- */
.velo {
  position: fixed; inset: 0; z-index: 50; background: rgba(43, 26, 16, .45);
  display: flex; align-items: flex-end; justify-content: center;
  animation: aparecer .2s ease;
}
.hoja {
  width: 100%; max-width: 520px; max-height: 92vh; overflow: auto;
  background: #fff; border-radius: 26px 26px 0 0;
  padding: 10px 20px calc(20px + env(safe-area-inset-bottom, 0px));
  animation: subir .32s cubic-bezier(.2,1.2,.4,1);
}
.hoja::before { content: ""; display: block; width: 44px; height: 5px; border-radius: 9px; background: #EADDD3; margin: 0 auto 12px; }
@media (min-width: 700px) {
  .velo.centro { align-items: center; }
  .velo.centro .hoja { border-radius: 26px; }
}
@keyframes aparecer { from { opacity: 0; } }
@keyframes subir { from { transform: translateY(60px); opacity: 0; } }

/* ---------- Avisos (toast) ---------- */
.toast-zona { position: fixed; left: 0; right: 0; top: calc(12px + env(safe-area-inset-top, 0px)); z-index: 90; display: grid; justify-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast {
  background: var(--tinta); color: #fff; padding: 11px 18px; border-radius: 14px; font-size: 14px; font-weight: 500;
  box-shadow: 0 10px 30px rgba(0,0,0,.2); animation: toast 2.6s ease forwards; max-width: 420px;
}
.toast.ok { background: var(--verde); }
.toast.mal { background: var(--rojo); }
@keyframes toast { 0% { transform: translateY(-20px); opacity: 0; } 10%, 85% { transform: none; opacity: 1; } 100% { transform: translateY(-10px); opacity: 0; } }

/* ---------- Banner demo ---------- */
.demo-banner {
  background: var(--tinta); color: #FFE3D1; font-size: 12.5px; text-align: center;
  padding: 7px max(16px, env(safe-area-inset-right, 0px)) 7px max(16px, env(safe-area-inset-left, 0px));
}
.demo-banner a { color: #fff; font-weight: 600; }

/* ---------- Animaciones de estado ---------- */
.escena { width: 100%; max-width: 300px; margin: 0 auto; display: block; }
/* carnicero */
.cuchillo-brazo { transform-origin: 146px 126px; animation: afilar 0.9s ease-in-out infinite; }
@keyframes afilar { 0%, 100% { transform: rotate(-16deg); } 50% { transform: rotate(14deg); } }
.chispas { animation: chispa .9s linear infinite; transform-origin: 120px 116px; }
@keyframes chispa { 0%, 35%, 65%, 100% { opacity: 0; transform: scale(.4); } 50% { opacity: 1; transform: scale(1.15); } }
.ojos { transform-origin: 110px 70px; animation: parpadeo 4s infinite; }
@keyframes parpadeo { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
.carnicero-cuerpo { animation: respirar 1.8s ease-in-out infinite; transform-origin: 110px 190px; }
@keyframes respirar { 50% { transform: scaleY(1.015); } }
/* moto */
.moto { animation: rebote .35s ease-in-out infinite alternate; }
@keyframes rebote { to { transform: translateY(-2.5px); } }
.rueda { transform-box: fill-box; transform-origin: center; animation: girar .45s linear infinite; }
@keyframes girar { to { transform: rotate(360deg); } }
.carril { animation: carril .5s linear infinite; }
@keyframes carril { to { transform: translateX(-48px); } }
.viento line { animation: viento .7s linear infinite; }
.viento line:nth-child(2) { animation-delay: .23s; }
.viento line:nth-child(3) { animation-delay: .46s; }
@keyframes viento { 0% { transform: translateX(30px); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateX(-40px); opacity: 0; } }
.humo circle { transform-box: fill-box; transform-origin: center; animation: humo 1s ease-out infinite; }
.humo circle:nth-child(2) { animation-delay: .33s; }
.humo circle:nth-child(3) { animation-delay: .66s; }
@keyframes humo { 0% { transform: translate(0,0) scale(.4); opacity: .8; } 100% { transform: translate(-34px,-10px) scale(1.6); opacity: 0; } }
.edificios { animation: carril-lento 6s linear infinite; }
@keyframes carril-lento { to { transform: translateX(-260px); } }
/* recibido */
.pulso { transform-box: fill-box; transform-origin: center; animation: pulso 1.8s ease-out infinite; }
.pulso.b { animation-delay: .6s; }
@keyframes pulso { 0% { transform: scale(.6); opacity: .7; } 100% { transform: scale(1.5); opacity: 0; } }
.reloj-aguja { transform-origin: 130px 92px; animation: girar 3s linear infinite; }
/* listo */
.check-trazo { stroke-dasharray: 120; stroke-dashoffset: 120; animation: trazo .7s .2s ease forwards; }
@keyframes trazo { to { stroke-dashoffset: 0; } }
.check-circulo { transform-box: fill-box; transform-origin: center; animation: pop .5s cubic-bezier(.3,1.7,.5,1); }
@keyframes pop { from { transform: scale(0); } }
.confeti rect { animation: confeti 2.4s ease-in infinite; }
@keyframes confeti { 0% { transform: translateY(-30px) rotate(0); opacity: 0; } 10% { opacity: 1; } 100% { transform: translateY(150px) rotate(320deg); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
/* letrero de cerrado */
.letrero { transform-origin: 130px 14px; animation: mecer 2.6s ease-in-out infinite; }
@keyframes mecer { 0%, 100% { transform: rotate(-7deg); } 50% { transform: rotate(7deg); } }
.zzz text { animation: zzz 2.4s ease-in-out infinite; }
.zzz text:nth-child(2) { animation-delay: .4s; }
.zzz text:nth-child(3) { animation-delay: .8s; }
@keyframes zzz { 0%, 100% { opacity: .2; transform: translateY(4px); } 50% { opacity: 1; transform: none; } }

/* =========================================================
   COMPARTIDOS: contador, totales y editor de pedido
   ========================================================= */
.contador { display: flex; align-items: center; gap: 4px; background: var(--naranja-suave); border-radius: 999px; padding: 3px; width: fit-content; }
.contador button { width: 30px; height: 30px; border-radius: 50%; border: 0; background: #fff; color: var(--naranja-2); font-size: 17px; font-weight: 600; display: grid; place-items: center; box-shadow: 0 2px 5px rgba(0,0,0,.06); transition: transform .15s; }
.contador button:active { transform: scale(.85); }
.contador span { min-width: 22px; padding: 0 4px; text-align: center; font-weight: 700; font-size: 14px; white-space: nowrap; }
.totales { display: grid; gap: 6px; padding: 14px 0; }
.totales div { display: flex; justify-content: space-between; color: var(--tinta-2); }
.totales .grande { color: var(--tinta); font-size: 19px; font-weight: 700; }
.gratis { color: var(--verde); font-weight: 600; }
.vacio { text-align: center; color: var(--tinta-3); padding: 20px; grid-column: 1 / -1; }
@media (min-width: 700px) { .velo.centro .hoja.hoja-ancha { max-width: 640px; } }
.editor-ped { display: grid; gap: 14px; }
.ed-lineas { display: grid; gap: 10px; }
.ed-linea { border: 1.5px solid var(--linea); border-radius: 16px; padding: 12px; display: grid; gap: 10px; background: #fff; }
.ed-linea.agotada { border-color: #F6B9B5; background: #FFF6F5; }
.ed-info b { display: block; font-size: 15px; }
.ed-info small { display: block; color: var(--tinta-3); font-size: 12.5px; }
.ed-agot { color: var(--rojo) !important; font-weight: 600; }
.ed-ctrl { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.ed-ctrl strong { font-size: 16px; }
.ed-acc { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.ed-acc .input { padding: 9px 12px; font-size: 14px; border-radius: 12px; }
.mini-borrar { border: 0; background: var(--rojo-suave); color: var(--rojo); border-radius: 12px; padding: 0 12px; font-weight: 600; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }
.ed-agregar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.ed-agregar .input { padding: 10px 12px; border-radius: 12px; }

/* =========================================================
   ÍCONOS: selector y su uso en productos
   ========================================================= */
/* un ícono subido se ve centrado y sin recortar, igual que un emoji */
img.ico { object-fit: contain !important; width: 64% !important; height: 64% !important; margin: auto; display: block; }
.ico-sel { display: grid; gap: 12px; }
.ico-cuerpo { max-height: min(52vh, 460px); overflow-y: auto; display: grid; gap: 14px; padding-right: 4px; overscroll-behavior: contain; }
.ico-grupo h4 { font-size: 12px; font-weight: 600; color: var(--tinta-3); text-transform: uppercase; letter-spacing: .06em; margin: 0 0 8px; }
.ico-rejilla { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; }
.ico-tile { border: 1.5px solid var(--linea); background: #fff; border-radius: 16px; padding: 8px 4px 6px; display: grid; justify-items: center; gap: 2px; cursor: pointer; transition: transform .15s, border-color .15s, background .15s; width: 100%; min-height: 76px; }
.ico-tile:hover { border-color: var(--naranja); background: var(--naranja-suave); }
.ico-tile:active { transform: scale(.92); }
.ico-tile span { font-size: 30px; line-height: 1.15; }
.ico-tile img { width: 36px; height: 36px; object-fit: contain; }
.ico-tile small { font-size: 10.5px; color: var(--tinta-2); text-align: center; line-height: 1.15; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ico-tile.subir { border-style: dashed; border-color: var(--naranja); color: var(--naranja-2); }
.ico-tile.subir span { font-size: 26px; font-weight: 600; }
.ico-propio { position: relative; }
.ico-x { position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: var(--rojo); color: #fff; font-size: 14px; line-height: 1; display: grid; place-items: center; cursor: pointer; }
.ico-pie { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.ico-emoji { display: flex; gap: 6px; }
.ico-emoji .input { width: 72px; text-align: center; font-size: 20px; padding: 8px; }

/* aviso de nueva versión */
.aviso-version {
  position: fixed; z-index: 95; left: 50%; transform: translateX(-50%);
  top: calc(12px + env(safe-area-inset-top, 0px)); width: min(440px, calc(100% - 32px));
  display: flex; align-items: center; gap: 12px; text-align: left; border: 0; cursor: pointer;
  background: var(--tinta); color: #fff; border-radius: 18px; padding: 12px 16px;
  box-shadow: 0 14px 34px rgba(0,0,0,.28); font-family: var(--fuente); animation: aviso-baja .45s cubic-bezier(.2,1.3,.4,1);
}
.aviso-version .av-ic { font-size: 26px; }
.aviso-version b { display: block; font-size: 14.5px; }
.aviso-version small { color: #FFD9C2; font-size: 12.5px; }
@keyframes aviso-baja { from { transform: translate(-50%, -30px); opacity: 0; } }
