/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 顶部导航栏 */
.header {
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

.logo h1 {
    color: #ff6700;
    font-size: 24px;
    font-weight: bold;
}

.search-box {
    flex: 1;
    max-width: 500px;
    margin: 0 20px;
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 10px 40px 10px 15px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 14px;
}

.search-box button {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 16px;
}

.user-actions {
    display: flex;
    align-items: center;
}

.action-item {
    display: flex;
    align-items: center;
    margin-left: 20px;
    color: #666;
    text-decoration: none;
    transition: color 0.3s ease;
}

.action-item:hover {
    color: #ff6700;
}

.action-item i {
    margin-right: 5px;
}

.action-item.active {
    color: #ff6700;
    font-weight: bold;
}

/* 购物车按钮 */
.cart-btn {
    cursor: pointer;
    position: relative;
}

/* 购物车弹窗 */
.cart-popup {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 380px;
    background: #fff;
    box-shadow: -2px 0 10px rgba(0,0,0,0.1);
    z-index: 2000;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.cart-popup.active {
    transform: translateX(0);
}

.cart-popup-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.cart-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.cart-popup-header h3 {
    font-size: 18px;
    font-weight: bold;
}

.close-btn {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #999;
    transition: color 0.3s ease;
}

.close-btn:hover {
    color: #333;
}

.cart-popup-body {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
}

.cart-popup-shop-section {
    margin-bottom: 20px;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 10px;
}

.cart-popup-shop-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.cart-popup-shop-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid #f0f0f0;
}

.cart-popup-shop-name {
    font-size: 14px;
    font-weight: bold;
    color: #333;
}

.cart-popup-item {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.3s ease;
}

.cart-popup-item:hover {
    background: #f9f9f9;
    border-radius: 8px;
    padding-left: 10px;
}

.cart-popup-item:last-child {
    border-bottom: none;
}

.cart-popup-item img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    margin-right: 10px;
}

.cart-popup-item-info {
    flex: 1;
}

.cart-popup-item-name {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 5px;
    color: #333;
}

.cart-popup-item-price {
    color: #ff6700;
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 5px;
}

.cart-popup-item-quantity {
    display: flex;
    align-items: center;
}

.cart-popup-item-quantity button {
    width: 24px;
    height: 24px;
    border: 1px solid #ddd;
    background: #f5f5f5;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.cart-popup-item-quantity button:hover {
    background: #e0e0e0;
}

.cart-popup-item-quantity span {
    margin: 0 10px;
    min-width: 20px;
    text-align: center;
    font-size: 14px;
}

.cart-popup-item-delete {
    background: none;
    border: none;
    color: #999;
    font-size: 14px;
    cursor: pointer;
    transition: color 0.3s ease;
    margin-left: 10px;
}

.cart-popup-item-delete:hover {
    color: #ff4757;
}

.cart-popup-empty {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.cart-popup-empty i {
    font-size: 40px;
    margin-bottom: 10px;
}

.cart-popup-footer {
    padding: 15px;
    border-top: 1px solid #f0f0f0;
    background: #fff;
}

.cart-popup-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.cart-popup-total span:first-child {
    font-size: 16px;
    color: #666;
}

.cart-popup-total-price {
    font-size: 20px;
    font-weight: bold;
    color: #ff6700;
}

.cart-popup-checkout {
    width: 100%;
    background: #ff6700;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 12px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cart-popup-checkout:hover {
    background: #ff8533;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 103, 0, 0.3);
}

.cart-popup-checkout:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .cart-popup {
        width: 100%;
    }
}

/* 分类导航 */
.category-nav {
    background-color: #fff;
    border-bottom: 1px solid #f0f0f0;
    padding: 10px 0;
    overflow-x: auto;
    white-space: nowrap;
}

.category-list {
    display: flex;
    list-style: none;
}

.category-list li {
    margin-right: 20px;
}

.category-list li a {
    display: flex;
    align-items: center;
    padding: 8px 15px;
    color: #666;
    text-decoration: none;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.category-list li a:hover {
    background-color: #f5f5f5;
    color: #ff6700;
}

.category-list li.active a {
    background-color: #ff6700;
    color: #fff;
}

.category-list li a i {
    margin-right: 5px;
}

/* 主要内容区域 */
.main-content {
    padding: 20px 0;
}

/* 店铺列表 */
.shop-list {
    margin-bottom: 30px;
}

.shop-list h2 {
    font-size: 20px;
    margin-bottom: 15px;
    color: #333;
}

.shop-item {
    display: flex;
    background-color: #fff;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    text-decoration: none;
    color: #333;
}

.shop-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.shop-item.active {
    border-left: 4px solid #ff6700;
}

.shop-info {
    flex: 1;
    margin-right: 15px;
}

.shop-info h3 {
    font-size: 16px;
    margin-bottom: 10px;
    font-weight: bold;
}

.shop-meta {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    font-size: 14px;
    color: #999;
}

.shop-meta span {
    margin-right: 15px;
}

.shop-meta .rating {
    color: #ff9800;
}

.shop-tags {
    display: flex;
    flex-wrap: wrap;
}

.tag {
    background-color: #f5f5f5;
    color: #666;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 10px;
    margin-right: 8px;
    margin-bottom: 5px;
}

.shop-item img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
}

