/* ── Menú digital (/menu/{empresa}/{sucursal}) ─────────────────────────
   BEM: .mnu-pub (página) + .mnu (widget: búsqueda, chips scrollspy,
   cards, bottom-sheet). Mobile-first. Sin !important. */

.mnu-pub {
    max-width: 860px;
    margin: 0 auto;
    padding: var(--space-3, 12px) var(--space-4, 16px) var(--space-8, 64px);
}

.mnu-pub__breadcrumb {
    margin: 2px 0 10px;
    font-size: 0.85rem;
}
.mnu-pub__breadcrumb a {
    color: var(--c-text-muted);
    text-decoration: none;
}
.mnu-pub__breadcrumb a:hover {
    color: var(--c-primary-ink);
}

.mnu-pub__head {
    margin-bottom: var(--space-3, 12px);
}
.mnu-pub__title {
    margin: 0 0 2px;
    font-family: var(--font-display, var(--font-sans));
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--c-text);
    line-height: 1.25;
}
.mnu-pub__subtitle {
    margin: 0;
    color: var(--c-text-muted);
    font-size: 0.9rem;
}

.mnu-pub__empty {
    padding: var(--space-6, 32px) var(--space-4, 16px);
    border: 1px dashed var(--c-border, var(--c-sage-200));
    border-radius: 12px;
    text-align: center;
    background: var(--c-surface, var(--c-white));
}
.mnu-pub__empty-title {
    margin: 0 0 4px;
    font-weight: 700;
    color: var(--c-text);
}
.mnu-pub__empty-hint {
    margin: 0;
    color: var(--c-text-muted);
    font-size: 0.88rem;
}

/* ── Búsqueda ── */
.mnu-search {
    position: relative;
    margin-bottom: var(--space-3, 12px);
}
.mnu-search__icon {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--c-text-muted);
    pointer-events: none;
}
.mnu-search__sr {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}
.mnu-search__input {
    width: 100%;
    min-height: 46px;
    padding: 10px 14px 10px 38px;
    border: 1px solid var(--c-border, var(--c-sage-200));
    border-radius: 999px;
    background: var(--c-surface, var(--c-white));
    color: var(--c-text);
    font-size: 0.95rem;
}
.mnu-search__input:focus {
    outline: none;
    border-color: var(--c-accent);
    box-shadow: 0 0 0 3px rgba(58, 124, 165, 0.15);
}

