:root {
    --green: #1f8a4c;
    --green-dark: #166b3a;
    --bg: #f3f6f3;
    --text: #1c2b1f;
    --muted: #6b7c70;
    --line: #e2ebe3;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px));
    -webkit-tap-highlight-color: rgba(31, 138, 76, .15);
}
body.has-cart-bar {
    padding-bottom: calc(120px + env(safe-area-inset-bottom, 0px));
}
.shop-sticky {
    position: sticky;
    top: 0;
    z-index: 30;
    background: var(--green);
}
.shop-head {
    background: var(--green);
    color: #fff;
    padding: 12px 16px 8px;
}
.shop-head h1 { margin: 0; font-size: 18px; }
.head-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.head-link { color: #fff; font-size: 14px; font-weight: 600; text-decoration: none; padding: 6px 0; }
.shop-head p { margin: 4px 0 8px; font-size: 12px; opacity: .9; }
.who {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin: 6px 0 8px;
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(0,0,0,.18);
    font-size: 13px;
}
.who a { color: #f6c344; font-weight: 600; }
.unit {
    display: block;
    padding: 12px 4px;
    border-bottom: 1px solid var(--line);
    color: var(--text);
    text-decoration: none;
}
.unit b { display: block; }
.unit .muted { font-size: 12px; }
.search {
    width: 100%;
    border: 0;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 16px;
    background: #fff;
    color: var(--text);
}
.cats {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    background: #fff;
    border-bottom: 1px solid var(--line);
    padding: 0 8px;
}
.cat-btn {
    flex: 0 0 auto;
    padding: 12px 14px;
    color: var(--muted);
    background: none;
    border: 0;
    border-bottom: 2px solid transparent;
    font-size: 15px;
    cursor: pointer;
}
.cat-btn.active { color: var(--green); border-color: var(--green); font-weight: 600; }
.section { padding: 8px 12px 16px; }
.section h2 {
    font-size: 14px;
    color: var(--green-dark);
    margin: 14px 4px 8px;
}
.item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 8px;
    border: 1px solid var(--line);
}
.item .name { font-size: 16px; font-weight: 600; }
.item .meta { font-size: 13px; color: var(--muted); margin-top: 4px; }
.item .price { color: #c0392b; font-weight: 700; }
.plus {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 0;
    background: var(--green);
    color: #fff;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
}
.plus:disabled { opacity: .5; }
.cart-bar {
    position: fixed; left: 0; right: 0;
    bottom: calc(56px + env(safe-area-inset-bottom, 0px));
    z-index: 40;
    background: #16351f;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px 10px 16px;
}
.cart-bar .info { font-size: 14px; }
.cart-bar .info b { font-size: 18px; }
.cart-bar a {
    background: #f6c344;
    color: #16351f;
    font-weight: 700;
    padding: 12px 18px;
    border-radius: 8px;
    text-decoration: none;
}
.tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    display: flex;
    background: #fff;
    border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom, 0px);
}
.tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    height: 56px;
    color: var(--muted);
    text-decoration: none;
    font-size: 11px;
    position: relative;
}
.tab svg { width: 22px; height: 22px; }
.tab.active { color: var(--green); font-weight: 600; }
.tab-badge {
    position: absolute;
    top: 4px;
    right: calc(50% - 22px);
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: #c0392b;
    color: #fff;
    font-size: 10px;
    line-height: 16px;
    text-align: center;
    font-style: normal;
    font-weight: 700;
}
.page { padding: 14px; }
.card { background: #fff; border-radius: 10px; padding: 14px; margin-bottom: 10px; }
.row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); }
label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }
input, select, textarea {
    width: 100%; padding: 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 16px;
}
.btn {
    width: 100%;
    margin-top: 16px;
    background: var(--green);
    color: #fff;
    border: 0;
    border-radius: 10px;
    padding: 12px;
    font-size: 16px;
    font-weight: 700;
}
.qty {
    display: flex; align-items: center; gap: 8px;
}
.qty button {
    width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line); background: #fff;
}
.flash { background: #e8f7ee; color: #166b3a; padding: 8px 12px; margin: 8px 12px; border-radius: 8px; }
.ok-box { text-align: center; padding: 40px 16px; }
.ok-box h1 { color: var(--green); }
.muted { color: var(--muted); font-size: 13px; }
.order-card { display: block; color: inherit; text-decoration: none; }
.status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
    background: #eee;
    color: var(--text);
}
.status.pending_pick,
.status.pending_delivery { background: #fff3cd; color: #856404; }
.status.picked { background: #dbeafe; color: #1e40af; }
.status.delivering { background: #fce7f3; color: #9d174d; }
.status.cancelled { background: #f3f4f6; color: #6b7280; }
