/* QRMenu — estilos del sitio, panel del negocio y superadmin.
   Los colores de marca (--brand, --accent) se inyectan desde los ajustes del superadmin. */

@font-face {
  font-family: 'Bricolage Grotesque';
  src: url('../fonts/bricolage-grotesque-latin-wght-normal.woff2') format('woff2');
  font-weight: 200 800;
  font-display: swap;
}

:root {
  --brand: #0F5C4D;
  --on-brand: #FFFFFF;
  --accent: #F2A93B;
  --on-accent: #111111;

  --bg: #F4F6F1;
  --surface: #FFFFFF;
  --surface-2: #EBEFE7;
  --ink: #16211D;
  --muted: #56645D;
  --line: #D5DCD2;
  --brand-text: color-mix(in oklab, var(--brand) 88%, black);
  --brand-soft: color-mix(in oklab, var(--brand) 10%, var(--surface));
  --ok: #17694A; --ok-bg: #E2F3EA;
  --warn: #7A4D00; --warn-bg: #FCEFD3;
  --err: #A1241D; --err-bg: #FBE4E1;
  --focus: #1B6EF3;
  --shadow: 0 1px 2px rgb(22 33 29 / .06), 0 8px 24px -12px rgb(22 33 29 / .18);

  --display: 'Bricolage Grotesque', system-ui, sans-serif;
  --body: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --r-sm: 6px; --r: 10px; --r-lg: 18px;
  color-scheme: light;
}

:root[data-theme='dark'] {
  --bg: #0E1512;
  --surface: #17201C;
  --surface-2: #1F2B26;
  --ink: #E9F0EB;
  --muted: #A1B0A8;
  --line: #2C3A34;
  --brand-text: color-mix(in oklab, var(--brand) 42%, white);
  --brand-soft: color-mix(in oklab, var(--brand) 26%, var(--surface));
  --ok: #7FD9AE; --ok-bg: #143326;
  --warn: #F4C56B; --warn-bg: #3A2C0C;
  --err: #FF9D94; --err-bg: #3F1815;
  --focus: #8AB4FF;
  --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 10px 28px -14px rgb(0 0 0 / .7);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 1rem/1.55 var(--body);
}
img, svg { max-width: 100%; height: auto; }
h1, h2, h3 { font-family: var(--display); line-height: 1.12; margin: 0 0 .5em; letter-spacing: -.015em; text-wrap: balance; }
h1 { font-size: clamp(1.7rem, 1.2rem + 2vw, 2.4rem); font-weight: 700; }
h2 { font-size: clamp(1.3rem, 1.1rem + 1vw, 1.7rem); font-weight: 650; }
h3 { font-size: 1.1rem; font-weight: 650; }
p { margin: 0 0 1em; }
a { color: var(--brand-text); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -60px; background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: var(--r-sm); z-index: 100; }
.skip:focus { top: 8px; }
.container { width: min(1120px, 100% - 2.5rem); margin-inline: auto; }
.narrow { width: min(680px, 100% - 2.5rem); margin-inline: auto; }
.stack > * + * { margin-top: 1rem; }
.row { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }
.row.between { justify-content: space-between; }
.grid { display: grid; gap: 1rem; }
.cols-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.cols-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }
.cols-4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); }

