/*
 * 前台样式
 * 开发机构：西和县涵光阁传媒工作室
 * 官网：www.gshgg.cn
 * 版权所有：智慧餐厅点餐系统
 * 注意：智慧餐厅点餐系统最终解释权隶属于西和县涵光阁传媒工作室；二开系统不可商业使用；请购买正版软件
 */

/* ========== 前台样式 ========== */
:root {
    --primary: #ff6b35;
    --primary-dark: #e55a2b;
    --primary-light: #fff3ee;
    --secondary: #2d3436;
    --bg: #f8f9fa;
    --card-bg: #ffffff;
    --text: #2d3436;
    --text-light: #636e72;
    --border: #eee;
    --shadow: 0 2px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
    --radius: 12px;
    --radius-sm: 8px;
}

* { box-sizing: border-box; }

body.customer-body {
    background: var(--bg);
    color: var(--text);
    padding-bottom: 80px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
}

/* 导航 */
.customer-nav {
    background: linear-gradient(135deg, var(--primary) 0%, #ff8a5c 100%);
    color: white;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(255,107,53,0.3);
}

/* 分类滚动 */
.category-scroll {
    background: white;
    padding: 12px 0;
    overflow-x: auto;
    white-space: nowrap;
    position: sticky;
    top: 52px;
    z-index: 99;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    scrollbar-width: none;
}
.category-scroll::-webkit-scrollbar { display: none; }

.category-chip {
    display: inline-block;
    padding: 6px 18px;
    border-radius: 20px;
    background: #f1f3f5;
    color: var(--text);
    text-decoration: none;
    font-size: 0.9rem;
    margin-right: 8px;
    transition: all 0.2s;
    flex-shrink: 0;
}
.category-chip:hover {
    background: var(--primary-light);
    color: var(--primary);
}
.category-chip.active {
    background: var(--primary);
    color: white;
}

/* 公告栏 */
.notice-bar {
    background: #fff8f0;
    border: 1px solid #ffe0cc;
    border-radius: var(--radius-sm);
    padding: 8px 14px;
    font-size: 0.85rem;
    color: #d35400;
    display: flex;
    align-items: center;
    gap: 8px;
    overflow: hidden;
}

/* 菜品卡片 */
.menu-grid { padding-top: 12px; }

.menu-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
    height: 100%;
    display: flex;
    flex-direction: column;
}
.menu-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.menu-card-img {
    position: relative;
    padding-top: 75%;
    background: #f1f3f5;
    overflow: hidden;
}
.menu-card-img img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.menu-card-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: #ddd;
}

.menu-tags {
    position: absolute;
    top: 8px;
    left: 8px;
    display: flex;
    gap: 4px;
}
.tag {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: bold;
}
.tag-hot { background: #ff4757; color: white; }
.tag-new { background: #2ed573; color: white; }
.tag-rec { background: #ffa502; color: white; }

.spicy-level {
    position: absolute;
    bottom: 8px;
    right: 8px;
    font-size: 0.75rem;
}

.menu-card-body {
    padding: 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.menu-card-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 4px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.menu-card-desc {
    font-size: 0.78rem;
    color: var(--text-light);
    margin-bottom: 8px;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.menu-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.price { color: var(--primary); font-weight: bold; font-size: 1.1rem; }
.original-price {
    font-size: 0.75rem;
    color: #aaa;
    text-decoration: line-through;
    margin-left: 4px;
}

.btn-add-cart {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--primary);
    color: white;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
}
.btn-add-cart:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
}
.btn-add-cart:active {
    transform: scale(0.95);
}

/* 购物车底部栏 */
.cart-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    padding: 12px 0;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
    z-index: 200;
}

.cart-info {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}
.cart-icon-wrap {
    position: relative;
    width: 48px;
    height: 48px;
    background: var(--secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.3rem;
}
.cart-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--primary);
    color: white;
    font-size: 0.7rem;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}
.cart-total {
    font-weight: bold;
    font-size: 1.2rem;
    color: var(--primary);
}
.cart-hint {
    display: block;
    font-size: 0.75rem;
    color: var(--text-light);
}

.btn-order {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 28px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-order:hover { background: var(--primary-dark); }

/* 购物车详情 */
.cart-detail-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 250;
    display: none;
}
.cart-detail-overlay.show { display: block; }

.cart-detail {
    position: fixed;
    bottom: -100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 16px 16px 0 0;
    z-index: 300;
    max-height: 60vh;
    transition: bottom 0.3s;
    overflow: hidden;
}
.cart-detail.show { bottom: 0; }

.cart-detail-header {
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
}
.cart-detail-body {
    padding: 0 16px 16px;
    max-height: 45vh;
    overflow-y: auto;
}

.cart-item {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f5f5f5;
}
.cart-item-info { flex: 1; }
.cart-item-name { font-weight: 600; font-size: 0.95rem; }
.cart-item-price { color: var(--primary); font-size: 0.85rem; }

.quantity-ctrl {
    display: flex;
    align-items: center;
    gap: 8px;
}
.qty-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid #ddd;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.9rem;
}
.qty-btn:hover { background: #f5f5f5; }
.qty-num {
    min-width: 24px;
    text-align: center;
    font-weight: bold;
}

/* 订单摘要 */
.order-summary {
    background: #f8f9fa;
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-top: 12px;
}

/* 店铺信息页 */
.shop-info-card {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}
.shop-info-row {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f5f5f5;
}
.shop-info-row:last-child { border: none; }
.shop-info-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    flex-shrink: 0;
}

/* 订单历史页 */
.order-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 16px;
}
.order-card-header {
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
    border-bottom: 1px solid var(--border);
}
.order-card-body { padding: 16px; }
.order-item-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 0.9rem;
}
.order-card-footer {
    padding: 12px 16px;
    background: #fafafa;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}
.empty-state i { font-size: 3rem; margin-bottom: 16px; display: block; }

/* 响应式 */
@media (max-width: 576px) {
    .menu-card-title { font-size: 0.88rem; }
    .menu-card-desc { font-size: 0.72rem; }
    .price { font-size: 1rem; }
}
