:root { --bg: #f6f6f4; --card: #fff; --text: #1a1a1a; --muted: #666; --line: #e2e2de; --accent: #c2185b; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font: 15px/1.4 system-ui, sans-serif; background: var(--bg); color: var(--text); }
button { font: inherit; color: inherit; cursor: pointer; border: 1px solid var(--line); background: var(--card); border-radius: 8px; padding: 6px 12px; }
button:disabled { opacity: .4; cursor: default; }
.primary { background: var(--accent); color: var(--accent-text, #fff); border-color: var(--accent); }
.top { position: sticky; top: 0; z-index: 1; background: #111; color: #fff; padding: 10px 16px; display: flex; gap: 16px; align-items: center; overflow-x: auto; }
.top a { color: #fff; text-decoration: none; white-space: nowrap; opacity: .85; }
.layout { padding: 16px; max-width: 1200px; margin: auto; }
@media (max-width: 800px) { .layout { grid-template-columns: 1fr; } }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.prod { display: flex; flex-direction: column; gap: 4px; text-align: left; padding: 12px; }
.prod small, .muted { color: var(--muted); }
.line { border-bottom: 1px solid var(--line); padding: 8px 0; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
dialog { border: none; border-radius: 14px; width: min(520px, 94vw); padding: 18px; }
fieldset { border: 1px solid var(--line); border-radius: 10px; margin: 10px 0; }
.opt { display: flex; justify-content: space-between; align-items: center; padding: 4px 0; }
label.field { display: block; margin: 8px 0; }
label.field input, label.field select { width: 100%; padding: 8px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.error { color: #b00020; }
/* Las columnas se acomodan al espacio (3, 2 o 1) en vez de esconderse detrás del panel de Nuevo pedido. */
.board { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; padding: 16px; align-items: start; }
.board > section { min-width: 0; }
.board h2 { margin: 0 0 8px; font-size: 16px; }
.order { margin-bottom: 10px; }
.badge { font-size: 12px; padding: 2px 8px; border-radius: 99px; background: #eee; }

button.mini { padding: 2px 8px; }
.pane { max-width: 960px; padding: 16px; }

/* Pestañas */
.tabs { display: flex; gap: 2px; flex-wrap: wrap; }
.tabs button { border: 0; background: transparent; border-radius: 0; padding: 8px 12px; border-bottom: 2px solid transparent; color: var(--muted); }
.tabs button.on { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.tabs.sub { border-bottom: 1px solid var(--line); margin-bottom: 12px; }

/* Lista a la izquierda, detalle a la derecha (como Justo) */
.md { display: grid; grid-template-columns: 340px 1fr; gap: 16px; padding: 16px; align-items: start; }
.md-list { background: var(--card); border: 1px solid var(--line); border-radius: 12px; display: flex; flex-direction: column;
  height: calc(100vh - 100px); position: sticky; top: 16px; }
.md-tools { display: flex; flex-direction: column; gap: 6px; padding: 10px; border-bottom: 1px solid var(--line); }
.md-tools input, .md-tools select, .md-new input { padding: 8px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.md-items { overflow: auto; flex: 1; }
.md-head { padding: 8px 12px 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.md-item { display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line);
  border-radius: 0; padding: 8px 12px; background: transparent; }
.md-item:hover { background: #f7f7f4; }
.md-item.on { background: #fde7ef; box-shadow: inset 3px 0 0 var(--accent); }
.md-new { display: flex; gap: 6px; padding: 10px; border-top: 1px solid var(--line); }
.md-new input { flex: 1; }
.md-detail { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px 20px; min-height: 300px; }
.md-detail h2 { margin: 0 0 12px; }
.md-detail .field { display: block; margin: 12px 0; }
.md-detail input:not([type=checkbox]):not([type=file]), .md-detail select, .md-detail textarea {
  display: block; width: 100%; margin-top: 4px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.md-foot { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); margin-top: 16px; padding-top: 12px; }
.md-empty { padding: 16px; }
.thumb { border-radius: 8px; object-fit: cover; flex: none; }
/* Página web: vista previa y SEO */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } }
.preview { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--bg); }
.pv-top { display: flex; gap: 12px; align-items: center; padding: 10px 12px; font-size: 13px; }
.serp { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; max-width: 600px; font-family: Arial, sans-serif; }
.serp-url { color: #202124; font-size: 13px; }
.serp-title { color: #1a0dab; font-size: 19px; margin: 2px 0; }
.serp-desc { color: #4d5156; font-size: 14px; }
.notice { padding: 8px 16px; text-align: center; font-weight: 600; }
.notice.ticker { padding: 8px 0; overflow: hidden; white-space: nowrap; text-align: left; }
.ticker-track { display: inline-flex; animation: ticker linear infinite; }
.ticker-track span { padding: 0 32px; }
.ticker-track span::before { content: "★"; margin-right: 32px; opacity: .6; }
.notice.ticker:hover .ticker-track { animation-play-state: paused; }
@keyframes ticker { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .ticker-track { animation: none; } }
/* En celular, del mismo alto que el recuadro del logo (30 px) */
@media (max-width: 760px) { .notice { padding: 0 12px; font-size: 13px; line-height: 30px; } .notice.ticker { padding: 0; } .ticker-track span { padding: 0 18px; } .ticker-track span::before { margin-right: 18px; } }
.banners { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; background: #000; }
.banners::-webkit-scrollbar { display: none; }
.banner { flex: 0 0 100%; scroll-snap-align: start; position: relative; overflow: hidden; border: 0; border-radius: 0; padding: 0; background: #000; color: #fff; text-align: left; }
/* La imagen se ve completa, con su propia proporción (en celular, la versión para celular si la hay); el video sí se recorta a 16:5. */
.banner img { width: 100%; height: auto; max-height: 480px; object-fit: cover; display: block; }
.banner video { width: 100%; aspect-ratio: 16 / 5; max-height: 480px; object-fit: cover; display: block; }
.banners { align-items: center; }
.banner span { position: absolute; left: 0; right: 0; bottom: 0; padding: 16px 24px; background: linear-gradient(transparent, rgba(0,0,0,.7)); }
.site-foot { border-top: 1px solid var(--line); margin-top: 32px; padding: 24px 16px; background: var(--card); }
.site-foot .cols { max-width: 1200px; margin: auto; display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 24px; }
@media (max-width: 800px) { .site-foot .cols { grid-template-columns: 1fr; } }
.site-foot a { color: inherit; }
.site-foot .powered { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 24px -16px -24px; padding: 14px 16px; background: #000; color: #fff; font-size: 13px; }
.site-foot .powered img { height: 22px; }
.grid-table { width: 100%; border-collapse: collapse; margin-top: 6px; }
.grid-table th, .grid-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.grid-table input[type=number] { display: inline-block !important; width: 110px !important; margin: 0 !important; }
.thumb.empty { display: inline-block; background: #eee; }
.toast { position: fixed; bottom: 20px; right: 20px; background: #111; color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 10; }
@media (max-width: 900px) { .md { grid-template-columns: 1fr; } .md-list { height: 50vh; position: static; } }

/* Selector de etiquetas con buscador */
.tags { position: relative; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 6px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--card); }
.tags .chips { display: contents; }
.tags .chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 4px 2px 10px; border-radius: 99px;
  background: #fde7ef; color: #7a0f38; font-size: 13px; cursor: grab; }
.tags .chip button { border: 0; background: transparent; padding: 0 6px; color: inherit; font-size: 15px; line-height: 1; }
.tags > input { flex: 1; min-width: 160px; border: 0; outline: none; padding: 4px; font: inherit; background: transparent; }
.tags .drop { position: absolute; left: 0; right: 0; top: 100%; margin-top: 4px; z-index: 5; max-height: 260px; overflow: auto;
  background: var(--card); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.12); }
.tags .drop > div { padding: 8px 10px; cursor: pointer; }
.tags .drop > div.on, .tags .drop > div:hover { background: #f4f4f1; }

/* App del personal: menú lateral + contenido */
.app { display: grid; grid-template-columns: 200px 1fr; min-height: 100vh; }
#side { background: #111; color: #fff; padding: 16px 12px; display: flex; flex-direction: column; gap: 16px; position: sticky; top: 0; height: 100vh; }
#side .brand { font-weight: 700; font-size: 18px; padding: 0 8px; }
#side nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
#side nav a { color: #ddd; text-decoration: none; padding: 8px; border-radius: 8px; }
#side nav a:hover { background: #222; }
#side nav a[aria-current="page"] { background: var(--accent); color: #fff; }
#side .who { display: flex; justify-content: space-between; align-items: end; gap: 8px; padding: 0 8px; color: #bbb; }
.content { min-width: 0; }
.content > .bar { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--card); }
.content > .bar h1 { font-size: 18px; margin: 0; }
/* Celular: barra arriba con ☰ y el menú lateral sale como cajón desde la izquierda (como Justo) */
.mbar, #sideShade { display: none; }
@media (max-width: 800px) {
  .app { grid-template-columns: 1fr; }
  .mbar { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: #111; color: #fff; position: sticky; top: 0; z-index: 4; font-weight: 700; }
  .mbar button { border: 0; background: transparent; color: inherit; font-size: 26px; line-height: 1; padding: 2px 4px; }
  #side { position: fixed; top: 0; left: 0; bottom: 0; width: min(300px, 85vw); height: 100dvh; z-index: 7; overflow: auto;
    transform: translateX(-100%); transition: transform .25s ease-out; box-shadow: 0 0 30px rgba(0,0,0,.3); }
  .side-open #side { transform: none; }
  #sideShade { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 6; }
  .side-open #sideShade { display: block; }
  .content > .bar { flex-wrap: wrap; gap: 8px; padding: 10px 12px; }
  .content > .bar .tabs { width: 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .content > .bar .tabs button { white-space: nowrap; }
}

/* Web del cliente: diseño configurable (Página web → Diseño) */
.shop { font-family: var(--font-body, system-ui, sans-serif); }
.shop h1, .shop h2, .shop h3 { font-family: var(--font-title, inherit); }
.shop .prod b, .shop legend, .shop .banner b { font-family: var(--font-subtitle, inherit); }
.shop .top { background: var(--header-bg, #111); color: var(--header-text, #fff); }
.shop .top a, .shop .top #mode { color: var(--header-text, #fff); }
.shop .site-foot { background: var(--footer-bg, #fff); color: var(--footer-text, #1a1a1a); }
.notice a { text-decoration: underline; }
.prod { position: relative; }
.prod .txt { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ph { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; display: block; }
.quick { position: absolute; top: 8px; right: 8px; width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: var(--accent-text, #fff);
  display: grid; place-items: center; font-size: 22px; line-height: 1; box-shadow: 0 2px 6px rgba(0,0,0,.2); }
/* Solo imagen (promos como afiche): la foto completa a su tamaño natural, sin texto; si el producto no tiene foto se ve como clásica. */
.cards-imagen { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; align-items: start; } /* afiches de distinta proporción no se estiran */
.cards-imagen .prod:has(.ph) { padding: 0; overflow: hidden; }
.cards-imagen .prod:has(.ph) .ph { aspect-ratio: auto; border-radius: 0; max-width: none !important; }
.cards-imagen .prod:has(.ph) .txt { display: none; }
.cards-imagen .prod:has(.ph) .badge { position: absolute; top: 8px; left: 8px; }
.cards-imagen .quick { background: #fff; color: #111; border: 1px solid #ddd; box-shadow: 0 1px 4px rgba(0,0,0,.15); }
/* Animación de marca Xsmile (public/xsmile.js): cintas adhesivas por detrás de la web y sello al agregar al carrito. */
.xs-fondo { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
/* La cinta se mueve con transform (lo anima la tarjeta gráfica, sin redibujar): la tira interior mide un patrón más que el ancho y se desplaza un patrón exacto. */
.xs-cinta { position: absolute; left: -12%; right: -12%; height: 44px; overflow: hidden; }
.xs-cinta > div { width: calc(100% + 662px); height: 100%; background: url('/xsmile-cinta.svg') repeat-x; background-size: 662px 44px; animation: xs-pasar 60s linear infinite; will-change: transform; }
.xs-cinta.c0 { top: 16%; transform: rotate(-6deg); } .xs-cinta.c1 { top: 50%; transform: rotate(4deg); } .xs-cinta.c1 > div { animation-direction: reverse; } .xs-cinta.c2 { top: 82%; transform: rotate(-3deg); }
@keyframes xs-pasar { to { transform: translateX(-662px); } } /* un patrón completo (1536 × 102 a 44 px de alto) */
.xs-on #menu > h2, .xs-on #menu > p.muted { display: inline-flex; align-items: center; gap: 10px; background: var(--bg); padding: 4px 14px 4px 4px; border-radius: 999px; } /* los títulos se leen sobre las cintas */
.xs-sello { position: fixed; inset: 0; width: 100%; height: 100%; margin: 0; border: 0; padding: 0; background: transparent; display: grid; place-items: center; z-index: 60; pointer-events: none; }
.xs-sello div { font-family: 'Barlow Condensed', Impact, sans-serif; font-weight: 900; font-size: clamp(26px, 5vw, 48px); line-height: .92; text-align: center; color: #111; -webkit-text-stroke: 4px #fff; paint-order: stroke fill; transform: rotate(-9deg) scale(3); opacity: 0; animation: xs-timbrar 2.4s cubic-bezier(.2,.9,.3,1) forwards; }
.xs-sello small { display: block; font-size: .45em; letter-spacing: 2px; margin-top: 6px; -webkit-text-stroke: 2px #fff; }
@keyframes xs-timbrar { 0% { transform: rotate(-9deg) scale(2.4); opacity: 0; } 22%, 80% { transform: rotate(-9deg) scale(1); opacity: 1; } 100% { transform: rotate(-9deg) scale(1.04); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .xs-cinta > div { animation: none; } }
/* Tarjetas horizontales como Chicken Love You: texto a un lado, foto cuadrada al otro a toda la altura, "+" sobre la foto. */
.cards-horizontal_izq, .cards-horizontal_der { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.cards-horizontal_izq .prod, .cards-horizontal_der .prod { flex-direction: row; align-items: stretch; gap: 0; padding: 0; overflow: hidden; box-shadow: 0 1px 6px rgba(0,0,0,.08); }
.cards-horizontal_der .prod { flex-direction: row-reverse; }
.cards-horizontal_izq .ph, .cards-horizontal_der .ph { width: 140px; max-width: none !important; height: auto; aspect-ratio: 1; flex: none; border-radius: 0; align-self: stretch; }
.cards-horizontal_izq .txt, .cards-horizontal_der .txt { flex: 1; padding: 14px 14px 14px 16px; gap: 6px; }
.cards-horizontal_izq .txt b, .cards-horizontal_der .txt b { font-size: 16px; line-height: 1.25; }
.cards-horizontal_izq .txt small, .cards-horizontal_der .txt small { order: 2; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.cards-horizontal_izq .quick, .cards-horizontal_der .quick { top: auto; bottom: 8px; right: 8px; width: 30px; height: 30px; font-size: 20px; background: #fff; color: #111; border: 1px solid #ddd; box-shadow: none; }
.cards-horizontal_izq .quick { right: auto; left: 8px; }
.prod:has(.quick):not(:has(.ph)) .txt { padding-right: 36px; }
.cards-vertical_amplia { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.cards-vertical_amplia .ph { aspect-ratio: 4 / 3; max-width: none !important; }
.cards-vertical_compacta { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.cards-vertical_compacta .prod { padding: 8px; font-size: 13px; }
.cards-vertical_compacta .prod small { display: none; }
@media (max-width: 500px) { .cards-horizontal_izq, .cards-horizontal_der { grid-template-columns: 1fr; } }
dialog.page { width: 100vw; max-width: 100vw; height: 100vh; max-height: 100vh; margin: 0; border-radius: 0; padding: 24px max(16px, calc(50vw - 360px)); }
fieldset.done { background: #fafaf8; }
dialog.popup { width: min(420px, 92vw); text-align: center; position: relative; }
.popup-x { position: absolute; top: 8px; right: 8px; width: 32px; height: 32px; padding: 0; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; border: 0; font-size: 16px; line-height: 32px; z-index: 1; }

/* Admin → Página web → Diseño */
.designer { display: grid; grid-template-columns: 190px 380px 1fr; gap: 16px; padding: 16px; align-items: start; }
.ds-nav { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; position: sticky; top: 16px; }
.ds-nav button { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; text-align: left; padding: 10px 12px; background: transparent; }
.ds-nav button.on { background: #fde7ef; box-shadow: inset 3px 0 0 var(--accent); font-weight: 600; }
.ds-form { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; max-height: calc(100vh - 100px); overflow: auto; position: sticky; top: 16px; }
.ds-form h2 { margin: 0 0 8px; font-size: 18px; }
.ds-form input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=color]), .ds-form select, .ds-form textarea {
  display: block; width: 100%; margin-top: 4px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.ds-form .list-row { flex-wrap: nowrap; margin: 6px 0; }
.ds-form .list-row input { margin: 0 !important; }
.ds-form .bar-item { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.ds-form .md-item { border: 1px solid var(--line); border-radius: 8px; margin: 6px 0; }
.ds-form .md-new { padding: 10px 0; border: 0; }
.field.color { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.field.color input { width: 100%; height: 40px; padding: 2px; border: 1px solid var(--line); border-radius: 8px; }
.choices { display: flex; flex-direction: column; gap: 6px; margin: 8px 0 12px; }
.choice { display: flex; gap: 10px; align-items: start; border: 1px solid var(--line); border-radius: 10px; padding: 10px; cursor: pointer; }
.choice:has(input:checked) { border-color: var(--accent); background: #fdf3f7; }
.choice .pay-ico { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; }
.ds-save { position: sticky; bottom: -16px; background: var(--card); display: flex; justify-content: space-between; align-items: center; gap: 8px;
  border-top: 1px solid var(--line); margin: 16px -16px -16px; padding: 12px 16px; }
.ds-preview { position: sticky; top: 16px; min-width: 0; }
.ds-tools { margin-bottom: 8px; }
.ds-frame { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #ddd; height: calc(100vh - 140px); }
.ds-frame iframe { border: 0; width: 100%; height: 100%; display: block; background: #fff; }
.ds-frame.mobile { width: 390px; max-width: 100%; margin: auto; border-radius: 28px; border: 8px solid #111; }
@media (max-width: 1200px) { .designer { grid-template-columns: 1fr; } .ds-nav { flex-direction: row; flex-wrap: wrap; position: static; } .ds-form, .ds-preview { position: static; max-height: none; } }

/* Encabezado de la web: menú principal arriba, barra de entrega debajo y categorías fijas en carrusel */
.shop .top { position: static; overflow: visible; gap: 24px; padding: 12px 24px; }
.shop #brand { font-weight: 700; font-size: 20px; opacity: 1; }
.navlinks { display: flex; gap: 20px; }
.navlinks a { font-weight: 600; }
.icons { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.shop .top .icons > a { font-weight: 600; opacity: 1; display: inline-flex; align-items: center; gap: 6px; position: relative; padding: 4px; }
.shop .top .icons > a:hover { opacity: .7; }
.shop .top .icons .lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } /* solo para lectores de pantalla, como en Shopify */
.shop .top .icons .count { position: absolute; top: -2px; right: -6px; min-width: 18px; height: 18px; line-height: 18px; padding: 0 5px; font-size: 11px; text-align: center; }
.count { background: var(--accent); color: var(--accent-text, #fff); border-radius: 99px; padding: 0 7px; font-size: 12px; line-height: 20px; }
.burger { display: none; position: relative; }
.burger summary { list-style: none; cursor: pointer; font-size: 24px; line-height: 1; padding: 4px; }
.burger summary::-webkit-details-marker { display: none; }
.burger nav { position: absolute; right: 0; top: 100%; margin-top: 8px; min-width: 200px; display: flex; flex-direction: column; z-index: 5;
  background: var(--card); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.2); overflow: hidden; }
.shop .burger nav a { color: var(--text); padding: 12px 16px; border-bottom: 1px solid var(--line); opacity: 1; }
.modebar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 24px; background: var(--card); border-bottom: 1px solid var(--line); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 99px; padding: 3px; background: var(--bg); }
.seg button { border: 0; border-radius: 99px; background: transparent; padding: 6px 14px; font-weight: 600; }
.seg button.on { background: var(--accent); color: var(--accent-text, #fff); }
.modebar .pick { border-radius: 99px; font-weight: 600; }
.modebar .when { color: var(--muted); font-size: 14px; }
.modebar button, .modebar .when, .co svg, .modebar svg { display: inline-flex; align-items: center; gap: 6px; }
.modebar svg { vertical-align: -3px; }
.cats { position: sticky; top: 0; z-index: 2; display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none;
  padding: 10px 24px; background: var(--card); border-bottom: 1px solid var(--line); box-shadow: 0 2px 6px rgba(0,0,0,.04); }
.cats::-webkit-scrollbar { display: none; }
.cats a { flex: none; scroll-snap-align: start; white-space: nowrap; text-decoration: none; color: var(--text); font-weight: 600;
  padding: 7px 14px; border-radius: 99px; border: 1px solid var(--line); background: var(--card); }
.cats a.on { background: var(--accent); color: var(--accent-text, #fff); border-color: var(--accent); }
.shop h2 { scroll-margin-top: 70px; display: flex; align-items: center; gap: 10px; }
.cat-ico { display: inline-flex; width: 40px; height: 40px; border-radius: 50%; align-items: center; justify-content: center; background: var(--icon-fill, var(--accent)); color: var(--icon-fill-text, #111); }
.cat-ico .ico { --icon-fill: transparent; }
.cats a .ico { vertical-align: -4px; margin-right: 4px; }
.cats a.on .ico { --icon-fill: transparent; }
.ico { vertical-align: -5px; }
@media (max-width: 760px) {
  .shop .top { gap: 8px; padding: 10px 16px; }
  .navlinks { display: none; }
  .burger { display: block; }
  /* En celular: menú de hamburguesa a la izquierda, logo al centro y solo el carrito a la derecha; Ingresar va dentro del menú */
  .shop .top .icons { display: contents; }
  .shop .top .icons > .account-link { display: none; }
  .shop .top .burger { order: -1; }
  .shop .top .cartbtn { margin-left: auto; }
  /* El menú sube desde abajo hasta media pantalla, como la ficha de producto; tocar fuera lo cierra */
  .burger[open]::before { content: ''; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 5; }
  .burger nav { position: fixed; left: 0; right: 0; bottom: 0; top: auto; margin: 0; height: 50dvh; border-radius: 18px 18px 0 0; padding: 8px 0 16px; z-index: 6;
    overflow: auto; animation: slideup .25s ease-out; }
  .shop .burger nav a { padding: 16px 20px; font-size: 17px; font-weight: 600; }
  .shop .top .burger nav .lbl { position: static; width: auto; height: auto; clip: auto; }
  .shop .top .icons > a { gap: 2px; }
  .modebar { padding: 8px 16px; gap: 8px; }
  .modebar .seg { width: 100%; }
  .modebar .seg button { flex: 1; }
  .modebar .when { font-size: 13px; }
  .cats { padding: 8px 16px; }
}

/* Encabezado "cápsula": flotante, redondeado, logo al centro y fijo al bajar (Página web → Diseño → Encabezado) */
.capsula .top { position: sticky; top: 8px; z-index: 3; margin: 8px 12px 0; border-radius: 99px; padding: 8px 20px; box-shadow: 0 6px 20px rgba(0,0,0,.18);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; }
.capsula .navlinks { order: -1; }
.capsula .navlinks a { border: 1.5px solid currentColor; border-radius: 99px; padding: 5px 14px; opacity: 1; font-size: 14px; }
.capsula #brand { justify-self: center; }
.capsula #brand img { height: 48px !important; }
.capsula .icons { justify-self: end; }
.capsula .cats { top: 72px; }
.logo-text { display: inline-block; background: var(--accent); color: var(--accent-text, #fff); font-family: var(--font-title, inherit); font-weight: 700;
  text-transform: uppercase; letter-spacing: .5px; font-size: 22px; line-height: 1; padding: 9px 14px; border-radius: 6px; }
@media (max-width: 760px) { .logo-text { font-size: 13px; padding: 6px 10px; letter-spacing: 0; } .capsula .icons { gap: 10px; } .capsula .top { padding: 6px 10px; } }
@media (max-width: 760px) {
  .capsula .top { margin: 8px 8px 0; padding: 6px 14px; grid-template-columns: 1fr auto 1fr; }
  .capsula #brand img { height: 40px !important; }
  .capsula .cartbtn { justify-self: end; }
  .capsula .cats { top: 64px; }
}

/* Páginas aparte de la web: Locales y Mi cuenta */
.page-view { display: none; max-width: 1100px; margin: auto; padding: 16px; }
body[data-view=locales] #storesView, body[data-view=cuenta] #accountView, body[data-view=checkout] #checkoutView, body[data-view=suscripcion] #subsView { display: block; }
body[data-view] .layout, body[data-view] .cats, body[data-view] .banners { display: none !important; }
body[data-view=checkout] #mode { display: none !important; } /* en el checkout se cambia desde "Detalles de entrega" */
.auth { max-width: 420px; margin: 24px auto; }
.account { display: grid; grid-template-columns: 1fr 1.3fr; gap: 16px; align-items: start; }
@media (max-width: 760px) { .account { grid-template-columns: 1fr; } }
.stores { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.badge.open { background: #d8f3dc; color: #1b5e20; }
.hours { width: 100%; border-collapse: collapse; font-size: 14px; }
.hours td { padding: 3px 0; border-bottom: 1px solid var(--line); }
.hours td + td { text-align: right; }
.hours tr.today { font-weight: 700; }

/* Paneles laterales (producto y carrito), como Chicken Love You: a la derecha en PC, pantalla completa en celular */
dialog.sheet { padding: 0; }
dialog.sheet[open] { display: flex; flex-direction: column; }
dialog.panel { margin: 0 0 0 auto; width: min(460px, 100vw); max-width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; }
dialog.panel[open] { animation: slidein .2s ease-out; }
@keyframes slidein { from { transform: translateX(40px); opacity: 0; } }
@keyframes slideup { from { transform: translateY(100%); } }
dialog.sheet::backdrop { background: rgba(0,0,0,.45); }
dialog.sheet.page { padding: 0; }
dialog.sheet.page .sheet-body, dialog.sheet.page .sheet-head, dialog.sheet.page .sheet-foot { padding-inline: max(16px, calc(50vw - 360px)); }
.sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--line); font-size: 17px; }
.sheet-head button { border: 0; background: transparent; font-size: 18px; }
.sheet-body { flex: 1; overflow: auto; padding: 16px; }
.sheet-body .ph { max-width: none !important; border-radius: 12px; }
.sheet-foot { display: flex; gap: 10px; align-items: center; padding: 12px 16px; border-top: 1px solid var(--line); background: var(--card); }
.sheet-foot .grow, .grow { flex: 1; padding: 12px; font-weight: 700; border-radius: 10px; }
.sheet textarea { width: 100%; padding: 8px; border: 1px solid var(--line); border-radius: 8px; font: inherit; resize: vertical; }
.stepper { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 99px; padding: 2px; background: var(--bg); }
.stepper button { border: 0; background: transparent; border-radius: 99px; width: 30px; height: 30px; padding: 0; }
/* Líneas del carrito */
.cline { display: flex; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.cthumb { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; flex: none; background: #eee; display: block; }
.ctxt { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ctxt a { color: var(--accent); font-size: 13px; }
.cright { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; gap: 6px; }
.total { font-size: 17px; }
.sug-title { margin: 16px 0 8px; text-transform: uppercase; font-size: 12px; letter-spacing: .04em; color: var(--muted); }
.sugs { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; }
.sug { position: relative; flex: 0 0 116px; display: flex; flex-direction: column; gap: 2px; text-align: left; padding: 0; border: 0; background: transparent; }
.sug .cthumb { width: 116px; height: 116px; }
.sug b { color: var(--accent); font-size: 13px; }
.sug .quick { top: 84px; right: 6px; width: 28px; height: 28px; font-size: 18px; }
/* Checkout en su propia página */
.back { display: inline-block; margin: 4px 0 8px; color: var(--muted); }
.co { display: grid; grid-template-columns: 1fr 380px; gap: 16px; align-items: start; padding-bottom: 90px; }
.co h2 { font-size: 17px; margin: 0 0 8px; }
.co .card { margin-bottom: 12px; }
.co-sum { position: sticky; top: 16px; }
.co-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 3; background: var(--card); border-top: 1px solid var(--line);
  padding: 10px 16px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.co-bar .error { margin: 0; text-align: center; }
.co-bar button { width: min(600px, 100%); padding: 14px; font-weight: 700; font-size: 16px; border-radius: 10px; }
.btnlink { display: inline-block; padding: 10px 18px; border-radius: 10px; text-decoration: none; }
.pts-pierdes { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: space-between; border: 2px solid var(--accent); }
.pts-pierdes p { margin: 0; font-size: 17px; }
.pts-pierdes small { color: var(--muted); font-size: 13px; }
@media (max-width: 860px) { .co { grid-template-columns: 1fr; } .co-sum { position: static; } }
#modeDlg .seg { display: flex; }
#modeDlg .seg button { flex: 1; }

/* Tablero de Pedidos: luces de los canales de venta */
/* Va en la barra de arriba, al lado del título "Pedidos" */
.content > .bar { flex-wrap: wrap; }
#channels { min-width: 0; }
.chan { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.chan > b { margin-right: 4px; }
.statusbar { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; padding: 8px 16px; border-bottom: 1px solid var(--line); background: var(--card); }

.light { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }
.light i { width: 10px; height: 10px; border-radius: 50%; background: #d32f2f; box-shadow: 0 0 0 3px rgba(211,47,47,.18); }
.light.on i { background: #2e7d32; box-shadow: 0 0 0 3px rgba(46,125,50,.2); }
.chan select { padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; font: inherit; font-weight: 700; }
.chan .lights { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.counter { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 99px; padding: 3px 4px 3px 12px; font-weight: 600; }
.counter button { width: 30px; height: 30px; padding: 0; border-radius: 50%; font-size: 18px; line-height: 1; }
.counter b { min-width: 52px; text-align: center; }
dialog.wide { width: min(980px, 96vw); }
.scroll-x { overflow-x: auto; }
.cuadre td, .cuadre th { white-space: nowrap; }
.cuadre input { width: 110px; padding: 6px; border: 1px solid var(--line); border-radius: 6px; font: inherit; }
.ok { color: #2e7d32; font-weight: 600; }
/* Turnos y caja */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 12px; }
.kpi { display: flex; flex-direction: column; gap: 4px; }
.kpi b { font-size: 22px; }
.aud-grid { display: grid; align-items: start; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
a.mini.btnlink { padding: 4px 10px; border: 1px solid var(--line); border-radius: 8px; color: inherit; font-size: 13px; }
.grid-table.info td:first-child { color: var(--muted); width: 200px; }
.cfg-row { margin: 6px 0; flex-wrap: nowrap; }
.cfg-row input:not([type=checkbox]), .cfg-row select { padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; font: inherit; }
#side .place { display: flex; flex-direction: column; gap: 4px; padding: 0 8px; }
#side .place small { color: #999; text-transform: uppercase; letter-spacing: .05em; font-size: 11px; }
#side .place select { width: 100%; padding: 6px 8px; border-radius: 8px; border: 1px solid #333; background: #1d1d1d; color: #fff; font: inherit; font-weight: 600; }
#side nav a.switch { margin-top: 12px; border-top: 1px solid #2a2a2a; border-radius: 0; padding-top: 14px; color: #bbb; }
.cfg-row label.row { flex-wrap: nowrap; white-space: nowrap; }
.cfg-row select { width: auto !important; display: inline-block !important; margin: 0 !important; }
/* Interruptores (Bloquear productos, Ajustes) */
.block-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.block-row.off > span:first-child { color: var(--muted); text-decoration: line-through; }
.switch { display: inline-flex; align-items: center; gap: 8px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch i { width: 42px; height: 24px; border-radius: 99px; background: #d32f2f; position: relative; transition: background .15s; }
.switch i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked + i { background: #2e7d32; }
.switch input:checked + i::after { transform: translateX(18px); }
.switch input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch small { width: 72px; font-weight: 600; }
/* Historial */
.history tbody tr { cursor: pointer; }
.history tbody tr:hover { background: #f7f7f4; }
#tools input, #tools select { padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
/* KDS */
.kds { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; padding: 16px; align-items: start; }
.ticket { background: var(--card); border: 1px solid var(--line); border-top: 8px solid #2e7d32; border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.ticket.late { border-top-color: #f9a825; }
.ticket.very-late { border-top-color: #d32f2f; }
.ticket header { display: flex; justify-content: space-between; gap: 8px; font-size: 18px; }
.ticket .mins { font-weight: 700; }
.ticket.very-late .mins { color: #d32f2f; }
.kitem { font-size: 17px; padding: 6px 0; border-top: 1px dashed var(--line); cursor: pointer; }
.kitem.done { opacity: .35; text-decoration: line-through; }
.kmod { font-size: 15px; padding-left: 10px; }
.knote { font-size: 15px; background: #fff7d6; border-radius: 6px; padding: 2px 6px; margin-top: 2px; }
.promo-price { color: var(--accent); }
.promo-tag { display: inline-block; background: var(--accent); color: var(--accent-text, #fff); font-weight: 700; font-size: 12px; border-radius: 6px; padding: 1px 6px; margin-left: 4px; }
.knote.sched { background: #e3f0ff; font-weight: 700; }
.ticket .primary { padding: 12px; font-size: 16px; font-weight: 700; }
.danger { background: #c62828; color: #fff; border-color: #c62828; }
/* Pedidos: tablero + panel "Nuevo pedido" a la derecha */
.pedidos-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(380px, 50%); align-items: start; } /* la toma de pedido ocupa media pantalla */
.pedidos-wrap .board { min-width: 0; padding-right: 8px; }
.pedidos-wrap .board .order { font-size: 14px; }
.pos { margin: 16px 16px 16px 0; position: sticky; top: 16px; max-height: calc(100vh - 140px); overflow: auto; display: flex; flex-direction: column; gap: 10px; }
.pos h2 { margin: 0; font-size: 18px; }
/* Las partes del panel no se encogen (si no, la carta con scroll quedaba en 0 de alto al abrir Cliente en delivery): el panel hace scroll. */
.pos > * { flex-shrink: 0; }
.pos-types { display: flex; } .pos-types button { flex: 1; padding: 6px 4px; font-size: 13px; }
.pos-client { display: flex; flex-direction: column; gap: 6px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.pos-client[open] > *:not(summary) { margin-top: 6px; display: block; }
.pos-client summary { cursor: pointer; font-weight: 600; list-style-position: inside; }
.pos-points { background: var(--soft, rgba(255,200,0,.08)); border-radius: 8px; padding: 6px 8px; }
.pos-points .pos-cats, .pos-points input { margin-top: 6px; width: 100%; }
.pos input { padding: 7px 8px; border: 1px solid var(--line); border-radius: 8px; font: inherit; width: 100%; }
.pos-cats { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.pos-cats button { flex: none; border-radius: 99px; padding: 4px 10px; font-size: 13px; }
.pos-cats button.on { background: var(--accent); color: var(--accent-text, #fff); border-color: var(--accent); }
.pos-products { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; max-height: 42vh; overflow: auto; }
.pos-products button { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 8px; font-size: 13px; min-height: 56px; }
.pos-lines { border-top: 1px solid var(--line); }
.pos-line { display: flex; justify-content: space-between; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.pos-line-r { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.pos-total .row { flex-wrap: nowrap; }
@media (max-width: 1100px) { .pedidos-wrap { grid-template-columns: 1fr; } .pos { margin: 0 16px 16px; position: static; max-height: none; } }
.pos-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.pos-actions button { display: flex; flex-direction: column; gap: 2px; padding: 10px 6px; border-radius: 10px; }
.pos-actions small { font-size: 11px; opacity: .8; }
.pos-table { flex-wrap: nowrap; } .pos-table input { flex: 1; }
.pos select { padding: 7px 8px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.pos-disc { flex-wrap: nowrap; }
/* Cuenta regresiva del pedido (Pedidos y KDS) */
.timer { font-weight: 700; font-variant-numeric: tabular-nums; padding: 2px 8px; border-radius: 99px; white-space: nowrap; }
.timer.ok { background: #e6f6ea; color: #1b5e20; }
.timer.soon { background: #fff4cc; color: #8a6100; }
.timer.urgent { background: #ffe0cc; color: #b34700; }
.timer.late { background: #d32f2f; color: #fff; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: .6; } }
.order:has(.timer.urgent) { border-left: 4px solid #ef6c00; }
.order:has(.timer.late) { border-left: 4px solid #d32f2f; }
.ticket:has(.timer.ok) { border-top-color: #2e7d32; }
.ticket:has(.timer.soon) { border-top-color: #f9a825; }
.ticket:has(.timer.urgent) { border-top-color: #ef6c00; }
.ticket:has(.timer.late) { border-top-color: #d32f2f; }
.suggest { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin: 2px 0 4px; }
.suggest button { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; text-align: left; padding: 6px 10px; background: var(--card); }
.suggest button:hover { background: #f4f4f1; }
/* Pedidos: menú ⋮ y vista lista */
.dots { border: 0; background: transparent; font-size: 20px; line-height: 1; padding: 2px 6px; border-radius: 6px; }
.dots:hover { background: #eee; }
.order > .primary { width: 100%; margin-top: 4px; }
.omenu { position: fixed; z-index: 20; display: flex; flex-direction: column; min-width: 200px; background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.18); overflow: hidden; }
.omenu button { border: 0; border-radius: 0; text-align: left; padding: 10px 14px; background: transparent; }
.omenu button:hover { background: #f4f4f1; }
.danger-text { color: #c62828; }
.board.list { grid-template-columns: 1fr; }
.board.list section { min-width: 0; }
.orow { display: grid; grid-template-columns: 130px 120px 1fr 2fr 110px auto; gap: 10px; align-items: center; background: var(--card);
  border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; margin-bottom: 6px; font-size: 14px; }
.orow-id { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.orow-items { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.orow-total { text-align: right; }
.orow:has(.timer.urgent) { border-left: 4px solid #ef6c00; }
.orow:has(.timer.late) { border-left: 4px solid #d32f2f; }
/* La lista se adapta al ancho del tablero (que comparte la pantalla con Nuevo pedido), no al de la ventana. */
.board.list { container-type: inline-size; }
@container (max-width: 900px) {
  .orow { grid-template-columns: 100px 1fr 90px auto; }
  .orow > span:nth-child(2), .orow-items { display: none; }
  .orow .primary { white-space: nowrap; }
}
/* ⋮ siempre en la esquina superior derecha de la tarjeta */
.order { position: relative; }
.order > .spread:first-child { padding-right: 30px; flex-wrap: wrap; gap: 4px; }
.order > .spread:first-child .dots { position: absolute; top: 6px; right: 4px; }
.order .badge { white-space: normal; }
/* Ficha del pedido */
.order, .orow { cursor: pointer; }
.order:hover, .orow:hover { box-shadow: 0 2px 10px rgba(0,0,0,.08); }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.detail-grid h4, dialog h4 { margin: 12px 0 4px; }
.detail-actions { flex-wrap: wrap; margin-top: 12px; border-top: 1px solid var(--line); padding-top: 12px; }
@media (max-width: 700px) { .detail-grid { grid-template-columns: 1fr; } }
/* Reportes */
.reports h2 { margin: 20px 0 10px; }
.reports h3 { margin: 4px 0 10px; font-size: 15px; }
.reports .md-detail { margin-bottom: 16px; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 160px; padding-top: 8px; border-bottom: 1px solid var(--line); }
.bar-col { flex: 1; min-width: 6px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; cursor: default; }
.bar-fill { width: 100%; max-width: 36px; background: var(--accent); border-radius: 4px 4px 0 0; opacity: .85; }
.bar-col:hover .bar-fill { opacity: 1; }
.bar-col small { font-size: 10px; color: var(--muted); white-space: nowrap; height: 14px; }
.share td { padding: 6px 8px; }
.share-bar { width: 35%; }
.share-bar span { display: block; height: 8px; border-radius: 4px; background: var(--accent); opacity: .8; min-width: 2px; }
#filters select, #filters input { padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
/* Lista angosta (poco espacio al lado de Nuevo pedido), en tres líneas:
   código + tiempo | total  ·  tipo y cliente | cómo paga  ·  botón a lo ancho con su ⋮ al final. */
@container (max-width: 560px) {
  .orow, .vidrio .orow { grid-template-columns: minmax(0, 1fr) auto; row-gap: 6px; align-items: center; }
  .orow > .orow-id { grid-column: 1; grid-row: 1; flex-direction: row; align-items: center; gap: 8px; }
  .orow > span:nth-child(3) { grid-column: 1; grid-row: 2; min-width: 0; }
  .orow > .orow-total { grid-column: 2; grid-row: 1 / span 2; }
  .orow > span:last-child { grid-column: 1 / -1; grid-row: 3; flex-wrap: nowrap; }
  .orow > span:last-child .primary { flex: 1; }
}
.orow .badge { white-space: nowrap; }
.code-time { gap: 8px; flex-wrap: nowrap; }
.orow-id .timer, .code-time .timer { flex: none; }
/* Ventanas largas (ficha del local): título con ✕ arriba y Guardar/Cancelar siempre visibles abajo */
dialog .dlg-head { position: sticky; top: -18px; z-index: 2; background: var(--card, #fff); margin: -18px -18px 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
dialog .dlg-foot { position: sticky; bottom: -18px; z-index: 2; background: var(--card, #fff); margin: 12px -18px -18px; padding: 12px 18px; border-top: 1px solid var(--line); }

/* Menú lateral ocultable (Pedidos) */
.app.side-hidden { grid-template-columns: 1fr; }
.app.side-hidden #side { display: none; }
@media (max-width: 800px) { .app.side-hidden #side { display: flex; } #sideToggle { display: none; } } /* en celular manda el cajón de la barra de arriba */
.side-toggle { font-size: 18px; line-height: 1; padding: 6px 10px; }
.auto { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; margin-top: 8px; }
.auto summary { cursor: pointer; list-style: none; }
.auto-form { margin-top: 10px; }
.auto-form textarea { width: 100%; font: inherit; padding: 8px; border: 1px solid var(--line); border-radius: 8px; }
.mb { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 10px 0; }
.mb-blocks { display: flex; flex-direction: column; gap: 8px; max-height: 60vh; overflow: auto; }
.mb-block { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.mb-block textarea, .mb-block input:not([type=checkbox]) { width: 100%; font: inherit; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; }
.mb-add { flex-wrap: wrap; gap: 6px; }
.mb-prods { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; max-height: 160px; overflow: auto; }
.mb-preview iframe { width: 100%; height: 60vh; border: 1px solid var(--line); border-radius: 10px; background: #f4f4f5; }
.btnlike { cursor: pointer; border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px; }
@media (max-width: 900px) { .mb { grid-template-columns: 1fr; } }
.wiz-steps { display: flex; gap: 18px; list-style: none; padding: 0; margin: 10px 0 14px; flex-wrap: wrap; }
.wiz-steps li { display: flex; align-items: center; gap: 6px; color: var(--muted); cursor: pointer; }
.wiz-steps li span { width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; font-size: 12px; }
.wiz-steps li.on { color: inherit; font-weight: 700; } .wiz-steps li.on span, .wiz-steps li.done span { background: var(--accent); color: #fff; border-color: transparent; }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.tpl { display: flex; flex-direction: column; gap: 4px; text-align: left; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); cursor: pointer; font: inherit; }
.tpl:hover { border-color: var(--accent); }
.tpl-prev { height: 220px; overflow: hidden; border-radius: 8px; background: #f4f4f5; pointer-events: none; }
.tpl-prev iframe { width: 560px; height: 620px; border: 0; transform: scale(0.36); transform-origin: 0 0; }
.aud-pick { cursor: pointer; border: 2px solid transparent; } .aud-pick.on { border-color: var(--accent); }
.wiz-review { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; } .wiz-review .mb-preview iframe { height: 70vh; }
.wiz-nav { margin-top: 14px; }
@media (max-width: 900px) { .wiz-review { grid-template-columns: 1fr; } }
input[type=color] { width: 46px; height: 34px; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); cursor: pointer; }

/* WhatsApp: conversación con burbujas (cliente a la izquierda; IA, local y avisos a la derecha) */
.wa-chat { display: flex; flex-direction: column; gap: 8px; max-height: 60vh; overflow: auto; padding: 12px; background: #efeae2; border-radius: 10px; }
.wa-msg { max-width: 80%; padding: 6px 10px; border-radius: 10px; background: #fff; align-self: flex-start; box-shadow: 0 1px 1px #0001; }
.wa-msg small { display: block; color: var(--muted); font-size: 11px; }
.wa-msg.ia, .wa-msg.persona, .wa-msg.sistema { align-self: flex-end; background: #d9fdd3; }
.wa-msg.persona { background: #cfe9ff; }
.wa-msg.sistema { background: #fff7d6; }
.wa-fix { margin-top: 8px; border-top: 1px solid var(--line); padding-top: 6px; }
.badge.closed { background: #ffe0e0; color: #b00020; }
#main .card { margin-bottom: 14px; }
#main .card h2 { margin: 0 0 8px; font-size: 18px; }
.wa-alert { position: fixed; right: 16px; bottom: 16px; z-index: 50; max-width: 360px; background: #25d366; color: #fff; font-weight: 700; padding: 12px 16px; border-radius: 12px; box-shadow: 0 6px 20px #0003; text-decoration: none; }
#cfg .field textarea, #cfg .field select { width: 100%; box-sizing: border-box; }
.wa-btns { display: flex; flex-direction: column; gap: 3px; margin-top: 6px; }
.wa-btns button { background: #fff; color: #027eb5; border: 0; border-top: 1px solid #0001; border-radius: 0; padding: 7px; font-weight: 600; }
.wa-btns button:disabled { opacity: 1; cursor: default; }

/* Dirección de delivery: sugerencias del mapa y pin para confirmar */
.addr-sug { display: grid; gap: 4px; margin-top: 6px; }
.addr-sug button { text-align: left; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; padding: 10px 4px; display: flex; gap: 6px; align-items: center; }
.geo-btn { width: 100%; margin-top: 4px; display: flex; gap: 6px; justify-content: center; align-items: center; padding: 10px; font-weight: 600; }
.pin-map { height: 240px; border-radius: 10px; margin-bottom: 6px; background: var(--line); }
.linkbtn { width: 100%; border: 0; background: transparent; text-decoration: underline; margin-top: 6px; }

/* Gato negro que pasea por abajo de la web (public/gato.js) */
.gato { position: fixed; left: 0; bottom: 0; width: 140px; z-index: 5; pointer-events: none; color: #111; }
.gato svg { display: block; width: 100%; fill: currentColor; transition: transform .2s; }
.gato.left svg { transform: scaleX(-1); }
body[data-view=checkout] .gato { display: none; } /* en el checkout no distrae */
.gato svg > * { pointer-events: auto; cursor: pointer; }
.gato.flop svg { transform: translateY(30%) rotate(180deg); transition: transform .35s cubic-bezier(.5, -0.4, .6, 1.4); }
.gato.left.flop svg { transform: translateY(30%) rotate(180deg) scaleX(-1); }
.gato.flop .leg { animation: cat-step .18s ease-in-out infinite alternate; }
.gato.flop .l2, .gato.flop .l3 { animation-direction: alternate-reverse; }
.gato.flop .cat-tail { animation-duration: .4s; }
.gato .leg { transform-box: fill-box; transform-origin: 50% 10%; }
.gato .cat-tail { transform-box: view-box; transform-origin: 34px 44px; animation: cat-tail 1.8s ease-in-out infinite alternate; }
.gato .eye { fill: #f5d90a; transform-box: fill-box; transform-origin: center; animation: cat-blink 4s infinite; }
.gato .yarn { display: none; fill: var(--accent, #e2001a); }
.gato.walking svg { animation: cat-bob .25s ease-in-out infinite alternate; }
.gato.walking .l1, .gato.walking .l4 { animation: cat-step .5s ease-in-out infinite alternate; }
.gato.walking .l2, .gato.walking .l3 { animation: cat-step .5s ease-in-out -.5s infinite alternate-reverse; }
.gato.left.walking svg { animation-name: cat-bob-left; }
.gato.playing .paw { animation: cat-bat .35s ease-in-out infinite alternate; }
.gato.playing .cat-tail { animation-duration: .5s; }
.gato.playing .yarn { display: block; transform-box: fill-box; transform-origin: center; animation: cat-yarn .7s ease-in-out infinite alternate; }
@keyframes cat-step { from { transform: rotate(-22deg); } to { transform: rotate(22deg); } }
@keyframes cat-bob { to { transform: translateY(1.5px); } }
@keyframes cat-bob-left { from { transform: scaleX(-1); } to { transform: scaleX(-1) translateY(1.5px); } }
@keyframes cat-tail { from { transform: rotate(-10deg); } to { transform: rotate(12deg); } }
@keyframes cat-bat { from { transform: rotate(0); } to { transform: rotate(-65deg); } }
@keyframes cat-yarn { from { transform: translateX(0) rotate(0); } to { transform: translateX(5px) rotate(90deg); } }
@keyframes cat-blink { 0%, 94%, 100% { transform: scaleY(1); } 97% { transform: scaleY(.1); } }
@media (max-width: 760px) { .gato { width: 95px; } }
/* Suscripción: lista de beneficios del plan */
.perks { list-style: none; padding: 0; margin: 12px 0 16px; display: grid; gap: 6px; }
/* Mesas: plano por sector (libre gris, en cocina con acento, servida en verde) y rondas en la cocina */
.msector { padding: 12px 16px 4px; }
.msector h3 { margin: 0 0 8px; font-size: 15px; }
.mgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.mesa { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 92px; padding: 10px; border-radius: 14px; text-align: left; border: 1px solid var(--line); background: var(--card); color: var(--text); }
.mesa b { font-size: 20px; } .mesa small, .mesa span { font-size: 12px; color: var(--muted); }
.mesa.busy { border-color: var(--accent); box-shadow: inset 0 4px 0 var(--accent); }
.mesa.busy span { color: var(--accent); font-weight: 600; }
.mesa.served { border-color: #2e7d32; box-shadow: inset 0 4px 0 #2e7d32; }
.mesa.served span { color: #2e7d32; font-weight: 600; }
.mesa.on { outline: 3px solid var(--lime, var(--accent)); outline-offset: 1px; }
.mround { border-top: 1px dashed var(--line); padding-top: 6px; display: flex; flex-direction: column; gap: 4px; }
.mrows { display: flex; flex-direction: column; gap: 6px; } .mrow input { min-width: 0; }
.pos-in { display: flex; flex-direction: column; gap: 10px; }
.kround { font-size: 12px; font-weight: 700; text-transform: uppercase; color: var(--muted); margin-top: 4px; }
.kround.new { color: #fff; background: #d32f2f; border-radius: 6px; padding: 2px 8px; align-self: flex-start; }
.kitem.old { opacity: .45; }

/* Código de 6 dígitos (como en Justo): un solo campo dibujado como 6 casillas; pegar y autocompletar siguen funcionando. */
label.field input.codigo, label.field input.codigo:focus {
  --cell: 1.9ch; --gap: .5ch;
  background-color: transparent !important; border: 0 !important;
  display: block; box-sizing: content-box; width: calc(6 * (var(--cell) + var(--gap))); height: 2.2em; margin-top: 6px;
  padding: 0 0 0 calc((var(--cell) - 1ch) / 2); border: 0; border-radius: 0; outline: none; overflow: hidden;
  font: 600 1.5rem/1 ui-monospace, Consolas, monospace; letter-spacing: calc(var(--cell) + var(--gap) - 1ch);
  background-image: repeating-linear-gradient(90deg, color-mix(in srgb, currentColor 12%, transparent) 0 var(--cell), transparent 0 calc(var(--cell) + var(--gap))) !important;
  background-repeat: no-repeat !important; background-size: calc(6 * var(--cell) + 5 * var(--gap)) 100% !important;
}
