/* Hoja de estilos de la aplicación. Tokens en :root. */

:root {
  /* Huerta */
  --verde:        #3f6f4a;   /* principal */
  --verde-2:      #7aa45c;   /* secundario */
  --verde-deep:   #2f4032;   /* texto fuerte */
  --crema:        #f6f1e7;   /* fondo */
  --crema-2:      #fdfbf6;   /* superficie */
  --limon:        #e8c34a;   /* acento */
  --limon-deep:   #8a6d12;

  /* tints "tres tonos por estado" */
  --verde-tint:   #e3eed8;
  --limon-tint:   #faf0c8;
  --rojo:         #c0533e;   /* solo para alertas/eliminar */
  --rojo-tint:    #f4ddd6;

  --texto:        #2f4032;
  --texto-soft:   #6f7a68;
  --linea:        #e3ddcf;

  --sombra-sm:    0 2px 8px -4px rgba(47,64,50,.25);
  --sombra:       0 8px 24px -12px rgba(47,64,50,.35);
  --sombra-lg:    0 20px 50px -24px rgba(47,64,50,.45);

  --r-sm: 10px; --r: 14px; --r-lg: 20px;
  --fuente: 'Inter', system-ui, -apple-system, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--fuente);
  color: var(--texto);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
  min-height: 100dvh;
  /* Fondo "huerta": gradientes orgánicos (zonas con sombra / zonas iluminadas)
     sobre crema. La textura grain va en body::before. Nada plano, nada blanco. */
  background-color: var(--crema);
  background-image:
    radial-gradient(130% 90% at 12% -8%, rgba(122,164,92,.22), transparent 55%),
    radial-gradient(110% 75% at 100% 5%, rgba(232,195,74,.16), transparent 52%),
    radial-gradient(95% 95% at 50% 118%, rgba(63,111,74,.13), transparent 60%);
  background-attachment: fixed;
}
/* Textura grain (ruido fractal feTurbulence) — sensación de papel/lienzo, táctil. */
body::before {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHdpZHRoPScxNjAnIGhlaWdodD0nMTYwJz4gPGZpbHRlciBpZD0nbic+IDxmZVR1cmJ1bGVuY2UgdHlwZT0nZnJhY3RhbE5vaXNlJyBiYXNlRnJlcXVlbmN5PScwLjknIG51bU9jdGF2ZXM9JzQnIHN0aXRjaFRpbGVzPSdzdGl0Y2gnLz4gPGZlQ29sb3JNYXRyaXggdHlwZT0nc2F0dXJhdGUnIHZhbHVlcz0nMCcvPiA8L2ZpbHRlcj4gPHJlY3Qgd2lkdGg9JzEwMCUnIGhlaWdodD0nMTAwJScgZmlsdGVyPSd1cmwoI24pJyBvcGFjaXR5PScwLjU1Jy8+IDwvc3ZnPg==");
  background-size: 160px 160px;
  opacity: .55; mix-blend-mode: multiply;
}
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

/* ---------- App shell mobile-first ---------- */
.app { max-width: 560px; margin: 0 auto; padding: 0 16px 96px; }

.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: max(18px, env(safe-area-inset-top)) 4px 14px;
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 20px; letter-spacing: -.02em; }
.brand .mark {
  width: 30px; height: 30px; border-radius: 9px;
  background: var(--verde); color: #fff;
  display: grid; place-items: center; font-size: 15px;
  box-shadow: var(--sombra-sm);
}
.brand .mark svg { width: 17px; height: 17px; }
.top .acc { display: flex; align-items: center; gap: 8px; }

/* Botón "Instalar" del header: discreto, contorno verde, con ícono de descarga */
.btn-instalar {
  display: flex; align-items: center; gap: 6px;
  font-weight: 700; font-size: 13px;
  padding: 8px 13px; border-radius: 999px;
  background: var(--verde-tint); color: var(--verde-deep);
  box-shadow: inset 0 0 0 1.5px var(--verde-2);
  transition: transform .12s ease, background .12s ease;
}
.btn-instalar:active { transform: translateY(1px) scale(.99); }
.btn-instalar svg { flex: 0 0 auto; }
.btn-instalar[hidden] { display: none; }
@media (max-width: 360px) { .btn-instalar span { display: none; } }

/* Toggle de idioma del header: muestra el idioma AL que cambia (EN/ES) */
.btn-lang {
  font-weight: 800; font-size: 12px; letter-spacing: .03em;
  padding: 8px 11px; border-radius: 999px;
  background: transparent; color: var(--verde-deep);
  box-shadow: inset 0 0 0 1.5px var(--linea);
  transition: transform .12s ease, box-shadow .12s ease, color .12s ease;
}
.btn-lang:hover { box-shadow: inset 0 0 0 1.5px var(--verde-2); color: var(--verde); }
.btn-lang:active { transform: translateY(1px) scale(.99); }