/* ── Botones ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 44px; padding: .55rem 1.1rem; border-radius: var(--r);
  border: 1.5px solid transparent; background: var(--brand); color: var(--on-brand);
  font: 600 .975rem/1.2 var(--body); text-decoration: none; cursor: pointer;
  transition: filter .15s, background .15s;
}
.btn:hover { filter: brightness(1.1); }
.btn:active { filter: brightness(.95); }
.btn.accent { background: var(--accent); color: var(--on-accent); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { background: var(--surface-2); filter: none; }
.btn.danger { background: transparent; color: var(--err); border-color: currentColor; }
.btn.danger:hover { background: var(--err-bg); filter: none; }
.btn.sm { min-height: 36px; padding: .3rem .75rem; font-size: .875rem; border-radius: var(--r-sm); }
.btn.lg { min-height: 52px; padding: .8rem 1.5rem; font-size: 1.05rem; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--brand-text); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
form.inline { display: inline; }

/* ── Tarjetas, avisos, insignias ── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: clamp(1rem, .7rem + 1.2vw, 1.5rem); }
.card > :last-child { margin-bottom: 0; }
.card.flat { border-radius: var(--r); }
.card h2 { font-size: 1.2rem; }
.alert { padding: .8rem 1rem; border-radius: var(--r); border: 1px solid; margin-bottom: 1rem; font-weight: 500; }
.alert.ok { background: var(--ok-bg); color: var(--ok); border-color: color-mix(in oklab, var(--ok) 35%, transparent); }
.alert.warn { background: var(--warn-bg); color: var(--warn); border-color: color-mix(in oklab, var(--warn) 35%, transparent); }
.alert.err { background: var(--err-bg); color: var(--err); border-color: color-mix(in oklab, var(--err) 35%, transparent); }
.alert ul { margin: .3rem 0 0; padding-left: 1.2rem; font-weight: 400; }
.badge { display: inline-block; padding: .15rem .6rem; border-radius: 99px; font-size: .8rem; font-weight: 600; background: var(--surface-2); color: var(--ink); white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.err { background: var(--err-bg); color: var(--err); }

/* ── Formularios ── */
.field { display: grid; gap: .35rem; margin-bottom: 1rem; }
.field label, .label { font-weight: 600; font-size: .95rem; }
.field .opt { font-weight: 400; color: var(--muted); font-size: .85rem; }
.field .hint { color: var(--muted); font-size: .875rem; margin: 0; }
.field .error { color: var(--err); font-size: .875rem; font-weight: 600; margin: 0; }
input[type='text'], input[type='email'], input[type='password'], input[type='number'], input[type='date'],
input[type='tel'], input[type='search'], input[type='url'], select, textarea {
  width: 100%; min-height: 44px; padding: .55rem .75rem;
  background: var(--surface); color: var(--ink);
  border: 1.5px solid var(--line); border-radius: var(--r);
  font: inherit;
}
textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
textarea.tall { min-height: 320px; font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: .9rem; }
input:hover, select:hover, textarea:hover { border-color: color-mix(in oklab, var(--line) 50%, var(--ink)); }
input[aria-invalid='true'], textarea[aria-invalid='true'], select[aria-invalid='true'] { border-color: var(--err); }
input[type='file'] { width: 100%; padding: .5rem; border: 1.5px dashed var(--line); border-radius: var(--r); background: var(--surface); color: var(--ink); font: inherit; }
.check { display: flex; gap: .65rem; align-items: flex-start; margin-bottom: .75rem; }
.check input { width: 22px; height: 22px; margin: 1px 0 0; flex: none; accent-color: var(--brand); }
.check label { font-weight: 500; }
.check .hint { display: block; color: var(--muted); font-size: .875rem; font-weight: 400; }
.color { display: flex; gap: .5rem; align-items: center; }
.color input[type='color'] { width: 52px; height: 44px; padding: 2px; border: 1.5px solid var(--line); border-radius: var(--r); background: var(--surface); cursor: pointer; flex: none; }
.color input[type='text'] { font-family: ui-monospace, Menlo, Consolas, monospace; text-transform: uppercase; }
fieldset { border: 0; padding: 0; margin: 0 0 1rem; min-width: 0; }
legend { font-weight: 600; font-size: .95rem; padding: 0; margin-bottom: .5rem; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.chip span { display: inline-flex; align-items: center; min-height: 40px; padding: .3rem .9rem; border: 1.5px solid var(--line); border-radius: 99px; background: var(--surface); font-weight: 500; font-size: .92rem; }
.chip input:checked + span { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
.chip input:checked + span::before { content: '✓'; margin-right: .4rem; }
.chip input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; margin-top: 1.25rem; }
.repeater-row { display: grid; gap: .5rem; grid-template-columns: 1fr; padding: .9rem; border: 1px solid var(--line); border-radius: var(--r); margin-bottom: .6rem; background: var(--bg); }
.repeater-row .field { margin: 0; }
.thumb { width: 64px; height: 64px; object-fit: cover; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface-2); flex: none; }
.thumb.logo { object-fit: contain; background: #fff; }

/* ── Tablas que se vuelven tarjetas en móvil ── */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: .85rem; color: var(--muted); font-weight: 600; padding: .5rem .75rem; border-bottom: 1px solid var(--line); }
.table td { padding: .7rem .75rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 720px) {
  .table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .table tr { display: block; padding: .75rem 0; border-bottom: 1px solid var(--line); }
  .table tr:last-child { border-bottom: 0; }
  .table td { display: flex; justify-content: space-between; gap: 1rem; padding: .25rem 0; border: 0; text-align: right; }
  .table td::before { content: attr(data-label); color: var(--muted); font-size: .85rem; text-align: left; flex: none; }
  .table td[data-label='']::before { display: none; }
  .table td.main { display: block; text-align: left; font-weight: 600; }
  .table td.main::before { display: none; }
}

