/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #37352f;
    background-color: #ffffff;
    font-size: 16px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Header Styles */
.header {
    background: #ffffff;
    border-bottom: 1px solid #e9e9e7;
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(8px);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* 断点：≤1000px 启用移动端 Header（隐藏原 nav，显示三点按钮） */
@media (max-width: 1000px) {
    .nav {
        display: none !important;
    }
    .header-content {
        position: relative; /* 让绝对定位的 mobile-menu 定位到 header-content */
    }
    .mobile-menu-toggle {
        display: inline-flex !important;
        margin-left: auto;
    }
    .mobile-menu {
        top: calc(100% + 8px); /* 菜单显示在 header 下方 8px */
    }
}

/* 新增：移动端三点按钮与菜单基础样式（桌面默认隐藏） */
.mobile-menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    font-size: 24px;
    line-height: 1;
    border: none;
    background: transparent;
    color: #37352f;
    border-radius: 8px;
    cursor: pointer;
}
.mobile-menu-toggle:hover {
    background-color: #f7f6f3;
}

.mobile-menu {
    display: none;
    position: absolute;
    right: 0;
    background: #ffffff;
    border: 1px solid #e9e9e7;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    min-width: 160px;
    z-index: 110;
}
.mobile-menu.open {
    display: block;
}
.mobile-menu-item {
    display: block;
    padding: 10px 14px;
    text-decoration: none;
    color: #37352f;
    font-size: 14px;
}
.mobile-menu-item:hover {
    background: #f7f6f3;
}

/* 断点：≤1000px 启用移动端 Header（隐藏原 nav，显示三点按钮） */
@media (max-width: 1000px) {
    .nav {
        display: none !important;
    }
    .header-content {
        position: relative; /* 让绝对定位的 mobile-menu 定位到 header-content */
    }
    .mobile-menu-toggle {
        display: inline-flex !important;
        margin-left: auto;
    }
    .mobile-menu {
        top: calc(100% + 8px); /* 菜单显示在 header 下方 8px */
    }
}
.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-img {
    height: 40px;
    width: auto;
    object-fit: contain;
    background-color: transparent;
    border: none;
    outline: none;
    display: block;
    filter: none;
    opacity: 1;
}



.nav {
    display: flex;
    gap: 24px;
    align-items: center;
}

.nav-link {
    text-decoration: none;
    color: #787774;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
    color: #37352f;
    background-color: #f7f6f3;
}

/* Dropdown Menu Styles */
.nav-dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-toggle {
    cursor: pointer;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: #ffffff;
    border: 1px solid #e9e9e7;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    min-width: 200px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    max-height: 400px;
    overflow-y: auto;
}

.nav-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: block;
    padding: 10px 16px;
    text-decoration: none;
    color: #37352f;
    font-size: 14px;
    font-weight: 400;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #f7f6f3;
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover {
    background-color: #f7f6f3;
    color: #37352f;
}

/* Hero Section */
.hero {
    padding: 80px 0;
    text-align: center;
    background: linear-gradient(135deg, #f7f6f3 0%, #ffffff 100%);
}

.hero-title {
    font-size: 48px;
    font-weight: 700;
    color: #37352f;
    margin-bottom: 16px;
    line-height: 1.2;
}

.hero-description {
    font-size: 18px;
    color: #787774;
    max-width: 600px;
    margin: 0 auto 32px;
    line-height: 1.6;
}

.hero-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    font-size: 16px;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background-color: #37352f;
    color: #ffffff;
}

.btn-primary:hover {
    background-color: #2f2e29;
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: #ffffff;
    color: #37352f;
    border: 1px solid #e9e9e7;
}

.btn-secondary:hover {
    background-color: #f7f6f3;
    transform: translateY(-1px);
}

/* Menu Index Section */
.menu-index {
    padding: 80px 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.section-header {
    text-align: center;
    margin-bottom: 48px;
}

.section-header h2 {
    font-size: 36px;
    font-weight: 700;
    color: #37352f;
    margin-bottom: 12px;
}

.section-header p {
    font-size: 18px;
    color: #787774;
    max-width: 600px;
    margin: 0 auto;
}

/* Menu Grid Layout */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.menu-link {
    display: block;
    background: white;
    border-radius: 12px;
    padding: 20px 24px;
    text-decoration: none;
    color: #2c3e50;
    font-size: 18px;
    font-weight: 500;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
    border-left: 4px solid #d32f2f;
    text-align: center;
}

.menu-link:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border-left-color: #b71c1c;
    background: #fafafa;
}