/* ── Tabs de catálogo (solo si hay más de uno) ── */
.mnu-cattabs {
    display: flex;
    gap: 6px;
    margin-bottom: var(--space-3, 12px);
    overflow-x: auto;
    scrollbar-width: none;
}
.mnu-cattabs::-webkit-scrollbar { display: none; }
.mnu-cattabs__tab {
    flex: 0 0 auto;
    min-height: 38px;
    padding: 7px 16px;
    border: 1px solid var(--c-border, var(--c-sage-200));
    border-radius: 999px;
    background: var(--c-surface, var(--c-white));
    color: var(--c-text-muted);
    font-size: 0.86rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.mnu-cattabs__tab.is-active {
    background: var(--c-brand-surface);
    border-color: var(--c-primary);
    color: var(--c-on-brand);
}

/* ── Chips de sección (sticky + scrollspy) ── */
.mnu-chips {
    position: sticky;
    /* Debajo del header público sticky (56px). En embed no hay header. */
    top: 56px;
    z-index: 20;
    display: flex;
    gap: 6px;
    margin: 0 calc(-1 * var(--space-4, 16px));
    padding: 8px var(--space-4, 16px);
    background: var(--c-bg);
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.mnu-chips::-webkit-scrollbar { display: none; }
body.sb-embed .mnu-chips { top: 0; }

.mnu-chips__chip {
    flex: 0 0 auto;
    min-height: 36px;
    padding: 6px 14px;
    border: 1px solid var(--c-border, var(--c-sage-200));
    border-radius: 999px;
    background: var(--c-surface, var(--c-white));
    color: var(--c-text);
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.mnu-chips__chip.is-active {
    background: var(--c-brand-surface);
    border-color: var(--c-primary);
    color: var(--c-on-brand);
}
.mnu-chips[hidden] { display: none; }

.mnu-noresults {
    margin: var(--space-4, 16px) 0;
    padding: var(--space-4, 16px);
    border-radius: 10px;
    background: var(--c-surface-2);
    color: var(--c-text-muted);
    text-align: center;
    font-size: 0.9rem;
}

/* ── Secciones ── */
.mnu-section {
    /* Ancla bajo header (56) + chips (~52). En embed el JS no interviene:
       scroll-margin generoso funciona en ambos contextos. */
    scroll-margin-top: 118px;
    padding-top: var(--space-4, 16px);
}
body.sb-embed .mnu-section { scroll-margin-top: 62px; }

.mnu-section__title {
    margin: 0 0 2px;
    font-family: var(--font-display, var(--font-sans));
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--c-text);
}
.mnu-section__desc {
    margin: 0 0 6px;
    color: var(--c-text-muted);
    font-size: 0.85rem;
}

/* ── Cards de producto (fila: texto izq + foto der) ── */
.mnu-cards {
    display: grid;
    gap: 10px;
    margin-top: 8px;
}

.mnu-card {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 12px;
    border: 1px solid var(--c-border, var(--c-sage-200));
    border-radius: 12px;
    background: var(--c-surface, var(--c-white));
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.mnu-card:hover,
.mnu-card:focus-visible {
    /* base.css aplica `button:hover { background: primary; color: var(--c-on-brand) }`; sin
       reafirmar el fondo claro, la tarjeta se vuelve azul y su texto oscuro
       queda ilegible. Mantener superficie clara y colores propios del texto. */
    background: var(--c-surface, var(--c-white));
    color: var(--c-text);
    border-color: var(--c-accent);
    box-shadow: 0 6px 18px rgba(22, 32, 40, 0.08);
}
.mnu-card.is-hidden { display: none; }

.mnu-card__body {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    flex: 1 1 auto;
}
.mnu-card__name {
    font-weight: 700;
    color: var(--c-text);
    font-size: 0.95rem;
    line-height: 1.3;
}
.mnu-card__desc {
    color: var(--c-text-muted);
    font-size: 0.82rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}
.mnu-card__price {
    margin-top: auto;
    padding-top: 4px;
    display: inline-flex;
    align-items: baseline;
    gap: 7px;
    font-variant-numeric: tabular-nums;
}
.mnu-card__price-old {
    color: var(--c-text-muted);
    font-size: 0.8rem;
}
.mnu-card__price-now {
    color: var(--c-text);
    font-size: 0.95rem;
    font-weight: 800;
}
.mnu-card__price-now--offer {
    color: var(--c-danger);
}

.mnu-card__media {
    flex: 0 0 auto;
    width: 88px;
    height: 88px;
    border-radius: 10px;
    overflow: hidden;
    background: var(--c-surface-2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--c-text-muted);
}
.mnu-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.mnu-section.is-hidden { display: none; }

/* ── Bottom-sheet de detalle ── */
.mnu-sheet {
    position: fixed;
    inset: 0;
    z-index: 1200;
}
.mnu-sheet[hidden] { display: none; }

.mnu-sheet__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
}

.mnu-sheet__panel {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    max-height: 88dvh;
    overflow-y: auto;
    border-radius: 18px 18px 0 0;
    background: var(--c-surface, var(--c-white));
    box-shadow: 0 -12px 40px rgba(8, 28, 60, 0.25);
    transform: translateY(100%);
    transition: transform 0.22s ease;
    padding-bottom: max(16px, env(safe-area-inset-bottom));
}
.mnu-sheet.is-open .mnu-sheet__panel { transform: translateY(0); }

.mnu-sheet__handle {
    display: block;
    width: 42px;
    height: 4px;
    margin: 10px auto 0;
    border-radius: 999px;
    background: var(--c-border, var(--c-sage-200));
}

.mnu-sheet__close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--c-border);
    border-radius: 50%;
    background: color-mix(in srgb, var(--c-surface) 95%, transparent);
    color: var(--c-text, var(--c-slate-900));
    cursor: pointer;
}
.mnu-sheet__close svg { width: 28px; height: 28px; }

