/*
 * Carta pública. Pensada primero para móvil.
 * Los colores de marca están en :root: al personalizar para el cliente se cambian ahí y nada más.
 * Tema claro fijo a propósito: la carta tiene que verse igual que el local, no según el móvil.
 */
:root {
    --bg: #fbf7f2;
    --surface: #ffffff;
    --text: #2b1d16;
    --muted: #75655b;
    --line: #ebe1d7;
    --brand: #8a3b2e;
    --brand-ink: #ffffff;
    --brand-soft: #f4e6e1;
    --sold-out: #a99c93;

    --font-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-display: Georgia, "Times New Roman", serif;

    --radius: 12px;
    --gutter: 16px;
    --max: 680px;
    --nav-height: 52px;

    color-scheme: light;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 16px/1.45 var(--font-body);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ul {
    margin: 0;
}

ul {
    padding: 0;
    list-style: none;
}

a {
    color: var(--brand);
}

:focus-visible {
    outline: 3px solid var(--brand);
    outline-offset: 2px;
}

/* ---------- Cabecera ---------- */

.menu-header {
    max-width: var(--max);
    margin: 0 auto;
    padding: calc(20px + env(safe-area-inset-top)) var(--gutter) 12px;
}

.menu-header__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.venue-name {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.01em;
}

.lang-switch {
    display: flex;
    flex-shrink: 0;
    border: 1px solid var(--line);
    border-radius: 999px;
    overflow: hidden;
    background: var(--surface);
}

.lang-switch a {
    min-width: 44px;
    padding: 8px 10px;
    text-align: center;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--muted);
    text-decoration: none;
}

.lang-switch a[aria-current] {
    background: var(--brand);
    color: var(--brand-ink);
}

.context-chip {
    display: inline-block;
    margin-top: 10px;
    padding: 4px 12px;
    border-radius: 999px;
    background: var(--brand-soft);
    color: var(--brand);
    font-size: 0.875rem;
    font-weight: 600;
}

/* ---------- Barra de categorías (fija al hacer scroll) ---------- */

.category-nav {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgb(251 247 242 / 0.94);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
}

.category-nav ul {
    display: flex;
    gap: 8px;
    max-width: var(--max);
    height: var(--nav-height);
    margin: 0 auto;
    padding: 0 var(--gutter);
    align-items: center;
    overflow-x: auto;
    scrollbar-width: none;
}

.category-nav ul::-webkit-scrollbar {
    display: none;
}

.category-nav a {
    display: block;
    padding: 7px 14px;
    border-radius: 999px;
    color: var(--text);
    font-size: 0.9375rem;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
}

.category-nav a.is-active {
    background: var(--text);
    color: var(--bg);
}

/* ---------- Carta ---------- */

.menu {
    max-width: var(--max);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

.menu-section {
    padding-top: 24px;
    scroll-margin-top: var(--nav-height);
}

.menu-section h2 {
    margin-bottom: 4px;
    font-family: var(--font-display);
    font-size: 1.375rem;
    font-weight: 700;
}

.product {
    display: flex;
    gap: 14px;
    padding: 16px 0;
    border-bottom: 1px solid var(--line);
}

.product-list .product:last-child {
    border-bottom: 0;
}

.product__body {
    flex: 1;
    min-width: 0;
}

.product__name {
    font-size: 1.0625rem;
    font-weight: 600;
    line-height: 1.3;
}

.product__description {
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.9375rem;
}

.product__price {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.price {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.product__image {
    flex-shrink: 0;
    width: 96px;
    height: 96px;
    border-radius: var(--radius);
    object-fit: cover;
    background: var(--line);
}

/* Agotado: se ve (el cliente sabe que existe) pero apagado */
.product--sold-out .product__name,
.product--sold-out .product__description,
.product--sold-out .price {
    color: var(--sold-out);
}

.product--sold-out .product__image {
    filter: grayscale(1);
    opacity: 0.6;
}

.sold-out-label {
    padding: 2px 8px;
    border-radius: 6px;
    background: var(--line);
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ---------- Alérgenos ---------- */

.allergens {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 8px;
}

.allergen {
    padding: 1px 8px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--muted);
    font-size: 0.75rem;
    line-height: 1.6;
}

/* ---------- Pie y páginas de aviso ---------- */

.menu-footer {
    max-width: var(--max);
    margin: 32px auto 0;
    padding: 20px var(--gutter) calc(32px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.875rem;
}

.menu-empty {
    max-width: var(--max);
    margin: 24px auto;
    padding: 0 var(--gutter);
    color: var(--muted);
}

.notice-page {
    max-width: 480px;
    margin: 0 auto;
    padding: 48px var(--gutter);
    text-align: center;
}

.notice-page h2 {
    margin-top: 32px;
    font-size: 1.25rem;
}

.notice-page p {
    margin-top: 12px;
    color: var(--muted);
}

.button {
    display: inline-block;
    margin-top: 12px;
    padding: 12px 22px;
    border-radius: 999px;
    background: var(--brand);
    color: var(--brand-ink);
    font-weight: 600;
    text-decoration: none;
}
