/* ============================================
   QR Speisekarte – Bui Vien Street Wien
   Light, Clean, Mobile-First
   ============================================ */

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --white: #FFFFFF;
    --bg: #FAFAFA;
    --bg-card: #FFFFFF;
    --border: #EEEEEE;
    --border-dark: #E0E0E0;
    --text: #1A1A1A;
    --text-secondary: #6B7280;
    --text-muted: #9CA3AF;
    --accent: #C8860A;
    --accent-light: #FEF3C7;
    --accent-dark: #92400E;
    --green: #16A34A;
    --green-light: #DCFCE7;
    --green-dark: #166534;
    --red: #DC2626;
    --red-light: #FEE2E2;
    --red-dark: #991B1B;
    --orange: #EA580C;
    --orange-light: #FFEDD5;
    --orange-dark: #9A3412;
    --purple: #7C3AED;
    --purple-light: #EDE9FE;
    --purple-dark: #5B21B6;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-pill: 20px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans', sans-serif;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

html {
    font-family: var(--font);
    font-size: 16px;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    scroll-behavior: smooth;
}

body {
    min-height: 100dvh;
    overflow-x: hidden;
    background: var(--bg);
}

a { color: var(--accent); text-decoration: none; }

/* --- Header --- */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 52px;
    padding: 0 16px;
    max-width: 600px;
    margin: 0 auto;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-logo {
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: var(--text);
}

.header-subtitle {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 400;
}

.table-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    background: var(--accent-light);
    color: var(--accent-dark);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* --- Icon Button --- */
.icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.15s;
}
.icon-btn:hover, .icon-btn:active { background: var(--border); }
.icon-btn.active { color: var(--accent); background: var(--accent-light); }

/* --- Language Dropdown --- */
.lang-dropdown { position: relative; }

.lang-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 40px;
    padding: 0 12px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border-dark);
    background: var(--white);
    color: var(--text);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.lang-btn:hover { border-color: var(--accent); box-shadow: var(--shadow-sm); }

.lang-code { font-weight: 600; font-size: 12px; color: var(--text-secondary); }

.lang-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 180px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 12px 40px rgba(0,0,0,0.12);
    overflow: hidden;
    z-index: 200;
}
[dir="rtl"] .lang-menu { right: auto; left: 0; }
.lang-menu.open { display: block; }

.lang-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 16px;
    color: var(--text-secondary);
    font-size: 14px;
    transition: background 0.1s;
}
.lang-option:hover { background: var(--bg); color: var(--text); }
.lang-option.active { background: var(--accent-light); color: var(--accent-dark); font-weight: 600; }

/* --- Search Bar --- */
.search-bar {
    position: sticky;
    top: 52px;
    z-index: 90;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 8px 16px;
}

.search-inner {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.search-icon {
    position: absolute;
    top: 50%;
    left: 14px;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}
[dir="rtl"] .search-icon { left: auto; right: 14px; }

#searchInput {
    width: 100%;
    height: 44px;
    padding: 0 14px 0 44px;
    border-radius: var(--radius);
    border: 1px solid var(--border-dark);
    background: var(--white);
    color: var(--text);
    font-size: 15px;
    font-family: var(--font);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
[dir="rtl"] #searchInput { padding: 0 44px 0 14px; }
#searchInput::placeholder { color: var(--text-muted); }
#searchInput:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(200,134,10,0.12); }

/* --- Filter Panel --- */
.filter-panel {
    display: none;
    max-width: 600px;
    margin: 0 auto;
    padding: 12px 16px 16px;
    background: var(--white);
    border-bottom: 1px solid var(--border);
}
.filter-panel.open { display: block; }

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.filter-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.filter-reset {
    font-size: 12px;
    color: var(--accent);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    font-weight: 500;
    transition: background 0.15s;
}
.filter-reset:hover { background: var(--accent-light); }

.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border-dark);
    background: var(--white);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
    min-height: 36px;
}
.filter-chip:has(input:checked) {
    background: var(--red-light);
    border-color: var(--red);
    color: var(--red-dark);
    font-weight: 600;
}
.filter-chip input { display: none; }

/* --- Category Tabs --- */
.category-nav {
    position: sticky;
    top: 104px; /* header 52 + search ~52 */
    z-index: 80;
    display: flex;
    gap: 0;
    padding: 0 16px;
    overflow-x: auto;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.category-nav::-webkit-scrollbar { display: none; }

.cat-tab {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 12px 16px;
    border: none;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.15s, border-color 0.15s;
    min-height: 44px;
}
.cat-tab:hover { color: var(--text); }
.cat-tab.active {
    color: var(--text);
    border-bottom-color: var(--accent);
    font-weight: 600;
}

.cat-icon { font-size: 16px; }

/* --- Menu Content --- */
.menu-content {
    max-width: 600px;
    margin: 0 auto;
    padding: 0 0 calc(40px + var(--safe-bottom));
}

/* --- Category Section --- */
.category-section {
    padding-top: 8px;
}
.category-section.filtered-hidden { display: none; }

.section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 16px 8px;
}

.section-icon { font-size: 22px; }

.section-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.01em;
}

/* --- Item Cards --- */
.items-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0 12px;
}

