/* Menú digital de Fideli. Sin dependencias: lo carga la página pública /t/{negocio}/menu.
   Variables que pone la vista: --brand, --on-brand, --font-title, --r (esquinas), --r-sm, --pill. */

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

body.sheet-open { overflow: hidden; }

img { display: block; max-width: 100%; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }

.wrap { width: 100%; max-width: 640px; margin: 0 auto; padding-bottom: 96px; }
.pad { padding: 0 16px; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Temas por plantilla ---------- */
body.t-photos  { --bg: #fff;     --surface: #fff; --text: #1f1f1f; --muted: #6b6b6b; --line: #ececec; }
body.t-grid    { --bg: #fdf4f2;  --surface: #fff; --text: #2a1b22; --muted: #8c6f7b; --line: #f1e3e0; }
body.t-classic { --bg: #fbf7f0;  --surface: #fff; --text: #2b2118; --muted: #8a7a68; --line: #e6dccb; }

@supports (background: color-mix(in srgb, red 10%, white)) {
  body.t-grid { --bg: color-mix(in srgb, var(--brand) 7%, #ffffff); --line: color-mix(in srgb, var(--brand) 14%, #ffffff); }
}

/* ---------- Animación de entrada ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .55s var(--ease), transform .55s var(--ease); transition-delay: calc(var(--i, 0) * 45ms); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Imágenes: aparecen con difuminado cuando cargan ---------- */
.media { position: relative; overflow: hidden; background: var(--shimmer-base, #eee); }
.media::after { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .55) 50%, transparent 70%); transform: translateX(-100%); animation: shimmer 1.4s infinite; pointer-events: none; }
.media.loaded::after, .media.empty::after { display: none; }
.media img { width: 100%; height: 100%; object-fit: cover; opacity: 0; filter: blur(12px); transform: scale(1.05); transition: opacity .6s var(--ease), filter .6s var(--ease), transform .8s var(--ease); }
.media.loaded img { opacity: 1; filter: none; transform: none; }
.media.empty { display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 55%, #000)); }
.media.empty span { color: var(--on-brand); font-family: var(--font-title); font-size: 32px; font-weight: 700; opacity: .85; }
@keyframes shimmer { to { transform: translateX(100%); } }

/* ---------- Encabezado ---------- */
.logo { width: 52px; height: 52px; flex: none; border-radius: 50%; background: var(--brand); color: var(--on-brand); display: flex; align-items: center; justify-content: center; font-family: var(--font-title); font-size: 24px; font-weight: 700; overflow: hidden; border: 2px solid rgba(255, 255, 255, .85); }
.logo img { width: 100%; height: 100%; object-fit: cover; }
.name { margin: 0; font-family: var(--font-title); font-weight: 700; line-height: 1.1; letter-spacing: -.01em; }
.tagline { margin: 4px 0 0; font-size: 13px; color: var(--muted); }

/* Portada (plantilla Fotos grandes) */
.hero { position: relative; height: 230px; display: flex; align-items: flex-end; background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 50%, #000)); overflow: hidden; }
.hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scale(1.08); animation: hero-zoom 1.6s var(--ease) forwards; }
.hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0, 0, 0, .72), rgba(0, 0, 0, .12) 55%, rgba(0, 0, 0, .35)); }
.hero-in { position: relative; z-index: 1; width: 100%; max-width: 640px; margin: 0 auto; padding: 18px 16px; display: flex; align-items: center; gap: 12px; color: #fff; }
.hero .name { font-size: 26px; color: #fff; }
.hero .tagline { color: rgba(255, 255, 255, .85); }
@keyframes hero-zoom { to { transform: scale(1); } }

.head { display: flex; align-items: center; gap: 12px; padding: 18px 16px 6px; }
.head .name { font-size: 24px; }

.t-classic .head { flex-direction: column; align-items: flex-start; gap: 4px; padding-top: 28px; }
.t-classic .head .name { font-size: 34px; }
.t-classic .head .logo { display: none; }

/* ---------- Banner de lealtad ---------- */
.perk { margin: 14px 16px 0; padding: 12px 14px; display: flex; align-items: center; gap: 10px; border-radius: var(--r); background: var(--brand); color: var(--on-brand); font-size: 13px; font-weight: 600; text-decoration: none; transition: transform .2s var(--ease), box-shadow .2s var(--ease); }
.perk b { margin-left: auto; text-decoration: underline; font-weight: 700; white-space: nowrap; }
.perk svg { flex: none; }
.card-strip { margin: 14px 16px 0; padding: 14px; border-radius: var(--r); background: #1f1a17; color: #fff; text-decoration: none; display: block; }
.card-strip .row { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; font-weight: 700; }
.card-strip .row span:last-child { font-size: 12px; font-weight: 600; opacity: .8; }
.card-strip .bar { height: 8px; margin: 10px 0 6px; border-radius: 4px; background: rgba(255, 255, 255, .18); overflow: hidden; }
.card-strip .bar i { display: block; height: 100%; width: 0; border-radius: 4px; background: var(--brand-light, #fff); transition: width 1.1s var(--ease) .3s; }
.card-strip small { font-size: 12px; opacity: .8; }

/* ---------- Buscador y etiquetas ---------- */
.filters { padding: 14px 16px 4px; display: grid; gap: 10px; }
.search { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); transition: border-color .2s, box-shadow .2s; }
.search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.search svg { flex: none; color: var(--muted); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 16px; }
.search input::placeholder { color: var(--muted); }
.tagbar { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; }
.tagbar::-webkit-scrollbar { display: none; }
.tag { flex: none; padding: 7px 12px; border-radius: var(--pill); border: 1px solid var(--line); background: var(--surface); font-size: 12px; font-weight: 600; color: var(--muted); transition: background .2s, color .2s, border-color .2s, transform .15s; }
.tag:active { transform: scale(.94); }
.tag[aria-pressed='true'] { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }

/* ---------- Categorías (barra fija que sigue al scroll) ---------- */
.cats { position: sticky; top: 0; z-index: 20; background: var(--bg); background: color-mix(in srgb, var(--bg) 88%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-bottom: 1px solid transparent; transition: border-color .25s; }
.cats.stuck { border-bottom-color: var(--line); }
.cats-track { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 10px 16px; max-width: 640px; margin: 0 auto; }
.cats-track::-webkit-scrollbar { display: none; }
.cats a { flex: none; padding: 8px 14px; border-radius: var(--pill); border: 1px solid var(--line); background: var(--surface); font-size: 13px; font-weight: 600; text-decoration: none; color: var(--muted); transition: background .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease), transform .15s; }
.cats a:active { transform: scale(.95); }
.cats a.active { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.t-classic .cats a.active { background: var(--text); border-color: var(--text); color: var(--bg); }
.t-photos .cats a { border: 0; background: transparent; border-radius: 0; padding: 8px 4px; margin-right: 12px; font-size: 14px; box-shadow: inset 0 -3px 0 transparent; }
.t-photos .cats a.active { background: transparent; color: var(--text); box-shadow: inset 0 -3px 0 var(--brand); }

/* ---------- Secciones ---------- */
.section { padding: 22px 16px 0; scroll-margin-top: 58px; }
.section-title { margin: 0 0 14px; font-family: var(--font-title); font-size: 21px; font-weight: 700; letter-spacing: -.01em; }
.t-classic .section-title { font-family: 'Inter', sans-serif; font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: var(--brand); }
.item.is-hidden, .section.is-hidden { display: none; }

.noresults { padding: 48px 24px; text-align: center; color: var(--muted); font-size: 14px; }

/* ---------- Tarjetas con foto (Fotos grandes) ---------- */
.list-photos { display: grid; gap: 16px; }
.card { position: relative; display: block; width: 100%; text-align: left; padding: 0; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); overflow: hidden; transition: transform .3s var(--ease), box-shadow .3s var(--ease); }
.card .media { aspect-ratio: 16 / 10; }
.card-body { padding: 14px; display: grid; gap: 6px; }
.row-nm { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.item-name { margin: 0; font-size: 17px; font-weight: 700; line-height: 1.25; }
.price { flex: none; font-size: 16px; font-weight: 800; color: var(--brand); }
.desc { margin: 0; font-size: 13px; line-height: 1.45; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge { padding: 4px 10px; border-radius: var(--pill); font-size: 12px; font-weight: 700; background: color-mix(in srgb, var(--brand) 12%, #fff); color: var(--brand); }
.badge.solid { background: var(--brand); color: var(--on-brand); }
.badge.gray { background: #f1f1f1; color: #555; }
.item { cursor: pointer; }
.item:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.item:active { transform: scale(.985); }

/* ---------- Cuadrícula ---------- */
.list-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tile { position: relative; text-align: left; padding: 0; border: 0; border-radius: var(--r); background: var(--surface); overflow: hidden; display: flex; flex-direction: column; transition: transform .3s var(--ease), box-shadow .3s var(--ease); }
.tile .media { aspect-ratio: 1 / .9; }
.tile-body { padding: 10px 12px 12px; display: grid; gap: 4px; }
.tile .item-name { font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.5em; }
.tile .row-pr { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.tile .price { font-size: 15px; }
.tile .pts { font-size: 12px; font-weight: 700; color: var(--brand); }
.t-grid .search { border-color: transparent; }

/* ---------- Clásica ---------- */
.list-classic .item { display: flex; gap: 14px; align-items: flex-start; padding: 16px 0; border-bottom: 1px solid var(--line); background: none; border-left: 0; border-right: 0; border-top: 0; border-radius: 0; text-align: left; width: 100%; transition: padding .25s var(--ease), opacity .2s; }
.list-classic .item:last-child { border-bottom: 0; }
.list-classic .info { flex: 1; min-width: 0; display: grid; gap: 4px; }
.list-classic .item-name { font-family: var(--font-title); font-size: 19px; font-weight: 600; }
.list-classic .price { color: var(--text); }
.list-classic .reward { font-size: 12px; font-weight: 700; color: var(--brand); }
.list-classic .thumb { width: 68px; height: 68px; flex: none; border-radius: var(--r-sm); }
.list-classic .thumb.media { aspect-ratio: auto; }

/* ---------- Agotado ---------- */
.item.sold .media, .item.sold .thumb { filter: grayscale(1); opacity: .6; }
.item.sold .item-name, .item.sold .price { opacity: .55; }
.sold-tag { position: absolute; top: 10px; left: 10px; z-index: 2; padding: 4px 10px; border-radius: var(--pill); background: rgba(0, 0, 0, .75); color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.list-classic .sold-tag { position: static; display: inline-block; margin-top: 2px; width: fit-content; }

/* Hover solo en dispositivos con ratón (en el celular se queda pegado). */
@media (hover: hover) {
  .card:hover, .tile:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(0, 0, 0, .1); }
  .card:hover .media img, .tile:hover .media img { transform: scale(1.05); }
  .perk:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(0, 0, 0, .18); }
  .cats a:not(.active):hover, .tag:not([aria-pressed='true']):hover { border-color: var(--brand); color: var(--brand); }
  .list-classic .item:hover { padding-left: 8px; }
}

/* ---------- Hoja con el detalle del platillo ---------- */
.backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .5); opacity: 0; transition: opacity .3s var(--ease); }
.backdrop.open { opacity: 1; }
.sheet { position: fixed; z-index: 51; left: 0; right: 0; bottom: 0; max-height: 92dvh; max-width: 640px; margin: 0 auto; background: var(--surface); color: var(--text); border-radius: 22px 22px 0 0; overflow: hidden auto; transform: translateY(100%); transition: transform .42s var(--ease); touch-action: pan-y; overscroll-behavior: contain; box-shadow: 0 -12px 40px rgba(0, 0, 0, .25); }
.sheet.open { transform: none; }
.sheet.dragging { transition: none; }
.sheet-grab { position: absolute; top: 8px; left: 50%; z-index: 3; width: 40px; height: 5px; margin-left: -20px; border-radius: 3px; background: rgba(255, 255, 255, .85); box-shadow: 0 0 6px rgba(0, 0, 0, .3); }
.sheet-close { position: absolute; top: 12px; right: 12px; z-index: 3; width: 36px; height: 36px; border: 0; border-radius: 50%; background: rgba(0, 0, 0, .55); color: #fff; font-size: 20px; line-height: 1; display: flex; align-items: center; justify-content: center; transition: transform .2s; }
.sheet-close:active { transform: scale(.9); }
.sheet .media { aspect-ratio: 4 / 3; max-height: 46dvh; width: 100%; }
.sheet-body { padding: 18px 20px 28px; display: grid; gap: 10px; }
.sheet-body h2 { margin: 0; font-family: var(--font-title); font-size: 24px; line-height: 1.2; }
.sheet-body .price { font-size: 22px; }
.sheet-body p { margin: 0; font-size: 15px; line-height: 1.55; color: var(--muted); }
.sheet-cta { display: flex; align-items: center; gap: 10px; margin-top: 4px; padding: 12px 14px; border-radius: var(--r); background: color-mix(in srgb, var(--brand) 10%, #fff); color: var(--brand); font-size: 13px; font-weight: 700; text-decoration: none; }
.sheet-sold { color: #b91c1c; font-weight: 700; font-size: 13px; }

@media (min-width: 720px) {
  .sheet { top: 50%; bottom: auto; left: 50%; right: auto; width: 460px; margin: 0; border-radius: 22px; transform: translate(-50%, -46%) scale(.96); opacity: 0; transition: transform .35s var(--ease), opacity .3s var(--ease); }
  .sheet.open { transform: translate(-50%, -50%); opacity: 1; }
  .sheet-grab { display: none; }
  .list-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---------- Volver arriba ---------- */
.to-top { position: fixed; right: 16px; bottom: 20px; z-index: 30; width: 46px; height: 46px; border: 0; border-radius: 50%; background: var(--brand); color: var(--on-brand); display: flex; align-items: center; justify-content: center; box-shadow: 0 6px 18px rgba(0, 0, 0, .25); opacity: 0; transform: translateY(14px) scale(.9); pointer-events: none; transition: opacity .3s var(--ease), transform .3s var(--ease); }
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.to-top:active { transform: scale(.92); }

.foot { padding: 28px 16px 0; text-align: center; font-size: 12px; color: var(--muted); }
.foot a { color: var(--brand); font-weight: 600; }

/* ---------- Menos movimiento ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0ms !important; }
  .reveal { opacity: 1; transform: none; }
  .media img { opacity: 1; filter: none; transform: none; }
}

/* =====================================================================
   Plantillas 4 a 8
   ===================================================================== */
:root { --ease: cubic-bezier(.2, .8, .2, 1); }

.chip-pts { flex: none; padding: 8px 14px; border-radius: var(--pill); background: var(--brand); color: var(--on-brand); font-size: 13px; font-weight: 800; text-decoration: none; transition: transform .2s var(--ease); }
.chip-pts:active { transform: scale(.94); }
.badge.glassy { background: rgba(255, 255, 255, .22); color: #fff; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.sold-line { font-size: 12px; font-weight: 700; color: #dc2626; }

/* ---------- Revista ---------- */
body.t-magazine { --bg: #fffbef; --surface: #fff; --text: #1a1a1a; --muted: #7a6f55; --line: #f0e8cf; }
.t-magazine .head { justify-content: space-between; padding-top: 24px; }
.t-magazine .head .name { font-size: 32px; font-weight: 900; text-transform: uppercase; letter-spacing: -.02em; }
.mag-feat { padding-top: 22px; }
.mag-feat .section-title { padding: 0 16px; }
.carousel { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 16px 14px; scrollbar-width: none; scroll-padding: 0 16px; }
.carousel::-webkit-scrollbar { display: none; }
.slide { position: relative; flex: none; width: min(74vw, 280px); scroll-snap-align: start; border-radius: var(--r); overflow: hidden; background: var(--surface); border: 1px solid var(--line); text-align: left; transition: transform .3s var(--ease), box-shadow .3s var(--ease); }
.slide .media { aspect-ratio: 4 / 3; }
.slide-media { position: relative; }
.slide-price { position: absolute; left: 10px; bottom: 10px; padding: 6px 12px; border-radius: var(--pill); background: var(--brand); color: var(--on-brand); font-size: 14px; font-weight: 800; }
.slide-body { padding: 12px 14px 14px; display: grid; gap: 4px; }
.slide .item-name { font-size: 16px; font-weight: 800; }
.reward { font-size: 12px; font-weight: 700; color: var(--brand); }
.list-mag { display: grid; gap: 10px; }
.row-card { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: var(--r); background: var(--surface); transition: transform .25s var(--ease), box-shadow .25s var(--ease); }
.row-card .info { flex: 1; min-width: 0; display: grid; gap: 3px; }
.row-card .item-name { font-size: 15px; font-weight: 800; }
.row-card .price { color: var(--text); }
.row-card .thumb { width: 72px; height: 72px; flex: none; border-radius: var(--r-sm); aspect-ratio: auto; }
body.filtering .mag-feat { display: none; }
@supports (animation-timeline: view()) {
  .slide { animation: slide-pop linear both; animation-timeline: view(inline); animation-range: entry 0% entry 100%; }
  @keyframes slide-pop { from { transform: scale(.9); opacity: .55; } to { transform: none; opacity: 1; } }
}

/* ---------- Historias ---------- */
body.t-stories { --bg: #f3faf4; --surface: #fff; --text: #14352a; --muted: #5b7f6a; --line: #d3e9da; }
@supports (background: color-mix(in srgb, red 10%, white)) {
  body.t-stories { --bg: color-mix(in srgb, var(--brand) 6%, #fff); --line: color-mix(in srgb, var(--brand) 18%, #fff); }
}
.t-stories .head, .t-dark .head, .t-magazine .head { justify-content: space-between; }
.stories { display: flex; align-items: flex-start; gap: 14px; overflow-x: auto; scrollbar-width: none; padding: 14px 16px 6px; scroll-snap-type: x proximity; }
.stories::-webkit-scrollbar { display: none; }
.story { flex: none; width: 70px; display: grid; align-content: start; justify-items: center; gap: 6px; padding: 0; border: 0; background: none; font-size: 12px; font-weight: 600; color: var(--muted); scroll-snap-align: start; transition: color .25s; }
.story-name { max-width: 70px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ring { display: block; padding: 3px; border-radius: 50%; background: var(--line); transition: background .3s, transform .3s var(--ease); }
.ring .media { display: block; flex: none; width: 60px; height: 60px; border-radius: 50%; border: 2px solid var(--bg); }
.ring .media.empty, .rail-btn .dot.empty { display: flex; }
.ring .media.empty span { font-size: 22px; }
.story:active .ring { transform: scale(.92); }
.story.active { color: var(--text); font-weight: 700; }
.story.active .ring { background: conic-gradient(from 20deg, var(--brand), color-mix(in srgb, var(--brand) 35%, #fff), var(--brand)); animation: ring-spin .9s var(--ease); }
@keyframes ring-spin { from { transform: rotate(-120deg) scale(.9); } to { transform: none; } }
.feed { display: grid; gap: 14px; }
.fcard { position: relative; display: block; width: 100%; padding: 0; border: 0; border-radius: calc(var(--r) * 1.6); overflow: hidden; aspect-ratio: 4 / 3.3; text-align: left; background: var(--surface); transition: transform .3s var(--ease), box-shadow .3s var(--ease); }
.fcard > .media { position: absolute; inset: 0; width: 100%; height: 100%; aspect-ratio: auto; }
.ftop { position: absolute; z-index: 2; top: 12px; left: 12px; right: 12px; display: flex; justify-content: space-between; gap: 8px; }
.fcard .sold-tag { position: static; }
.glass { position: absolute; z-index: 2; left: 12px; right: 12px; bottom: 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: var(--r); background: rgba(255, 255, 255, .86); color: #14352a; -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.glass .item-name { font-family: var(--font-title); font-size: 17px; font-weight: 700; }
.glass .desc { -webkit-line-clamp: 1; font-size: 12px; color: #5b7f6a; }
.glass .price { font-family: var(--font-title); font-size: 20px; font-weight: 700; color: #14352a; }
.ginfo { min-width: 0; display: grid; gap: 2px; }

/* ---------- Riel lateral ---------- */
body.t-rail { --bg: #fff; --surface: #fff; --text: #1f1f1f; --muted: #6b6b6b; --line: #ececec; }
.wide { max-width: 640px; padding-bottom: 0; }
.t-rail .head { padding-bottom: 12px; }
.rail-layout { display: flex; align-items: flex-start; border-top: 1px solid var(--line); }
.rail { position: sticky; top: 0; flex: none; width: 84px; height: 100vh; height: 100dvh; overflow-y: auto; display: grid; align-content: start; gap: 6px; padding: 8px; background: #fafafa; border-right: 1px solid var(--line); scrollbar-width: none; }
.rail::-webkit-scrollbar { display: none; }
.rail-btn { display: grid; align-content: start; justify-items: center; gap: 6px; padding: 10px 2px; border: 0; border-radius: var(--r); background: none; font-size: 11px; font-weight: 600; line-height: 1.2; text-align: center; color: var(--muted); transition: background .3s var(--ease), color .3s var(--ease), transform .15s; }
.rail-btn:active { transform: scale(.94); }
.rail-btn .dot { display: block; flex: none; width: 38px; height: 38px; border-radius: 50%; }
.rail-btn .dot.empty span { font-size: 16px; }
.rail-btn.active { background: var(--brand); color: var(--on-brand); }
.rail-main { flex: 1; min-width: 0; padding-bottom: 96px; }
.rail-main .perk, .rail-main .card-strip { margin: 12px 12px 0; }
.rail-main .filters { padding: 12px 12px 0; }
.rail-main .tagbar { margin: 0 -12px; padding: 0 12px; }
.rail-main .section { padding: 18px 12px 0; scroll-margin-top: 0; }
.t-rail .section-title { font-family: 'Inter', sans-serif; font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: var(--brand); }
.list-rail { display: grid; gap: 14px; }
.rrow { display: flex; gap: 12px; align-items: flex-start; transition: transform .25s var(--ease); }
.rrow .sq { width: 92px; height: 92px; flex: none; border-radius: var(--r); aspect-ratio: auto; }
.rrow .info { flex: 1; min-width: 0; display: grid; gap: 3px; }
.rrow .item-name { font-size: 15px; font-weight: 800; }
.rrow .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 2px; }
.rrow .badge { padding: 2px 8px; font-size: 11px; }

/* ---------- Oscuro con fotos ---------- */
body.t-dark { --bg: #0e0e12; --surface: #1a1a22; --text: #ffffff; --muted: #9ca3af; --line: #2a2a33; --shimmer-base: #1d1d25; }
.t-dark .head { padding-top: 24px; }
.t-dark .head .name { font-size: 26px; font-weight: 900; letter-spacing: .22em; text-transform: uppercase; }
.t-dark .search { background: var(--surface); }
.t-dark .media::after { background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .08) 50%, transparent 70%); }
.list-dark { display: grid; gap: 14px; }
.dcard { position: relative; display: block; width: 100%; padding: 0; border: 0; border-radius: calc(var(--r) * 1.5); overflow: hidden; aspect-ratio: 16 / 11; text-align: left; background: var(--surface); color: #fff; transition: transform .35s var(--ease), box-shadow .35s var(--ease); }
.dcard > .media { position: absolute; inset: 0; width: 100%; height: 100%; aspect-ratio: auto; }
.scrim { position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; display: grid; gap: 4px; padding: 56px 16px 16px; background: linear-gradient(to top, rgba(0, 0, 0, .9), rgba(0, 0, 0, .55) 55%, transparent); }
.dcard .item-name { font-size: 20px; font-weight: 800; }
.dcard .price { font-size: 20px; color: var(--brand); }
.dcard .desc { color: #d1d5db; -webkit-line-clamp: 1; }
.dcard .sold-tag { z-index: 3; }
@supports (animation-timeline: view()) {
  .dcard .media img { animation: parallax linear both; animation-timeline: view(); }
  @keyframes parallax { from { transform: translateY(-7%) scale(1.14); } to { transform: translateY(7%) scale(1.14); } }
}

/* ---------- Carta elegante ---------- */
body.t-elegant { --bg: #14110f; --surface: #1b1713; --text: #f5ebd7; --muted: #a89a82; --line: #2b251e; --shimmer-base: #221d17; }
.t-elegant .head { flex-direction: column; align-items: center; text-align: center; gap: 8px; padding-top: 34px; }
.t-elegant .eyebrow { font-size: 11px; font-weight: 600; letter-spacing: .4em; color: var(--brand); }
.t-elegant .head .name { font-size: 34px; }
.orn { width: 56px; height: 1px; background: var(--brand); transform-origin: center; animation: draw 1.1s var(--ease) both .2s; }
@keyframes draw { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.t-elegant .tagline { font-family: var(--font-title); font-style: italic; font-size: 14px; }
.t-elegant .cats-track { justify-content: center; }
.t-elegant .cats a { padding: 8px 2px; margin: 0 8px; border: 0; border-radius: 0; background: none; font-size: 11px; letter-spacing: .18em; text-transform: uppercase; box-shadow: inset 0 -1px 0 transparent; }
.t-elegant .cats a.active { background: none; color: var(--brand); box-shadow: inset 0 -1px 0 var(--brand); }
.t-elegant .perk { background: none; border: 1px solid var(--brand); color: var(--brand); }
.t-elegant .section-title { text-align: center; font-family: 'Inter', sans-serif; font-size: 12px; letter-spacing: .32em; text-transform: uppercase; color: var(--brand); }
.erow { display: flex; gap: 14px; align-items: flex-start; padding: 18px 0; background: linear-gradient(var(--line), var(--line)) bottom left / 0 1px no-repeat; transition: background-size 1s var(--ease) .15s; }
.erow.in { background-size: 100% 1px; }
.erow:last-child { background: none; }
.erow .info { flex: 1; min-width: 0; display: grid; gap: 5px; }
.erow .row-nm { align-items: baseline; }
.erow .item-name { font-family: var(--font-title); font-size: 19px; font-weight: 600; transition: color .25s; }
.erow .leader { flex: 1; border-bottom: 1px dotted #5a4f3f; transform: translateY(-4px); }
.erow .price { color: var(--brand); font-size: 15px; }
.erow .desc { font-family: var(--font-title); font-style: italic; }
.erow .reward { font-size: 11px; color: var(--muted); font-weight: 600; }
.erow .thumb { width: 64px; height: 64px; flex: none; border-radius: var(--r-sm); aspect-ratio: auto; }
@media (hover: hover) { .erow:hover .item-name { color: var(--brand); } }

/* ---------- Hover de las plantillas nuevas ---------- */
@media (hover: hover) {
  .slide:hover, .fcard:hover, .dcard:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(0, 0, 0, .18); }
  .row-card:hover { transform: translateX(4px); box-shadow: 0 6px 16px rgba(0, 0, 0, .08); }
  .rrow:hover { transform: translateX(3px); }
  .fcard:hover .media img, .dcard:hover .media img, .slide:hover .media img { transform: scale(1.05); }
  .story:hover .ring { transform: scale(1.06); }
  .rail-btn:not(.active):hover { background: rgba(0, 0, 0, .05); color: var(--text); }
}
.slide:active, .fcard:active, .dcard:active, .row-card:active, .rrow:active, .erow:active { transform: scale(.985); }

/* ---------- Modo de una categoría a la vez (Historias y Riel lateral) ---------- */
[data-mode='tabs'] .section.is-off { display: none; }
[data-mode='tabs'] .vt-content { view-transition-name: content; }

/* ---------- View Transitions ---------- */
/* Al abrir el detalle: la foto del platillo se transforma en la foto grande de la hoja. */
::view-transition-group(dish) { animation-duration: .5s; animation-timing-function: var(--ease); }
::view-transition-old(dish), ::view-transition-new(dish) { height: 100%; width: 100%; object-fit: cover; overflow: clip; }
html.vt-sheet .sheet, html.vt-sheet .backdrop { transition: none; }
html.vt-sheet::view-transition-old(root) { animation: .25s ease both vt-fade-out; }
html.vt-sheet::view-transition-new(root) { animation: .3s ease both vt-fade-in; }

/* Al cambiar de categoría: el contenido sale hacia un lado y entra desde el otro. */
html.vt-tab::view-transition-old(root), html.vt-tab::view-transition-new(root) { animation: none; }
html.vt-tab[data-dir='next']::view-transition-old(content) { animation: .28s var(--ease) both vt-out-left; }
html.vt-tab[data-dir='next']::view-transition-new(content) { animation: .4s var(--ease) both vt-in-right; }
html.vt-tab[data-dir='prev']::view-transition-old(content) { animation: .28s var(--ease) both vt-out-right; }
html.vt-tab[data-dir='prev']::view-transition-new(content) { animation: .4s var(--ease) both vt-in-left; }

/* Al buscar o filtrar: las tarjetas que quedan se acomodan con movimiento. */
html.vt-filter::view-transition-old(root), html.vt-filter::view-transition-new(root) { animation: none; }
html.vt-filter::view-transition-group(*) { animation-duration: .38s; animation-timing-function: var(--ease); }

@keyframes vt-fade-out { to { opacity: 0; } }
@keyframes vt-fade-in { from { opacity: 0; } }
@keyframes vt-out-left { to { opacity: 0; transform: translateX(-28px); } }
@keyframes vt-in-right { from { opacity: 0; transform: translateX(28px); } }
@keyframes vt-out-right { to { opacity: 0; transform: translateX(28px); } }
@keyframes vt-in-left { from { opacity: 0; transform: translateX(-28px); } }

@media (prefers-reduced-motion: reduce) {
  .orn { animation: none; }
  .erow { background-size: 100% 1px; }
  .carousel .slide, .dcard .media img { animation: none !important; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}

/* Etiquetas sobre fondo oscuro */
.t-dark .badge, .t-elegant .badge { background: color-mix(in srgb, var(--brand) 22%, transparent); color: var(--brand); }
.t-dark .badge.solid, .t-elegant .badge.solid { background: var(--brand); color: var(--on-brand); }
.t-dark .badge.glassy { background: rgba(255, 255, 255, .16); color: #fff; }
.t-dark .sheet-cta, .t-elegant .sheet-cta { background: color-mix(in srgb, var(--brand) 18%, transparent); }
.t-dark .badge.gray, .t-elegant .badge.gray { background: rgba(255, 255, 255, .1); color: #d1d5db; }

/* =====================================================================
   Pedidos en línea (order.js): extras en la hoja del platillo y barra del carrito
   ===================================================================== */
.sheet-order { display: grid; gap: 14px; margin-top: 6px; }
.order-note { margin: 0; padding: 12px 14px; border-radius: var(--r-sm); background: color-mix(in srgb, var(--text) 6%, transparent); font-size: 13px; color: var(--muted); }
.opt-group { margin: 0; padding: 0; border: 0; display: grid; gap: 6px; min-width: 0; }
.opt-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; padding: 0 0 2px; font-size: 15px; }
.opt-rule { padding: 3px 9px; border-radius: var(--pill); background: color-mix(in srgb, var(--text) 8%, transparent); color: var(--muted); font-size: 11px; font-weight: 700; }
.opt-rule.required { background: color-mix(in srgb, var(--brand) 14%, transparent); color: var(--brand); }
.opt { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); font-size: 14px; cursor: pointer; transition: border-color .2s, background .2s; }
.opt:has(input:checked) { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 8%, var(--surface)); }
.opt:has(input:disabled) { opacity: .5; cursor: default; }
.opt input { width: 18px; height: 18px; margin: 0; flex: none; accent-color: var(--brand); }
.opt-name { flex: 1; min-width: 0; }
.opt-price { font-style: normal; font-weight: 700; color: var(--muted); font-size: 13px; }
.opt-group.missing .opt-rule { background: #dc2626; color: #fff; }
.opt-group.missing { animation: opt-shake .4s; }
@keyframes opt-shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.sheet-notes { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.sheet-notes textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); color: var(--text); font: inherit; font-size: 16px; resize: vertical; }
.sheet-notes textarea:focus { outline: 0; border-color: var(--brand); }
.sheet-add { position: sticky; bottom: -28px; display: flex; gap: 10px; align-items: center; margin: 0 -20px -28px; padding: 12px 20px calc(16px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); }
.stepper { display: flex; align-items: center; border: 1px solid var(--line); border-radius: var(--pill); flex: none; }
.stepper-btn { width: 40px; height: 44px; border: 0; background: none; font-size: 20px; font-weight: 700; color: var(--text); }
.stepper-value { min-width: 22px; text-align: center; font-weight: 800; }
.add-btn { flex: 1; min-width: 0; height: 46px; border: 0; border-radius: var(--pill); background: var(--brand); color: var(--on-brand); font-size: 15px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: transform .15s; }
.add-btn:active { transform: scale(.97); }

.order-closed { position: fixed; left: 50%; bottom: 16px; z-index: 30; width: calc(100% - 32px); max-width: 600px; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--r); background: #1f1a17; color: #fff; font-size: 13px; font-weight: 600; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); }
.order-closed svg { flex: none; }
body.can-order .to-top { bottom: 84px; }
.opt.sold .opt-name { text-decoration: line-through; color: var(--muted); }

/* Agenda en línea (consultorios, veterinarias y servicios): barra para agendar y botón en la hoja del servicio. */
body.can-book .wrap { padding-bottom: 120px; }
body.can-book .to-top { bottom: 84px; }
.book-bar { position: fixed; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 40; width: calc(100% - 32px); max-width: 600px; transform: translateX(-50%); display: flex; align-items: center; justify-content: center; gap: 10px; padding: 14px 18px; border-radius: var(--pill); background: var(--brand); color: var(--on-brand); font-weight: 800; font-size: 15px; text-decoration: none; box-shadow: 0 12px 30px -12px rgba(0, 0, 0, .45); }
.book-bar svg { flex: none; }

.cart-bar { position: fixed; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 40; width: calc(100% - 32px); max-width: 600px; transform: translateX(-50%); display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: var(--pill); background: var(--brand); color: var(--on-brand); text-decoration: none; font-weight: 800; box-shadow: 0 10px 28px rgba(0, 0, 0, .28); animation: cart-in .45s var(--ease); }
.cart-bar.bump { animation: cart-bump .45s var(--ease); }
.cart-count { min-width: 28px; height: 28px; padding: 0 8px; border-radius: 14px; display: flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--on-brand) 20%, transparent); font-size: 14px; }
.cart-label { flex: 1; font-size: 15px; }
.cart-total { font-size: 15px; }
body.has-cart .wrap { padding-bottom: 120px; }
@keyframes cart-in { from { transform: translate(-50%, 120%); } to { transform: translate(-50%, 0); } }
@keyframes cart-bump { 40% { transform: translate(-50%, 0) scale(1.05); } }

/* Acceso directo al pedido en curso (order-track.js): arriba de la barra del carrito si también hay carrito. */
.order-track-stack { position: fixed; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 39; width: calc(100% - 32px); max-width: 600px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; }
.order-track { display: flex; align-items: center; gap: 10px; padding: 11px 16px; border-radius: var(--pill); background: #fff; color: #1f1a17; border: 2px solid var(--brand); text-decoration: none; box-shadow: 0 8px 24px rgba(0, 0, 0, .18); animation: cart-in .45s var(--ease); }
.order-track-stack[hidden] { display: none; }
.order-track-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 0 color-mix(in srgb, var(--brand) 45%, transparent); animation: track-pulse 1.8s infinite; }
.order-track-text { flex: 1; min-width: 0; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.order-track-text span { color: #6f6660; }
.order-track-go { flex: none; display: flex; align-items: center; gap: 2px; font-size: 14px; font-weight: 800; color: var(--brand); }
body.has-cart .order-track-stack { bottom: calc(80px + env(safe-area-inset-bottom)); }
body.has-track .wrap { padding-bottom: calc(58px + var(--track-n, 1) * 56px); }
body.has-track.has-cart .wrap { padding-bottom: calc(128px + var(--track-n, 1) * 56px); }
body.has-track .to-top { bottom: calc(28px + var(--track-n, 1) * 56px); }
body.has-track.has-cart .to-top { bottom: calc(90px + var(--track-n, 1) * 56px); }
@keyframes track-pulse { 70% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--brand) 0%, transparent); } }
@media (prefers-reduced-motion: reduce) { .order-track, .order-track-dot { animation: none; } }
