/* Tapiffy · páginas de locales y paneles */
:root {
  --navy: #14213D; --navy-2: #1B2B4F; --ivory: #FAF8F4; --sand: #EFEBE3; --paper: #FFFFFF;
  --ink: #14213D; --mute: #56607A; --line: rgba(20,33,61,.12);
  --coral: #FF5A36; --coral-dark: #C8391A; --ok: #0F7B4F; --err: #B42318;
  --display: "Sora", "Segoe UI", system-ui, sans-serif;
  --sans: "Manrope", "Segoe UI", system-ui, sans-serif;
  --local: #FF5A36;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: var(--sans); font-size: 16px; line-height: 1.5; color: var(--ink); background: var(--ivory); -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--display); letter-spacing: -0.02em; line-height: 1.15; text-wrap: balance; }
:focus-visible { outline: 3px solid var(--coral); outline-offset: 2px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- alérgenos ---------- */
.algs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.alg { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink); }
.alg b { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--alg); color: #fff; font-size: 10px; font-weight: 800; letter-spacing: .02em; }

/* =========================================================
   Página pública del local
   ========================================================= */
.pub { background: var(--ivory); min-height: 100vh; }
.pub-wrap { width: min(560px, 100%); margin-inline: auto; padding-inline: 20px; }
.pub-head { text-align: center; padding: 48px 0 28px; }
.pub-logo { width: 112px; height: 112px; margin: 0 auto 18px; border-radius: 50%; object-fit: cover; background: var(--paper); box-shadow: 0 0 0 4px var(--paper), 0 0 0 6px var(--local), 0 18px 40px -20px rgba(20,33,61,.5); }
.pub-inicial { display: grid; place-items: center; background: var(--local); color: #fff; font-family: var(--display); font-weight: 800; font-size: 48px; }
.pub-head h1 { font-size: clamp(28px, 7vw, 36px); font-weight: 800; }
.pub-saludo { margin-top: 8px; color: var(--mute); font-size: 17px; }
.pub-botones { display: grid; gap: 12px; padding-bottom: 24px; }
.pub-btn { display: flex; align-items: center; gap: 14px; min-height: 60px; padding: 10px 18px; border-radius: 18px; background: var(--paper); border: 1px solid var(--line); text-decoration: none; font-weight: 700; font-size: 17px; box-shadow: 0 10px 24px -20px rgba(20,33,61,.6); transition: transform .2s; }
.pub-btn:active { transform: scale(.98); }
.pub-ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: color-mix(in srgb, var(--local) 14%, white); color: var(--local); flex: none; }
.pub-ic svg { width: 22px; height: 22px; }
.pub-btn-main { background: var(--navy); color: var(--ivory); border-color: var(--navy); }
.pub-btn-main .pub-ic { background: var(--local); color: #fff; }
.pub-wifi { display: block; padding: 0; }
.pub-wifi summary { display: flex; align-items: center; gap: 14px; min-height: 60px; padding: 10px 18px; cursor: pointer; list-style: none; }
.pub-wifi summary::-webkit-details-marker { display: none; }
.pub-wifi-datos { padding: 0 18px 16px 72px; display: grid; gap: 8px; font-weight: 500; }
.pub-wifi-datos p { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.pub-wifi-datos span { color: var(--mute); font-size: 14px; min-width: 90px; }
.pub-clave { font-family: ui-monospace, Menlo, Consolas, monospace; word-break: break-all; }
.pub-copiar { border: 1.5px solid var(--line); background: var(--ivory); border-radius: 999px; padding: 6px 14px; font-size: 14px; font-weight: 700; cursor: pointer; min-height: 36px; }
.pub-vacio { text-align: center; color: var(--mute); }
.pub-pie { text-align: center; padding: 24px 0 40px; font-size: 13px; color: var(--mute); }
.pub-pie a { text-decoration: none; }
.pub-pie b { font-family: var(--display); color: var(--navy); }
.pub-404 { text-align: center; padding-top: 30vh; }
.pub-404 p { margin-top: 10px; color: var(--mute); }

/* Carta */
.carta-top { position: sticky; top: 0; z-index: 10; background: var(--navy); color: var(--ivory); }
.carta-top-in { display: flex; align-items: center; gap: 12px; padding-top: 14px; padding-bottom: 14px; }
.carta-atras { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: rgba(255,255,255,.1); flex: none; }
.carta-atras svg { width: 22px; height: 22px; }
.carta-local { font-size: 13px; opacity: .8; font-weight: 600; }
.carta-top h1 { font-size: 22px; font-weight: 800; }
.carta-cats { overflow-x: auto; scrollbar-width: none; border-top: 1px solid rgba(255,255,255,.1); }
.carta-cats::-webkit-scrollbar { display: none; }
.carta-cats-in { display: flex; gap: 8px; width: min(560px, 100%); margin-inline: auto; padding: 10px 20px; }
.carta-cats a { flex: none; padding: 8px 14px; border-radius: 999px; background: rgba(255,255,255,.1); text-decoration: none; font-weight: 700; font-size: 14px; white-space: nowrap; }
.carta { padding-bottom: 20px; }
.carta-sec { padding-top: 26px; scroll-margin-top: 130px; }
.carta-sec h2 { font-size: 22px; font-weight: 800; padding-bottom: 8px; border-bottom: 2px solid var(--local); }
.carta-lista { list-style: none; padding: 0; }
.plato { display: flex; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.plato-txt { flex: 1; min-width: 0; }
.plato-fila { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.plato h3 { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.plato-precio { font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; }
.plato p { margin-top: 4px; color: var(--mute); font-size: 15px; }
.plato-foto { width: 96px; height: 96px; border-radius: 14px; object-fit: cover; flex: none; }
.plato-agotado { display: inline-block; margin-top: 4px; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--err); background: #FDECEA; padding: 2px 8px; border-radius: 6px; }
.plato.is-agotado h3, .plato.is-agotado .plato-precio { text-decoration: line-through; color: var(--mute); }
.plato.is-agotado .plato-foto { filter: grayscale(1); opacity: .6; }
.carta-leyenda { margin-top: 28px; padding: 20px; border-radius: 18px; background: var(--paper); border: 1px solid var(--line); }
.carta-leyenda h2 { font-size: 17px; margin-bottom: 4px; }
.algs-leyenda { gap: 10px 16px; margin-bottom: 14px; }
.carta-leyenda p { color: var(--mute); font-size: 14px; }

/* =========================================================
   Paneles (gestión y administrador)
   ========================================================= */
.panel { background: var(--sand); min-height: 100vh; }
.p-wrap { width: min(760px, 100%); margin-inline: auto; padding-inline: 16px; }
.p-top { background: var(--navy); color: var(--ivory); position: sticky; top: 0; z-index: 10; }
.p-top-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; }
.p-logo { display: inline-flex; align-items: flex-start; gap: 2px; text-decoration: none; min-width: 0; }
.p-logo span { font-family: var(--display); font-weight: 800; font-size: 22px; letter-spacing: -0.06em; line-height: 1; }
.p-logo svg { width: 12px; height: 12px; color: var(--coral); transform: rotate(-35deg); margin-top: -2px; flex: none; }
.p-logo em { font-style: normal; font-size: 13px; opacity: .75; margin: 5px 0 0 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40vw; }
.p-nav { display: flex; align-items: center; gap: 14px; }
.p-link { background: none; border: 0; color: var(--ivory); font-weight: 700; cursor: pointer; text-decoration: none; padding: 10px 4px; font-size: 15px; }
.p-salir { display: inline; }
.p-main { padding-top: 22px; padding-bottom: 60px; display: grid; gap: 16px; }
.p-h1 { font-size: clamp(24px, 5vw, 30px); font-weight: 800; }
.p-h2 { font-size: 18px; font-weight: 800; margin-top: 10px; }
.p-sub { color: var(--mute); margin-top: 4px; }
.p-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.p-card { background: var(--paper); border-radius: 18px; border: 1px solid var(--line); padding: 18px; }
.p-vacio p { color: var(--mute); }
.p-volver { font-weight: 700; text-decoration: none; color: var(--mute); }
.p-flash { padding: 12px 14px; border-radius: 12px; font-weight: 600; }
.p-ok { background: #E7F6EE; color: var(--ok); }
.p-err { background: #FDECEA; color: var(--err); }
.p-ayuda, .p-nota { color: var(--mute); font-size: 14px; }
.p-opc { font-weight: 500; color: var(--mute); font-size: 13px; }
.p-login { max-width: 420px; width: 100%; margin: 6vh auto 0; display: grid; gap: 14px; }
.p-login h1 { font-size: 30px; font-weight: 800; }

.p-form { display: grid; gap: 8px; }
.p-form label { font-weight: 700; font-size: 15px; margin-top: 6px; }
.p-form input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=color]), .p-form select, .p-form textarea, .p-inline input {
  width: 100%; min-height: 48px; padding: 10px 14px; border-radius: 12px; border: 1.5px solid rgba(20,33,61,.22); background: var(--paper); }
.p-form textarea { resize: vertical; }
.p-form input:focus, .p-form select:focus, .p-form textarea:focus, .p-inline input:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 4px rgba(255,90,54,.22); }
.p-form input[type=color] { width: 72px; height: 44px; border: 1.5px solid rgba(20,33,61,.22); border-radius: 10px; padding: 2px; background: var(--paper); }
.p-form fieldset { border: 0; padding: 0; margin-top: 10px; display: grid; gap: 8px; }
.p-form legend { font-weight: 700; font-size: 15px; margin-bottom: 8px; }
.p-check { display: flex !important; align-items: center; gap: 10px; font-weight: 600 !important; }
.p-check input { width: 22px; height: 22px; accent-color: var(--coral-dark); flex: none; }
.p-check-grande { padding: 12px 14px; border-radius: 12px; background: var(--ivory); margin-top: 10px !important; }
.p-algs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
.p-alg { display: flex !important; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 12px; border: 1.5px solid var(--line); font-weight: 600 !important; font-size: 14px !important; margin: 0 !important; cursor: pointer; }
.p-alg input { width: 20px; height: 20px; accent-color: var(--coral-dark); flex: none; }
.p-alg:has(input:checked) { border-color: var(--navy); background: var(--ivory); }
.p-foto-actual { display: flex; align-items: center; gap: 14px; }
.p-foto-actual img { width: 72px; height: 72px; object-fit: cover; border-radius: 12px; }

.p-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--paper); font-weight: 800; font-size: 15px; text-decoration: none; cursor: pointer; white-space: nowrap; }
.p-btn:hover { border-color: var(--navy); }
.p-btn-main { background: var(--coral); border-color: var(--coral); color: var(--navy); margin-top: 8px; }
.p-btn-main:hover { background: #FF7352; border-color: #FF7352; }
.p-btn-peligro { color: var(--err); border-color: #F3C2BC; }
.p-btn:disabled { opacity: .6; cursor: progress; }
.p-borrar { display: flex; justify-content: flex-end; }
.p-inline { display: flex; gap: 8px; flex-wrap: wrap; }
.p-inline input { flex: 1 1 200px; }
.p-radios { display: grid; gap: 10px; }
.p-radios .p-btn { justify-self: start; }

.p-cat-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.p-cat-head h2 { font-size: 20px; font-weight: 800; }
.p-mini { display: flex; gap: 6px; }
.p-mini form { display: contents; }
.p-mini-v { flex-direction: column; gap: 4px; }
.p-ico { width: 34px; height: 34px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--paper); cursor: pointer; font-weight: 800; }
.p-prods { list-style: none; padding: 0; margin: 10px 0 14px; }
.p-prod { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); scroll-margin-top: 80px; }
.p-prod img { width: 52px; height: 52px; object-fit: cover; border-radius: 10px; flex: none; }
.p-prod-info { flex: 1; min-width: 0; text-decoration: none; display: grid; gap: 2px; }
.p-prod-info strong { font-size: 16px; overflow-wrap: anywhere; }
.p-prod-info > span:not(.algs) { color: var(--mute); font-size: 14px; font-variant-numeric: tabular-nums; }
.p-prod-info .algs { margin-top: 2px; }
.p-prod-info .alg b { width: 20px; height: 20px; font-size: 9px; }
.p-prod.is-agotado .p-prod-info strong { text-decoration: line-through; color: var(--mute); }
.p-toggle-f { flex: none; }
.p-toggle { min-width: 104px; min-height: 40px; padding: 0 12px; border-radius: 999px; border: 0; cursor: pointer; font-weight: 800; font-size: 13px; background: #E7F6EE; color: var(--ok); }
.p-toggle.on { background: #FDECEA; color: var(--err); }
.p-btn-add { width: 100%; border-style: dashed; }
.p-cat-opts { margin-top: 12px; }
.p-cat-opts summary { cursor: pointer; color: var(--mute); font-weight: 700; font-size: 14px; padding: 6px 0; }
.p-cat-opts form { margin-top: 10px; }

.p-enlaces { display: grid; gap: 14px; }
.p-enlaces > div { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.p-enlaces span { width: 100%; font-weight: 700; font-size: 14px; }
.p-enlaces code { flex: 1 1 220px; padding: 10px 12px; border-radius: 10px; background: var(--ivory); font-size: 14px; overflow-wrap: anywhere; }
.p-locales { list-style: none; padding: 0; display: grid; gap: 10px; }
.p-local { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.p-local > a:first-child { flex: 1; min-width: 0; text-decoration: none; display: grid; }
.p-local span { color: var(--mute); font-size: 14px; overflow-wrap: anywhere; }
.p-local em { color: var(--err); font-style: normal; font-weight: 700; }
.p-peligro summary { cursor: pointer; color: var(--err); font-weight: 700; }
.p-peligro form { margin-top: 12px; }

@media (max-width: 480px) {
  .p-prod { flex-wrap: wrap; }
  .p-prod-info { flex-basis: calc(100% - 64px); }
  .p-prod img + .p-prod-info { flex-basis: calc(100% - 64px); }
  .p-toggle-f { margin-left: auto; }
  .p-mini-v { flex-direction: row; }
}

.pub-previa { background: #FFF4D6; color: #7A4B00; text-align: center; font-size: 14px; font-weight: 600; padding: 10px 16px; }
.p-aviso { background: #FFF4D6; color: #7A4B00; }
.p-nota-cat { color: var(--mute); font-size: 13px; }