/* Legacy list styles for compatibility */
.menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 24px;
}

.menu-list li {
    margin-bottom: 12px;
}

.category-icon {
    font-size: 40px;
    margin-bottom: 12px;
    display: block;
}

.category-card h3 {
    font-size: 18px;
    font-weight: 600;
    color: #37352f;
    margin-bottom: 8px;
    line-height: 1.3;
}

.category-card p {
    color: #787774;
    line-height: 1.4;
    font-size: 14px;
}

/* Features Section */
.features {
    padding: 80px 0;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 32px;
}

.feature-card {
    background: #ffffff;
    padding: 32px;
    border-radius: 12px;
    border: 1px solid #e9e9e7;
    text-align: center;
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: #d3d1cb;
}

.feature-icon {
    font-size: 48px;
    margin-bottom: 16px;
    display: block;
}

.feature-card h3 {
    font-size: 20px;
    font-weight: 600;
    color: #37352f;
    margin-bottom: 12px;
}

.feature-card p {
    color: #787774;
    line-height: 1.5;
}

/* Menu Header */
.menu-header {
    padding: 60px 0 40px;
    text-align: center;
    background: #f7f6f3;
}

.menu-header h1 {
    font-size: 40px;
    font-weight: 700;
    color: #37352f;
    margin-bottom: 12px;
}

.menu-header p {
    font-size: 18px;
    color: #787774;
    margin-bottom: 40px;
}

/* Menu Controls */
.menu-controls {
    display: flex;
    flex-direction: column;
    gap: 24px;
    align-items: center;
    max-width: 800px;
    margin: 0 auto;
}

.search-box {
    width: 100%;
    max-width: 400px;
}

.search-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e9e9e7;
    border-radius: 8px;
    font-size: 16px;
    background: #ffffff;
    transition: border-color 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: #37352f;
}

.filter-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.filter-btn {
    padding: 8px 16px;
    border: 1px solid #e9e9e7;
    background: #ffffff;
    color: #787774;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

/* 新增：下拉容器与样式（默认隐藏） */
.filter-select-container {
    display: none;
    width: 100%;
    max-width: 400px;
    margin-top: 4px;
}

.filter-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e9e9e7;
    border-radius: 6px;
    background: #ffffff;
    color: #37352f;
    font-size: 14px;
}

/* 断点：≤1000px 只显示下拉；>1000px 显示按钮 */
@media (max-width: 1000px) {
    .filter-buttons {
        display: none;
    }
    .filter-select-container {
        display: block;
    }
}

.filter-btn:hover,
.filter-btn.active {
    background: #37352f;
    color: #ffffff;
    border-color: #37352f;
}

/* Menu Content */
.menu-content {
    padding: 40px 0;
}

.menu-categories {
    display: flex;
    flex-direction: column;
    gap: 48px;
}

.category-section {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e9e9e7;
    overflow: hidden;
}

.category-header {
    background: #f7f6f3;
    padding: 24px 32px;
    border-bottom: 1px solid #e9e9e7;
}

.category-title {
    font-size: 24px;
    font-weight: 600;
    color: #37352f;
    margin-bottom: 4px;
}

.category-count {
    font-size: 14px;
    color: #787774;
}

.menu-items {
    padding: 0;
}

.menu-item {
    padding: 24px 32px;
    border-bottom: 1px solid #f7f6f3;
    transition: background-color 0.2s ease;
}

.menu-item:last-child {
    border-bottom: none;
}

.menu-item:hover {
    background-color: #fafaf9;
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
    gap: 16px;
}

.item-name {
    font-size: 18px;
    font-weight: 600;
    color: #37352f;
    line-height: 1.3;
    flex: 1;
}

.item-price {
    font-size: 18px;
    font-weight: 600;
    color: #37352f;
    white-space: nowrap;
}

.item-description {
    color: #787774;
    line-height: 1.5;
    margin-bottom: 12px;
}

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

.allergen-icon {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: 1px solid #e9e9e7;
    background: #ffffff;
    padding: 2px;
}

/* Allergen Information */
.allergens-info {
    padding: 80px 0;
    background: #f7f6f3;
}

.section-header {
    text-align: center;
    margin-bottom: 48px;
}