/* ── Marca y cabecera del sitio ── */
.brand { display: inline-flex; align-items: center; gap: .6rem; font: 700 1.2rem/1 var(--display); color: var(--ink); text-decoration: none; letter-spacing: -.02em; }
.brand img { height: 34px; width: auto; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--brand); display: grid; grid-template-columns: 1fr 1fr; gap: 3px; padding: 6px; flex: none; }
.brand-mark i { background: var(--on-brand); border-radius: 2px; }
.brand-mark i:nth-child(4) { background: var(--accent); }
.site-header { position: sticky; top: 0; z-index: 30; background: color-mix(in oklab, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 64px; }
.site-nav { display: flex; align-items: center; gap: .35rem; }
.site-nav a.plain { color: var(--ink); text-decoration: none; font-weight: 500; padding: .5rem .7rem; border-radius: var(--r-sm); }
.site-nav a.plain:hover { background: var(--surface-2); }
.icon-btn { width: 44px; height: 44px; display: inline-grid; place-items: center; border-radius: var(--r); border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; flex: none; }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn svg { width: 20px; height: 20px; }
[data-theme='dark'] .icon-sun, :root:not([data-theme='dark']) .icon-moon { display: none; }
@media (max-width: 640px) { .site-nav .hide-sm { display: none; } }
.site-footer { border-top: 1px solid var(--line); padding: 2rem 0 2.5rem; margin-top: 4rem; color: var(--muted); font-size: .92rem; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: .4rem 1.25rem; }
.site-footer a, .site-footer .linkbtn { color: var(--muted); }

/* ── Página principal ── */
.hero { padding: clamp(2.5rem, 1.5rem + 5vw, 5.5rem) 0 clamp(2rem, 1rem + 4vw, 4rem); overflow: hidden; }
.hero .container { display: grid; gap: 2.5rem; align-items: center; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); }
.hero h1 { font-size: clamp(2.2rem, 1.2rem + 4.4vw, 4.1rem); font-weight: 750; letter-spacing: -.035em; line-height: 1; margin-bottom: 1.25rem; }
.hero .lead { font-size: clamp(1.05rem, 1rem + .4vw, 1.25rem); color: var(--muted); max-width: 34rem; margin-bottom: 1.75rem; }
.hero-note { margin-top: 1rem; color: var(--muted); font-size: .92rem; }
@media (max-width: 860px) { .hero .container { grid-template-columns: 1fr; } }

