/* =====================================================================
   CACAO VITAL — estilos de la app pública (mobile-first)
   ===================================================================== */
:root {
  --choco: #3B241B;
  --cacao: #70452F;
  --cacao-2: #8A5A40;
  --beige: #F5EBDD;
  --cream: #FBF6EF;
  --paper: #FFFDF9;
  --lavanda: #8C65C8;
  --verde: #6F946B;
  --naranja: #E6A14B;
  --rojo: #B4485B;
  --ink: #2A1912;
  --muted: #7A6559;
  --line: #EADFD0;
  --ok: #4F7350;
  --warn: #B7791F;
  --danger: #A63A3A;

  --radius-sm: 12px;
  --radius: 20px;
  --radius-lg: 28px;
  --shadow-sm: 0 2px 8px rgba(59, 36, 27, .06);
  --shadow: 0 10px 30px rgba(59, 36, 27, .10);
  --shadow-lg: 0 20px 50px rgba(59, 36, 27, .16);

  --font: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;

  --app-max: 520px;
  --tabbar-h: 72px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --ease: cubic-bezier(.2, .8, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--beige);
  background-image:
    radial-gradient(circle at 10% 0%, rgba(140, 101, 200, .10), transparent 40%),
    radial-gradient(circle at 100% 30%, rgba(230, 161, 75, .12), transparent 40%),
    radial-gradient(circle at 0% 100%, rgba(111, 148, 107, .12), transparent 40%);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; margin: 0 0 .5em; color: var(--choco); letter-spacing: -.01em; }
h1 { font-size: clamp(1.7rem, 6vw, 2.3rem); }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
[hidden] { display: none !important; }
.icon { width: 22px; height: 22px; flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--choco); color: #fff; padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip-link:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--lavanda); outline-offset: 2px; border-radius: 8px; }

/* ---------- Shell ---------- */
.app {
  max-width: var(--app-max);
  margin: 0 auto;
  min-height: 100vh;
  background: var(--cream);
  position: relative;
  box-shadow: 0 0 0 1px rgba(59, 36, 27, .04), var(--shadow-lg);
  display: flex;
  flex-direction: column;
}
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 8px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px;
  background: rgba(251, 246, 239, .88);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.topbar.scrolled { border-bottom-color: var(--line); }
