/* ==========================================================================
   Sitio público — template-restaurante-menu
   Dos tarjetas: información (33%) + menú (66%). En móvil, la tarjeta de
   información es un panel lateral y las categorías una hoja inferior.
   Colores: --accent y --bg vienen de Admin › Datos del lugar › Apariencia.
   Íconos: helper fi() = Font Awesome Pro+ «Sharp Duotone Solid».
   ========================================================================== */
:root {
    --accent: #c2410c;
    --bg: #f5efe6;
    --ink: #221c17;
    --muted: #7a6f66;
    --card: #fffdf9;
    --line: color-mix(in srgb, var(--ink) 11%, transparent);
    --accent-soft: color-mix(in srgb, var(--accent) 12%, var(--card));
    --accent-ink: color-mix(in srgb, var(--accent) 75%, var(--ink));
    --font-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-heading: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
    --radius: 18px;
    --shadow: 0 1px 2px rgba(34, 28, 23, .05), 0 12px 32px -12px rgba(34, 28, 23, .18);
    --gap: clamp(1rem, 2vw, 1.75rem);
    --fa-primary-color: var(--accent);
    --fa-secondary-color: var(--accent);
    --fa-secondary-opacity: .35;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font-body); color: var(--ink); background: var(--bg); line-height: 1.55; min-height: 100vh; }
body.has-bg-image { background: var(--bg) var(--bg-image) center / cover fixed; }
body.lock { overflow: hidden; }
img, video { max-width: 100%; display: block; }
a { color: var(--accent-ink); }
button { font: inherit; color: inherit; }
.muted { color: var(--muted); }
.center { text-align: center; }
[hidden] { display: none !important; }

/* ---------- Layout ---------- */
.page {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: var(--gap);
    max-width: 1320px; margin: 0 auto; padding: var(--gap); align-items: start;
}
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--line); }
.info-panel { position: sticky; top: var(--gap); max-height: calc(100vh - 2 * var(--gap)); overflow-y: auto; border-radius: var(--radius); scrollbar-width: thin; }
.info-card { padding: clamp(1.25rem, 2.4vw, 2rem); display: flex; flex-direction: column; gap: 1.15rem; position: relative; }
.panel-close { display: none; }
.site-foot { text-align: center; color: var(--muted); font-size: .85rem; padding: 1.25rem 0 .25rem; }