/* Escena: tarjeta de mesa con QR + teléfono mostrando el menú */
.scene { position: relative; min-height: 430px; display: grid; place-items: center; }
.scene::before { content: ''; position: absolute; inset: 8% -30% -12% 6%; background: var(--brand); border-radius: 46% 54% 40% 60% / 55% 45% 55% 45%; opacity: .12; }
[data-theme='dark'] .scene::before { opacity: .3; }
.tent { position: absolute; left: 0; bottom: 6%; width: 46%; max-width: 210px; background: #fff; color: #16211D; border-radius: 14px; padding: 16px 14px 14px; text-align: center; box-shadow: var(--shadow); transform: rotate(-5deg); border: 1px solid #DDE3D9; }
.tent svg { display: block; width: 100%; height: auto; border-radius: 6px; }
.tent b { display: block; font: 700 .95rem/1.2 var(--display); margin-bottom: 8px; }
.tent span { display: block; font-size: .72rem; color: #56645D; margin-top: 6px; }
.phone { position: relative; margin-left: 30%; width: min(62%, 270px); aspect-ratio: 9 / 18.5; background: #101513; border-radius: 34px; padding: 9px; box-shadow: 0 30px 60px -30px rgb(0 0 0 / .55); }
.phone iframe { width: 100%; height: 100%; border: 0; border-radius: 26px; background: #fff; display: block; }
@media (max-width: 860px) { .scene { min-height: 400px; max-width: 420px; margin-inline: auto; width: 100%; } }

.section { padding: clamp(2.5rem, 1.5rem + 4vw, 4.5rem) 0; }
.section.tint { background: var(--surface); border-block: 1px solid var(--line); }
.section-head { max-width: 40rem; margin-bottom: 2rem; }
.section-head h2 { font-size: clamp(1.6rem, 1.2rem + 1.8vw, 2.4rem); font-weight: 700; letter-spacing: -.025em; }
.steps { list-style: none; margin: 0; padding: 0; counter-reset: paso; display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.steps li { counter-increment: paso; padding-top: 1rem; border-top: 3px solid var(--brand); }
.steps li::before { content: counter(paso); font: 750 2.6rem/1 var(--display); color: var(--brand-text); display: block; margin-bottom: .5rem; }
.steps p, .feature p { color: var(--muted); margin: 0; }
.features { display: grid; gap: 1.75rem 2.5rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.feature h3 { font-size: 1.15rem; margin-bottom: .35rem; }
.feature { padding-left: 1rem; border-left: 3px solid var(--accent); }

.tpl-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); }
.tpl { display: block; text-decoration: none; color: var(--ink); }
.tpl-thumb { border-radius: var(--r); border: 1px solid var(--line); padding: 14px 12px; aspect-ratio: 3 / 4; overflow: hidden; display: flex; flex-direction: column; gap: 7px; font-size: 11px; line-height: 1.25; }
.tpl-thumb b { font-size: 15px; display: block; margin-bottom: 2px; }
.tpl-thumb .ln { display: flex; justify-content: space-between; gap: 6px; padding: 5px 7px; border-radius: 5px; }
.tpl-thumb .tag { align-self: flex-start; padding: 2px 8px; border-radius: 99px; font-weight: 700; font-size: 10px; }
.tpl-thumb.is-image { padding: 0; display: block; }
.tpl-thumb.is-image img { width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block; }
.tpl-group { font-size: 1rem; color: var(--muted); font-family: var(--body); font-weight: 600; letter-spacing: 0; margin: 1.75rem 0 .75rem; }
.tpl-group:first-of-type { margin-top: 0; }
.tpl strong { display: block; margin-top: .55rem; }
.tpl small { color: var(--muted); display: block; line-height: 1.35; }
.tpl:hover .tpl-thumb { border-color: var(--brand); }

.toggle { display: inline-flex; padding: 4px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); margin-bottom: 1.5rem; }
.toggle button { border: 0; background: transparent; color: var(--ink); font: 600 .95rem var(--body); padding: .5rem 1.1rem; border-radius: 99px; cursor: pointer; min-height: 40px; }
.toggle button[aria-pressed='true'] { background: var(--brand); color: var(--on-brand); }
.plans { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr)); align-items: stretch; }
.plan { display: flex; flex-direction: column; background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r-lg); padding: 1.5rem; }
.plan.featured { border-color: var(--brand); box-shadow: var(--shadow); }
.plan .flag { align-self: flex-start; background: var(--accent); color: var(--on-accent); font-weight: 700; font-size: .8rem; padding: .2rem .7rem; border-radius: 99px; margin-bottom: .75rem; }
.plan h3 { font-size: 1.35rem; }
.plan .price { font: 750 2.3rem/1 var(--display); letter-spacing: -.03em; margin: .75rem 0 .15rem; }
.plan .price small { font: 500 .95rem var(--body); color: var(--muted); letter-spacing: 0; }
.plan ul { list-style: none; padding: 0; margin: 1.1rem 0 1.5rem; display: grid; gap: .5rem; flex: 1; align-content: start; }
.plan li { padding-left: 1.6rem; position: relative; }
.plan li::before { content: '✓'; position: absolute; left: 0; color: var(--brand-text); font-weight: 800; }
[data-interval='monthly'] .when-yearly, [data-interval='yearly'] .when-monthly { display: none !important; }
.faq details { border-bottom: 1px solid var(--line); padding: .35rem 0; }
.faq summary { cursor: pointer; font: 650 1.08rem/1.35 var(--display); padding: .8rem 0; list-style-position: inside; }
.faq details p { color: var(--muted); max-width: 44rem; }
.cta-band { background: var(--brand); color: var(--on-brand); border-radius: var(--r-lg); padding: clamp(1.75rem, 1rem + 3vw, 3rem); display: flex; flex-wrap: wrap; gap: 1.25rem; align-items: center; justify-content: space-between; }
.cta-band h2 { margin: 0; font-size: clamp(1.4rem, 1.1rem + 1.6vw, 2.1rem); max-width: 22ch; }
.prose { max-width: 44rem; }
.prose h2 { margin-top: 1.5em; }
.prose li { margin-bottom: .4em; }