/* 商家信息 */
.shop-header {
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 15px 0;
}

.shop-header .shop-info {
    display: flex;
    flex-direction: column;
}

.back-btn {
    display: flex;
    align-items: center;
    color: #666;
    text-decoration: none;
    margin-bottom: 10px;
    font-size: 14px;
}

.back-btn i {
    margin-right: 5px;
}

.shop-header h2 {
    font-size: 20px;
    margin-bottom: 10px;
}

/* 菜单区域 */
.menu-main {
    padding: 20px 0;
}

.menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.menu-header h2 {
    font-size: 20px;
    color: #333;
}

.menu-tabs {
    display: flex;
    overflow-x: auto;
    white-space: nowrap;
}

.menu-tabs button {
    padding: 8px 15px;
    margin-left: 10px;
    border: 1px solid #ddd;
    background-color: #fff;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.menu-tabs button:hover {
    background-color: #f5f5f5;
    color: #ff6700;
}

.menu-tabs button.active {
    background-color: #ff6700;
    color: #fff;
    border-color: #ff6700;
}

/* 菜单项目 */
.menu-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
}

.menu-item {
    background-color: #fff;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.menu-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.menu-item img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 15px;
}

.menu-item-info h3 {
    font-size: 16px;
    margin-bottom: 8px;
    font-weight: bold;
}

.menu-item-info p {
    font-size: 14px;
    color: #999;
    margin-bottom: 15px;
    flex: 1;
}

.menu-item-price {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.menu-item-price .price {
    font-size: 18px;
    font-weight: bold;
    color: #ff6700;
}

.quantity-control {
    display: flex;
    align-items: center;
}

.quantity-control button {
    width: 30px;
    height: 30px;
    border: 1px solid #ddd;
    background-color: #f5f5f5;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.quantity-control button:hover {
    background-color: #e0e0e0;
}

.quantity-control button:disabled {
    color: #ccc;
    cursor: not-allowed;
}

.quantity-control .quantity {
    margin: 0 15px;
    min-width: 30px;
    text-align: center;
    font-size: 14px;
}

/* 底部购物车 */
.cart-bottom {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #fff;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    padding: 15px 0;
    z-index: 999;
}

.cart-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-total {
    display: flex;
    align-items: center;
}

.cart-total span:first-child {
    font-size: 14px;
    color: #666;
    margin-right: 10px;
}

.total-price {
    font-size: 20px;
    font-weight: bold;
    color: #ff6700;
}

.checkout-btn {
    background-color: #ff6700;
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 10px 30px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.checkout-btn:hover {
    background-color: #ff8533;
    transform: translateY(-2px);
}

.checkout-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    transform: none;
}



/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-20px); }
    60% { transform: translateY(-10px); }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header-content {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .search-box {
        order: 3;
        width: 100%;
        margin: 0;
    }
    
    .menu-items {
        grid-template-columns: 1fr;
    }
    
    .shop-item {
        flex-direction: column;
        text-align: center;
    }
    
    .shop-info {
        margin-right: 0;
        margin-bottom: 15px;
    }
    
    .shop-item img {
        width: 100%;
        height: 150px;
    }
    
    .cart-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .cart-item {
        flex-wrap: wrap;
    }
    
    .cart-item-info {
        width: calc(100% - 100px);
    }
    
    .cart-item-actions {
        width: 100%;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        margin-top: 10px;
    }
    
    .cart-item-quantity {
        margin-bottom: 0;
    }
    
    .cart-container {
        padding: 15px 0 50px;
    }
}

@media (max-width: 480px) {
    .header-content {
        padding: 10px 0;
    }
    
    .logo h1 {
        font-size: 20px;
    }
    
    .action-item {
        margin-left: 10px;
        font-size: 14px;
    }
    
    .category-list li {
        margin-right: 10px;
    }
    
    .category-list li a {
        padding: 6px 10px;
        font-size: 14px;
    }
    
    .menu-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .menu-tabs button {
        margin-left: 5px;
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .menu-item img {
        height: 120px;
    }
    
    .cart-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .checkout-btn {
        width: 100%;
        text-align: center;
    }
}