/* Guía de instalación iOS: pasos numerados con íconos */
.guia-ios { margin-top: 8px; }
.guia-ios .paso-ios {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 0; border-bottom: 1px solid var(--linea);
}
.guia-ios .paso-ios:last-child { border-bottom: none; }
.guia-ios .num-ios {
  flex: 0 0 auto; width: 28px; height: 28px; border-radius: 50%;
  background: var(--verde); color: #fff; display: grid; place-items: center;
  font-weight: 800; font-size: 14px;
}
.guia-ios .paso-ios p { font-size: 15px; line-height: 1.4; color: var(--texto); }
.guia-ios .ios-ic {
  display: inline-flex; vertical-align: middle; margin: 0 3px;
  color: var(--verde); transform: translateY(-1px);
}
.guia-ios .aviso-nav {
  margin-top: 16px; padding: 12px 14px; border-radius: var(--r-sm);
  background: var(--limon-tint); color: var(--limon-deep);
  font-size: 13.5px; line-height: 1.4;
}

.btn {
  font-weight: 700; font-size: 14px;
  padding: 10px 16px; border-radius: 999px;
  background: var(--verde); color: #fff;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
  box-shadow: var(--sombra-sm);
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn.ghost { background: transparent; color: var(--verde); box-shadow: none; }
.btn.outline { background: var(--crema-2); color: var(--verde-deep); box-shadow: inset 0 0 0 1.5px var(--linea); }
.btn.lim { background: var(--limon); color: var(--limon-deep); }
.btn.block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.ghost.danger { color: var(--rojo); width: 100%; }
.btn.ghost.danger:active { background: var(--rojo-tint); }

/* ---- Perfil del cliente (modal-auth) ---- */
.perfil-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.perfil-avatar {
  width: 46px; height: 46px; flex: 0 0 46px;
  border-radius: 50%; display: grid; place-items: center;
  background: var(--verde); color: #fff; font-weight: 800; font-size: 20px;
}
.perfil-sec {
  background: var(--crema); border: 1px solid var(--linea);
  border-radius: var(--r); padding: 14px; margin-bottom: 12px;
}
.perfil-plan { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.perfil-plan-label { display: block; font-size: 12px; color: var(--texto-soft); text-transform: uppercase; letter-spacing: .04em; }
.perfil-plan strong { font-size: 17px; color: var(--verde-deep); }
.perfil-nota { font-size: 13px; color: var(--texto-soft); margin: 10px 0 0; }
.perfil-nota.aviso { color: var(--rojo); }
.perfil-sec #btn-cancelar-sub { margin-top: 12px; }

/* Enlace de texto sutil (¿olvidaste contraseña?, reenviar correo) */
.link-sutil {
  background: none; border: none; padding: 0; cursor: pointer;
  color: var(--verde); font-weight: 600; font-size: 13px;
  text-decoration: underline; text-underline-offset: 2px;
}
.link-sutil:disabled { opacity: .55; cursor: not-allowed; }

/* Aviso "confirma tu correo" en el perfil */
.perfil-aviso-email {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--limon, #f3efd0); color: var(--verde-deep);
  border: 1px solid var(--linea); border-radius: var(--r);
  padding: 11px 14px; margin-bottom: 12px; font-size: 13px; font-weight: 600;
}
.perfil-aviso-email .link-sutil { white-space: nowrap; }

/* ---------- Pestañas Cámara / Despensa ---------- */
.tabs {
  display: flex; gap: 4px; padding: 4px;
  background: var(--crema-2); border-radius: 999px;
  box-shadow: inset 0 0 0 1px var(--linea);
  margin: 4px 2px 16px;
}
.tab {
  flex: 1; font-weight: 700; font-size: 14px;
  padding: 9px 12px; border-radius: 999px; color: var(--texto-soft);
  transition: all .15s ease;
}
.tab.on { background: var(--verde); color: #fff; box-shadow: var(--sombra-sm); }
.vista[hidden] { display: none; }

/* ---------- Despensa ---------- */
.despensa-search { position: relative; }
#despensa-input {
  width: 100%; font-family: inherit; font-size: 15px;
  padding: 14px 16px; border-radius: var(--r);
  background: var(--crema-2); color: var(--texto);
  border: 1.5px solid var(--linea); outline: none;
  transition: border-color .12s ease;
}
#despensa-input:focus { border-color: var(--verde-2); }
.autocomplete {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 10;
  background: var(--crema-2); border-radius: var(--r);
  box-shadow: var(--sombra); border: 1px solid var(--linea);
  overflow: hidden; max-height: 280px; overflow-y: auto;
}
.autocomplete button {
  display: flex; width: 100%; align-items: center; justify-content: space-between;
  padding: 12px 16px; font-size: 15px; color: var(--texto); text-align: left;
  border-bottom: 1px solid var(--linea);
}
.autocomplete button:last-child { border-bottom: none; }
.autocomplete button:hover, .autocomplete button:focus { background: var(--verde-tint); }
.autocomplete .cat { font-size: 11px; color: var(--texto-soft); text-transform: capitalize; }
.despensa-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 2px 4px; min-height: 8px; }
.despensa-chips .chip { cursor: pointer; }
.despensa-chips .chip .x { font-weight: 800; opacity: .55; margin-left: 2px; }
.despensa-chips .chip:hover .x { opacity: 1; }

/* ---------- HÉROE: visor de cámara ---------- */
.viewer-wrap { margin-top: 6px; }
.viewer {
  position: relative;
  aspect-ratio: 4/5;
  border-radius: var(--r-lg);
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 50% 40%, #cfe0bf 0%, #9bbd86 60%, #7aa45c 100%);
  display: grid; place-items: center;
  box-shadow: var(--sombra-lg);
  -webkit-mask-image: radial-gradient(140% 140% at 50% 50%, #000 70%, rgba(0,0,0,.92));
}
.viewer.has-photo { background: var(--verde-deep); }
.viewer .preview { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* esquinas de encuadre */
.frame i { position: absolute; width: 28px; height: 28px; border: 3px solid rgba(255,255,255,.9); }
.frame i:nth-child(1){ top: 18px; left: 18px; border-right: 0; border-bottom: 0; border-radius: 8px 0 0 0; }
.frame i:nth-child(2){ top: 18px; right: 18px; border-left: 0; border-bottom: 0; border-radius: 0 8px 0 0; }
.frame i:nth-child(3){ bottom: 18px; left: 18px; border-right: 0; border-top: 0; border-radius: 0 0 0 8px; }
.frame i:nth-child(4){ bottom: 18px; right: 18px; border-left: 0; border-top: 0; border-radius: 0 0 8px 0; }

/* scan-line animada (solo en idle) */
.scanline {
  position: absolute; left: 10%; right: 10%; height: 3px;
  background: var(--limon); border-radius: 3px;
  box-shadow: 0 0 16px 2px var(--limon);
  animation: scan 2.6s ease-in-out infinite;
}
@keyframes scan { 0%,100%{ top: 22%; opacity:.4 } 50%{ top: 78%; opacity:1 } }
.viewer.has-photo .scanline, .viewer.loading .scanline { display: none; }

.viewer .hint {
  position: absolute; top: 16px; left: 50%; transform: translateX(-50%);
  color: #fff; font-weight: 600; font-size: 12.5px;
  padding: 6px 14px; border-radius: 999px;
  background: rgba(47,64,50,.55); backdrop-filter: blur(4px);
  white-space: nowrap;
}

/* shutter (botón de captura) — clip-path no default */
.shutter-bar { display: flex; justify-content: center; margin-top: -34px; position: relative; z-index: 3; }
.shutter {
  width: 72px; height: 72px; border-radius: 50%;
  background: #fff; box-shadow: var(--sombra);
  display: grid; place-items: center;
  transition: transform .12s ease;
}
.shutter:active { transform: scale(.92); }
.shutter::after {
  content: ''; width: 54px; height: 54px; border-radius: 50%;
  background: var(--verde);
  box-shadow: inset 0 0 0 4px #fff;
}
.shutter.busy::after { background: var(--limon); animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 0%,100%{ transform: scale(1) } 50%{ transform: scale(.82) } }

.subhint { text-align: center; color: var(--texto-soft); font-size: 13px; margin-top: 12px; }
.subhint b { color: var(--verde); }

/* ---------- Chips de ingredientes ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 2px 4px; }
.chip {
  font-size: 13px; font-weight: 600;
  padding: 8px 13px; border-radius: 999px;
  background: var(--verde-tint); color: var(--verde);
  box-shadow: inset 0 0 0 1px rgba(63,111,74,.18);
  display: inline-flex; align-items: center; gap: 7px;
  animation: chipin .35s cubic-bezier(.2,.8,.3,1) backwards;
}
.chip.dudoso { background: var(--limon-tint); color: var(--limon-deep); box-shadow: inset 0 0 0 1px rgba(138,109,18,.22); }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .6; }
@keyframes chipin { from { opacity: 0; transform: translateY(6px) scale(.96); } }

/* ---------- Cards de receta ---------- */
.section-h { display: flex; align-items: baseline; justify-content: space-between; margin: 26px 2px 14px; }
.section-h h2 { font-size: 19px; font-weight: 800; letter-spacing: -.01em; }
.section-h .count { font-size: 13px; color: var(--texto-soft); font-weight: 600; }

/* Grupos de recetas por categoría (Plato, Postre, …) */
.grupo-cat { margin-bottom: 18px; }
.cat-h {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: var(--verde); margin: 0 2px 10px;
}
.cat-h span {
  font-size: 11px; font-weight: 700; color: var(--verde);
  background: var(--verde-tint); border-radius: 999px; padding: 1px 8px;
}

.cards { display: grid; gap: 14px; }
.card {
  background: var(--crema-2); border-radius: var(--r);
  padding: 15px 16px; box-shadow: var(--sombra-sm);
  border: 1px solid var(--linea);
  transition: transform .14s ease, box-shadow .14s ease;
  text-align: left; width: 100%;
}
.card:active { transform: translateY(1px); }
.card:hover { box-shadow: var(--sombra); }
.card .ct { font-size: 16px; font-weight: 700; color: var(--verde-deep); line-height: 1.3; }
.card .meta { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 11px; align-items: center; }
.badge {
  font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 8px;
  background: var(--verde-tint); color: var(--verde);
}
.badge.tipo-postre { background: #f4e3ec; color: #9c3f6a; }
.badge.tipo-bebida { background: #e0eef0; color: #2f6f7a; }
.badge.tipo-snack  { background: var(--limon-tint); color: var(--limon-deep); }
.badge.t { background: transparent; color: var(--texto-soft); padding-left: 2px; }
.badge.combo { background: var(--verde); color: #fff; }
.fav-star { margin-left: auto; color: var(--limon); font-size: 18px; line-height: 1; }

/* ---------- Estados ---------- */
.skeleton { background: var(--crema-2); border-radius: var(--r); border: 1px solid var(--linea); padding: 15px 16px; }
.skeleton .l { height: 13px; border-radius: 6px; background: linear-gradient(90deg,#eee7d8,#f3eee2,#eee7d8); background-size: 200% 100%; animation: shine 1.3s linear infinite; }
.skeleton .l.t { width: 70%; height: 17px; margin-bottom: 11px; }
.skeleton .l.s { width: 40%; }
@keyframes shine { from{ background-position: 200% 0 } to{ background-position: -200% 0 } }

.empty { text-align: center; padding: 40px 20px; color: var(--texto-soft); }
.empty .ic { width: 64px; height: 64px; margin: 0 auto 14px; color: var(--verde-2); }
.empty p { font-size: 14px; max-width: 280px; margin: 0 auto; }

/* ---------- Filtros dietéticos ---------- */
.filtros-wrap { position: relative; margin-top: 6px; }
.filtros-wrap::after {
  content: ''; position: absolute; top: 0; right: 0; bottom: 0; width: 36px;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(246,241,231,0), var(--crema));
}
.filtros { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 2px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.filtros::-webkit-scrollbar { display: none; }
.filtro {
  flex: 0 0 auto; font-size: 13px; font-weight: 600;
  padding: 7px 14px; border-radius: 999px;
  background: var(--crema-2); color: var(--texto-soft);
  box-shadow: inset 0 0 0 1.5px var(--linea);
  transition: all .12s ease;
}
.filtro.on { background: var(--verde); color: #fff; box-shadow: none; }

/* ---------- Modal (detalle + auth + planes) ---------- */
.modal-bg {
  position: fixed; inset: 0; background: rgba(47,64,50,.5);
  backdrop-filter: blur(3px);
  display: none; align-items: flex-end; justify-content: center; z-index: 50;
}
.modal-bg.open { display: flex; }
.modal {
  background: var(--crema-2); width: 100%; max-width: 560px;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  max-height: 92dvh; overflow-y: auto;
  padding: 8px 20px 32px;
  animation: up .28s cubic-bezier(.2,.8,.3,1);
}
@keyframes up { from { transform: translateY(100%); } }
.modal .grip { width: 42px; height: 5px; border-radius: 3px; background: var(--linea); margin: 8px auto 16px; }
.modal h3 { font-size: 22px; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; }
.modal .meta { margin: 14px 0 18px; }
.modal h4 { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--verde); margin: 20px 0 10px; }
.modal ul, .modal ol { padding-left: 4px; list-style: none; }
.modal .ing li { padding: 9px 0; border-bottom: 1px solid var(--linea); font-size: 15px; display: flex; gap: 10px; }
.modal .ing li::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--verde-2); margin-top: 8px; flex: 0 0 auto; }
.modal .pasos li { counter-increment: paso; padding: 12px 0 12px 42px; position: relative; font-size: 15px; border-bottom: 1px solid var(--linea); }
.modal .pasos li::before {
  content: counter(paso); position: absolute; left: 0; top: 10px;
  width: 28px; height: 28px; border-radius: 9px;
  background: var(--verde-tint); color: var(--verde);
  display: grid; place-items: center; font-weight: 800; font-size: 14px;
}
.modal .pasos { counter-reset: paso; }
.modal .actions { display: flex; gap: 10px; margin-top: 24px; position: sticky; bottom: 0; background: var(--crema-2); padding: 12px 0 0; }

/* formularios auth */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--texto-soft); margin-bottom: 6px; }
.field input, .field select {
  width: 100%; font-family: inherit; font-size: 15px;
  padding: 12px 14px; border-radius: var(--r-sm);
  background: #fff; color: var(--texto);
  border: 1.5px solid var(--linea); outline: none;
  transition: border-color .12s ease;
}
.field input:focus { border-color: var(--verde-2); }
.msg { font-size: 13px; padding: 10px 12px; border-radius: var(--r-sm); margin-bottom: 12px; }
.msg.err { background: var(--rojo-tint); color: var(--rojo); }
.msg.ok { background: var(--verde-tint); color: var(--verde); }
.switch-auth { text-align: center; font-size: 13px; color: var(--texto-soft); margin-top: 14px; }
.switch-auth button { color: var(--verde); font-weight: 700; }

/* planes */
.planes { display: grid; gap: 12px; margin-top: 8px; }
.plan {
  border: 1.5px solid var(--linea); border-radius: var(--r);
  padding: 16px; background: #fff; position: relative;
}
.plan.destacado { border-color: var(--verde); box-shadow: 0 0 0 3px var(--verde-tint); }
.plan .badge-pop { position: absolute; top: -10px; right: 14px; background: var(--limon); color: var(--limon-deep); font-size: 11px; font-weight: 800; padding: 3px 10px; border-radius: 7px; }
.plan .pn { font-size: 17px; font-weight: 800; color: var(--verde-deep); }
.plan .pp { font-size: 24px; font-weight: 800; margin: 4px 0 12px; }
.plan .pp span { font-size: 14px; font-weight: 600; color: var(--texto-soft); }
.plan ul { list-style: none; font-size: 14px; }
.plan ul li { padding: 5px 0 5px 24px; position: relative; color: var(--texto); }
.plan ul li::before { content: '✓'; position: absolute; left: 0; color: var(--verde-2); font-weight: 800; }
.plan ul li.no { color: var(--texto-soft); }
.plan ul li.no::before { content: '–'; color: var(--linea); }
/* contenedor del botón PayPal: vacío hasta que el usuario elige el plan */
.paypal-box { margin-top: 10px; }
.paypal-box:empty { display: none; }

/* aviso de límite */
/* Pop-up de límite (usa la hoja #modal-auth) */
.pop-limite h3 { font-size: 24px; margin-bottom: 14px; }
.pop-barra { display: flex; gap: 6px; margin-bottom: 14px; }
.pop-barra i { flex: 1; height: 8px; border-radius: 4px; background: var(--verde-2); transform-origin: left; animation: pop-llena .45s cubic-bezier(.16,1,.3,1) both; }
.pop-barra i:last-child { background: var(--limon); }
.pop-barra i:nth-child(2) { animation-delay: .06s; } .pop-barra i:nth-child(3) { animation-delay: .12s; }
.pop-barra i:nth-child(4) { animation-delay: .18s; } .pop-barra i:nth-child(5) { animation-delay: .24s; }
@keyframes pop-llena { from { transform: scaleX(0); } }
.pop-msg { color: var(--texto-soft); font-size: 15px; margin-bottom: 18px; }
.pop-oferta { background: var(--verde-deep); color: var(--crema); border-radius: var(--r); padding: 18px; margin-bottom: 14px; }
.pop-precio { font-size: 40px; font-weight: 800; line-height: 1; color: var(--limon); }
.pop-precio span { font-size: 15px; font-weight: 600; color: var(--crema); margin-left: 4px; }
.pop-plan { font-size: 17px; font-weight: 800; margin: 6px 0 10px; }
.pop-oferta ul { list-style: none; display: grid; gap: 6px; font-size: 14px; }
.pop-oferta li::before { content: '✓'; color: var(--limon); font-weight: 800; margin-right: 8px; }
.pop-cta { font-size: 16px; padding: 15px; margin-bottom: 6px; }
.limite-aviso { background: var(--limon-tint); color: var(--limon-deep); border-radius: var(--r); padding: 14px 16px; margin: 16px 2px; font-size: 14px; font-weight: 600; display: flex; gap: 10px; align-items: center; }

/* separador entre grupos de filtros (tiempo | dificultad) */
.filtro-sep { flex: 0 0 auto; width: 1px; align-self: stretch; margin: 4px 4px; background: var(--linea); }

/* ---------- Escalar porciones (detalle) ---------- */
.porciones { display: flex; align-items: center; gap: 12px; margin: 4px 0 6px; flex-wrap: wrap; }
.porc-label { font-size: 13px; font-weight: 700; color: var(--texto-soft); text-transform: uppercase; letter-spacing: .06em; }
.porc-pills { display: inline-flex; gap: 6px; background: var(--crema); padding: 4px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--linea); }
.porc-btn {
  min-width: 36px; padding: 6px 12px; border-radius: 999px;
  font-weight: 700; font-size: 14px; color: var(--texto-soft);
  transition: all .12s ease;
}
.porc-btn.on { background: var(--verde); color: #fff; box-shadow: var(--sombra-sm); }

/* ---------- Modo cocina (paso a paso fullscreen) ---------- */
.cocina {
  position: fixed; inset: 0; z-index: 100;
  background: var(--verde-deep); color: #fff;
  display: flex; flex-direction: column;
  padding: max(20px, env(safe-area-inset-top)) 22px max(22px, env(safe-area-inset-bottom));
  animation: cocina-in .25s ease;
}
@keyframes cocina-in { from { opacity: 0; } }
.cocina-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cocina-titulo { font-weight: 800; font-size: 16px; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cocina-x { width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,.12); color: #fff; font-size: 18px; flex: 0 0 auto; }
.cocina-progreso { display: flex; gap: 5px; margin: 18px 0 0; }
.cocina-progreso i { flex: 1; height: 4px; border-radius: 2px; background: rgba(255,255,255,.18); transition: background .2s ease; }
.cocina-progreso i.on { background: var(--limon); }
.cocina-cuerpo { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.cocina-num { font-size: 14px; font-weight: 700; color: var(--limon); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 18px; }
.cocina-paso { font-size: clamp(22px, 6vw, 30px); line-height: 1.35; font-weight: 600; }
.cocina-nav { display: flex; gap: 12px; }
.cocina-nav .btn { flex: 1; padding: 16px; font-size: 16px; }
.cocina-nav .btn.outline { background: rgba(255,255,255,.1); color: #fff; box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.25); }

/* ---------- Lista de compras ---------- */
.lista-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 2px 14px; flex-wrap: wrap; }
.lista-acciones { display: flex; gap: 8px; }
.lista-items { list-style: none; display: grid; gap: 10px; }
.lista-item {
  display: flex; align-items: center; gap: 8px;
  background: var(--crema-2); border: 1px solid var(--linea);
  border-radius: var(--r); box-shadow: var(--sombra-sm);
  overflow: hidden;
}
.lc-check {
  flex: 1; display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; text-align: left; color: var(--texto); font-size: 15px;
}
.lc-check .box {
  width: 22px; height: 22px; flex: 0 0 auto; border-radius: 7px;
  border: 2px solid var(--verde-2); color: #fff;
  display: grid; place-items: center; font-size: 13px; font-weight: 800;
  transition: background .12s ease, border-color .12s ease;
}
.lista-item.done .box { background: var(--verde); border-color: var(--verde); }
.lista-item.done .lc-check .txt { text-decoration: line-through; color: var(--texto-soft); }
.lc-x {
  width: 44px; align-self: stretch; flex: 0 0 auto;
  color: var(--texto-soft); font-size: 20px; font-weight: 700;
  border-left: 1px solid var(--linea);
}
.lc-x:hover { background: var(--rojo-tint); color: var(--rojo); }

/* ---------- Logo en capas + llama animada (sutil) ---------- */
/* olla fija + llama con sway suave y flicker; SOLO la llama se mueve */
.splash-logo, .brand-logo { position: relative; display: inline-block; }
.splash-logo img, .brand-logo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.splash-logo .base, .brand-logo .base { position: relative; }
.splash-logo .flame, .brand-logo .flame {
  transform-origin: 50% 70%;
  animation: llama-sway 2.6s ease-in-out infinite, llama-flick 1.5s ease-in-out infinite;
}
@keyframes llama-sway { 0%,100% { transform: rotate(-2deg); } 50% { transform: rotate(2deg); } }
@keyframes llama-flick {
  0%,100% { opacity: .9; transform: scale(1); }
  40% { opacity: 1; transform: scale(1.05); }
  75% { opacity: .85; transform: scale(.98); }
}

/* ---------- Splash de carga ---------- */
.splash {
  position: fixed; inset: 0; z-index: 200;
  background-color: var(--crema);
  background-image:
    radial-gradient(130% 90% at 12% -8%, rgba(122,164,92,.22), transparent 55%),
    radial-gradient(110% 75% at 100% 5%, rgba(232,195,74,.16), transparent 52%),
    radial-gradient(95% 95% at 50% 118%, rgba(63,111,74,.13), transparent 60%);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px;
  transition: opacity .4s ease, visibility .4s ease;
}
/* misma textura grain del fondo, dentro del splash */
.splash::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHdpZHRoPScxNjAnIGhlaWdodD0nMTYwJz4gPGZpbHRlciBpZD0nbic+IDxmZVR1cmJ1bGVuY2UgdHlwZT0nZnJhY3RhbE5vaXNlJyBiYXNlRnJlcXVlbmN5PScwLjknIG51bU9jdGF2ZXM9JzQnIHN0aXRjaFRpbGVzPSdzdGl0Y2gnLz4gPGZlQ29sb3JNYXRyaXggdHlwZT0nc2F0dXJhdGUnIHZhbHVlcz0nMCcvPiA8L2ZpbHRlcj4gPHJlY3Qgd2lkdGg9JzEwMCUnIGhlaWdodD0nMTAwJScgZmlsdGVyPSd1cmwoI24pJyBvcGFjaXR5PScwLjU1Jy8+IDwvc3ZnPg==");
  background-size: 160px 160px; opacity: .55; mix-blend-mode: multiply;
}
.splash > * { position: relative; z-index: 1; }
.splash-by { font-size: 12px; color: var(--texto-soft); letter-spacing: .02em; margin-top: 6px; }
.splash-by b { color: var(--verde); font-weight: 700; }
.splash.hide { opacity: 0; visibility: hidden; }
.splash-logo { width: 170px; height: 156px; }
.splash-word { font-weight: 800; font-size: 34px; letter-spacing: -.03em; }
.splash-word span { color: var(--verde); }
.splash-word b { color: var(--verde-deep); }
.splash-bar { width: 120px; height: 4px; border-radius: 3px; background: var(--linea); overflow: hidden; }
.splash-bar::after {
  content: ''; display: block; height: 100%; width: 40%; border-radius: 3px;
  background: var(--limon); animation: splash-load 1.3s ease-in-out infinite;
}
@keyframes splash-load { 0% { transform: translateX(-100%); } 100% { transform: translateX(350%); } }

/* header: el logo real reemplaza al .mark svg */
.brand-logo { width: 34px; height: 31px; flex: 0 0 auto; }

/* ----------------------------------------------------------------------
 * RESPONSIVE MÓVIL
 * El layout base es de 1 columna (max 560px), ya casi mobile-first. Aquí
 * solo corregimos lo que se rompe en pantallas reales pequeñas:
 *   - inputs a 16px → iOS NO hace zoom al enfocar (su umbral es <16px).
 *   - paddings/tipografías ajustadas para no apretar en 360-390px.
 *   - los filtros ya hacen scroll-x (no se apilan); reforzamos el área táctil.
 * No toca desktop (todo va dentro de max-width).
 * -------------------------------------------------------------------- */

/* Evitar zoom de iOS al enfocar cualquier input/select: 16px mínimo.
   Aplica en todos los anchos (es una mejora, no un breakpoint). */
#despensa-input,
.field input,
.field select,
.autocomplete button { font-size: 16px; }

@media (max-width: 480px) {
  .app { padding: 0 13px 92px; }

  /* Tabs: que las 3 quepan sin apretarse; texto un punto más chico */
  .tab { font-size: 13px; padding-left: 6px; padding-right: 6px; }

  /* Header */
  .brand { font-size: 18px; }

  /* Visor de cámara: mantener proporción pero algo más compacto */
  .viewer { aspect-ratio: 1 / 1; }

  /* Filtros: área táctil cómoda al hacer scroll horizontal */
  .filtro { font-size: 12.5px; padding: 9px 14px; }

  /* Cards y secciones */
  .section-h h2 { font-size: 17px; }
  .card { padding: 14px; }
  .card .ct { font-size: 15px; }

  /* Modal de receta: ocupa más alto útil, títulos proporcionados */
  .modal { padding-left: 18px; padding-right: 18px; }
  .modal h3 { font-size: 20px; }

  /* Lista de compras: filas con buen target táctil */
  .lista-item { gap: 8px; }
}

/* Pantallas muy estrechas (≤360px: iPhone SE, Android compactos) */
@media (max-width: 360px) {
  .tab { font-size: 12.5px; letter-spacing: -.01em; }
  .filtros { gap: 6px; }
  .brand-logo { width: 28px; height: 26px; }
}

/* ---------- Cámara circular ---------- */
/* overflow-x: clip evita que el aro rotado ensanche la página (la caja de un
   elemento girado crece en diagonal). */
.cam-zona { overflow-x: clip; display: flex; flex-direction: column; align-items: center; padding: 18px 0 4px; }
.cam { --d: min(76vw, 300px); position: relative; width: var(--d); height: var(--d); display: grid; place-items: center; }
.cam::before { content: ''; position: absolute; inset: 0; border-radius: 50%; box-shadow: inset 0 0 0 3px rgba(63,111,74,.12); }
.cam .aro {
  position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0deg, rgba(63,111,74,0) 150deg,
    rgba(63,111,74,.55) 250deg, var(--verde) 320deg, var(--verde-2) 350deg, #f3e7a8 358deg, transparent 360deg);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 5px));
          mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 5px));
  filter: drop-shadow(0 0 4px rgba(122,164,92,.9)) drop-shadow(0 0 12px rgba(232,195,74,.55));
  animation: cam-gira 3.2s linear infinite;
}
.cam .halo {
  position: absolute; inset: -10px; border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 300deg, rgba(232,195,74,.6) 352deg, transparent 360deg);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 22px), #000 calc(100% - 14px), transparent);
          mask: radial-gradient(farthest-side, transparent calc(100% - 22px), #000 calc(100% - 14px), transparent);
  filter: blur(6px);
  animation: cam-gira 3.2s linear infinite;
}
/* analizando: el aro acelera */
.cam.loading .aro, .cam.loading .halo { animation-duration: 1.1s; }
@keyframes cam-gira { to { transform: rotate(360deg); } }
.cam .lente {
  position: relative; width: calc(100% - 26px); height: calc(100% - 26px);
  border-radius: 50%; overflow: hidden;
  background: radial-gradient(120% 90% at 50% 35%, #cfe0bf 0%, #9bbd86 60%, #7aa45c 100%);
  box-shadow: var(--sombra-lg), inset 0 0 0 6px rgba(253,251,246,.9);
  display: grid; place-items: center;
}
.cam .preview { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cam .disparo {
  position: relative; z-index: 2; width: 86px; height: 86px; border-radius: 50%;
  background: var(--crema-2); color: var(--verde);
  display: grid; place-items: center;
  box-shadow: 0 12px 28px -10px rgba(47,64,50,.55), inset 0 0 0 1px rgba(63,111,74,.12);
  transition: transform .15s cubic-bezier(.16,1,.3,1), width .3s, height .3s;
}
.cam .disparo:active { transform: scale(.93); }
.cam .disparo svg { width: 36px; height: 36px; }
/* con foto: el botón se achica para dejar ver la foto (tocar de nuevo = otra foto) */
.cam.has-photo .disparo { width: 58px; height: 58px; opacity: .92; }
.cam.has-photo .disparo svg { width: 26px; height: 26px; }
.cam .disparo.busy svg { animation: pulse 1s ease-in-out infinite; }
.cam-zona .subhint { margin-top: 16px; }

/* ---------- Filtros: un color por grupo ---------- */
.filtros-wrap::after { display: none; }
.filtros { align-items: center; }
.filtro.f-dieta { background: var(--verde-tint); color: var(--verde); }
.filtro.f-tiempo { background: var(--limon-tint); color: var(--limon-deep); }
.filtro.f-dif { background: var(--crema-2); color: var(--verde-deep); box-shadow: inset 0 0 0 1.5px var(--linea); }
.filtro.f-dieta.on, .filtro.f-tiempo.on, .filtro.f-dif.on { background: var(--verde); color: #fff; box-shadow: none; }
.f-barra { flex: 0 0 auto; width: 2px; height: 22px; margin: 0 6px; border-radius: 2px; background: var(--verde-2); }

/* ---------- Planes ---------- */
.pl-titulo { font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.pl-sub { color: var(--texto-soft); font-size: 14px; margin: 4px 0 16px; }
.pl-switch { position: relative; display: grid; grid-template-columns: 1fr 1fr; background: var(--crema); border-radius: 999px; padding: 4px; margin-bottom: 14px; box-shadow: inset 0 0 0 1px var(--linea); }
.pl-switch button { position: relative; z-index: 1; padding: 11px; font-weight: 700; font-size: 15px; color: var(--texto-soft); transition: color .25s; }
.pl-switch button.on { color: #fff; }
.pl-switch .ficha { position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); border-radius: 999px; background: var(--verde); box-shadow: var(--sombra-sm); transition: transform .35s cubic-bezier(.16,1,.3,1); }
.pl-switch.chef .ficha { transform: translateX(100%); }
.pl-bloque { position: relative; overflow: hidden; border-radius: 22px; padding: 22px 20px 20px; background: linear-gradient(160deg, #36513b 0%, var(--verde-deep) 55%, #26352a 100%); color: var(--crema); box-shadow: 0 24px 40px -24px rgba(47,64,50,.8); }
.pl-bloque::before { content: ''; position: absolute; left: 20px; right: 20px; top: 0; height: 1px; background: linear-gradient(90deg, transparent, rgba(232,195,74,.8), transparent); }
.pl-bloque .marca-agua { position: absolute; right: -24px; bottom: -18px; width: 150px; opacity: .08; filter: grayscale(1) brightness(3); pointer-events: none; }
.pl-contenido { position: relative; animation: pl-entra .3s cubic-bezier(.16,1,.3,1); }
.pl-contenido[hidden] { display: none; }
@keyframes pl-entra { from { opacity: 0; transform: translateY(6px); } }
.pl-nombre { font-size: 15px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--verde-2); }
.pl-precio { display: flex; align-items: baseline; gap: 6px; margin: 6px 0 4px; }
.pl-precio b { font-size: 52px; font-weight: 800; line-height: 1; color: var(--limon); letter-spacing: -.03em; }
.pl-precio span { font-size: 15px; font-weight: 600; opacity: .85; }
.pl-frase { font-size: 14px; opacity: .8; margin-bottom: 16px; }
.pl-lista { list-style: none; display: grid; gap: 10px; margin-bottom: 20px; }
.pl-lista li { display: flex; gap: 10px; align-items: center; font-size: 15px; }
.pl-lista li svg { flex: 0 0 auto; width: 20px; height: 20px; color: var(--limon); }
.pl-cta { width: 100%; padding: 16px; border-radius: 999px; background: var(--limon); color: var(--limon-deep); font-size: 16px; font-weight: 800; box-shadow: 0 10px 22px -10px rgba(232,195,74,.9); transition: transform .15s; }
.pl-cta:active { transform: scale(.97); }
.pl-bloque .paypal-box { margin-top: 10px; }
.pl-bloque .paypal-box p { color: var(--crema) !important; opacity: .85; }
.pl-gratis { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 16px; padding: 14px 4px 0; font-size: 13px; color: var(--texto-soft); border-top: 1px solid var(--linea); }
.pl-gratis b { color: var(--texto); }

/* Respetar el notch / safe-area en iOS (viewport-fit=cover ya está en el HTML) */
@supports (padding: max(0px)) {
  .app { padding-bottom: max(92px, calc(92px + env(safe-area-inset-bottom))); }
}

@media (prefers-reduced-motion: reduce) { * { animation: none !important; } }
