/* ═══════════════════════════════════════════ */
/* Menu Pubblico - CSS                        */
/* Schema fisso, modificabile via CSS          */
/* ═══════════════════════════════════════════ */

/* ── Reset & body ───────────────── */
.menu-public-body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: #0f172a;
    color: #e2e8f0;
    min-height: 100vh;
}

/* ══════════════════════════════════ */
/* SPLASH PAGE                       */
/* ══════════════════════════════════ */
.menu-splash {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    text-align: center;
    padding: 20px 20px 100px;
    position: relative;
}
.menu-splash__content {
    animation: fadeIn 0.8s ease-out;
}
.menu-splash__logo {
    width: 180px;
    height: auto;
    margin-bottom: 24px;
    filter: drop-shadow(0 4px 20px rgba(59, 130, 246, 0.3));
}
.menu-splash__title {
    font-size: 2.2rem;
    font-weight: 700;
    margin: 0 0 8px;
    color: #f8fafc;
    letter-spacing: 0.02em;
}
.menu-splash__subtitle {
    font-size: 1.1rem;
    color: #94a3b8;
    margin: 0 0 32px;
}
.menu-splash__btn {
    display: inline-block;
    padding: 14px 40px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
    border: none;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}
.menu-splash__btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(59, 130, 246, 0.5);
}

.menu-splash__btn-wrapper {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    padding: 20px;
    background: transparent;
    z-index: 10;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ══════════════════════════════════ */
/* MENU MAIN LAYOUT                  */
/* ══════════════════════════════════ */
.menu-main {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ── Top bar ──────────────────── */
.menu-topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    background: transparent;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.menu-topbar__logo {
    width: 60px;
    height: auto;
}
.menu-topbar__legend-btn {
    padding: 8px 16px;
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.3);
    border-radius: 20px;
    color: #fbbf24;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s;
}
.menu-topbar__legend-btn:hover {
    background: rgba(251, 191, 36, 0.2);
}

/* ── Body (accordion) ─────────── */
.menu-body {
    flex: 1;
    padding: 16px;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}
.menu-body--accordion {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ══════════════════════════════════ */
/* ACCORDION                         */
/* ══════════════════════════════════ */
.menu-accordion {
    border-radius: 10px;
    overflow: hidden;
}

/* ─ Header sizes ─ */
.menu-accordion__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    border: none;
    cursor: pointer;
    font-family: inherit;
    transition: filter 0.2s;
    text-align: left;
}
.menu-accordion__header:hover {
    filter: brightness(1.15);
}
.menu-accordion__header--large {
    padding: 18px 24px;
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    border-radius: 10px;
}
.menu-accordion__header--medium {
    padding: 14px 20px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 8px;
}
.menu-accordion__header--small {
    padding: 10px 16px;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 6px;
}
.menu-accordion__header--empty {
    cursor: default;
}
.menu-accordion__header--empty:hover {
    filter: none;
}

.menu-accordion__label {
    display: flex;
    align-items: center;
    gap: 10px;
}
.menu-accordion__icon {
    font-size: 1.3em;
}
.menu-accordion__arrow {
    font-size: 1.1em;
    transition: transform 0.3s ease;
    opacity: 0.6;
}
.menu-accordion__header[aria-expanded="true"] .menu-accordion__arrow {
    transform: rotate(90deg);
}

/* ─ Body ─ */
.menu-accordion__body {
    padding: 6px 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.menu-accordion__products {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px 0;
}

/* Depth indentation */
.menu-accordion--depth-1 {
    margin-left: 12px;
}
.menu-accordion--depth-2 {
    margin-left: 12px;
}

/* Highlight animation on scroll-to */
@keyframes highlightFlash {
    0%   { box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.7); }
    100% { box-shadow: 0 0 0 3px transparent; }
}
.menu-accordion--highlight {
    animation: highlightFlash 1.5s ease-out;
}

/* ── Product card ─────────────── */
.menu-product {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 10px;
    padding: 16px 20px;
    transition: border-color 0.2s, box-shadow 0.2s;
    display: flex;
    gap: 14px;
    align-items: flex-start;
}
.menu-product__thumb {
    flex-shrink: 0;
    width: var(--product-thumb-w, 60px);
    height: var(--product-thumb-h, 60px);
    object-fit: cover;
    border-radius: 6px;
    display: block;
}
.menu-product__info {
    flex: 1;
    min-width: 0;
}
.menu-product:hover {
    border-color: #475569;
    box-shadow: 0 2px 12px rgba(0,0,0,0.2);
}
.menu-product__header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 6px;
}
.menu-product__name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #f8fafc;
    margin: 0;
}
.menu-product__price {
    font-size: 1.15rem;
    font-weight: 700;
    color: #fbbf24;
    white-space: nowrap;
}

