/* Menu Page Styles */
body {
    font-family: 'Inter', sans-serif;
    background-color: #1a0f0a; /* Dunkles Holz */
    color: #f3f4f6;
}

h1, h2, h3, .font-serif {
    font-family: 'Playfair Display', serif;
}

.bg-wood {
    background-color: #2D1B14;
}

.text-accent-red {
    color: #C53030;
}

.text-gold {
    color: #D4AF37;
}

/* Header - Vollständig opak */
.header-opaque {
    background-color: #1a0f0a !important;
    backdrop-filter: blur(12px);
}

/* Sidebar Navigation - Immer sichtbar */
.sidebar-nav {
    scrollbar-width: thin;
    scrollbar-color: #D4AF37 #2D1B14;
    height: calc(100vh - 5rem);
    position: sticky;
    top: 80px;
    align-self: flex-start;
}

.sidebar-nav::-webkit-scrollbar {
    width: 6px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: #2D1B14;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background-color: #D4AF37;
    border-radius: 3px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background-color: #f4c430;
}

.category-sidebar-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 16px;
    text-align: left;
    color: #9ca3af;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    position: relative;
    cursor: pointer;
    touch-action: manipulation; /* Sofortige Reaktion auf Mobile */
}

.category-sidebar-btn:hover {
    background-color: rgba(212, 175, 55, 0.1);
    color: #D4AF37;
    border-color: rgba(212, 175, 55, 0.2);
    transform: translateX(4px);
}

.category-sidebar-btn.active {
    background: linear-gradient(90deg, rgba(212, 175, 55, 0.15) 0%, rgba(212, 175, 55, 0.05) 100%);
    color: #D4AF37;
    border-color: #D4AF37;
    font-weight: 600;
}

.category-sidebar-btn.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background-color: #D4AF37;
    border-radius: 0 2px 2px 0;
}

.category-sidebar-btn .category-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    opacity: 0.6;
    transition: all 0.3s ease;
    stroke-width: 2;
}

.category-sidebar-btn:hover .category-icon,
.category-sidebar-btn.active .category-icon {
    opacity: 1;
    transform: scale(1.1);
}

.category-header {
    position: sticky;
    top: 80px;
    z-index: 20;
    background-color: #1a0f0a; /* Anpassung an Body-Farbe */
    border-bottom: 1px solid rgba(212, 175, 55, 0.1);
    transition: all 0.4s ease;
}

.menu-category-section {
    padding-top: 4rem;
    padding-bottom: 2rem;
    content-visibility: auto;
    contain-intrinsic-size: auto 400px;
}

.menu-category-section:first-child {
    padding-top: 1rem;
    content-visibility: visible;
}

/* Category Hero Banner */
.category-hero-banner {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    transition: transform 0.4s ease;
    background-color: #2D1B14; /* Placeholder Farbe */
}

/* Lazy Loading: Bilder starten unsichtbar und faden ein wenn geladen */
.lazy-image {
    opacity: 0;
    transition: opacity 0.4s ease-in-out;
}

.lazy-image.loaded,
img.loaded {
    opacity: 1 !important;
}

.category-hero-banner:hover {
    transform: scale(1.02);
}

.category-hero-banner img {
    transition: transform 0.6s ease;
}

.category-hero-banner:hover img {
    transform: scale(1.1);
}

.category-hero-overlay {
    transition: opacity 0.4s ease;
}

.category-hero-banner:hover .category-hero-overlay {
    opacity: 0.9;
}

.category-hero-content h2 {
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.8);
    animation: fadeInUp 0.6s ease-out;
}

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

/* Grid Spacing */
#menu-list .grid {
    gap: 2rem;
}

/* Hide native horizontal scrollbar but keep scrolling functional */
.hide-scrollbar {
    -ms-overflow-style: none; /* IE and Edge */
    scrollbar-width: none; /* Firefox */
}

.hide-scrollbar::-webkit-scrollbar { 
    display: none; /* Chrome, Safari */
}

/* Menu Item Row - Premium Design */
.menu-item-row {
    position: relative;
    padding: 1.5rem;
    border-radius: 12px;
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(212, 175, 55, 0.05);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.menu-item-row:hover {
    transform: translateY(-4px) scale(1.01);
    background-color: rgba(212, 175, 55, 0.05);
    border-color: rgba(212, 175, 55, 0.3);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5), 
                0 0 20px rgba(212, 175, 55, 0.05);
}

/* Die ID (Nummer) als edles Badge */
.item-id {
    font-family: 'Inter', sans-serif;
    font-size: 10px;
    color: #D4AF37;
    background: rgba(212, 175, 55, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid rgba(212, 175, 55, 0.2);
    margin-right: 8px;
}

/* Dot Leader Logik */
.item-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
}

.item-name-container {
    display: flex;
    align-items: baseline;
    flex: 1;
    min-width: 0; /* Erlaubt dem Container zu schrumpfen */
}

