/* Estilo común de las cartas (mesa.html y pedir.html): grilla de productos, ficha, hojas y barra inferior.
   Línea "bistró": crema cálido, café espresso, verde bosque y dorado; títulos con serif. */
:root {
  --bg: #f7f2ea; --panel: #fffdf9; --ink: #1f1a16; --muted: #7a6f64; --line: #e8dfd3; --soft: #f1e9dd;
  --brand: #1f3d33; --brand-ink: #f7f2ea; --brand-soft: #e6ede7; --accent: #b8863b; --accent-ink: #ffffff;
  --warn: #a15c07; --warn-bg: #fdf0d5; --ok: #2f6b3a; --ok-bg: #e2f1e2; --danger: #a8322a; --danger-bg: #fbe4e1;
  --serif: "Playfair Display", "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --sombra: 0 1px 2px rgba(31, 26, 22, .05), 0 10px 28px rgba(31, 26, 22, .07);
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #12100e; --panel: #1c1916; --ink: #f1e9dd; --muted: #a89c8f; --line: #2e2924; --soft: #26221e;
    --brand: #c9a35f; --brand-ink: #1c1916; --brand-soft: #2a241b; --accent: #d4ad6a; --accent-ink: #1c1916;
    --warn: #f0c36a; --warn-bg: #3a2c12; --ok: #9fd3a3; --ok-bg: #1b2e1d; --danger: #f2a39b; --danger-bg: #3a1714;
    --sombra: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 28px rgba(0, 0, 0, .35); }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0 auto; max-width: 560px; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