.item-row {
    display: flex;
    flex-direction: column;
    padding: 14px 16px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: box-shadow 0.15s, border-color 0.15s;
    min-height: 56px;
}
.item-row:hover { box-shadow: var(--shadow-md); border-color: var(--border-dark); }
.item-row:active { box-shadow: var(--shadow-sm); background: #FAFAFA; }
.item-row.filtered-hidden { display: none; }

.item-top-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.item-info { flex: 1; min-width: 0; }

.item-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
}

.item-icon {
    display: inline-flex;
    font-size: 14px;
    margin-inline-start: 3px;
    vertical-align: middle;
    line-height: 1;
}

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

.item-price {
    flex-shrink: 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--accent-dark);
    white-space: nowrap;
    padding-top: 1px;
}

.item-desc {
    margin-top: 4px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* --- Badges (used in modal) --- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1.4;
}

.badge-popular { background: var(--accent-light); color: var(--accent-dark); }
.badge-veg { background: var(--green-light); color: var(--green-dark); }
.badge-vegan { background: var(--green-light); color: var(--green-dark); }
.badge-spicy { background: var(--red-light); color: var(--red-dark); }
.badge-inhouse { background: var(--purple-light); color: var(--purple-dark); }

.badge-sm {
    padding: 1px 6px;
    font-size: 10px;
    border-radius: 3px;
    background: #F3F4F6;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* --- Pflicht-Optionen auf Karte --- */
.item-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

.item-option-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.item-option-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--accent-dark);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.item-option-divider {
    width: 1px;
    height: 14px;
    background: var(--border-dark);
    flex-shrink: 0;
}

.item-option-sep {
    color: var(--border-dark);
    font-size: 13px;
    font-weight: 300;
    user-select: none;
}

.item-option-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
}

.item-option-price {
    font-weight: 700;
    color: var(--accent-dark);
    font-size: 12px;
}

/* --- No Results --- */
.no-results {
    text-align: center;
    padding: 60px 16px;
    color: var(--text-muted);
    font-size: 15px;
}
.no-results-icon {
    font-size: 40px;
    margin-bottom: 12px;
    opacity: 0.4;
}

/* --- Modal (Bottom Sheet) --- */
.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 500;
    background: rgba(0, 0, 0, 0.35);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}
.modal-backdrop.open {
    opacity: 1;
    pointer-events: auto;
}

.modal-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 510;
    max-width: 600px;
    margin: 0 auto;
    max-height: 85dvh;
    background: var(--white);
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -4px 40px rgba(0,0,0,0.12);
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
    overscroll-behavior: contain;
}
.modal-sheet.open {
    transform: translateY(0);
}

.modal-handle {
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: #D1D5DB;
    margin: 10px auto 4px;
    flex-shrink: 0;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px 14px;
    flex-shrink: 0;
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    flex: 1;
    min-width: 0;
}

.modal-price-header {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent-dark);
    flex-shrink: 0;
    margin-inline-start: 16px;
}

.modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--bg);
    color: var(--text-secondary);
    cursor: pointer;
    flex-shrink: 0;
    margin-inline-start: 12px;
    transition: background 0.15s;
}
.modal-close:hover { background: var(--border); }

.modal-body {
    padding: 0 16px 24px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.modal-desc {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.modal-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}

.modal-section {
    margin-bottom: 16px;
}

.modal-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}

.modal-option-group {
    margin-bottom: 16px;
    background: var(--bg);
    border-radius: var(--radius);
    padding: 12px 14px;
}

.option-group-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.option-group-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.badge-required {
    background: var(--red-light);
    color: var(--red-dark);
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

.option-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.option-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    background: var(--white);
    font-size: 14px;
    color: var(--text);
}

.option-price {
    font-weight: 600;
    color: var(--accent-dark);
    font-size: 13px;
    flex-shrink: 0;
    margin-inline-start: 12px;
}

.modal-allergens {
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.modal-allergens-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.modal-allergen-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.modal-allergen-tag {
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    background: var(--bg);
    border: 1px solid var(--border);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}

/* --- Footer --- */
.footer {
    text-align: center;
    padding: 24px 16px calc(24px + var(--safe-bottom));
    color: var(--text-muted);
    font-size: 12px;
    letter-spacing: 0.01em;
}

/* --- Toast --- */
.toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    background: var(--text);
    color: var(--white);
    font-size: 13px;
    font-weight: 500;
    z-index: 600;
    animation: toast-in 0.25s ease-out;
    white-space: nowrap;
    box-shadow: var(--shadow-md);
}

@keyframes toast-in {
    from { opacity: 0; transform: translateX(-50%) translateY(10px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* --- RTL --- */
[dir="rtl"] .item-top-row { flex-direction: row-reverse; }
[dir="rtl"] .section-header { flex-direction: row-reverse; }
[dir="rtl"] .header-inner { flex-direction: row-reverse; }
[dir="rtl"] .header-left { flex-direction: row-reverse; }
[dir="rtl"] .header-right { flex-direction: row-reverse; }
[dir="rtl"] .item-allergens { flex-direction: row-reverse; }
[dir="rtl"] .filter-header { flex-direction: row-reverse; }
[dir="rtl"] .option-item { flex-direction: row-reverse; }
[dir="rtl"] .modal-header { flex-direction: row-reverse; }

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .modal-sheet { transition: none; }
    .modal-backdrop { transition: none; }
    .toast { animation: none; }
}

/* --- Tablet+ --- */
@media (min-width: 640px) {
    .item-row { padding: 16px 20px; }
    .items-list { gap: 12px; padding: 0 16px; }
    .section-header { padding: 20px 20px 10px; }
}
