/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.text-center {
    text-align: center;
}

/* 导航栏样式 */
.navbar {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 20px;
}

.nav-logo a {
    font-size: 1.5rem;
    font-weight: bold;
    color: #e74c3c;
    text-decoration: none;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: color 0.3s;
    position: relative;
}

.nav-link:hover {
    color: #e74c3c;
}

.cart-badge {
    background: #e74c3c;
    color: white;
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 0.8rem;
    margin-left: 5px;
}

/* 主内容区域 */
.main-content {
    min-height: calc(100vh - 140px);
}

/* 页脚样式 */
.footer {
    background: #333;
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
}

.footer-content p {
    margin-bottom: 0.5rem;
}
.footer-content p:last-child {
    margin-bottom: 0;
    font-size: 0.9rem;
    opacity: 0.8;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.btn-primary {
    background: #e74c3c;
    color: white;
}

.btn-primary:hover {
    background: #c0392b;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #3498db;
    color: white;
}

.btn-secondary:hover {
    background: #2980b9;
}

.btn-outline {
    background: transparent;
    border: 2px solid #e74c3c;
    color: #e74c3c;
}

.btn-outline:hover {
    background: #e74c3c;
    color: white;
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.9rem;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-disabled {
    background: #bdc3c7;
    color: #7f8c8d;
    cursor: not-allowed;
}

/* 首页样式 */
.hero-section {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    padding: 4rem 0;
    text-align: center;
}

.hero-content h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.features-section {
    padding: 4rem 0;
    background: white;
}

.features-section h2 {
    text-align: center;
    margin-bottom: 3rem;
    font-size: 2.5rem;
    color: #333;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.feature-card {
    text-align: center;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease-out;
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    margin-bottom: 1rem;
    color: #333;
}

.quick-menu-section {
    padding: 4rem 0;
    background: #f8f9fa;
}

.quick-menu-section h2 {
    text-align: center;
    margin-bottom: 3rem;
    font-size: 2.5rem;
    color: #333;
}

.menu-preview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.menu-item-preview {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease-out;
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

.menu-item-preview:hover {
    transform: translateY(-5px);
}

.item-image img {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.item-info {
    padding: 1rem;
}

.item-info h4 {
    margin-bottom: 0.5rem;
    color: #333;
}

.item-price {
    color: #e74c3c;
    font-weight: bold;
    margin-bottom: 1rem;
}

/* 菜单页面样式 */
.menu-header {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    padding: 3rem 0;
    text-align: center;
}

.menu-header h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.menu-container {
    padding: 3rem 0;
}

.category-section {
    margin-bottom: 4rem;
}

.category-title {
    font-size: 2rem;
    color: #333;
    margin-bottom: 2rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid #e74c3c;
}

.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.menu-item-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease-out;
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

.menu-item-card:hover {
    transform: translateY(-5px);
}

.item-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.item-content {
    padding: 1.5rem;
}

.item-name {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: #333;
}

.item-description {
    color: #666;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* 浮动购物车 */
.floating-cart {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
}

.floating-cart-btn {
    display: flex;
    align-items: center;
    background: #e74c3c;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 50px;
    text-decoration: none;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    transition: all 0.3s;
    font-weight: bold;
}

.floating-cart-btn:hover {
    background: #c0392b;
    transform: scale(1.05);
}

.floating-badge {
    background: white;
    color: #e74c3c;
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 0.8rem;
    margin-left: 8px;
}

/* 购物车页面样式 */
.cart-header {
    background: linear-gradient(135deg, #27ae60, #229954);
    color: white;
    padding: 3rem 0;
    text-align: center;
}

.cart-container {
    padding: 3rem 0;
}

.cart-items {
    margin-bottom: 3rem;
}

.cart-item {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.item-info h3 {
    margin-bottom: 0.5rem;
    color: #333;
}

.item-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.quantity-form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quantity-controls {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 5px;
    overflow: hidden;
}

.quantity-btn {
    background: #f8f9fa;
    border: none;
    padding: 5px 10px;
    cursor: pointer;
    font-weight: bold;
}

.quantity-input {
    width: 50px;
    text-align: center;
    border: none;
    border-left: 1px solid #ddd;
    border-right: 1px solid #ddd;
    padding: 5px;
}

.item-total {
    font-weight: bold;
    color: #e74c3c;
}

.cart-summary {
    background: white;
    border-radius: 10px;
    padding: 2rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.summary-card h3 {
    margin-bottom: 1.5rem;
    color: #333;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
}

.total-amount {
    font-size: 1.5rem;
    color: #e74c3c;
    font-weight: bold;
}

.summary-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.empty-cart {
    text-align: center;
    padding: 4rem 0;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 2rem;
    opacity: 0.5;
}

.empty-cart h2 {
    margin-bottom: 1rem;
    color: #333;
}

/* 结账页面样式 */
.checkout-header {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    color: white;
    padding: 3rem 0;
    text-align: center;
}

.checkout-container {
    padding: 3rem 0;
}

.checkout-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
}

.checkout-form-section {
    background: white;
    border-radius: 10px;
    padding: 2rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.checkout-form-section h2 {
    margin-bottom: 2rem;
    color: #333;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.3);
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.order-summary-section {
    background: white;
    border-radius: 10px;
    padding: 2rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    height: fit-content;
}

.order-summary-section h2 {
    margin-bottom: 1.5rem;
    color: #333;
}

.order-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
}

.order-total {
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 2px solid #e74c3c;
    font-size: 1.2rem;
}

.order-notes {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #eee;
}

.order-notes h3 {
    margin-bottom: 1rem;
    color: #333;
}

.order-notes ul {
    list-style: none;
    padding-left: 0;
}

.order-notes li {
    margin-bottom: 0.5rem;
    padding-left: 1.5rem;
    position: relative;
}

.order-notes li:before {
    content: "•";
    color: #e74c3c;
    position: absolute;
    left: 0;
}

/* 订单确认页面样式 */
.confirmation-header {
    background: linear-gradient(135deg, #27ae60, #229954);
    color: white;
    padding: 3rem 0;
    text-align: center;
}

.confirmation-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.order-id {
    font-size: 1.2rem;
    opacity: 0.9;
}

.confirmation-container {
    padding: 3rem 0;
}

.confirmation-card {
    background: white;
    border-radius: 10px;
    padding: 3rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    max-width: 800px;
    margin: 0 auto;
}

.order-details h2 {
    margin-bottom: 2rem;
    color: #333;
    text-align: center;
}

.detail-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #eee;
}

.detail-section h3 {
    margin-bottom: 1rem;
    color: #333;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.detail-row .label {
    font-weight: 500;
    color: #666;
}

.detail-row .value {
    color: #333;
}

.order-item-detail {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    padding: 0.5rem 0;
}

.order-summary-detail {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 5px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.total-row {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 2px solid #e74c3c;
    font-size: 1.2rem;
    font-weight: bold;
}

.confirmation-actions {
    margin-top: 3rem;
    text-align: center;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.contact-info {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 5px;
    text-align: center;
}

.contact-info h3 {
    margin-bottom: 1rem;
    color: #333;
}

/* 订单列表页面样式 */
.orders-header {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
    padding: 3rem 0;
    text-align: center;
}

.orders-container {
    padding: 3rem 0;
}

.orders-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.order-card {
    background: white;
    border-radius: 10px;
    padding: 2rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.order-info h3 {
    margin-bottom: 0.5rem;
    color: #333;
}

.order-time {
    color: #666;
    font-size: 0.9rem;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
}

.status-pending .status-badge {
    background: #f39c12;
    color: white;
}

.status-preparing .status-badge {
    background: #3498db;
    color: white;
}

.status-ready .status-badge {
    background: #27ae60;
    color: white;
}

.status-completed .status-badge {
    background: #95a5a6;
    color: white;
}

.order-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 1.5rem;
}

.customer-info h4,
.order-items h4 {
    margin-bottom: 1rem;
    color: #333;
}

.items-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.order-item {
    display: flex;
    justify-content: space-between;
    padding: 0.25rem 0;
}

.special-requests {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 5px;
    font-size: 0.9rem;
}

.order-footer {
    display: flex;
    justify-content: flex-end;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.empty-orders {
    text-align: center;
    padding: 4rem 0;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 2rem;
    opacity: 0.5;
}

.empty-orders h2 {
    margin-bottom: 1rem;
    color: #333;
}

.orders-actions {
    padding: 2rem 0;
}

/* 搜索栏样式 */
.menu-search-container {
    background: white;
    padding: 1.5rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}

.search-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.search-input-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.search-input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.3);
}

.search-btn {
    padding: 12px 20px;
    font-weight: bold;
}

.search-clear-btn {
    padding: 12px 20px;
}

.search-icon {
    margin-right: 5px;
}

.search-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.search-type-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.search-type-selector label {
    font-weight: 500;
    color: #333;
}

.search-type-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: white;
    font-size: 0.9rem;
}

.search-results-info {
    background: #f8f9fa;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    color: #666;
}

.search-results-info span {
    font-weight: bold;
    color: #e74c3c;
}

/* 分类导航菜单样式 */
.category-nav-container {
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 70px; /* 在主导航栏下方 */
    z-index: 999;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}

.category-nav {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.category-nav-list {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 0;
}

.category-nav-item {
    flex-shrink: 0;
}

.category-nav-link {
    display: block;
    padding: 1rem 1.5rem;
    text-decoration: none;
    color: #333;
    font-weight: 500;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.category-nav-link:hover {
    color: #e74c3c;
    background: #f8f9fa;
}

.category-nav-link.active {
    color: #e74c3c;
    border-bottom-color: #e74c3c;
    background: #fff5f5;
}

/* 菜单页面样式 */
.menu-header {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    padding: 3rem 0;
    text-align: center;
}

.menu-header h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.menu-container {
    padding: 2rem 0;
}

.category-section {
    margin-bottom: 4rem;
    scroll-margin-top: 140px; /* 导航菜单高度 + 主菜单高度 */
}

.category-title {
    font-size: 2rem;
    color: #333;
    margin-bottom: 2rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid #e74c3c;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .category-nav-container {
        top: 60px;
    }
    
    .category-nav-link {
        padding: 0.8rem 1rem;
        font-size: 0.9rem;
    }
    
    .category-section {
        scroll-margin-top: 120px;
    }
    
    .nav-menu {
        gap: 1rem;
    }
    
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .checkout-layout {
        grid-template-columns: 1fr;
    }
    
    .order-details {
        grid-template-columns: 1fr;
    }
    
    .cart-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    /* 热门菜品闪动问题修复 - 全局优化 */
    html {
        scroll-behavior: smooth;
    }
    
    body {
        overflow-x: hidden;
    }
    
    /* 为闪动板块添加特定修复 */
    .quick-menu-section,
    .menu-container {
        transform: translate3d(0, 0, 0);
        will-change: transform;
    }
    
    /* 优化所有卡片元素的渲染性能 */
    .menu-item-preview,
    .menu-item-card,
    .feature-card {
        will-change: transform;
    }
    
    /* 防止图片加载导致的布局抖动 */
    .item-image img {
        display: block;
        width: 100%;
        height: auto;
    }
    
    .item-controls {
        width: 100%;
        justify-content: space-between;
    }
    
    .hero-buttons,
    .action-buttons,
    .summary-actions,
    .form-actions {
        flex-direction: column;
    }
    
    .floating-cart {
        bottom: 1rem;
        right: 1rem;
    }
    
    .confirmation-card {
        padding: 2rem;
        margin: 0 1rem;
    }
}

/* 搜索建议下拉菜单样式 */
.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.search-suggestion-item {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background-color 0.2s;
}

.search-suggestion-item:hover {
    background-color: #f8f9fa;
}

.search-suggestion-item:last-child {
    border-bottom: none;
}

.search-suggestion-item.no-results {
    color: #999;
    cursor: default;
}

.search-suggestion-item.no-results:hover {
    background-color: transparent;
}

.suggestion-item-name {
    font-weight: 500;
    color: #333;
    margin-bottom: 4px;
}

.suggestion-item-details {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: #666;
}

.suggestion-item-price {
    color: #e74c3c;
    font-weight: bold;
}

.suggestion-item-category {
    background: #f1f1f1;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
}

/* 菜品高亮效果 */
.menu-item-card.highlight {
    animation: highlight-pulse 2s ease;
    box-shadow: 0 0 0 2px #e74c3c;
}

@keyframes highlight-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(231, 76, 60, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(231, 76, 60, 0);
    }
}