button { font: inherit; cursor: pointer; color: inherit; }
input, select, textarea { font: inherit; font-size: 16px; width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px; background: var(--panel); color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
textarea { resize: none; }
label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 5px; letter-spacing: .02em; }
svg.i { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* encabezado */
.top { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--panel) 92%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.marca { display: grid; grid-template-columns: 40px 1fr 40px; align-items: center; padding: calc(10px + env(safe-area-inset-top)) 12px 8px; }
.marca .t { text-align: center; min-width: 0; }
.marca .n { font-family: var(--serif); font-weight: 700; font-size: 20px; line-height: 1.15; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.marca .logo { display: block; height: 40px; max-width: 170px; margin: 0 auto 2px; object-fit: contain; }
/* En modo oscuro, el logo va sobre una placa clara para que no se pierda si tiene letras oscuras. */
@media (prefers-color-scheme: dark) { .marca .logo { background: #fff; border-radius: 8px; padding: 3px 8px; box-sizing: content-box; height: 34px; } }
.marca .s { font-size: 10.5px; color: var(--accent); letter-spacing: .22em; text-transform: uppercase; font-weight: 600; }
.marca .ib { background: none; border: 0; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; }
.buscar { padding: 0 16px 10px; }
.buscar input { border-radius: 99px; padding: 10px 18px; }
.cats { display: flex; gap: 6px; overflow-x: auto; padding: 2px 16px 12px; scrollbar-width: none; }
.cats::-webkit-scrollbar { display: none; }
.cat { white-space: nowrap; font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; padding: 8px 15px; border-radius: 99px; border: 1px solid var(--line); background: transparent; color: var(--muted); transition: all .15s; }
.cat:hover { color: var(--ink); border-color: var(--muted); }
.cat.on { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }

/* carta en grilla */
.aviso { margin: 14px 16px 0; padding: 12px 15px; border-radius: 16px; background: var(--brand-soft); font-size: 14px; }
main { padding: 4px 16px 130px; }
.sec { scroll-margin-top: calc(var(--alto-top, 150px) + 12px); } /* --alto-top: alto real de la barra de arriba (tienda.js) */
.sec h2 { font-family: var(--serif); font-size: 26px; font-weight: 700; margin: 30px 0 14px; display: flex; align-items: center; gap: 14px; }
.sec h2::after { content: ""; flex: 1; height: 1px; background: linear-gradient(to right, var(--accent), transparent); opacity: .6; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.card { background: var(--panel); border-radius: 18px; overflow: hidden; cursor: pointer; display: flex; flex-direction: column; box-shadow: var(--sombra); transition: transform .2s ease, box-shadow .2s ease; }
.card .img { position: relative; aspect-ratio: 1 / 1; background: var(--soft); display: flex; align-items: center; justify-content: center; font-size: 52px; overflow: hidden; }
.card .img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s ease; }
.card .nm { font-family: var(--serif); font-size: 16.5px; font-weight: 600; line-height: 1.25; padding: 12px 12px 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .ds { display: none; font-size: 13px; color: var(--muted); line-height: 1.4; padding: 2px 12px 0; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .pr { font-family: var(--serif); font-size: 16px; font-weight: 700; color: var(--accent); padding: 4px 12px 13px; display: flex; gap: 6px; align-items: center; margin-top: auto; }
@media (hover: hover) { .card:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(31,26,22,.06), 0 18px 40px rgba(31,26,22,.12); } .card:hover .img img { transform: scale(1.05); } }
.ctl { position: absolute; right: 10px; bottom: 10px; font-size: 16px; }
.mas { width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--panel); color: var(--brand); font-size: 24px; line-height: 1; font-weight: 500; box-shadow: 0 4px 14px rgba(0,0,0,.18); transition: transform .15s; }
.mas:hover { transform: scale(1.08); }
.step { display: flex; align-items: center; background: var(--brand); color: var(--brand-ink); border-radius: 99px; box-shadow: 0 4px 14px rgba(0,0,0,.18); }
.step button { background: none; border: 0; color: inherit; width: 32px; height: 32px; font-size: 18px; font-weight: 600; }
.step span { min-width: 16px; text-align: center; font-weight: 700; }
.cuantos { display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 7px; margin-right: 6px; border-radius: 99px; background: var(--brand); color: var(--brand-ink); font-size: 13px; font-weight: 700; vertical-align: middle; box-shadow: 0 4px 14px rgba(0,0,0,.18); }
.ctl { display: flex; align-items: center; }
.agotado { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; padding: 5px 11px; border-radius: 99px; background: var(--ink); color: var(--panel); }
.card.sin .img { filter: grayscale(.9); }
.card.sin .nm, .card.sin .pr { opacity: .6; }
.sinres { color: var(--muted); text-align: center; padding: 40px 0; }

/* barra inferior con carrito al centro */
.nav { position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; width: min(560px, 100%); z-index: 7; background: color-mix(in srgb, var(--panel) 94%, transparent); backdrop-filter: blur(10px); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(5, 1fr); align-items: end; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
.nav > button { background: none; border: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--muted); padding: 4px 0; position: relative; }
.nav > button.destacado { color: var(--brand); font-weight: 650; }
.nav .carrito .bola { width: 56px; height: 56px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; margin-top: -32px; box-shadow: 0 6px 16px rgba(0,0,0,.22); border: 4px solid var(--panel); }
.nav .carrito .bola svg { width: 26px; height: 26px; }
.nav .carrito .badge { position: absolute; top: -34px; left: calc(50% + 12px); background: var(--panel); color: var(--accent); border: 2px solid var(--accent); border-radius: 99px; min-width: 22px; height: 22px; font-size: 12px; font-weight: 700; display: grid; place-items: center; padding: 0 5px; }
.nav .carrito .tot { font-size: 13px; font-weight: 700; color: var(--ink); }
.flota { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(86px + env(safe-area-inset-bottom)); z-index: 6; border: 0; font-size: 13.5px; font-weight: 650; padding: 7px 15px; border-radius: 99px; background: var(--warn-bg); color: var(--warn); box-shadow: 0 4px 14px rgba(0,0,0,.14); white-space: nowrap; }
.flota.ok { background: var(--ok-bg); color: var(--ok); }

/* hojas deslizables */
.velo { position: fixed; inset: 0; background: rgba(20,16,12,.45); z-index: 9; display: none; }
.velo.on { display: block; }
.hoja { position: fixed; left: 50%; bottom: 0; transform: translate(-50%, 105%); transition: transform .25s ease; width: min(560px, 100%); max-height: 92vh; background: var(--panel); border-radius: 22px 22px 0 0; z-index: 10; display: flex; flex-direction: column; box-shadow: 0 -6px 30px rgba(0,0,0,.18); }
.hoja.on { transform: translate(-50%, 0); }
.hoja .cab { display: flex; align-items: center; gap: 10px; padding: 16px 18px 12px; border-bottom: 1px solid var(--line); }
.hoja .cab h3 { margin: 0; font-family: var(--serif); font-size: 21px; font-weight: 700; flex: 1; }
.cerrar { background: var(--soft); border: 0; border-radius: 99px; width: 34px; height: 34px; font-size: 16px; flex: 0 0 34px; }
.cuerpo { overflow-y: auto; padding: 12px 18px calc(18px + env(safe-area-inset-bottom)); }
.linea { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.linea .nm { flex: 1; min-width: 0; }
.linea .st { font-weight: 650; white-space: nowrap; }
.linea .step { box-shadow: none; }
.linea .step button { width: 30px; height: 28px; }
.btn { width: 100%; border: 0; border-radius: 99px; padding: 15px; font-weight: 600; letter-spacing: .02em; background: var(--brand); color: var(--brand-ink); margin-top: 14px; transition: filter .15s; }
.btn:hover:not(:disabled) { filter: brightness(1.12); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.conf { background: var(--warn); color: #fff; }
.btn2 { flex: 1; border: 1px solid var(--line); border-radius: 99px; padding: 12px; background: var(--panel); font-weight: 600; }
.fila { display: flex; gap: 8px; margin-top: 12px; }
.nota { font-size: 13.5px; color: var(--muted); margin-top: 8px; }
.vacio { color: var(--muted); text-align: center; padding: 18px 0; }

/* ficha del producto */
.det-img { aspect-ratio: 4 / 3; background: var(--soft); border-radius: 16px; overflow: hidden; display: flex; align-items: center; justify-content: center; font-size: 90px; border: 0; padding: 0; width: 100%; }
.det-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.det-pr { font-family: var(--serif); font-size: 24px; font-weight: 700; color: var(--accent); margin: 14px 0 4px; }
.det-desc { color: var(--muted); }
.det-tags { font-size: 13.5px; margin-top: 8px; color: var(--muted); }
.veg { color: var(--ok); font-weight: 600; }
.det-ctl { display: flex; align-items: center; gap: 12px; margin-top: 16px; }
.det-ctl .step { box-shadow: none; }
.det-ctl .step button { width: 40px; height: 40px; }

.zoom { position: fixed; inset: 0; background: rgba(0,0,0,.9); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 20; }
.zoom img { max-width: 100%; max-height: 85vh; border-radius: 12px; }
.toast { position: fixed; left: 50%; top: 90px; transform: translateX(-50%); background: var(--ink); color: var(--panel); padding: 10px 18px; border-radius: 99px; font-size: 14.5px; z-index: 30; opacity: 0; transition: opacity .2s; pointer-events: none; max-width: 90%; text-align: center; box-shadow: 0 6px 20px rgba(0,0,0,.2); }
.toast.on { opacity: 1; }

/* Firma de la plataforma al pie de la carta */
.firma-plat { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; text-decoration: none; color: inherit; opacity: .75; padding: 6px 12px 6px 6px; border-radius: 999px; border: 1px solid currentColor; border-color: rgba(127,127,127,.3); transition: opacity .15s; }
.firma-plat:hover { opacity: 1; }
.firma-plat img { width: 26px; height: 26px; flex: none; object-fit: contain; }
.firma-plat b { font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif; font-weight: 800; letter-spacing: -.02em; }
.firma-plat em { font-style: normal; color: #6015ca; }
.firma-mesa { text-align: center; padding: 18px 16px 6px; }

/* Selector de idioma (ES · EN · PT) de la carta y la mesa */
.idioma-sel { font: 600 12px system-ui, sans-serif; padding: 4px 2px; min-width: 46px; border-radius: 999px; border: 1px solid rgba(127,127,127,.35); background: transparent; color: inherit; cursor: pointer; }
#idiomaSel { display: flex; align-items: center; flex: none; }
/* En el celular va en la primera columna del encabezado; en el computador, a la izquierda del nombre */
@media (min-width: 960px) { .web .marca { position: relative; } .web .idioma-pos { position: absolute; left: 40px; top: 50%; transform: translateY(-50%); } }
