:root {
  --bg: #faf7f2;
  --card: #ffffff;
  --ink: #2b2320;
  --muted: #8a7d72;
  --accent: #d2541e;
  --accent-soft: #fbe9e0;
  --accent-ink: #9a3d15;
  --line: #ece4d9;
  --radius: 16px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
}

header {
  padding: 22px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--card);
  position: sticky;
  top: 0;
  z-index: 5;
}

header h1 { font-size: 20px; margin: 0; letter-spacing: -0.3px; }
header h1 span { color: var(--accent); }
header nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  margin-left: 16px;
}
header nav a:hover { color: var(--accent); }

main { max-width: 1000px; margin: 0 auto; padding: 24px 20px 60px; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 22px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.card__body { padding: 14px 16px 18px; }
.card__title { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.card__title h3 { margin: 0; font-size: 17px; }
.card__price { color: var(--accent); font-weight: 600; white-space: nowrap; }
.card__desc { color: var(--muted); font-size: 14px; margin: 6px 0 0; }
.card__likes { font-size: 13px; color: #e0245e; margin: 6px 0 0; }
.card__likes .top-badge {
  color: #8a5a00; background: #fbeecb; font-weight: 600;
  font-size: 11px; padding: 2px 8px; border-radius: 20px; margin-left: 6px;
}

/* botón "ver en grande" en cada plato */
.expand360 {
  margin-top: 12px;
  width: 100%;
  background: none;
  border: 1px solid var(--line);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
}
.expand360:hover { border-color: var(--accent); color: var(--accent); }

/* ===== vista fullscreen estilo reel (carrusel vertical) ===== */
.reel { position: fixed; inset: 0; z-index: 100; background: #000; }
.reel[hidden] { display: none; }
.reel__close {
  position: absolute; top: max(12px, env(safe-area-inset-top)); right: 12px; z-index: 6;
  background: rgba(0,0,0,0.35); border: 0; color: #fff;
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.reel__close svg { width: 22px; height: 22px; display: block; }

.reel__pager {
  position: absolute; inset: 0; margin: 0 auto; max-width: 500px;
  overflow-y: auto; scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.reel__pager::-webkit-scrollbar { display: none; }
.reel__slide {
  position: relative; height: 100%; overflow: hidden; background: #14110f;
  scroll-snap-align: start; scroll-snap-stop: always;
}

.reel__media { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.reel__canvas { width: 100%; max-height: 100%; }

.reel__top {
  position: absolute; top: 0; left: 0; right: 0; z-index: 2;
  display: flex; align-items: center; gap: 10px;
  padding: 14px; padding-top: max(14px, env(safe-area-inset-top));
}
.reel__avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255,255,255,0.92); color: #1c1916;
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600;
}
.reel__name { color: #fff; font-size: 14px; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.5); }

.reel__side {
  position: absolute; right: 10px; bottom: 128px; z-index: 2;
  display: flex; flex-direction: column; gap: 20px;
}
.reel__act {
  background: none; border: 0; color: #fff; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  font: inherit; font-size: 11px; text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}
.reel__act svg { width: 30px; height: 30px; }
.reel__likecount { font-size: 12px; font-weight: 600; }
.reel__act.is-on { color: #ff3b6b; }
.reel__act.js-like.is-on svg { fill: #ff3b6b; }
.reel__act.js-save.is-on svg { fill: #fff; }

.reel__caption {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  padding: 16px; padding-bottom: calc(16px + env(safe-area-inset-bottom));
  background: rgba(0,0,0,0.55);
}
.reel__title { color: #fff; font-size: 16px; font-weight: 600; }
.reel__title span { color: #ffb694; font-weight: 500; }
.reel__desc { color: rgba(255,255,255,0.85); font-size: 14px; line-height: 1.5; margin: 3px 0 0; }

/* hoja "Compartir" dentro del reel */
.sharesheet { position: absolute; inset: 0; z-index: 8; display: flex; align-items: flex-end; }
.sharesheet[hidden] { display: none; }
.sharesheet__backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.5); }
.sharesheet__panel {
  position: relative; z-index: 1; width: 100%; max-width: 500px; margin: 0 auto;
  background: var(--card); border-radius: 18px 18px 0 0;
  padding: 10px 12px calc(14px + env(safe-area-inset-bottom)); animation: sheetUp .18s ease;
}
@keyframes sheetUp { from { transform: translateY(30px); opacity: .5; } to { transform: none; opacity: 1; } }
.sharesheet__title { text-align: center; font-size: 13px; color: var(--muted); padding: 8px 0 10px; }
.sharesheet__item { display: flex; align-items: center; gap: 14px; width: 100%; border: 0; background: none; padding: 13px 10px; font: inherit; font-size: 15px; color: var(--ink); cursor: pointer; border-radius: 12px; text-align: left; }
.sharesheet__item:active { background: var(--bg); }
.sharesheet__ic { width: 38px; height: 38px; border-radius: 50%; background: var(--bg); display: flex; align-items: center; justify-content: center; flex: none; color: var(--ink); }
.sharesheet__ic svg { width: 20px; height: 20px; }
.sharesheet__ic--wa { background: #25D366; color: #fff; }
.sharesheet__cancel { width: 100%; border: 0; background: var(--bg); margin-top: 8px; padding: 13px; font: inherit; font-size: 15px; font-weight: 600; color: var(--ink); border-radius: 12px; cursor: pointer; }

.reel__toast { position: absolute; left: 50%; bottom: 92px; transform: translateX(-50%) translateY(10px); z-index: 9; background: rgba(0,0,0,0.82); color: #fff; font-size: 13px; padding: 8px 16px; border-radius: 20px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.reel__toast.is-on { opacity: 1; transform: translateX(-50%); }

/* ===== carta como feed (estilo Instagram) ===== */
.feed-body { background: var(--bg); }

.igtop {
  position: sticky; top: 0; z-index: 10;
  background: var(--card); border-bottom: 1px solid var(--line);
}
.igtop__inner {
  max-width: 470px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px;
}
.igtop__name { font-size: 19px; font-weight: 700; letter-spacing: -0.3px; }
.igtop__btn {
  background: none; border: 0; padding: 0; cursor: pointer;
  width: 26px; height: 26px; color: var(--ink);
}
.igtop__btn svg { width: 24px; height: 24px; display: block; }
.igtop__btn.ok { color: var(--accent); }

/* historias (categorías) */
.stories {
  max-width: 470px; margin: 0 auto;
  display: flex; gap: 14px; overflow-x: auto; padding: 12px 14px;
  background: var(--card); border-bottom: 1px solid var(--line);
  scrollbar-width: none;
}
.stories::-webkit-scrollbar { display: none; }
.story {
  flex: none; background: none; border: 0; padding: 0; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 5px; width: 64px;
}
.story__ring {
  width: 60px; height: 60px; border-radius: 50%;
  border: 2px solid var(--line); background: #f7f2ea;
  display: flex; align-items: center; justify-content: center;
}
.story__ic { font-size: 20px; font-weight: 700; color: var(--muted); }
.story__img { width: 52px; height: 52px; border-radius: 50%; overflow: hidden; display: block; }
.story__img img { width: 100%; height: 100%; object-fit: cover; }
.story.is-active .story__ring { border-color: var(--accent); }
.story.is-active .story__ic { color: var(--accent); }
.story__label {
  font-size: 11px; color: var(--muted); max-width: 64px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.story.is-active .story__label { color: var(--ink); }

.post__cat { display: block; font-size: 11px; color: var(--muted); }
.post__price-chip {
  margin-left: auto; flex: none; white-space: nowrap;
  background: var(--accent); color: #fff;
  font-size: 14px; font-weight: 600;
  padding: 6px 13px; border-radius: 20px;
}
.media-badge {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  font-size: 11px; color: #fff; background: rgba(0,0,0,0.55);
  padding: 3px 9px; border-radius: 20px; pointer-events: none;
}

.feed { max-width: 470px; margin: 0 auto; padding: 0; }

.post { background: var(--card); border-bottom: 1px solid var(--line); }
.post__head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
.post__avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: #f2ebe1; color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; flex: none;
}
.post__id { min-width: 0; }
.post__handle { font-size: 14px; font-weight: 600; }
.post__type {
  margin-left: auto; flex: none;
  font-size: 11px; color: var(--accent); background: #f3ede4;
  padding: 3px 9px; border-radius: 20px;
}

.post__media { width: 100%; background: #f1ece4; position: relative; }

.post__actions { display: flex; align-items: center; gap: 14px; padding: 9px 12px 3px; }
.act {
  background: none; border: 0; padding: 0; cursor: pointer;
  width: 27px; height: 27px; color: var(--ink); transition: transform .1s;
}
.act:active { transform: scale(0.88); }
.act svg { width: 27px; height: 27px; display: block; }
.act.view { margin-left: auto; }
.act.like.is-on { color: #e0245e; }
.act.like.is-on svg { fill: #e0245e; }
.act.save.is-on svg { fill: var(--ink); }

/* cloudimage-360 inyecta un `svg { color/fill }` GLOBAL que pisa nuestros íconos;
   lo neutralizamos aquí para que mantengan su color y sean de contorno. */
.act svg, .igtop__btn svg { color: var(--ink); fill: none; }
.reel__act svg, .reel__close svg { color: #fff; fill: none; }

.post__likes { padding: 2px 12px 0; font-size: 13px; font-weight: 600; color: var(--ink); }
.post__caption { padding: 3px 12px 14px; font-size: 14px; line-height: 1.5; }
.post__line { display: flex; align-items: baseline; gap: 8px; }
.post__name { font-weight: 600; }
.post__price { color: var(--accent); font-weight: 600; white-space: nowrap; }
.post__desc { color: var(--muted); margin: 3px 0 0; }
.post--text { border-bottom: 1px solid var(--line); }
.post--text .post__caption { padding-top: 2px; }

.feed__foot { text-align: center; color: var(--muted); font-size: 12px; padding: 22px; }
.feed__foot span { color: var(--accent); font-weight: 700; }

/* ===== header de la carta (estilo app) ===== */
.apphead { max-width: 470px; margin: 0 auto; background: var(--card); padding: 14px 16px 12px; }
.apphead__name { font-size: 21px; font-weight: 700; margin: 0; letter-spacing: -0.3px; }
.apphead__tag { font-size: 13px; color: var(--muted); margin: 3px 0 0; }

/* barra de categorías (fija) + interruptor de vista a la derecha */
.cats {
  max-width: 470px; margin: 0 auto;
  display: flex; align-items: center; gap: 10px;
  padding: 9px 16px; background: var(--card);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 6;
}
.cats__chips { display: flex; gap: 8px; overflow-x: auto; flex: 1; min-width: 0; scrollbar-width: none; }
.cats__chips::-webkit-scrollbar { display: none; }
.cats .viewtoggle { flex: none; }
.chip {
  flex: none; white-space: nowrap; cursor: pointer;
  border: 1px solid var(--line); background: #fffdfa; color: var(--muted);
  border-radius: 20px; padding: 7px 15px; font: inherit; font-size: 13px;
}
.chip.is-active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* interruptor de vista (feed / lista) */
.viewtoggle { display: inline-flex; border: 1px solid var(--line); border-radius: 20px; overflow: hidden; }
.viewtoggle button { background: none; border: 0; padding: 5px 11px; cursor: pointer; color: var(--muted); display: flex; align-items: center; }
.viewtoggle button svg { width: 18px; height: 18px; fill: none; color: inherit; }
.viewtoggle button.is-active { background: var(--accent); color: #fff; }

/* vista lista (tipo delivery) */
#feed.lista { background: var(--card); }
.lrow { display: flex; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--line); align-items: flex-start; }
.lrow.is-tappable { cursor: pointer; }
.lrow.is-tappable:active { background: var(--bg); }
.lrow__info { flex: 1; min-width: 0; }
.lrow__name { font-size: 15px; font-weight: 600; }
.lrow__desc { font-size: 13px; color: var(--muted); line-height: 1.4; margin: 3px 0 6px; }
.lrow__meta { display: flex; align-items: center; gap: 10px; }
.lrow__price { font-size: 14px; font-weight: 600; color: var(--accent); }
.lrow__likes { font-size: 12px; color: #e0245e; }
.lrow__thumb { position: relative; flex: none; }
.lrow__thumb img { width: 84px; height: 84px; border-radius: 12px; object-fit: cover; display: block; background: #f1ece4; }
.lrow__badge { position: absolute; top: 5px; left: 5px; font-size: 10px; color: #fff; background: rgba(0,0,0,0.55); padding: 2px 7px; border-radius: 20px; }


/* contenedor del visor de Scaleflex (js-cloudimage-360-view) */
.dish360 {
  width: 100%;
  min-height: 200px;
  position: relative;
  background: #f1ece4;
  overflow: hidden;
}
.dish360 canvas, .dish360 img { display: block; width: 100%; }

/* ===== media por tipo (foto / galería) ===== */
.dish-media { width: 100%; }

.dish-photo-wrap { aspect-ratio: 4 / 3; overflow: hidden; background: #f1ece4; }
.dish-photo { width: 100%; height: 100%; object-fit: cover; display: block; }

.dish-gallery { position: relative; background: #f1ece4; }
.dish-gallery__track {
  display: flex; aspect-ratio: 4 / 3;
  overflow-x: auto; scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.dish-gallery__track::-webkit-scrollbar { display: none; }
.dish-gallery__img {
  flex: 0 0 100%; width: 100%; height: 100%;
  object-fit: cover; scroll-snap-align: center; display: block;
}
.dish-gallery__dots {
  position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 6px;
}
.dish-gallery__dots .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: rgba(255,255,255,0.6); box-shadow: 0 0 2px rgba(0,0,0,0.4);
}
.dish-gallery__dots .dot.is-active { background: #fff; }

/* variante grande (modal): mostrar completo, sin recortar */
.dish-photo-wrap.is-large, .dish-gallery.is-large { width: 100%; height: 100%; aspect-ratio: auto; background: transparent; }
.dish-photo-wrap.is-large { display: flex; align-items: center; justify-content: center; }
.dish-photo-wrap.is-large .dish-photo { object-fit: contain; }
.dish-gallery.is-large .dish-gallery__track { height: 100%; aspect-ratio: auto; }
.dish-gallery.is-large .dish-gallery__img { object-fit: contain; }

/* visor casero antiguo (sin uso, conservado por compatibilidad) */
.viewer360 {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #f1ece4;
  cursor: grab;
  touch-action: none;
  user-select: none;
  overflow: hidden;
}
.viewer360:active { cursor: grabbing; }
.viewer360__img {
  width: 100%; height: 100%; object-fit: contain; display: block;
  pointer-events: none;
  transform-origin: center center;
  transition: transform .05s linear;
}
.viewer360.is-zoomed { cursor: move; }

.viewer360__zoom {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 2;
}
.viewer360__zoom button {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.viewer360__zoom button:hover { background: rgba(0,0,0,0.75); }
.viewer360__hint {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 12px;
  padding: 5px 12px;
  border-radius: 999px;
  transition: opacity .3s;
  pointer-events: none;
}
.viewer360__loader {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 14px;
}

/* admin */
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 28px;
}
.panel h2 { margin: 0 0 4px; font-size: 18px; }
.panel p.help { margin: 0 0 18px; color: var(--muted); font-size: 14px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.field input, .field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
  background: #fffdfa;
}
.row { display: flex; gap: 14px; }
.row .field { flex: 1; min-width: 0; }
button.btn {
  background: var(--accent);
  color: #fff;
  border: 0;
  padding: 11px 20px;
  border-radius: 10px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
button.btn:disabled { opacity: .5; cursor: not-allowed; }
button.del {
  background: none;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 8px;
  cursor: pointer;
  margin-top: 10px;
}
/* editor de config del visor */
.cfg { margin: 12px 0 4px; border-top: 1px solid var(--line); padding-top: 10px; }
.cfg summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--accent); list-style: none; }
.cfg summary::-webkit-details-marker { display: none; }
.cfg__body { padding-top: 10px; display: flex; flex-direction: column; gap: 10px; }
.cfg__row { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.cfg__row small { color: var(--muted); font-weight: 400; }
.cfg__row input[type="range"] { width: 100%; }
.cfg__chk { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.cfg__actions { display: flex; align-items: center; gap: 12px; margin-top: 4px; }
.cfg__actions .btn { padding: 7px 16px; font-size: 13px; }
.cfg__status { font-size: 13px; color: var(--muted); }

/* editor de datos del plato (nombre, precio, categoría, descripción) */
.edit { margin: 12px 0 4px; border-top: 1px solid var(--line); padding-top: 10px; }
.edit summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--accent); list-style: none; }
.edit summary::-webkit-details-marker { display: none; }
.edit__body { padding-top: 10px; display: flex; flex-direction: column; gap: 10px; }
.edit__row { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.edit__row input, .edit__row select, .edit__row textarea {
  width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px;
  font: inherit; background: #fffdfa; max-width: 100%;
}
.edit__actions { display: flex; align-items: center; gap: 12px; margin-top: 2px; }
.edit__actions .btn { padding: 7px 16px; font-size: 13px; }
.edit__status { font-size: 13px; color: var(--muted); }

.status { font-size: 14px; margin-top: 12px; min-height: 20px; }
.status.err { color: #c0392b; }
.status.ok { color: #1e8449; }
.empty { color: var(--muted); text-align: center; padding: 40px 0; }

/* ===== mobile-first: layout general ===== */
.wrap { max-width: 1000px; margin: 0 auto; padding: 18px 16px 80px; overflow-x: hidden; }
.section-title { font-size: 18px; margin: 4px 0 14px; }

/* botones genéricos (links y botones) */
.btn {
  display: inline-block;
  border: 0;
  border-radius: 12px;
  padding: 13px 20px;
  font: inherit;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  line-height: 1.1;
}
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { filter: brightness(1.05); }
.btn--ghost { background: none; color: var(--ink); border: 1px solid var(--line); }
.btn--block { display: block; width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* marca */
.brand { font-size: 30px; font-weight: 800; letter-spacing: -0.5px; margin: 0; }
.brand span { color: var(--accent); }
.brand--sm { font-size: 19px; font-weight: 800; text-decoration: none; color: var(--ink); }
.brand--sm span { color: var(--accent); }

/* ===== landing ===== */
.landing { display: flex; flex-direction: column; min-height: 100vh; }
.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 14px;
  padding: 32px 22px;
  max-width: 560px;
  margin: 0 auto;
}
.hero__tag { font-size: 20px; margin: 6px 0 0; }
.hero__sub { color: var(--muted); margin: 0; }
.hero__cta { display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 320px; margin-top: 14px; }
.foot { text-align: center; color: var(--muted); font-size: 13px; padding: 18px; }

/* ===== auth ===== */
.auth { display: flex; min-height: 100vh; align-items: center; justify-content: center; padding: 22px; }
.auth__box {
  width: 100%;
  max-width: 380px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 26px 22px;
}
.auth__box h1 { font-size: 22px; margin: 14px 0 18px; }
.auth__box .brand--sm { display: inline-block; }
.auth__alt { text-align: center; color: var(--muted); font-size: 14px; margin: 16px 0 0; }
.auth__alt a { color: var(--accent); }
.field small { color: var(--muted); font-weight: 400; }

/* ===== app bar (panel) ===== */
.appbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; background: var(--card); border-bottom: 1px solid var(--line);
}
.appbar__actions { display: flex; align-items: center; gap: 12px; }
.appbar__link { color: var(--muted); text-decoration: none; font-size: 14px; }
.appbar__link:hover { color: var(--accent); }
.appbar__btn {
  background: none; border: 1px solid var(--line); border-radius: 9px;
  padding: 7px 13px; font: inherit; font-size: 14px; cursor: pointer; color: var(--ink);
}

/* ===== navegación por secciones del panel =====
   Barra superior FIJA (sticky) en todos los tamaños: encabezado + pestañas
   quedan siempre visibles al hacer scroll (evita que una barra inferior fija
   quede oculta tras la barra del navegador móvil). */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--card); border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top);
}
.topbar .appbar { position: static; border-bottom: 0; }
.tabbar {
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--card); border-top: 1px solid var(--line);
}
.tab {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  border: 0; background: none; color: var(--muted); cursor: pointer;
  font: inherit; padding: 7px 2px 8px; line-height: 1;
  border-bottom: 2px solid transparent; min-width: 0;
}
.tab svg { width: 21px; height: 21px; flex: none; }
.tab span { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.tab.is-active { color: var(--accent); border-bottom-color: var(--accent); }
.wrap--app { padding-bottom: 48px; }

@media (min-width: 720px) {
  .topbar .appbar { max-width: 1000px; margin: 0 auto; width: 100%; }
  .tabbar {
    display: flex; gap: 4px; justify-content: flex-start;
    max-width: 1000px; margin: 0 auto; padding: 0 20px; border-top: 0;
  }
  .tab { flex-direction: row; gap: 8px; padding: 10px 14px 12px; }
  .tab svg { width: 18px; height: 18px; }
  .tab span { font-size: 14px; }
}
.hello { font-size: 22px; font-weight: 700; margin: 4px 0 18px; }

/* ===== menu bar (carta pública) ===== */
.menubar {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 18px 16px; background: var(--card); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
}
.menubar__head { min-width: 0; }
.menubar__name { font-size: 20px; margin: 0; }
.menubar__tag { font-size: 13px; color: var(--muted); margin: 2px 0 0; }
.menubar__by { font-size: 13px; color: var(--muted); font-weight: 700; white-space: nowrap; }
.menubar__by span { color: var(--accent); }

/* ===== tarjeta compartir / QR ===== */
.btn--sm { padding: 8px 14px; font-size: 13px; border-radius: 10px; }
.share {
  display: flex; align-items: center; gap: 16px; justify-content: space-between;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 16px; margin-bottom: 16px;
}
.share__main { min-width: 0; }
.share__label { display: block; font-size: 12px; color: var(--muted); font-weight: 600; }
.share__url {
  display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; color: var(--accent); text-decoration: none; font-weight: 600;
  margin: 3px 0 10px; vertical-align: bottom;
}
.share__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.share__qr { width: 96px; height: 96px; flex: none; border-radius: 10px; background: #fff; }

/* ===== ajustes ===== */
.settings { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; margin-bottom: 22px; }
.settings summary { cursor: pointer; font-weight: 600; color: var(--accent); list-style: none; }
.settings summary::-webkit-details-marker { display: none; }
.settings__body { padding-top: 14px; }

.usage { font-size: 13px; color: var(--muted); font-weight: 400; }

/* selector de tipo de plato */
.segmented { display: flex; flex-wrap: wrap; gap: 6px; }
.segmented button {
  flex: 1 1 auto; min-width: 84px;
  border: 1px solid var(--line); background: #fffdfa; color: var(--ink);
  border-radius: 10px; padding: 9px 10px; font: inherit; font-size: 13px; cursor: pointer;
}
.segmented button.is-active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* selector de tipo con íconos (panel: agregar plato) */
.segmented--icons { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; flex-wrap: nowrap; }
.segmented--icons button {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  min-width: 0; padding: 9px 2px; color: var(--muted); background: var(--card);
  transition: border-color .12s, color .12s, background .12s;
}
.segmented--icons button svg { width: 20px; height: 20px; }
.segmented--icons button span { font-size: 12px; }
.segmented--icons button.is-active {
  background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); font-weight: 600;
}

/* zona de carga (drag/tap) + preview del archivo */
.drop {
  border: 1.5px dashed var(--line); border-radius: 12px;
  padding: 22px 16px; text-align: center; cursor: pointer; background: var(--bg);
  transition: border-color .12s, background .12s;
}
.drop:hover, .drop.is-over { border-color: var(--accent); background: var(--accent-soft); }
.drop__icon { color: var(--accent); line-height: 1; }
.drop__icon svg { width: 30px; height: 30px; }
.drop__title { font-size: 14px; font-weight: 600; margin-top: 8px; }
.drop__hint { font-size: 12px; color: var(--muted); margin-top: 3px; }

.preview {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--card);
}
.preview__thumb {
  width: 44px; height: 44px; border-radius: 8px; flex: none; overflow: hidden;
  background: var(--accent-soft); color: var(--accent-ink);
  display: flex; align-items: center; justify-content: center;
}
.preview__thumb svg { width: 20px; height: 20px; }
.preview__thumb img { width: 100%; height: 100%; object-fit: cover; }
.preview__info { min-width: 0; flex: 1; }
.preview__name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview__meta { font-size: 11px; color: var(--muted); }
.preview__x {
  flex: none; width: 28px; height: 28px; border-radius: 8px; padding: 0;
  border: 1px solid var(--line); background: var(--card); color: var(--muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.preview__x:hover { color: #c0392b; border-color: #e3b7ad; }
.preview__x svg { width: 16px; height: 16px; }

/* fila del slider de frames */
.frames-row { display: flex; align-items: center; gap: 10px; }
.frames-row label { margin: 0; flex: none; }
.frames-row input[type="range"] { flex: 1; }
.frames-row output { font-size: 13px; font-weight: 600; min-width: 22px; text-align: right; }
.help--sm { font-size: 11px; color: var(--muted); margin: 6px 0 0; }
.divider { height: 1px; background: var(--line); margin: 16px 0; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.btn svg { width: 18px; height: 18px; vertical-align: -3px; margin-right: 6px; }

/* gestión de categorías (panel) */
.catman { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.catchip { display: flex; align-items: center; gap: 8px; background: #faf7f2; border: 1px solid var(--line); border-radius: 22px; padding: 4px 8px 4px 4px; }
.catchip__img { width: 30px; height: 30px; border-radius: 50%; overflow: hidden; background: #f2ebe1; color: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; flex: none; }
.catchip__img img { width: 100%; height: 100%; object-fit: cover; }
.catchip__name { font-size: 13px; }
.catchip__del { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 12px; padding: 0 2px; }
.catchip__del:hover { color: #c0392b; }
.catman__add { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; width: 100%; }
.catman__add input { padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; font: inherit; background: #fffdfa; max-width: 100%; }
.catman__add input[name="name"] { flex: 1 1 100%; min-width: 0; }
.catman__add input[name="image"] { flex: 1 1 100%; min-width: 0; width: 100%; }

/* ===== buscador (carta pública y panel) ===== */
.search { max-width: 470px; margin: 0 auto; padding: 10px 16px 4px; }
.search__box {
  display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); border-radius: 24px; padding: 9px 14px; background: var(--card);
}
.search__box:focus-within { border-color: var(--accent); }
.search__icon { width: 18px; height: 18px; color: var(--muted); flex: none; }
.search__box input {
  flex: 1; min-width: 0; border: 0; background: transparent; padding: 0;
  font: inherit; font-size: 15px; color: var(--ink); outline: none; -webkit-appearance: none; appearance: none;
}
.search__box input::-webkit-search-cancel-button { display: none; }
.search__clear { border: 0; background: none; padding: 0; color: var(--muted); cursor: pointer; display: flex; flex: none; }
.search__clear svg { width: 16px; height: 16px; }

/* en el panel el buscador ocupa el ancho del contenido */
.wrap--app .search { max-width: none; margin: 0; padding: 4px 0 12px; }

/* resultados de búsqueda (carta pública) */
.sresults { max-width: 470px; margin: 0 auto; }
.sresult { display: flex; align-items: center; gap: 12px; padding: 11px 16px; border-bottom: 1px solid var(--line); }
.sresult.is-tappable { cursor: pointer; }
.sresult.is-tappable:active { background: var(--bg); }
.sresult__thumb { width: 60px; height: 60px; border-radius: 10px; overflow: hidden; flex: none; background: #f1ece4; }
.sresult__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sresult__thumb--none { background: var(--bg); }
.sresult__info { flex: 1; min-width: 0; }
.sresult__name { font-size: 15px; font-weight: 600; }
.sresult__cat { font-size: 11px; color: var(--muted); background: var(--bg); border: 1px solid var(--line); border-radius: 20px; padding: 1px 8px; margin-left: 6px; font-weight: 400; }
.sresult__desc { font-size: 13px; color: var(--muted); line-height: 1.4; margin-top: 2px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.sresult__price { font-size: 14px; font-weight: 600; color: var(--accent); white-space: nowrap; flex: none; }
mark { background: #ffe3d3; color: var(--accent); border-radius: 3px; padding: 0 1px; }

@media (max-width: 480px) {
  .share { flex-direction: column-reverse; align-items: stretch; text-align: left; }
  .share__qr { width: 120px; height: 120px; align-self: center; }
}

@media (min-width: 640px) {
  .hero__cta { flex-direction: row; justify-content: center; }
}

/* ============================================================
   LANDING PAGE (index.html, body.lp)
   ============================================================ */
.btn--lg { padding: 15px 26px; font-size: 16px; border-radius: 14px; }

.lp-nav {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 20px; background: var(--card); border-bottom: 1px solid var(--line);
}
.lp-nav__links { display: flex; align-items: center; gap: 16px; }
.lp-nav__links a { color: var(--ink); text-decoration: none; font-size: 14px; }
.lp-nav__links a.btn { color: #fff; }

.lp-hero { max-width: 1040px; margin: 0 auto; padding: 40px 20px 24px; display: grid; grid-template-columns: 1fr; gap: 34px; align-items: center; }
.lp-badge { display: inline-block; background: var(--accent-soft); color: var(--accent-ink); font-size: 13px; font-weight: 600; padding: 5px 12px; border-radius: 20px; }
.lp-hero__title { font-size: 36px; line-height: 1.08; letter-spacing: -0.5px; margin: 16px 0 0; }
.lp-hero__title span { color: var(--accent); }
.lp-hero__sub { font-size: 18px; color: var(--muted); margin: 14px 0 0; }
.lp-hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.lp-hero__note { font-size: 13px; color: var(--muted); margin-top: 14px; }

.lp-phone { display: flex; justify-content: center; }
.lp-phone__screen { width: 274px; background: var(--card); border: 8px solid #1c1916; border-radius: 34px; overflow: hidden; box-shadow: 0 20px 50px rgba(0,0,0,0.14); }
.lp-phone__bar { padding: 12px 14px; border-bottom: 1px solid var(--line); }
.lp-phone__name { display: block; font-weight: 700; font-size: 16px; }
.lp-phone__tag { display: block; font-size: 11px; color: var(--muted); }
.lp-post { border-bottom: 1px solid var(--line); }
.lp-post__head { display: flex; justify-content: space-between; align-items: center; padding: 9px 12px; font-weight: 600; font-size: 14px; }
.lp-post__price { background: var(--accent); color: #fff; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 16px; }
.lp-post__img { width: 100%; aspect-ratio: 1/1; object-fit: cover; display: block; background: #f1ece4; }
.lp-post__foot { padding: 7px 12px; font-size: 12px; color: #e0245e; font-weight: 600; }

.lp-section { padding: 46px 20px; }
.lp-section--tint { background: var(--card); }
.lp-h2 { text-align: center; font-size: 26px; letter-spacing: -0.3px; margin: 0 auto 28px; max-width: 900px; }

.lp-steps { display: grid; grid-template-columns: 1fr; gap: 22px; max-width: 1040px; margin: 0 auto; }
.lp-step { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 26px 20px 22px; text-align: center; }
.lp-step__n { position: absolute; top: -14px; left: 50%; transform: translateX(-50%); width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; font-size: 14px; display: flex; align-items: center; justify-content: center; }
.lp-step h3 { margin: 12px 0 6px; font-size: 17px; }
.lp-step p { margin: 0; color: var(--muted); font-size: 14px; }
.lp-ic { width: 30px; height: 30px; color: var(--accent); }

.lp-grid { display: grid; grid-template-columns: 1fr; gap: 16px; max-width: 1040px; margin: 0 auto; }
.lp-card { background: var(--bg); border: 1px solid var(--line); border-radius: 16px; padding: 22px 20px; }
.lp-card h3 { margin: 12px 0 6px; font-size: 16px; }
.lp-card p { margin: 0; color: var(--muted); font-size: 14px; }

.lp-chips { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; max-width: 760px; margin: 0 auto; }
.lp-chips span { background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 8px 16px; font-size: 14px; }

.lp-free { background: var(--accent); color: #fff; text-align: center; padding: 50px 20px; }
.lp-free .lp-h2 { color: #fff; }
.lp-free__sub { max-width: 560px; margin: 0 auto 22px; font-size: 16px; }
.lp-free .btn--primary { background: #fff; color: var(--accent); }
.lp-free .btn--primary:hover { filter: none; background: #fff9f5; }

.lp-faq { max-width: 760px; margin: 0 auto; }
.lp-faq details { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 10px; }
.lp-faq summary { cursor: pointer; font-weight: 600; font-size: 15px; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.lp-faq summary::-webkit-details-marker { display: none; }
.lp-faq summary::after { content: "+"; color: var(--accent); font-size: 22px; line-height: 1; flex: none; }
.lp-faq details[open] summary::after { content: "\2013"; }
.lp-faq p { margin: 10px 0 0; color: var(--muted); font-size: 14px; }

.lp-final { text-align: center; padding: 58px 20px; }
.lp-final__title { font-size: 28px; letter-spacing: -0.3px; margin: 0; }
.lp-final__sub { color: var(--muted); margin: 10px 0 22px; }
.lp-final .lp-hero__cta { justify-content: center; }

.lp-foot { border-top: 1px solid var(--line); padding: 26px 20px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.lp-foot__txt { color: var(--muted); font-size: 13px; }
.lp-foot a { color: var(--accent); text-decoration: none; font-size: 14px; }

@media (min-width: 760px) {
  .lp-steps { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 640px) {
  .lp-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 960px) {
  .lp-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 860px) {
  .lp-hero { grid-template-columns: 1.1fr 0.9fr; padding: 60px 20px 40px; }
  .lp-hero__title { font-size: 46px; }
}

/* ===== flujo de creación 360 (video + línea de tiempo + previsualización) ===== */
.v360__video { width: 100%; max-height: 260px; border-radius: 12px; background: #14110f; display: block; }
.v360tl { position: relative; height: 44px; margin: 12px 0 6px; border-radius: 8px; touch-action: none;
  background: repeating-linear-gradient(90deg, #ece4d9 0 18px, #e2d8c9 18px 20px); }
.v360tl__sel { position: absolute; top: 0; bottom: 0; border: 2px solid var(--accent); background: rgba(210,84,30,0.14); border-radius: 6px; pointer-events: none; }
.v360tl__h { position: absolute; top: -3px; width: 16px; height: 50px; margin-left: -8px; background: var(--accent);
  border-radius: 6px; cursor: ew-resize; touch-action: none; box-shadow: 0 1px 3px rgba(0,0,0,0.25); }
.v360tl__h::after { content: ""; position: absolute; top: 50%; left: 50%; width: 2px; height: 18px;
  background: rgba(255,255,255,0.85); transform: translate(-50%,-50%); border-radius: 2px; }
.v360__labels { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.v360__labels b { color: var(--ink); font-weight: 600; }
.v360spin { position: relative; aspect-ratio: 1/1; background: #f1ece4; border-radius: 12px; overflow: hidden;
  display: flex; align-items: center; justify-content: center; cursor: grab; touch-action: none; user-select: none; margin-top: 8px; }
.v360spin:active { cursor: grabbing; }
.v360spin img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; -webkit-user-drag: none; }
.v360spin__hint { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); font-size: 12px;
  color: #fff; background: rgba(0,0,0,0.5); padding: 4px 12px; border-radius: 20px; pointer-events: none; }