/* Variant rows (multiple formats/prices) */
.menu-product__variants {
    margin: 6px 0 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.menu-product__variant-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 3px 0;
}
.menu-product__variant-label {
    font-size: 0.88rem;
    color: #cbd5e1;
}
.menu-product__variant-price {
    font-size: 1rem;
    font-weight: 700;
    color: #fbbf24;
    white-space: nowrap;
}

.menu-product__desc {
    font-size: 0.88rem;
    color: #94a3b8;
    margin: 0 0 8px;
    line-height: 1.4;
}
.menu-product__ingredients {
    font-size: 0.84rem;
    color: #64748b;
    margin: 0 0 8px;
    line-height: 1.4;
}
.menu-product__ingredients-label {
    font-weight: 600;
    color: #94a3b8;
}

/* Allergen text display */
.menu-product__allergens {
    font-size: 0.82rem;
    color: #fbbf24;
    margin-top: 6px;
    line-height: 1.4;
}
.menu-product__allergens-label {
    font-weight: 600;
}

/* ── Empty state ──────────────── */
.menu-empty {
    text-align: center;
    padding: 80px 20px;
    color: #64748b;
    font-size: 1.1rem;
}

/* ══════════════════════════════════ */
/* LEGENDA ALLERGENI (overlay)       */
/* ══════════════════════════════════ */
.menu-legend-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.menu-legend {
    background: #1e293b;
    border: 1px solid #475569;
    border-radius: 14px;
    padding: 24px;
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}
.menu-legend__close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 1.5rem;
    cursor: pointer;
}
.menu-legend__title {
    margin: 0 0 16px;
    font-size: 1.2rem;
    color: #fbbf24;
}
.menu-legend__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
    margin-bottom: 16px;
}
.menu-legend__item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: rgba(251, 191, 36, 0.06);
    border-radius: 8px;
    font-size: 0.88rem;
}
.menu-legend__icon {
    font-size: 1.2rem;
}
.menu-legend__num {
    background: rgba(251, 191, 36, 0.2);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: #fbbf24;
    flex-shrink: 0;
}
.menu-legend__name {
    color: #e2e8f0;
}
.menu-legend__disclaimer {
    font-size: 0.8rem;
    color: #64748b;
    line-height: 1.5;
    margin: 0;
    border-top: 1px solid #334155;
    padding-top: 12px;
}

/* ══════════════════════════════════ */
/* RESPONSIVE                        */
/* ══════════════════════════════════ */
@media (max-width: 768px) {
    .menu-body {
        padding: 10px 8px;
    }
    .menu-body--accordion {
        gap: 6px;
    }
    .menu-accordion__header--large {
        padding: 14px 16px;
        font-size: 1.15rem;
    }
    .menu-accordion__header--medium {
        padding: 10px 14px;
        font-size: 0.95rem;
    }
    .menu-accordion__header--small {
        padding: 8px 12px;
        font-size: 0.88rem;
    }
    .menu-accordion--depth-1,
    .menu-accordion--depth-2 {
        margin-left: 8px;
    }
    .menu-product {
        padding: 12px 14px;
    }
    .menu-product__name {
        font-size: 1rem;
    }
    .menu-topbar {
        padding: 8px 12px;
    }
    .menu-topbar__logo {
        width: 45px;
    }
    .menu-splash__title {
        font-size: 1.6rem;
    }
    .menu-splash__logo {
        width: 130px;
    }
    .menu-legend__grid {
        grid-template-columns: 1fr;
    }
}