.mnu-sheet__media {
    width: 100%;
    aspect-ratio: 4 / 3;
    max-height: 260px;
    overflow: hidden;
    margin-top: 8px;
}
.mnu-sheet__media img {
    width: 100%;
    height: 100%;
    max-height: 260px;
    object-fit: cover;
    display: block;
}
.mnu-sheet__media[hidden] { display: none; }

.mnu-sheet__content {
    padding: 14px 18px 6px;
    display: grid;
    gap: 8px;
}
.mnu-sheet__name {
    margin: 0;
    font-family: var(--font-display, var(--font-sans));
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--c-text);
    padding-right: 52px;
}
.mnu-sheet__price {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--c-text);
    font-variant-numeric: tabular-nums;
}
.mnu-sheet__price[hidden] { display: none; }
.mnu-sheet__desc {
    margin: 0;
    color: var(--c-text-muted);
    font-size: 0.92rem;
    line-height: 1.55;
    white-space: pre-line;
}
.mnu-sheet__desc[hidden] { display: none; }

/* Atributos sin valor → pills (como en la ficha de producto). */
.mnu-sheet__pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.mnu-sheet__pills[hidden] { display: none; }
.mnu-sheet__pill {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 3px 11px;
    border: 1px solid var(--c-border, var(--c-sage-200));
    border-radius: 999px;
    background: var(--c-surface-2);
    color: var(--c-text);
    font-size: 0.78rem;
    font-weight: 600;
}

/* Atributos con valor → filas nombre/valor. */
.mnu-sheet__specs {
    display: grid;
    gap: 4px;
    padding: 8px 0 2px;
    border-top: 1px solid var(--c-border);
}
.mnu-sheet__specs[hidden] { display: none; }
.mnu-sheet__spec {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    font-size: 0.85rem;
    line-height: 1.45;
}
.mnu-sheet__spec-name {
    color: var(--c-text-muted);
    min-width: 0;
}
.mnu-sheet__spec-val {
    color: var(--c-text);
    font-weight: 600;
    text-align: right;
}

/* Tags → chips bajo su título. */
.mnu-sheet__tags {
    padding-top: 8px;
    border-top: 1px solid var(--c-border);
}
.mnu-sheet__tags[hidden] { display: none; }
.mnu-sheet__tags-title {
    margin: 0 0 6px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--c-text-muted);
}
.mnu-sheet__tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.mnu-sheet__tag {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 3px 11px;
    border-radius: 999px;
    background: var(--c-primary-soft);
    color: var(--c-primary-ink);
    font-size: 0.78rem;
    font-weight: 600;
}
.mnu-sheet__link { justify-self: start; }
.mnu-sheet__link[hidden] { display: none; }

body.mnu-sheet-open { overflow: hidden; }

/* ── Tablet / Desktop ── */
@media (min-width: 768px) {
    .mnu-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .mnu-card__media {
        width: 96px;
        height: 96px;
    }
    .mnu-sheet__panel {
        left: 50%;
        right: auto;
        bottom: auto;
        top: 50%;
        width: min(560px, calc(100vw - 2rem));
        max-height: 84vh;
        border-radius: 16px;
        transform: translate(-50%, -46%);
        opacity: 0;
        transition: transform 0.2s ease, opacity 0.2s ease;
    }
    .mnu-sheet.is-open .mnu-sheet__panel {
        transform: translate(-50%, -50%);
        opacity: 1;
    }
    .mnu-sheet__handle { display: none; }
}

@media (min-width: 1024px) {
    .mnu-pub__title { font-size: 1.65rem; }
}