.item-name-container h3 {
    flex-shrink: 1;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.item-dots {
    flex-grow: 1;
    border-bottom: 1px dotted rgba(212, 175, 55, 0.2);
    margin: 0 8px 5px 8px;
    min-width: 20px; /* Mindestmaß für die Punkte */
}

/* Preis darf niemals verschwinden */
.item-price {
    font-family: 'Playfair Display', serif;
    color: #C53030;
    font-weight: 700;
    font-size: 1.1rem;
    flex-shrink: 0;
    white-space: nowrap;
    text-align: right;
}

/* Wenn der Platz extrem eng wird (Mobile), Punkte verstecken */
@media (max-width: 480px) {
    .item-dots {
        display: none;
    }
}

/* Beschreibungstext */
.item-desc {
    color: #9ca3af;
    font-size: 0.875rem;
    line-height: 1.5;
    margin-top: 0.5rem;
    flex-grow: 1;
}

/* Options Container for grouped sizes */
.item-options-container {
    border-top: 1px solid rgba(212, 175, 55, 0.1);
    padding-top: 0.5rem;
    margin-top: 0.5rem !important;
}

/* Mobile Optimierung für die Karten */
@media (max-width: 640px) {
    .menu-item-row {
        padding: 1rem;
    }
    
    .item-price {
        font-size: 1rem;
    }
}

/* Search Styles */
/* Mobile-Search Helper */
.mobile-search-wrapper {
    display: none;
}

@media (max-width: 768px) {
    .mobile-search-wrapper {
        display: block;
    }
    
    .sidebar-nav .p-4 {
        padding: 12px 16px 8px 16px;
    }
    
    .category-label {
        display: none !important; /* Auf Mobile Platz sparen */
    }
    
    .sidebar-nav {
        display: flex;
        flex-direction: column;
    }

    /* Verhindert den Auto-Zoom auf iOS beim Klicken in die Suche */
    .search-input {
        font-size: 16px !important;
    }
}

.search-container {
    position: relative;
}

.search-input {
    background-color: rgba(45, 27, 20, 0.8);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 9999px;
    padding: 0.5rem 2.5rem;
    font-size: 0.875rem;
    color: #ffffff !important; /* Erzwungene weiße Schrift */
    transition: all 0.3s ease;
    width: 100%;
}

.search-input:focus {
    outline: none;
    border-color: #D4AF37;
    box-shadow: 0 0 0 1px #D4AF37;
    width: 320px;
}

@media (max-width: 768px) {
    .search-input {
        font-size: 16px !important; /* Verhindert Auto-Zoom auf iOS */
    }
    
    .search-input:focus {
        width: 100%;
    }
}

.search-input::placeholder {
    color: rgba(156, 163, 175, 0.6);
}

mark {
    background-color: rgba(212, 175, 55, 0.3);
    color: #D4AF37;
    font-weight: 600;
    padding: 0 2px;
    border-radius: 2px;
}

/* Allergen Footnote Badges & Glow Animation */
@keyframes gold-pulse {
    0% { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(212, 175, 55, 0); }
    100% { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0); }
}

.footnote-badge {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    font-size: 9px;
    font-weight: 700;
    color: #D4AF37;
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid rgba(212, 175, 55, 0.4);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    animation: gold-pulse 2s infinite; /* Der Glow-Effekt */
}

/* Globaler Allergen-Container (Toast) */
#allergen-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background-color: #2D1B14;
    border: 1px solid #D4AF37;
    border-radius: 16px;
    padding: 16px 24px;
    z-index: 2000;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.8);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    pointer-events: none;
}

#allergen-toast.active {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.toast-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast-title {
    font-family: 'Playfair Display', serif;
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
    padding-bottom: 4px;
}

.toast-list {
    color: #D4AF37;
    font-size: 0.85rem;
    line-height: 1.4;
}

/* Mobile Responsive - Sidebar bleibt sichtbar, wird nur schmaler */
@media (max-width: 1024px) {
    .sidebar-nav {
        width: 200px;
        font-size: 13px;
    }
    
    .category-sidebar-btn {
        padding: 10px 12px;
        font-size: 13px;
    }
    
    .category-sidebar-btn .category-icon {
        width: 18px;
        height: 18px;
    }
}

@media (max-width: 768px) {
    /* Auf Handy wird die Sidebar zur Kategorie-Leiste oben */
    main {
        flex-direction: column !important;
    }

    .sidebar-nav {
        width: 100% !important;
        height: auto;
        position: sticky;
        top: 80px;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        overflow-y: hidden;
        overflow-x: auto;
        z-index: 25;
    }

    /* Heading in der Kategorie-Leiste kompakter */
.sidebar-nav h2 {
    color: #D4AF37;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    margin-bottom: 1.5rem;
    padding-left: 1rem;
    font-weight: 700;
    opacity: 0.8;
}

    /* Nav von vertical (space-y) zu horizontal (scrollbar) */
    #category-nav {
        display: flex;
        gap: 10px;
        overflow-x: auto;
        padding-bottom: 8px;
        -ms-overflow-style: none;
        scrollbar-width: none;
    }

    #category-nav::-webkit-scrollbar {
        display: none;
    }

    .category-sidebar-btn {
        width: auto;
        flex: 0 0 auto;
        padding: 10px 12px;
        border-radius: 999px;
        white-space: nowrap;
        transform: none !important; /* kein seitliches rutschen */
    }

    .category-sidebar-btn.active::before {
        display: none; /* Linker Balken macht auf Pills keinen Sinn */
    }

    .category-sidebar-btn.active {
        box-shadow: inset 0 0 0 1px rgba(212, 175, 55, 0.7);
    }

    /* Category Header nicht sticky auf Mobile, damit nichts übereinander klebt */
    .category-header {
        position: static;
        padding-top: 1rem !important;
        padding-bottom: 1rem !important;
    }

    /* Suchfeld auf Mobile nicht „breiter auf focus“ */
    .search-input:focus {
        width: 100%;
    }
}

@media print {
    .no-print { 
        display: none; 
    }
    
    body { 
        background: white; 
        color: black; 
    }
    
    .text-gold, .text-accent-red { 
        color: black !important; 
    }
    
    .sidebar-nav {
        display: none;
    }
    
    main > div {
        margin-left: 0 !important;
    }
}

