/* ============ Menu Ristorante Dinamico - Frontend ============ */
.rmd-menu {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Poppins', -apple-system, sans-serif;
    color: #333;
    box-sizing: border-box;
}
.rmd-menu * { box-sizing: border-box; }

.rmd-menu-header { text-align: center; margin-bottom: 40px; }
.rmd-restaurant-name {
    font-family: var(--rmd-heading-font);
    color: var(--rmd-primary);
    font-size: clamp(1.8rem, 5vw, 2.8rem);
    margin: 0 0 15px;
    letter-spacing: 1px;
}
.rmd-divider {
    width: 80px; height: 3px;
    background: var(--rmd-accent);
    margin: 0 auto;
}

.rmd-category { margin-bottom: 45px; }
.rmd-category-title {
    font-family: var(--rmd-heading-font);
    color: var(--rmd-primary);
    font-size: clamp(1.4rem, 4vw, 2rem);
    margin: 0 0 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--rmd-accent);
}
.rmd-category-desc { font-style: italic; color: #777; margin-top: -12px; margin-bottom: 20px; }

.rmd-dish { margin-bottom: 22px; }
.rmd-dish-head {
    display: flex;
    align-items: baseline;
    gap: 8px;
}
.rmd-dish-name {
    font-family: var(--rmd-heading-font);
    font-size: clamp(1.05rem, 3vw, 1.25rem);
    color: #2a2a2a;
    margin: 0;
    font-weight: 600;
    flex-shrink: 0;
}
.rmd-dish-dots {
    flex: 1;
    border-bottom: 2px dotted #ccc;
    margin: 0 4px;
    min-width: 15px;
    transform: translateY(-4px);
}
.rmd-dish-price {
    font-weight: 700;
    color: var(--rmd-primary);
    font-size: clamp(1rem, 3vw, 1.2rem);
    white-space: nowrap;
    flex-shrink: 0;
}
.rmd-dish-desc { color: #666; font-size: 0.92rem; margin: 4px 0 0; line-height: 1.5; }
.rmd-dish-allergens { font-size: 0.78rem; color: #999; margin: 3px 0 0; }
.rmd-tag { font-size: 0.85em; }

.rmd-featured {
    background: linear-gradient(to right, rgba(201,169,97,0.08), transparent);
    border-left: 3px solid var(--rmd-accent);
    padding: 12px 15px;
    border-radius: 4px;
}
.rmd-empty { text-align: center; padding: 40px; color: #999; }

/* ============ TEMPLATE: Elegante (default) ============ */
.rmd-template-elegante .rmd-category-title {
    text-align: center; border-bottom: none; position: relative;
}
.rmd-template-elegante .rmd-category-title::after {
    content: ''; display: block; width: 60px; height: 2px;
    background: var(--rmd-accent); margin: 10px auto 0;
}

/* ============ TEMPLATE: Moderno ============ */
.rmd-template-moderno { font-family: 'Poppins', sans-serif; }
.rmd-template-moderno .rmd-category-title {
    text-transform: uppercase; letter-spacing: 2px;
    font-size: 1.3rem; border-bottom: 1px solid #eee;
}
.rmd-template-moderno .rmd-dish-dots { display: none; }
.rmd-template-moderno .rmd-dish-head { justify-content: space-between; }
.rmd-template-moderno .rmd-dish {
    padding-bottom: 18px; border-bottom: 1px solid #f0f0f0;
}

/* ============ TEMPLATE: Rustico ============ */
.rmd-template-rustico {
    background: #faf6f0;
    padding: 30px;
    border-radius: 8px;
    border: 1px solid #e8dfd0;
}
.rmd-template-rustico .rmd-category-title {
    font-style: italic;
    border-bottom: 2px dashed var(--rmd-accent);
}

/* ============ TEMPLATE: A Schede (card) ============ */
.rmd-template-card .rmd-dishes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}
.rmd-template-card .rmd-dish {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 3px 15px rgba(0,0,0,0.08);
    overflow: hidden;
    margin-bottom: 0;
}
.rmd-template-card .rmd-dish-img img {
    width: 100%; height: 180px; object-fit: cover; display: block;
}
.rmd-template-card .rmd-dish-content { padding: 15px; }
.rmd-template-card .rmd-dish-dots { display: none; }
.rmd-template-card .rmd-dish-head { flex-direction: column; align-items: flex-start; gap: 4px; }
.rmd-template-card .rmd-dish-price { margin-top: 8px; }

/* Immagini generali (non-card) */
.rmd-dish-img img { border-radius: 6px; max-width: 120px; }
.rmd:not(.rmd-template-card) .rmd-dish { display: flex; gap: 15px; }

/* ============ MOBILE ============ */
@media (max-width: 600px) {
    .rmd-menu { padding: 15px; }
    .rmd-template-rustico { padding: 18px; }
    .rmd-category { margin-bottom: 35px; }
    .rmd-dish-head { flex-wrap: wrap; }
    .rmd-dish-dots { display: none; }
    .rmd-template-moderno .rmd-dish-head,
    .rmd-dish-head {
        justify-content: space-between;
    }
    .rmd-dish-name { flex: 1 1 auto; min-width: 60%; }
    .rmd-dish-price { flex: 0 0 auto; margin-left: auto; }
    .rmd-template-card .rmd-dishes { grid-template-columns: 1fr; }
    .rmd-dish-img img { max-width: 90px; }
}

@media (max-width: 400px) {
    .rmd-dish-name { min-width: 100%; }
}

/* ============ TEMPLATE: A Tab ============ */
.rmd-template-tab .rmd-tabs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
    border-bottom: 2px solid var(--rmd-accent);
    margin-bottom: 25px;
    padding-bottom: 0;
}
.rmd-template-tab .rmd-tabs::-webkit-scrollbar { height: 4px; }
.rmd-template-tab .rmd-tabs::-webkit-scrollbar-thumb { background: var(--rmd-accent); border-radius: 2px; }

.rmd-template-tab .rmd-tab {
    flex: 0 0 auto;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    padding: 12px 20px;
    font-family: var(--rmd-heading-font);
    font-size: clamp(0.95rem, 2.5vw, 1.15rem);
    color: #888;
    cursor: pointer;
    white-space: nowrap;
    transition: all .25s ease;
    margin-bottom: -2px;
    font-weight: 600;
}
.rmd-template-tab .rmd-tab:hover { color: var(--rmd-primary); }
.rmd-template-tab .rmd-tab.active {
    color: var(--rmd-primary);
    border-bottom-color: var(--rmd-primary);
}

.rmd-template-tab .rmd-tab-panel { display: none; animation: rmdFade .35s ease; }
.rmd-template-tab .rmd-tab-panel.active { display: block; }

@keyframes rmdFade {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

@media (max-width: 600px) {
    .rmd-template-tab .rmd-tab { padding: 10px 14px; }
}

/* ============ Sticky tabs / titoli ============ */
.rmd-sticky-tabs .rmd-tabs {
    position: sticky;
    top: 0;
    z-index: 20;
    background: #fff;
    padding-top: 8px;
}
/* Titoli categoria sticky nei template non-tab, se attivato via classe */
.rmd-sticky-titles .rmd-category-title {
    position: sticky;
    top: 0;
    z-index: 15;
    background: #fff;
    padding-top: 12px;
}

/* ============ Testo a fine menu ============ */
.rmd-menu-footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--rmd-accent);
    text-align: center;
    color: #777;
    font-size: 0.9rem;
    line-height: 1.7;
    font-style: italic;
}

/* ============ Sottocategorie ============ */
.rmd-subcategory { margin: 20px 0 10px; }
.rmd-subcategory-title {
    font-family: var(--rmd-heading-font);
    color: var(--rmd-accent);
    font-size: clamp(1.05rem, 3vw, 1.35rem);
    margin: 0 0 14px;
    padding-left: 12px;
    border-left: 3px solid var(--rmd-accent);
    font-style: italic;
    font-weight: 600;
}
.rmd-template-moderno .rmd-subcategory-title {
    text-transform: uppercase; letter-spacing: 1px; font-style: normal;
    font-size: 1rem; border-left: none; padding-left: 0;
    color: #999;
}
.rmd-template-card .rmd-subcategory { grid-column: 1 / -1; }
/* Sticky anche per i titoli categoria nei template non-tab, se richiesto */
.rmd-sticky-tabs .rmd-category-title {
    position: sticky; top: 52px; background: #fff; z-index: 10; padding-top: 8px;
}
