/* Reset & Base */
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; background-color: #f7f8fa; color: #333; padding-bottom: 60px; max-width: 480px; margin: 0 auto; min-height: 100vh; position: relative; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

/* Variables */
:root {
    --primary-color: #00c250; /* WeChat Green-ish */
    --secondary-color: #ff9900;
    --text-color: #333;
    --gray-bg: #f5f5f5;
    --border-color: #eee;
}

/* Layout Helpers */
.container { padding: 10px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }
.text-center { text-align: center; }
.font-bold { font-weight: bold; }
.text-xs { font-size: 12px; }
.text-sm { font-size: 14px; }
.text-lg { font-size: 18px; }
.text-red { color: #ff4d4f; }
.text-gray { color: #999; }
.bg-white { background: #fff; }
.rounded { border-radius: 8px; }
.shadow { box-shadow: 0 2px 4px rgba(0,0,0,0.05); }

/* Header */
.header { position: sticky; top: 0; z-index: 100; background: #fff; padding: 10px 15px; display: flex; align-items: center; justify-content: space-between; box-shadow: 0 1px 2px rgba(0,0,0,0.05); }
.search-bar { background: #f5f5f5; border-radius: 20px; padding: 6px 15px; flex: 1; margin: 0 10px; color: #999; font-size: 13px; display: flex; align-items: center; }

/* Banner */
.banner { margin: 10px; border-radius: 12px; overflow: hidden; position: relative; background: #333; color: #fff; min-height: 150px; }
.banner img { width: 100%; height: 100%; object-fit: cover; }

/* Grid Menu */
.grid-menu { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 15px; background: #fff; margin-bottom: 10px; }
.menu-item { display: flex; flex-direction: column; align-items: center; font-size: 12px; color: #666; }
.menu-icon { width: 40px; height: 40px; margin-bottom: 5px; border-radius: 10px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 20px; }

/* Product List (Home) */
.section-title { padding: 15px; font-weight: bold; font-size: 16px; display: flex; align-items: center; }
.section-title::before { content: ''; display: inline-block; width: 4px; height: 16px; background: var(--secondary-color); margin-right: 8px; border-radius: 2px; }
.product-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 0 10px 10px; }
.product-card { background: #fff; border-radius: 8px; overflow: hidden; padding-bottom: 8px; position: relative; }
.product-img { width: 100%; padding-top: 100%; position: relative; background: #eee; }
.product-img img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; }
.product-info { padding: 8px; }
.product-name { font-size: 12px; height: 32px; overflow: hidden; margin-bottom: 4px; line-height: 1.3; }
.product-price { color: #ff4d4f; font-weight: bold; font-size: 14px; }
.add-btn { position: absolute; bottom: 8px; right: 8px; width: 20px; height: 20px; border: 1px solid #ff4d4f; border-radius: 50%; color: #ff4d4f; display: flex; align-items: center; justify-content: center; font-size: 14px; }

/* Category Page */
.category-layout { display: flex; height: calc(100vh - 110px); }
.sidebar { width: 85px; background: #f7f8fa; overflow-y: auto; }
.sidebar-item { padding: 15px 5px; text-align: center; font-size: 13px; color: #666; border-left: 3px solid transparent; }
.sidebar-item.active { background: #fff; color: #333; font-weight: bold; border-left-color: var(--secondary-color); }
.content-area { flex: 1; background: #fff; overflow-y: auto; padding: 10px; }
.cat-product-item { display: flex; margin-bottom: 15px; }
.cat-prod-img { width: 80px; height: 80px; border-radius: 8px; margin-right: 10px; background: #eee; }
.cat-prod-info { flex: 1; display: flex; flex-direction: column; justify-content: space-between; }

/* Form Styles */
.form-group { background: #fff; padding: 0 15px; margin-bottom: 10px; }
.form-item { display: flex; align-items: center; justify-content: space-between; padding: 15px 0; border-bottom: 1px solid #f5f5f5; font-size: 14px; }
.form-item:last-child { border-bottom: none; }
.form-label { color: #333; font-weight: 500; min-width: 80px; }
.form-input { flex: 1; text-align: right; border: none; outline: none; font-size: 14px; color: #333; background: transparent; }
.form-select { border: none; outline: none; background: transparent; color: #666; direction: rtl; }

/* Bottom Nav */
.bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; background: #fff; border-top: 1px solid #eee; height: 55px; display: flex; justify-content: space-around; align-items: center; z-index: 1000; max-width: 480px; margin: 0 auto; }
.nav-item { display: flex; flex-direction: column; align-items: center; color: #999; font-size: 10px; flex: 1; }
.nav-item.active { color: var(--text-color); } /* Changed active color to dark as per screenshot 5 */
.nav-icon { font-size: 22px; margin-bottom: 2px; }

/* Buttons */
.btn { display: inline-block; text-align: center; border-radius: 20px; padding: 8px 16px; font-size: 14px; cursor: pointer; }
.btn-primary { background: var(--primary-color); color: #fff; border: none; width: 100%; padding: 12px; font-size: 16px; font-weight: bold; border-radius: 25px; }
.btn-sm { padding: 4px 10px; font-size: 12px; }

/* Order Page Specific */
.qty-control { display: flex; align-items: center; }
.qty-btn { width: 24px; height: 24px; border-radius: 50%; background: #f0f0f0; display: flex; align-items: center; justify-content: center; font-weight: bold; color: #666; }
.qty-val { margin: 0 10px; font-weight: bold; }
.checkbox-custom { width: 16px; height: 16px; border: 1px solid #ccc; border-radius: 4px; display: flex; align-items: center; justify-content: center; margin-right: 5px; }
.checkbox-custom.checked { background: var(--primary-color); border-color: var(--primary-color); color: #fff; }

/* User Center */
.user-header { background: #fff; padding: 20px; display: flex; align-items: center; margin-bottom: 10px; }
.avatar { width: 60px; height: 60px; border-radius: 50%; background: #eee; margin-right: 15px; overflow: hidden; }
.user-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; background: #333; color: #fff; padding: 15px; margin: 10px; border-radius: 8px; }
.order-status-bar { display: flex; justify-content: space-around; background: #fff; padding: 15px 0; margin-bottom: 10px; }
.status-item { display: flex; flex-direction: column; align-items: center; font-size: 12px; color: #666; }
.status-icon { font-size: 24px; margin-bottom: 5px; color: #333; }
.menu-list { background: #fff; }
.menu-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; padding: 20px 10px; text-align: center; }