.topbar-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; flex: 1; min-width: 0; }
.topbar-brand img { border-radius: 10px; }
.topbar-title { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; color: var(--choco); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: .02em; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 14px; border: 0;
  display: inline-grid; place-items: center; flex: none;
  background: #fff; color: var(--choco); box-shadow: var(--shadow-sm);
  cursor: pointer; text-decoration: none;
  transition: transform .15s var(--ease), background .2s;
}
.icon-btn:active { transform: scale(.94); }
.icon-btn.is-active { color: #fff; background: var(--rojo); }

.view { flex: 1; padding: 8px 20px calc(var(--tabbar-h) + 32px + var(--safe-b)); outline: none; }
.view.enter { animation: viewIn .38s var(--ease) both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ---------- Tab bar ---------- */
.tabbar {
  position: fixed; z-index: 30;
  left: 50%; transform: translateX(-50%);
  bottom: calc(12px + var(--safe-b));
  width: min(calc(100% - 24px), calc(var(--app-max) - 24px));
  height: var(--tabbar-h);
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
  background: var(--choco); color: #E9D9C8;
  border-radius: 24px; box-shadow: var(--shadow-lg);
  padding: 0 6px;
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  text-decoration: none; font-size: .7rem; font-weight: 500; height: 100%;
  opacity: .72; transition: opacity .2s, color .2s;
}
.tabbar a .icon { width: 22px; height: 22px; }
.tabbar a.active { opacity: 1; color: #fff; }
.tabbar a.active:not(.tab-fab)::after { content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--naranja); margin-top: 1px; }
.tabbar .tab-fab {
  width: 58px; height: 58px; margin: -26px auto 0; border-radius: 20px; opacity: 1;
  background: linear-gradient(135deg, var(--naranja), #D9822B); color: #fff;
  box-shadow: 0 10px 20px rgba(230, 161, 75, .45); border: 4px solid var(--cream);
}
.tabbar .tab-fab .icon { width: 26px; height: 26px; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 56px; padding: 0 24px; border-radius: 18px; border: 0;
  font-weight: 700; font-size: 1.02rem; text-decoration: none; cursor: pointer;
  transition: transform .15s var(--ease), box-shadow .2s, background .2s, opacity .2s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.97); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }
.btn-block { width: 100%; }
.btn-primary { background: var(--choco); color: #fff; box-shadow: 0 10px 22px rgba(59, 36, 27, .25); }
.btn-primary:hover { background: #4A2E22; }
.btn-accent { background: var(--c, var(--cacao)); color: #fff; box-shadow: 0 10px 22px color-mix(in srgb, var(--c, var(--cacao)) 40%, transparent); }
.btn-ghost { background: #fff; color: var(--choco); box-shadow: var(--shadow-sm); border: 1px solid var(--line); }
.btn-link { background: none; color: var(--cacao); min-height: 44px; padding: 0 8px; text-decoration: underline; text-underline-offset: 3px; font-weight: 500; }
.btn-sm { min-height: 42px; padding: 0 16px; border-radius: 14px; font-size: .92rem; }
.btn .spinner { width: 18px; height: 18px; }
.btn-row { display: flex; gap: 12px; }
.btn-row > * { flex: 1; }
.stack { display: grid; gap: 12px; }

/* ---------- Utilidades ---------- */
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: .72rem; font-weight: 700; color: var(--cacao); margin: 0 0 6px; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.center { text-align: center; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 36px; }
.card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 18px; border: 1px solid rgba(234, 223, 208, .6); }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
  background: color-mix(in srgb, var(--c, var(--cacao)) 12%, #fff); color: color-mix(in srgb, var(--c, var(--cacao)) 80%, #000);
  font-size: .82rem; font-weight: 700; white-space: nowrap;
}
.chip .icon { width: 16px; height: 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 28px 0 12px; }
.section-title h2 { margin: 0; }
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 16px; font-size: .88rem; line-height: 1.45; }
.notice .icon { width: 20px; height: 20px; margin-top: 1px; }
.notice-info { background: #F1ECF9; color: #4B3474; }
.notice-warn { background: #FBF0DD; color: #7A4E12; }
.notice-ok { background: #E9F1E7; color: #2F4E30; }
.disclaimer { font-size: .8rem; color: var(--muted); line-height: 1.45; }

/* ---------- Carga / esqueletos ---------- */
.loading { display: grid; place-items: center; gap: 14px; padding: 80px 0; color: var(--muted); text-align: center; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(112, 69, 47, .2); border-top-color: var(--cacao); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, #F1E7DA 25%, #F8F1E8 37%, #F1E7DA 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; border-radius: var(--radius); }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.empty { text-align: center; padding: 40px 12px; }
.empty-art { width: 96px; height: 96px; border-radius: 32px; margin: 0 auto 18px; display: grid; place-items: center; background: #fff; color: var(--cacao); box-shadow: var(--shadow); }
.empty-art .icon { width: 42px; height: 42px; }

/* ---------- Bienvenida (pantallas 1–2) ---------- */
.welcome { display: flex; flex-direction: column; min-height: calc(100vh - 200px); }
.welcome-hero {
  position: relative; border-radius: var(--radius-lg); padding: 28px 22px 0; overflow: hidden;
  background: linear-gradient(160deg, #fff 0%, var(--beige) 100%);
  box-shadow: var(--shadow);
}
.welcome-hero::before { content: ''; position: absolute; width: 220px; height: 220px; right: -60px; top: -80px; border-radius: 50%; background: radial-gradient(circle, rgba(140, 101, 200, .25), transparent 70%); }
.welcome-hero h1 { position: relative; margin-bottom: .35em; }
.welcome-hero p { position: relative; color: var(--muted); }
.welcome-hero > img { width: 100%; max-width: 380px; margin: 8px auto 0; animation: floaty 6s ease-in-out infinite; }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.brand-lockup { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; position: relative; }
.brand-lockup img { width: 48px; height: 48px; border-radius: 14px; box-shadow: var(--shadow-sm); }
.brand-lockup strong { display: block; font-family: var(--font-display); font-size: 1.25rem; letter-spacing: .04em; color: var(--choco); }
.brand-lockup span { font-size: .85rem; color: var(--muted); font-style: italic; }
.qr-chip { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin: 16px 0 0; border-radius: 18px; background: #fff; box-shadow: var(--shadow-sm); border-left: 5px solid var(--c, var(--cacao)); }
.qr-chip img { width: 46px; height: 46px; }
.qr-chip small { display: block; color: var(--muted); font-size: .78rem; }
.features { list-style: none; padding: 0; margin: 20px 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.features li { background: #fff; border-radius: 16px; padding: 12px 8px; text-align: center; font-size: .78rem; color: var(--muted); box-shadow: var(--shadow-sm); }
.features .icon { margin: 0 auto 6px; color: var(--cacao); }
.features strong { display: block; color: var(--choco); font-size: .92rem; }
.last-result { display: flex; align-items: center; gap: 14px; text-decoration: none; margin-top: 16px; }
.last-result img { width: 56px; height: 56px; }
.last-result .grow { flex: 1; min-width: 0; }
.install-card { display: flex; align-items: center; gap: 12px; margin-top: 16px; }
.install-card .icon { color: var(--cacao); }

/* Pantalla de validación QR */
.qr-screen { text-align: center; padding: 48px 8px; }
.qr-screen .qr-badge { width: 120px; height: 120px; margin: 0 auto 24px; border-radius: 36px; display: grid; place-items: center; background: #fff; box-shadow: var(--shadow); position: relative; color: var(--cacao); }
.qr-screen .qr-badge .icon { width: 56px; height: 56px; }
.qr-screen .qr-badge::after { content: ''; position: absolute; inset: -8px; border-radius: 42px; border: 3px solid var(--naranja); opacity: .0; animation: pulse 1.6s ease-out infinite; }
@keyframes pulse { 0% { transform: scale(.9); opacity: .8; } 100% { transform: scale(1.15); opacity: 0; } }

/* ---------- Cuestionario (pantallas 3–5) ---------- */
.quiz-head { margin: 4px 0 20px; }
.progress-meta { display: flex; justify-content: space-between; font-size: .85rem; color: var(--muted); font-weight: 500; margin-bottom: 8px; }
.progress { height: 10px; border-radius: 999px; background: #EFE3D3; overflow: hidden; }
.progress > span { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--lavanda), var(--naranja)); transition: width .6s var(--ease); }
.steps { display: flex; gap: 6px; justify-content: center; margin-top: 12px; }
.steps i { width: 8px; height: 8px; border-radius: 50%; background: #E2D4C3; transition: all .3s; }
.steps i.done { background: var(--cacao); }
.steps i.current { width: 22px; border-radius: 6px; background: var(--naranja); }
.quiz-title { font-size: clamp(1.55rem, 6vw, 2rem); margin-bottom: 6px; }
.options { display: grid; gap: 12px; margin: 22px 0 24px; }
.option {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  padding: 14px 16px; min-height: 72px; border-radius: 20px; cursor: pointer;
  background: #fff; border: 2px solid transparent; box-shadow: var(--shadow-sm);
  transition: transform .15s var(--ease), border-color .2s, box-shadow .2s, background .2s;
  animation: optIn .4s var(--ease) both;
}
.option:nth-child(2) { animation-delay: .04s; } .option:nth-child(3) { animation-delay: .08s; }
.option:nth-child(4) { animation-delay: .12s; } .option:nth-child(5) { animation-delay: .16s; } .option:nth-child(6) { animation-delay: .2s; }
@keyframes optIn { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: none; } }
.option:hover { box-shadow: var(--shadow); }
.option:active { transform: scale(.98); }
.option .opt-icon { width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center; flex: none; background: var(--beige); color: var(--cacao); transition: background .2s, color .2s; }
.option .opt-text { flex: 1; font-weight: 500; line-height: 1.35; }
.option .opt-check { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; flex: none; color: transparent; transition: all .2s; }
.option .opt-check .icon { width: 16px; height: 16px; }
.option[aria-checked="true"] { border-color: var(--cacao); background: #FFF9F2; box-shadow: 0 8px 20px rgba(112, 69, 47, .14); }
.option[aria-checked="true"] .opt-icon { background: var(--cacao); color: #fff; }
.option[aria-checked="true"] .opt-check { background: var(--cacao); border-color: var(--cacao); color: #fff; animation: pop .3s var(--ease); }
@keyframes pop { 0% { transform: scale(.6); } 70% { transform: scale(1.15); } 100% { transform: scale(1); } }
.quiz-actions { position: sticky; bottom: calc(var(--tabbar-h) + 24px + var(--safe-b)); display: flex; gap: 12px; padding-top: 8px; }
.quiz-actions .btn-ghost { flex: 0 0 auto; width: 56px; padding: 0; }
.quiz-actions .btn-primary { flex: 1; }

/* ---------- Resultados (pantalla 6) ---------- */
.result-hero {
  position: relative; text-align: center; border-radius: var(--radius-lg); padding: 24px 20px 26px; overflow: hidden;
  background: linear-gradient(170deg, color-mix(in srgb, var(--c) 22%, #fff), #fff 70%);
  box-shadow: var(--shadow);
}
.result-hero .confetti { position: absolute; inset: 0; pointer-events: none; }
.result-hero .confetti i { position: absolute; width: 8px; height: 14px; border-radius: 3px; opacity: 0; animation: confetti 1.8s var(--ease) forwards; }
@keyframes confetti { 0% { opacity: 1; transform: translateY(-20px) rotate(0); } 100% { opacity: 0; transform: translateY(220px) rotate(540deg); } }
.result-hero img { width: 190px; height: 190px; margin: 0 auto; filter: drop-shadow(0 14px 18px rgba(59, 36, 27, .18)); animation: popIn .6s var(--ease) both .1s; }
@keyframes popIn { from { opacity: 0; transform: scale(.8) rotate(-6deg); } to { opacity: 1; transform: none; } }
.result-name { font-size: 2.2rem; margin: 6px 0 2px; color: color-mix(in srgb, var(--c) 75%, #000); }
.ring { position: relative; width: 120px; height: 120px; margin: 14px auto 6px; }
.ring svg { width: 120px; height: 120px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 10; }
.ring .track { stroke: color-mix(in srgb, var(--c) 15%, #fff); }
.ring .arc { stroke: var(--c); stroke-linecap: round; transition: stroke-dashoffset 1.4s var(--ease) .2s; }
.ring .value { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.ring .value strong { font-family: var(--font-display); font-size: 1.9rem; line-height: 1; color: var(--choco); }
.ring .value small { display: block; font-size: .68rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin-top: 2px; }
.ranking { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.rank-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 18px; background: #fff; box-shadow: var(--shadow-sm); text-decoration: none; transition: transform .15s; }
.rank-item:active { transform: scale(.98); }
.rank-pos { width: 28px; height: 28px; border-radius: 10px; display: grid; place-items: center; font-weight: 700; font-size: .85rem; background: var(--beige); color: var(--cacao); flex: none; }
.ranking li:first-child .rank-pos { background: var(--naranja); color: #fff; }
.rank-item img { width: 46px; height: 46px; flex: none; }
.rank-body { flex: 1; min-width: 0; }
.rank-top { display: flex; justify-content: space-between; gap: 8px; font-weight: 700; color: var(--choco); }
.rank-top span:last-child { color: color-mix(in srgb, var(--c) 80%, #000); }
.rank-body { display: block; }
.bar { display: block; height: 8px; border-radius: 999px; background: #F1E7DA; overflow: hidden; margin-top: 6px; }
.bar > span { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--c); transition: width 1.1s var(--ease); }

/* ---------- Producto (pantalla 7) ---------- */
.product-hero {
  position: relative; margin: 0 -20px; padding: 18px 20px 28px; text-align: center;
  background: linear-gradient(180deg, color-mix(in srgb, var(--c) 26%, var(--cream)) 0%, var(--cream) 100%);
  border-radius: 0 0 36px 36px;
}
.product-hero img { width: min(260px, 70%); margin: 0 auto; filter: drop-shadow(0 18px 22px rgba(59, 36, 27, .2)); animation: popIn .55s var(--ease) both; }
.product-hero .fav-float { position: absolute; top: 14px; right: 20px; }
.product-name { font-size: 2.3rem; margin: 10px 0 2px; color: color-mix(in srgb, var(--c) 70%, #000); }
.product-sub { color: var(--muted); font-weight: 500; margin: 0; }
.compat-pill { display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; padding: 8px 14px; border-radius: 999px; background: var(--c); color: #fff; font-weight: 700; font-size: .9rem; box-shadow: 0 8px 18px color-mix(in srgb, var(--c) 40%, transparent); }
.compat-pill .icon { width: 18px; height: 18px; }
.ing-mini { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.ing-mini a { display: flex; flex-direction: column; align-items: center; gap: 6px; text-decoration: none; text-align: center; padding: 12px 6px; border-radius: 18px; background: #fff; box-shadow: var(--shadow-sm); font-size: .85rem; font-weight: 500; }
.ing-mini img { width: 56px; height: 56px; }
.features-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.features-list li { display: flex; gap: 10px; align-items: flex-start; }
.features-list .icon { width: 20px; height: 20px; color: var(--c, var(--verde)); margin-top: 2px; }
.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: #EFE3D3; padding: 4px; border-radius: 16px; gap: 4px; }
.segmented a, .segmented button { border: 0; background: transparent; min-height: 42px; border-radius: 12px; font-weight: 700; font-size: .9rem; color: var(--muted); text-decoration: none; display: grid; place-items: center; cursor: pointer; transition: background .2s, color .2s; }
.segmented .active { background: #fff; color: var(--choco); box-shadow: var(--shadow-sm); }

/* ---------- Catálogo (pantalla 8) ---------- */
.catalog { display: grid; gap: 16px; }
.p-card { position: relative; display: flex; gap: 14px; align-items: center; padding: 14px; border-radius: 24px; background: #fff; box-shadow: var(--shadow-sm); text-decoration: none; overflow: hidden; transition: transform .2s var(--ease), box-shadow .2s; }
.p-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: var(--c); }
.p-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.p-card .p-img { width: 104px; height: 104px; flex: none; border-radius: 20px; background: color-mix(in srgb, var(--c) 14%, #fff); display: grid; place-items: center; }
.p-card .p-img img { width: 96px; height: 96px; }
.p-card .p-body { flex: 1; min-width: 0; }
.p-card h3 { margin: 0 0 2px; font-size: 1.25rem; color: color-mix(in srgb, var(--c) 70%, #000); }
.p-card .p-ing { font-size: .82rem; font-weight: 700; color: var(--cacao); margin: 0 0 6px; }
.p-card .p-desc { font-size: .86rem; color: var(--muted); margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.p-card .p-go { color: var(--c); }
.p-card .fav-mini { position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; border-radius: 12px; }
.p-card .fav-mini .icon { width: 18px; height: 18px; }

/* ---------- Ingredientes (pantalla 9) ---------- */
.ing-list { display: grid; gap: 16px; }
.ing-card { padding: 0; overflow: hidden; }
.ing-card header { display: flex; gap: 14px; align-items: center; padding: 16px 16px 0; }
.ing-card header img { width: 72px; height: 72px; flex: none; }
.ing-card header h3 { margin: 0; }
.ing-card .ing-body { padding: 12px 16px 16px; display: grid; gap: 10px; font-size: .92rem; }
.ing-meta { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: .84rem; }
.ing-meta .icon { width: 16px; height: 16px; }
.ing-card p { margin: 0; }

/* ---------- Nutrición (pantalla 10) ---------- */
.nutri-table { width: 100%; border-collapse: collapse; }
.nutri-table th, .nutri-table td { padding: 12px 4px; border-bottom: 1px solid var(--line); text-align: left; font-size: .95rem; }
.nutri-table td { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--choco); }
.nutri-table tr.sub th { padding-left: 18px; font-weight: 400; color: var(--muted); font-size: .88rem; }
.nutri-table tr.sub td { font-weight: 500; color: var(--muted); }
.nutri-table tr:last-child th, .nutri-table tr:last-child td { border-bottom: 0; }
.nutri-energy { display: flex; align-items: center; justify-content: space-between; padding: 18px; border-radius: 20px; background: var(--choco); color: #fff; margin-bottom: 14px; }
.nutri-energy strong { font-family: var(--font-display); font-size: 2.2rem; line-height: 1; }
.nutri-energy small { opacity: .75; }
.macro-bar { display: flex; height: 14px; border-radius: 999px; overflow: hidden; margin: 10px 0 8px; background: #F1E7DA; }
.macro-bar span { transition: flex-grow .8s var(--ease); flex-grow: 0; }
.macro-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: .82rem; color: var(--muted); }
.macro-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* ---------- Consejos (pantalla 11) ---------- */
.filter-chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 20px 10px; margin: 0 -20px; scrollbar-width: none; }
.filter-chips::-webkit-scrollbar { display: none; }
.filter-chips button { flex: none; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 9px 16px; font-weight: 500; font-size: .88rem; cursor: pointer; transition: all .2s; }
.filter-chips button.active { background: var(--choco); color: #fff; border-color: var(--choco); }
.articles { display: grid; gap: 16px; }
.a-card { display: block; text-decoration: none; border-radius: 24px; overflow: hidden; background: #fff; box-shadow: var(--shadow-sm); transition: transform .2s, box-shadow .2s; }
.a-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.a-card img { width: 100%; aspect-ratio: 400 / 190; object-fit: cover; }
.a-card .a-body { padding: 14px 16px 16px; }
.a-card h3 { margin: 6px 0 4px; }
.a-card p { margin: 0; color: var(--muted); font-size: .9rem; }
.a-meta { display: flex; gap: 10px; align-items: center; font-size: .78rem; color: var(--muted); }
.a-meta .icon { width: 14px; height: 14px; }
.article-cover { margin: 0 -20px 20px; }
.article-cover img { width: 100%; aspect-ratio: 400 / 200; object-fit: cover; }
.prose { font-size: 1.02rem; }
.prose h3 { margin-top: 1.4em; }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: .4em; }

/* ---------- Escáner ---------- */
.scanner { position: relative; border-radius: var(--radius-lg); overflow: hidden; background: #1E120D; aspect-ratio: 3 / 4; display: grid; place-items: center; color: #E9D9C8; }
.scanner video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scanner .frame { position: absolute; width: 64%; aspect-ratio: 1; border-radius: 28px; box-shadow: 0 0 0 9999px rgba(0, 0, 0, .45); }
.scanner .frame::before { content: ''; position: absolute; inset: 0; border-radius: inherit; border: 3px solid var(--naranja); }
.scanner .frame::after { content: ''; position: absolute; left: 8%; right: 8%; height: 3px; top: 10%; background: var(--naranja); box-shadow: 0 0 12px var(--naranja); animation: scanline 2.2s ease-in-out infinite; }
@keyframes scanline { 0%, 100% { top: 10%; } 50% { top: 88%; } }
.scanner .placeholder { text-align: center; padding: 24px; position: relative; z-index: 1; }
.scanner .placeholder .icon { width: 56px; height: 56px; margin: 0 auto 12px; }
.manual-form { display: flex; gap: 10px; }
.input { width: 100%; min-height: 52px; padding: 0 16px; border-radius: 16px; border: 1.5px solid var(--line); background: #fff; font-size: 1rem; }
.input:focus { outline: none; border-color: var(--cacao); box-shadow: 0 0 0 4px rgba(112, 69, 47, .12); }

/* ---------- Toasts / banner ---------- */
.toast-wrap { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabbar-h) + 28px + var(--safe-b)); z-index: 60; display: grid; gap: 8px; width: min(92vw, 440px); pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 16px; background: var(--ink); color: #fff; box-shadow: var(--shadow-lg); font-size: .92rem; animation: toastIn .35s var(--ease) both; }
.toast.out { animation: toastOut .3s ease forwards; }
.toast .icon { width: 20px; height: 20px; }
.toast button { margin-left: auto; background: var(--naranja); color: var(--ink); border: 0; border-radius: 10px; padding: 8px 12px; font-weight: 700; cursor: pointer; }
.toast.error { background: var(--danger); }
.toast.ok .icon { color: #A8D5A2; }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(10px); } }
.offline-banner { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 12px; background: #FBF0DD; color: #7A4E12; font-size: .85rem; font-weight: 500; }
.offline-banner .icon { width: 18px; height: 18px; }
.noscript { padding: 24px; text-align: center; }

/* Corazón animado */
.heart-btn.is-active .icon { fill: currentColor; animation: heartbeat .45s var(--ease); }
@keyframes heartbeat { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1); } }

/* ---------- Tablet / escritorio ---------- */
@media (min-width: 760px) {
  :root { --app-max: 760px; }
  .view { padding-left: 32px; padding-right: 32px; }
  .product-hero { margin: 0 -32px; }
  .article-cover { margin: 0 -32px 24px; }
  .filter-chips { margin: 0 -32px; padding: 4px 32px 10px; }
  .catalog { grid-template-columns: 1fr 1fr; }
  .articles { grid-template-columns: 1fr 1fr; }
  .ing-list { grid-template-columns: 1fr 1fr; }
  .welcome-hero { display: grid; grid-template-columns: 1.1fr 1fr; align-items: center; gap: 12px; padding: 36px 32px; }
  .welcome-hero > img { margin: 0; }
  .options { grid-template-columns: 1fr 1fr; }
  .options .option:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
@media (min-width: 1100px) {
  :root { --app-max: 1040px; }
  .catalog { grid-template-columns: repeat(3, 1fr); }
  .catalog .p-card { flex-direction: column; text-align: center; padding: 20px; }
  .catalog .p-card .p-img { width: 100%; height: 170px; }
  .catalog .p-card .p-img img { width: 160px; height: 160px; }
  .catalog .p-card .p-go { display: none; }
  .articles { grid-template-columns: repeat(3, 1fr); }
  .ing-list { grid-template-columns: repeat(3, 1fr); }
  .product-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: start; }
  .product-layout .product-hero { margin: 0; border-radius: 36px; position: sticky; top: 90px; padding-top: 40px; }
  .result-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: start; }
  .result-layout .section-title:first-child { margin-top: 0; }
}

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