/* ---------- Botones ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; padding: .7rem 1.15rem; border-radius: 999px; border: 1px solid transparent; font-weight: 650; text-decoration: none; cursor: pointer; line-height: 1.15; transition: transform .12s, background .15s; }
.btn:active { transform: scale(.98); }
.btn-accent { background: var(--accent); color: #fff; --fa-primary-color: #fff; --fa-secondary-color: #fff; }
.btn-accent:hover { background: var(--accent-ink); }
.btn-soft { background: var(--accent-soft); color: var(--accent-ink); font-size: .9rem; padding: .5rem .9rem; }
.btn-block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: .5rem; }

/* ---------- Bloques de la tarjeta de información ---------- */
.ib { margin: 0; }
.ib-label { margin: 0 0 .5rem; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; }
.ib-logo { display: flex; justify-content: center; }
.ib-logo img { object-fit: contain; }
.ib-logo.size-s img { max-height: 64px; max-width: 160px; }
.ib-logo.size-m img { max-height: 104px; max-width: 220px; }
.ib-logo.size-l img { max-height: 150px; max-width: 100%; }
.ib-logo.round img { width: 120px; height: 120px; max-height: none; border-radius: 50%; object-fit: cover; }
.ib-logo.round.size-s img { width: 80px; height: 80px; }
.ib-logo.round.size-l img { width: 160px; height: 160px; }
.story-ring { padding: 4px; border: 0; border-radius: 22px; cursor: pointer; background: conic-gradient(from 210deg, var(--accent), #f59e0b, #ec4899, var(--accent)); }
.round .story-ring { border-radius: 50%; }
.story-ring img { background: var(--card); border: 3px solid var(--card); border-radius: 18px; }
.round .story-ring img { border-radius: 50%; }
.story-ring.seen { background: var(--line); }
.ib-photo { border-radius: calc(var(--radius) - 6px); overflow: hidden; }
.ib-photo button, .ib-image button, .m-image button { display: block; width: 100%; height: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.ib-photo img { width: 100%; height: 100%; object-fit: cover; }
.ib-title.align-center { text-align: center; }
.place-name { font-family: var(--font-heading); font-size: clamp(1.6rem, 2.6vw, 2.1rem); font-weight: 700; line-height: 1.1; margin: 0; letter-spacing: -.01em; }
.place-tagline { margin: .3rem 0 0; color: var(--accent-ink); font-style: italic; font-family: var(--font-heading); font-size: 1.05rem; }
.ib-desc { color: color-mix(in srgb, var(--ink) 82%, transparent); }
.ib-row { display: flex; gap: .55rem; margin: 0 0 .65rem; }
.ib-row i { margin-top: .2rem; }
.ib-map { width: 100%; height: 190px; border: 0; border-radius: 12px; margin-bottom: .65rem; }
.ib-contact.style-icons { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; }
.ib-contact.style-icons a { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); font-size: 1.2rem; text-decoration: none; transition: transform .15s, background .15s; }
.ib-contact.style-icons a:hover { transform: translateY(-2px); background: color-mix(in srgb, var(--accent) 22%, var(--card)); }
.ib-contact.style-list { display: flex; flex-direction: column; gap: .35rem; }
.ib-contact.style-list a { display: flex; gap: .65rem; align-items: center; text-decoration: none; color: var(--ink); padding: .4rem .5rem; border-radius: 10px; }
.ib-contact.style-list a:hover { background: var(--accent-soft); }
.ib-contact.style-list small { display: block; color: var(--muted); font-size: .75rem; }
.ib-contact .fa-whatsapp { color: #128c4a; }
.ib-hours dl { display: grid; grid-template-columns: auto 1fr; gap: .2rem 1rem; margin: 0; font-size: .95rem; }
.ib-hours dt { color: var(--muted); }
.ib-hours dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.open-badge { margin-left: auto; text-transform: none; letter-spacing: 0; font-size: .75rem; padding: .1rem .55rem; border-radius: 999px; }
.open-badge.is-open { background: #dcfce7; color: #166534; }
.open-badge.is-closed { background: #fee2e2; color: #991b1b; }
.ib-image img { width: 100%; border-radius: 12px; }
.ib-image figcaption, .m-image figcaption { font-size: .85rem; color: var(--muted); margin-top: .35rem; text-align: center; }
.ib-divider { border: 0; border-top: 1px dashed var(--line); width: 100%; }
.ib-html iframe { max-width: 100%; }

/* Historias (fila de burbujas) */
.stories-row { display: flex; gap: .6rem; overflow-x: auto; padding: 3px 2px 6px; scrollbar-width: none; }
.stories-row::-webkit-scrollbar { display: none; }
.story-bubble { position: relative; flex: 0 0 64px; height: 64px; padding: 3px; border-radius: 50%; border: 0; cursor: pointer; background: conic-gradient(from 210deg, var(--accent), #f59e0b, #ec4899, var(--accent)); }
.story-bubble.seen { background: var(--line); }
.story-bubble img, .story-bubble video { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 2px solid var(--card); background: #000; }
.story-kind { position: absolute; right: 2px; bottom: 2px; font-size: .7rem; background: var(--card); border-radius: 50%; width: 20px; height: 20px; display: grid; place-items: center; }

/* ---------- Menú ---------- */
.menu-card { padding: clamp(1rem, 2.4vw, 2rem); }
.menu-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.menu-title { font-family: var(--font-heading); font-size: clamp(1.7rem, 3vw, 2.3rem); margin: 0; display: flex; align-items: center; gap: .6rem; }
.menu-search { flex: 1 1 260px; max-width: 380px; display: flex; align-items: center; gap: .5rem; padding: .15rem .45rem .15rem .9rem; border: 1px solid var(--line); border-radius: 999px; background: #fff; transition: box-shadow .15s, border-color .15s; }
.menu-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.menu-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; padding: .55rem 0; }
.menu-search input::-webkit-search-cancel-button { display: none; }
.menu-search button { border: 0; background: var(--accent-soft); border-radius: 50%; width: 30px; height: 30px; cursor: pointer; }
.search-empty { text-align: center; color: var(--muted); padding: 1.5rem 0; }
.menu-tabs { display: flex; flex-direction: column; gap: .6rem; }

.cat { border: 1px solid var(--line); border-radius: 14px; background: #fff; scroll-margin-top: 1rem; overflow: hidden; }
.cat.open { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.cat-h { margin: 0; font-size: 1rem; }
.cat-toggle { width: 100%; display: flex; align-items: center; gap: .85rem; padding: 1rem 1.15rem; border: 0; background: none; cursor: pointer; text-align: left; }
.cat-toggle:hover { background: color-mix(in srgb, var(--accent) 5%, #fff); }
.cat.open .cat-toggle { background: var(--accent-soft); }
.cat-icon { font-size: 1.35rem; width: 1.6rem; text-align: center; }
.cat-titles { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cat-title { font-family: var(--font-heading); font-size: 1.3rem; font-weight: 700; line-height: 1.2; }
.cat-sub { color: var(--muted); font-size: .88rem; font-weight: 400; }
.cat-count { background: var(--accent); color: #fff; font-size: .75rem; font-weight: 700; border-radius: 999px; padding: .1rem .55rem; }
.cat-chev { transition: transform .25s; }
.cat.open .cat-chev { transform: rotate(180deg); }
.cat-body { display: grid; grid-template-rows: 1fr; transition: grid-template-rows .3s ease; }
.js .cat:not(.open) .cat-body { grid-template-rows: 0fr; }
.cat-body > .cat-inner { min-height: 0; overflow: hidden; padding: .35rem 1.15rem 1.15rem; }
.js .cat:not(.open) .cat-inner { padding-top: 0; padding-bottom: 0; }
.cat-body > .cat-inner { transition: padding .3s ease; }
.cat-desc { color: color-mix(in srgb, var(--ink) 75%, transparent); font-style: italic; padding: .75rem 0; border-bottom: 1px dashed var(--line); margin-bottom: .25rem; }
.cat-items + .cat-desc { border-bottom: 0; border-top: 1px dashed var(--line); margin: .5rem 0 0; }
.cat-items { display: flex; flex-wrap: wrap; column-gap: 1.5rem; }
.cat-items > * { flex: 1 1 100%; }

.dish { display: flex; gap: 1rem; padding: .95rem 0; border-bottom: 1px solid var(--line); }
.cat-items > .dish:last-child { border-bottom: 0; }
.dish-img { flex: 0 0 92px; height: 92px; border-radius: 12px; overflow: hidden; padding: 0; border: 0; cursor: zoom-in; background: var(--bg); }
.dish-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.dish-img:hover img { transform: scale(1.06); }
.dish-body { flex: 1; min-width: 0; }
.dish-top { display: flex; align-items: baseline; gap: .75rem; }
.dish-name { font-size: 1.05rem; margin: 0; font-weight: 700; flex: 1; }
.dish-top::after { content: ""; }
.dish-price { font-weight: 800; color: var(--accent-ink); white-space: nowrap; font-variant-numeric: tabular-nums; }
.dish-price small { font-weight: 500; color: var(--muted); }
.dish-desc { margin: .2rem 0 0; color: var(--muted); font-size: .94rem; }
.dish-variants { list-style: none; margin: .45rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: .35rem; }
.dish-variants li { display: inline-flex; gap: .45rem; padding: .2rem .65rem; border-radius: 999px; background: var(--accent-soft); font-size: .88rem; }
.dish-variants b { color: var(--accent-ink); }
.dish-tags { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .45rem; }
.tag { font-size: .75rem; font-weight: 600; padding: .1rem .5rem; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.tag-picante { --fa-primary-color: #dc2626; --fa-secondary-color: #dc2626; }
.tag-vegano, .tag-vegetariano { --fa-primary-color: #15803d; --fa-secondary-color: #15803d; }
.m-text { padding: .9rem 0; color: color-mix(in srgb, var(--ink) 80%, transparent); }
.m-image { margin: .9rem 0; }
.m-image.half { flex: 1 1 calc(50% - .75rem); }
.m-image img { width: 100%; border-radius: 12px; }
.m-html { padding: .75rem 0; }
.m-html iframe { max-width: 100%; }
mark { background: color-mix(in srgb, var(--accent) 25%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
.is-filtered { display: none !important; }

/* ---------- Botones flotantes y paneles (móvil) ---------- */
.fbtns { display: none; }
.cats-panel { display: none; }
.backdrop { position: fixed; inset: 0; background: rgba(20, 16, 12, .45); z-index: 40; backdrop-filter: blur(2px); }

@media (max-width: 900px) {
    .page { grid-template-columns: 1fr; padding: .75rem .75rem 6rem; }
    .info-panel {
        position: fixed; top: 0; left: 0; bottom: 0; width: min(88vw, 400px); max-height: none; z-index: 50;
        border-radius: 0 var(--radius) var(--radius) 0; background: var(--card); transform: translateX(-105%); transition: transform .3s cubic-bezier(.2, .8, .2, 1);
    }
    .info-panel .info-card { min-height: 100%; border-radius: 0 var(--radius) var(--radius) 0; padding-top: 3.25rem; }
    .info-panel.open { transform: none; }
    .panel-close { display: grid; place-items: center; position: absolute; top: .75rem; right: .75rem; width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--accent-soft); cursor: pointer; z-index: 2; }

    .fbtns { display: block; }
    .fbtn {
        position: fixed; bottom: calc(1rem + env(safe-area-inset-bottom)); z-index: 30; height: 56px; min-width: 56px; border-radius: 999px; border: 0; cursor: pointer;
        display: inline-flex; align-items: center; justify-content: center; gap: .5rem; box-shadow: 0 10px 28px -8px rgba(0, 0, 0, .45); font-weight: 700;
    }
    .fbtn-left { left: 1rem; width: 56px; padding: 0; background: var(--card); overflow: hidden; border: 2px solid var(--card); }
    .fbtn-left img { width: 100%; height: 100%; object-fit: cover; }
    .fbtn-left i { font-size: 1.4rem; }
    .fbtn-right { right: 1rem; padding: 0 1.2rem; background: var(--accent); color: #fff; --fa-primary-color: #fff; --fa-secondary-color: #fff; }

    .cats-panel { display: block; position: fixed; inset: auto 0 0 0; z-index: 50; transform: translateY(105%); transition: transform .3s cubic-bezier(.2, .8, .2, 1); }
    .cats-panel.open { transform: none; }
    .cats-sheet { background: var(--card); border-radius: var(--radius) var(--radius) 0 0; max-height: 75vh; overflow-y: auto; padding: .5rem 0 calc(1rem + env(safe-area-inset-bottom)); box-shadow: 0 -10px 40px rgba(0, 0, 0, .25); }
    .cats-head { display: flex; align-items: center; justify-content: space-between; padding: .5rem 1rem .75rem; position: sticky; top: 0; background: var(--card); }
    .cats-head strong { font-family: var(--font-heading); font-size: 1.3rem; }
    .cats-head .panel-close { position: static; }
    .cats-panel ul { list-style: none; margin: 0; padding: 0 .5rem; }
    .cats-panel a { display: flex; align-items: center; gap: .85rem; padding: .8rem .75rem; border-radius: 12px; text-decoration: none; color: var(--ink); font-weight: 650; }
    .cats-panel a:active, .cats-panel a:hover { background: var(--accent-soft); }
    .cats-panel a i { font-size: 1.2rem; }
    .cats-panel a span { flex: 1; display: flex; flex-direction: column; }
    .cats-panel a small { font-weight: 400; color: var(--muted); font-size: .82rem; }
    .cats-panel a em { font-style: normal; color: var(--muted); font-size: .85rem; }

    .menu-search { max-width: none; }
    .cat-title { font-size: 1.15rem; }
    .dish-img { flex-basis: 76px; height: 76px; }
    .m-image.half { flex-basis: 100%; }
}

/* ---------- Reservación (dialog) ---------- */
.res-modal { width: min(560px, calc(100vw - 1.5rem)); max-height: calc(100dvh - 1.5rem); border: 0; border-radius: var(--radius); padding: clamp(1.25rem, 3vw, 2rem); background: var(--card); color: var(--ink); box-shadow: 0 30px 80px rgba(0, 0, 0, .35); }
.res-modal::backdrop { background: rgba(20, 16, 12, .55); backdrop-filter: blur(3px); }
.res-modal h2 { font-family: var(--font-heading); margin: 0 2.5rem .5rem 0; font-size: 1.6rem; display: flex; gap: .55rem; align-items: center; }
.res-close { position: absolute; top: .9rem; right: .9rem; }
.res-close button { width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--accent-soft); cursor: pointer; }
.res-form { display: flex; flex-direction: column; gap: .9rem; margin-top: 1rem; }
.f-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.f { display: flex; flex-direction: column; gap: .3rem; font-size: .9rem; font-weight: 600; }
.f em { font-weight: 400; color: var(--muted); font-style: normal; }
.f input, .f textarea { font: inherit; font-weight: 400; padding: .65rem .8rem; border: 1px solid var(--line); border-radius: 12px; background: #fff; width: 100%; }
.f input:focus, .f textarea:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.f.err input, .f.err textarea { border-color: #dc2626; }
.f small, .f-radios small { color: #dc2626; font-weight: 500; }
.f-radios { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .4rem 1rem; font-size: .92rem; }
.f-radios legend { font-weight: 600; font-size: .9rem; margin-bottom: .35rem; width: 100%; }
.f-radios label { display: inline-flex; gap: .35rem; align-items: center; cursor: pointer; }
.f-radios input { accent-color: var(--accent); }
.hp { position: absolute; left: -9999px; }
.res-done { text-align: center; padding: 1rem 0; }
.res-done h2 { justify-content: center; margin-right: 0; }
.res-done-icon { font-size: 3.2rem; margin-bottom: .75rem; }
@media (max-width: 520px) { .f-grid { grid-template-columns: 1fr; } }

/* ---------- Visor de historias ---------- */
.story-viewer { position: fixed; inset: 0; z-index: 90; background: rgba(10, 8, 6, .94); display: flex; align-items: center; justify-content: center; }
.sv-frame { position: relative; width: min(100vw, calc(100dvh * 9 / 16)); height: min(100dvh, calc(100vw * 16 / 9)); background: #000; overflow: hidden; border-radius: 14px; user-select: none; -webkit-user-select: none; touch-action: pan-y; }
.sv-media { position: absolute; inset: 0; display: grid; place-items: center; }
.sv-media img, .sv-media video { width: 100%; height: 100%; object-fit: contain; }
.sv-bars { position: absolute; top: .6rem; left: .6rem; right: .6rem; display: flex; gap: 4px; z-index: 3; }
.sv-bar { flex: 1; height: 3px; border-radius: 3px; background: rgba(255, 255, 255, .35); overflow: hidden; }
.sv-bar i { display: block; height: 100%; width: 0; background: #fff; }
.sv-bar.done i { width: 100%; }
.sv-top { position: absolute; top: 1.2rem; left: .75rem; right: .5rem; display: flex; align-items: center; gap: .5rem; z-index: 3; color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .6); }
.sv-top strong { flex: 1; font-size: .95rem; }
.sv-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; background: #fff; }
.sv-btn { width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; color: #fff; cursor: pointer; font-size: 1.15rem; --fa-primary-color: #fff; --fa-secondary-color: #fff; }
.sv-nav { position: absolute; top: 15%; bottom: 20%; width: 35%; border: 0; background: transparent; cursor: pointer; z-index: 2; color: #fff; font-size: 1.6rem; opacity: 0; transition: opacity .2s; --fa-primary-color: #fff; --fa-secondary-color: #fff; }
.sv-prev { left: 0; text-align: left; padding-left: .5rem; }
.sv-next { right: 0; text-align: right; padding-right: .5rem; }
.story-viewer.manual .sv-nav, .sv-frame:hover .sv-nav { opacity: .85; }
.sv-caption { position: absolute; left: 0; right: 0; bottom: 0; padding: 3rem 1rem 1.5rem; z-index: 3; color: #fff; text-align: center; background: linear-gradient(transparent, rgba(0, 0, 0, .7)); display: flex; flex-direction: column; align-items: center; gap: .75rem; }
.sv-caption:empty { display: none; }
.sv-caption .btn { background: #fff; color: #111; }
@media (min-width: 901px) { .sv-frame { height: min(92dvh, calc(100vw * 16 / 9)); width: min(100vw, calc(92dvh * 9 / 16)); } }

/* ---------- Visor de fotos ---------- */
.zoom { position: fixed; inset: 0; z-index: 95; background: rgba(10, 8, 6, .9); display: grid; place-items: center; padding: 1rem; cursor: zoom-out; }
.zoom img { max-width: 100%; max-height: 92dvh; border-radius: 12px; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .cat-body, .info-panel, .cats-panel, .cat-chev { transition: none; }
}