/* ── Acceso ── */
.auth { min-height: calc(100vh - 66px); display: grid; place-items: start center; padding: clamp(1.5rem, 1rem + 4vw, 4rem) 1.25rem; }
.auth .card { width: min(460px, 100%); }
.auth h1 { font-size: 1.7rem; }

/* ── Panel (negocio y superadmin) ── */
.shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--surface); border-right: 1px solid var(--line); padding: 1.1rem .9rem; display: flex; flex-direction: column; gap: 1.1rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side nav { display: grid; gap: 2px; }
.side nav a { display: block; padding: .6rem .8rem; border-radius: var(--r-sm); color: var(--ink); text-decoration: none; font-weight: 500; }
.side nav a:hover { background: var(--surface-2); }
.side nav a[aria-current='page'] { background: var(--brand-soft); color: var(--brand-text); font-weight: 650; box-shadow: inset 3px 0 0 var(--brand); }
.side .group { font-size: .8rem; color: var(--muted); font-weight: 600; padding: .9rem .8rem .3rem; }
.side .foot { margin-top: auto; display: grid; gap: .5rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.side .who { font-size: .875rem; color: var(--muted); padding: 0 .3rem; overflow-wrap: anywhere; }
.topbar { display: none; }
.main { padding: clamp(1rem, .5rem + 2.5vw, 2.25rem); min-width: 0; }
.main > .inner { max-width: 1000px; margin-inline: auto; }
.page-head { display: flex; flex-wrap: wrap; gap: .75rem 1rem; justify-content: space-between; align-items: flex-end; margin-bottom: 1.5rem; }
.page-head h1 { margin: 0; }
.page-head p { margin: .3rem 0 0; color: var(--muted); max-width: 46rem; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 1rem 1.1rem; }
.stat b { display: block; font: 700 1.9rem/1.1 var(--display); letter-spacing: -.02em; }
.stat span { color: var(--muted); font-size: .9rem; }
.todo { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
.todo li { display: flex; gap: .75rem; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: .7rem .9rem; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.todo .done { color: var(--ok); font-weight: 600; }
.item-row { display: flex; gap: .85rem; align-items: center; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.item-row:last-child { border-bottom: 0; }
.item-row .grow { flex: 1; min-width: 0; }
.item-row .name { font-weight: 600; display: block; overflow-wrap: anywhere; }
.item-row.off .name, .item-row.off .price { color: var(--muted); text-decoration: line-through; }
.item-row .price { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 560px) { .item-row { flex-wrap: wrap; } .item-row .ops { width: 100%; } }
.ops { display: flex; gap: .4rem; flex-wrap: wrap; }
.empty { text-align: center; padding: 2.25rem 1rem; color: var(--muted); border: 1.5px dashed var(--line); border-radius: var(--r-lg); }
.empty h2, .empty h3 { color: var(--ink); }
.qr-box { background: #fff; border-radius: var(--r); padding: 12px; border: 1px solid var(--line); width: min(100%, 300px); }
.qr-box svg { display: block; width: 100%; height: auto; }
.urlbox { display: flex; gap: .5rem; flex-wrap: wrap; }
.urlbox input { flex: 1; min-width: 200px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .9rem; }

.design { display: grid; gap: 1.5rem; grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
.design .preview { position: sticky; top: 1rem; }
.design .phone { margin: 0 auto; width: min(100%, 300px); }
@media (max-width: 1100px) { .design { grid-template-columns: 1fr; } .design .preview { position: static; order: -1; } .design .phone { width: min(100%, 260px); } }
.tpl-pick { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
.tpl-pick label { cursor: pointer; display: block; position: relative; }
.tpl-pick input { position: absolute; opacity: 0; }
.tpl-pick .tpl-thumb.is-image { padding: 0; aspect-ratio: 3 / 4; }
.tpl-pick .tpl-thumb { aspect-ratio: 1 / 1.1; padding: 10px 9px; font-size: 9px; gap: 5px; border-width: 2px; }
.tpl-pick .tpl-thumb b { font-size: 12px; }
.tpl-pick input:checked + .tpl-thumb { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.tpl-pick input:focus-visible + .tpl-thumb { outline: 3px solid var(--focus); outline-offset: 2px; }
.tpl-pick strong { display: block; font-size: .9rem; margin-top: .35rem; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .topbar { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .6rem 1rem; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 40; }
  .side { position: fixed; inset: 0 auto 0 0; width: min(290px, 86vw); z-index: 60; transform: translateX(-102%); transition: transform .2s ease; box-shadow: var(--shadow); visibility: hidden; }
  .side.open { transform: none; visibility: visible; }
  .side .brand { display: none; }
  .scrim { position: fixed; inset: 0; background: rgb(0 0 0 / .45); z-index: 50; }
}
@media (min-width: 901px) { .scrim { display: none !important; } }

/* ── Aviso de cookies ── */
.cookies { position: fixed; inset: auto 1rem 1rem 1rem; z-index: 90; max-width: 560px; margin-inline: auto; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 1.1rem 1.2rem; box-shadow: var(--shadow); }
.cookies[hidden] { display: none; }
.cookies h2 { font-size: 1.05rem; margin-bottom: .35rem; }
.cookies p { font-size: .92rem; color: var(--muted); margin-bottom: .75rem; }
.cookies .check { margin-bottom: .4rem; }
.cookies .actions { margin-top: .9rem; gap: .5rem; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
@media print { .no-print { display: none !important; } }
@media (max-width: 560px) { .cookies .hint { display: none; } .cookies { padding: .9rem 1rem; } }
/* En pantallas anchas el aviso va en la esquina derecha para no tapar los botones de los formularios */
@media (min-width: 900px) { .cookies { inset: auto 1rem 1rem auto; width: 400px; margin: 0; } }