.section-header h2 {
    font-size: 32px;
    font-weight: 700;
    color: #37352f;
    margin-bottom: 12px;
}

.section-header p {
    font-size: 18px;
    color: #787774;
    max-width: 600px;
    margin: 0 auto;
}

.allergen-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
    max-width: 1000px;
    margin: 0 auto;
}

.allergen-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #ffffff;
    padding: 16px;
    border-radius: 8px;
    border: 1px solid #e9e9e7;
    transition: all 0.2s ease;
}

.allergen-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.allergen-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid #e9e9e7;
    background: #ffffff;
    padding: 4px;
}

.allergen-item span {
    font-weight: 500;
    color: #37352f;
}

/* Allergen Legend */
.allergen-legend {
    padding: 40px 0;
    background: #f7f6f3;
    border-top: 1px solid #e9e9e7;
}

.allergen-legend h3 {
    text-align: center;
    font-size: 20px;
    font-weight: 600;
    color: #37352f;
    margin-bottom: 24px;
}

.allergen-grid-small {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 固定为4列 */
    gap: 12px;
    max-width: 1000px;
    margin: 0 auto;
}

.allergen-item-small {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #ffffff;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #e9e9e7;
    font-size: 12px;
}

.allergen-icon-small {
    width: 20px;
    height: 20px;
    border-radius: 3px;
    border: 1px solid #e9e9e7;
    background: #ffffff;
    padding: 2px;
}

.allergen-item-small span {
    font-weight: 500;
    color: #37352f;
    white-space: normal;       /* 允许换行 */
    word-break: break-word;    /* 单词内也可断行 */
    overflow-wrap: anywhere;   /* 更积极的断行 */
}

/* Footer */
.footer {
    background: #37352f;
    color: #ffffff;
    padding: 48px 0 24px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 32px;
    margin-bottom: 32px;
    padding: 0 24px;
}

.footer-section h3,
.footer-section h4 {
    margin-bottom: 16px;
    font-weight: 600;
}

.footer-section h3 {
    font-size: 20px;
}

.footer-section h4 {
    font-size: 16px;
}

.footer-section p {
    color: #a8a29e;
    line-height: 1.6;
    margin-bottom: 8px;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 8px;
}

.footer-section ul li a {
    color: #a8a29e;
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-section ul li a:hover {
    color: #ffffff;
}

.footer-bottom {
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid #525047;
    color: #a8a29e;
}

/* Loading State */
.loading {
    text-align: center;
    padding: 60px 0;
    color: #787774;
    font-size: 18px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }
    
    .header-content {
        flex-direction: row;
        justify-content: space-between;
        gap: 0;
        text-align: left;
    }
    
    .nav {
        gap: 16px;
    }
    
    .hero {
        padding: 60px 0;
    }
    
    .hero-title {
        font-size: 36px;
    }
    
    .hero-description {
        font-size: 16px;
    }
    
    .hero-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 280px;
        justify-content: center;
    }
    
    .features {
        padding: 60px 0;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .feature-card {
        padding: 24px;
    }
    
    .menu-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
        padding: 0 16px;
    }
    
    .menu-header {
        padding: 40px 0 30px;
    }
    
    .menu-header h1 {
        font-size: 32px;
    }
    
    .menu-controls {
        gap: 16px;
    }
    
    .filter-buttons {
        gap: 6px;
    }
    
    .filter-btn {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .category-header,
    .menu-item {
        padding: 20px;
    }
    
    .category-title {
        font-size: 20px;
    }
    
    .item-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .item-name {
        font-size: 16px;
    }
    
    .item-price {
        font-size: 16px;
        align-self: flex-end;
    }
    
    .allergen-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .allergen-grid-small {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 8px;
    }
    
    .allergen-item-small {
        padding: 6px 8px;
        font-size: 11px;
    }
    
    .allergen-icon-small {
        width: 16px;
        height: 16px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 24px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 28px;
    }
    
    .menu-header h1 {
        font-size: 28px;
    }
    
    .category-header,
    .menu-item {
        padding: 16px;
    }
    
    .menu-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .allergen-grid-small {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Focus styles for accessibility */
.btn:focus,
.nav-link:focus,
.search-input:focus,
.filter-btn:focus {
    outline: 2px solid #37352f;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .header,
    .footer,
    .menu-controls {
        display: none;
    }
    
    .menu-item {
        break-inside: avoid;
    }
}