/* ============================================================
   微信诺便利 - 社区便利店 H5 自定义样式
   主题色: 便利店绿 #07c160 (微信绿, 也适合生鲜超市感)
   ============================================================ */

:root {
    --primary: #07c160;
    --primary-dark: #06ad56;
    --price: #fa5151;
    --text: #333;
    --text-light: #999;
    --bg: #f5f6f7;
}

body {
    font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
}

/* ---------- 顶部栏 ---------- */
/* 绿色渐变背景, 与首页轮播(banner svg)主色统一, 全站顶部风格一致
   使用较高优先级选择器(header .bui-bar), 覆盖 easybui 动态注入样式的默认蓝色 */
header .bui-bar {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
}
header .bui-bar .bui-bar-main {
    color: #fff;
}
header .bui-bar .bui-btn,
header .bui-bar .bui-btn-link {
    color: #fff;
}

/* 首页顶部: 楼栋标识胶囊(白字+半透明白底, 统一在绿色渐变上) */
.home-header .home-loc {
    background: rgba(255, 255, 255, 0.18);
    border-radius: 16px;
    padding: 6px 10px;
    display: flex;
    align-items: center;
    font-size: 12px;
    white-space: nowrap;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}
.home-header .home-loc i {
    margin-right: 4px;
}

/* 首页顶部右侧: 客服按钮(与楼栋标识对称, 同风格同配色) */
.home-header .bar-icon-btn {
    background: rgba(255, 255, 255, 0.18);
    border-radius: 16px;
    padding: 6px 10px;
    color: #fff;
    font-size: 12px;
    display: flex;
    align-items: center;
    white-space: nowrap;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}
.home-header .bar-icon-btn i {
    margin-right: 4px;
}

/* 首页顶部: 暂时隐藏楼栋标识与客服胶囊(保留节点, 便于后续恢复) */
.home-header .home-loc,
.home-header .bar-icon-btn {
    display: none;
}
.home-header .bui-bar-left,
.home-header .bui-bar-right {
    width: 0;
    padding: 0;
}

/* ---------- 首页搜索框 ---------- */
.home-search {
    padding: 8px 12px;
    background: var(--primary);
}
.home-search .search-box {
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 18px;
    height: 34px;
    padding: 0 12px;
    color: var(--text-light);
    font-size: 14px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}
.home-search .search-box i {
    margin-right: 6px;
    color: #bbb;
}

/* ---------- 轮播 ---------- */
#homeSlide {
    border-radius: 0;
}
.bui-slide .bui-slide-item {
    position: relative;
}

/* ---------- 分类宫格 ---------- */
.cat-grid {
    display: flex;
    flex-wrap: wrap;
    background: #fff;
    padding: 12px 0 6px;
}
.cat-grid .cat-item {
    width: 25%;
    text-align: center;
    padding: 10px 0;
}
.cat-grid .cat-icon {
    width: 52px;
    height: 52px;
    margin: 0 auto 6px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    background: #f0faf4;
}
.cat-grid .cat-name {
    font-size: 12px;
    color: var(--text);
}

/* ---------- 商品卡片(两列) ---------- */
.goods-grid {
    display: flex;
    flex-wrap: wrap;
    padding: 0 6px;
    background: var(--bg);
}
.goods-card {
    width: calc(50% - 12px);
    margin: 6px;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
}
.goods-card .goods-img {
    width: 100%;
    aspect-ratio: 1 / 1;
    display: block;
    background: #f7f8fa;
}
.goods-card .goods-info {
    padding: 8px 10px 10px;
}
.goods-card .goods-name {
    font-size: 14px;
    color: var(--text);
    line-height: 1.3;
    height: 36px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.goods-card .goods-sub {
    font-size: 11px;
    color: var(--text-light);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.goods-card .goods-bottom {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-top: 6px;
}
.price {
    color: var(--price);
    font-weight: bold;
    font-size: 16px;
}
.price .unit {
    font-size: 11px;
    font-weight: normal;
    color: var(--text-light);
    margin-left: 4px;
}
.price-old {
    color: #ccc;
    font-size: 11px;
    text-decoration: line-through;
    margin-left: 6px;
}
.add-cart-btn {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    line-height: 1;
}

/* ---------- 区块标题 ---------- */
.section-title {
    display: flex;
    align-items: center;
    padding: 12px 14px 6px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    background: var(--bg);
}
.section-title::before {
    content: "";
    width: 4px;
    height: 14px;
    border-radius: 2px;
    background: var(--primary);
    margin-right: 6px;
}

/* ---------- 分类页 ---------- */
.category-layout {
    display: flex;
    height: 100%;
}
.cat-left {
    width: 92px;
    background: #f7f8fa;
    overflow-y: auto;
}
.cat-left .cat-item {
    padding: 14px 10px;
    font-size: 13px;
    color: #666;
    text-align: center;
    border-left: 3px solid transparent;
}
.cat-left .cat-item.active {
    background: #fff;
    color: var(--primary);
    border-left-color: var(--primary);
    font-weight: 600;
}
.cat-right {
    flex: 1;
    background: #fff;
    overflow-y: auto;
    padding: 8px;
}

/* ---------- 购物车 ---------- */
.cart-item {
    display: flex;
    align-items: center;
    padding: 12px;
    background: #fff;
    border-bottom: 1px solid #f2f3f5;
}
.cart-check {
    margin-right: 10px;
}
.cart-item .goods-img {
    width: 76px;
    height: 76px;
    border-radius: 8px;
    margin-right: 10px;
    background: #f7f8fa;
}
.cart-item .cart-info {
    flex: 1;
    min-width: 0;
}
.cart-item .goods-name {
    font-size: 14px;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cart-item .goods-price {
    color: var(--price);
    font-weight: bold;
    margin-top: 6px;
}
.cart-empty {
    padding: 80px 0;
    text-align: center;
    color: #bbb;
}
.cart-empty .icon {
    font-size: 48px;
    display: block;
    margin-bottom: 10px;
}

/* 结算栏 */
.settle-bar {
    display: flex;
    align-items: center;
    background: #fff;
    padding: 8px 12px;
    border-top: 1px solid #eee;
}
.settle-bar .all-check {
    display: flex;
    align-items: center;
    font-size: 13px;
    color: #666;
    margin-right: auto;
}
.settle-bar .total {
    font-size: 13px;
    color: var(--text);
    margin-right: 12px;
}
.settle-bar .total .price {
    font-size: 18px;
}
.settle-btn {
    background: var(--primary);
    color: #fff;
    border-radius: 20px;
    padding: 8px 28px;
    font-size: 14px;
}

/* ---------- 确认订单 ---------- */
.address-card {
    display: flex;
    align-items: center;
    background: #fff;
    margin: 10px;
    padding: 14px;
    border-radius: 10px;
}
.address-card .addr-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f0faf4;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-right: 12px;
}
.address-card .addr-main {
    flex: 1;
    min-width: 0;
}
.address-card .addr-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}
.address-card .addr-detail {
    font-size: 13px;
    color: #666;
    margin-top: 3px;
}
.order-goods {
    background: #fff;
    margin: 0 10px 10px;
    border-radius: 10px;
    padding: 12px;
}
/* og-* 同时用于"确认订单"和"订单详情"两处商品清单, 故不挂在 .order-goods 下 */
.og-item {
    display: flex;
    padding: 6px 0;
    align-items: center;
}
.og-img {
    flex: 0 0 auto;
    width: 56px;
    height: 56px;
    border-radius: 6px;
    margin-right: 10px;
    background: #f7f8fa;
    object-fit: cover;
}
.og-name {
    flex: 1;
    font-size: 13px;
    color: var(--text);
}
.og-price {
    font-size: 13px;
    color: var(--text);
}
.amount-line {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 13px;
    color: #666;
}
.amount-line.total {
    font-weight: 600;
    color: var(--text);
    font-size: 14px;
    border-top: 1px dashed #eee;
    margin-top: 6px;
    padding-top: 10px;
}
.amount-line.total .price {
    font-size: 17px;
}

/* ---------- 订单卡片 ---------- */
.order-card {
    background: #fff;
    margin: 10px;
    border-radius: 10px;
    overflow: hidden;
}
.order-card .oc-head {
    display: flex;
    justify-content: space-between;
    padding: 10px 12px;
    font-size: 12px;
    color: var(--text-light);
    border-bottom: 1px solid #f5f5f5;
}
.order-card .oc-status {
    color: var(--primary);
    font-weight: 600;
}
.order-card .oc-body {
    display: flex;
    align-items: center;
    padding: 12px;
}
.order-card .oc-img {
    flex: 0 0 auto;
    width: 60px;
    height: 60px;
    border-radius: 6px;
    background: #f7f8fa;
    margin-right: 10px;
    object-fit: cover;
}
.order-card .oc-info {
    flex: 1;
    min-width: 0;
}
.order-card .oc-name {
    font-size: 14px;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.order-card .oc-count {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 4px;
}
.order-card .oc-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px 12px;
}
.order-card .oc-amount {
    font-size: 13px;
    color: var(--text);
}
.order-card .oc-actions {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
}
/* 订单列表 / 订单详情 操作按钮: 统一样式 */
.order-card .oc-actions .bui-btn,
#detailActions .bui-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto;
    height: 28px;
    line-height: 1;
    padding: 0 12px;
    font-size: 12px;
    border-radius: 15px;
    white-space: nowrap;
    text-align: center;
}
.order-card .oc-actions .bui-btn {
    margin-left: 8px;
}

/* ---------- 订单详情 ---------- */
.order-status-banner {
    background: var(--primary);
    color: #fff;
    padding: 20px 16px;
}
.order-status-banner .os-title {
    font-size: 18px;
    font-weight: 600;
}
.order-status-banner .os-tip {
    font-size: 12px;
    opacity: 0.85;
    margin-top: 4px;
}
.info-card {
    background: #fff;
    margin: 10px;
    border-radius: 10px;
    padding: 14px;
}
.info-card .ic-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
}
.info-card .ic-title::before {
    content: "";
    width: 4px;
    height: 14px;
    border-radius: 2px;
    background: var(--primary);
    margin-right: 6px;
}
.info-line {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 13px;
    color: #666;
}

/* ---------- 我的页面 ---------- */
.user-banner {
    background: var(--primary);
    padding: 24px 16px 20px;
    display: flex;
    align-items: center;
    color: #fff;
}
.user-banner .avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin-right: 14px;
    overflow: hidden;
}
.user-banner .avatar img {
    width: 100%;
    height: 100%;
}
.user-banner .user-name {
    font-size: 17px;
    font-weight: 600;
}
.user-banner .user-phone {
    font-size: 12px;
    opacity: 0.85;
    margin-top: 4px;
}
.order-entry {
    display: flex;
    background: #fff;
    margin: 10px;
    border-radius: 10px;
    padding: 16px 0;
}
.order-entry .oe-item {
    flex: 1;
    text-align: center;
    position: relative;
}
.order-entry .oe-icon {
    font-size: 24px;
    display: block;
    margin-bottom: 4px;
}
.order-entry .oe-name {
    font-size: 12px;
    color: #666;
}
.menu-list {
    background: #fff;
    margin: 0 10px 10px;
    border-radius: 10px;
}
.menu-list .bui-list-item {
    padding: 14px 12px;
    font-size: 14px;
    color: var(--text);
}

/* ---------- 地址 ---------- */
.addr-card {
    background: #fff;
    margin: 10px;
    border-radius: 10px;
    padding: 14px;
    position: relative;
}
.addr-card .ac-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}
.addr-card .ac-phone {
    font-size: 13px;
    color: #666;
    margin-left: 10px;
}
.addr-card .ac-detail {
    font-size: 13px;
    color: #666;
    margin-top: 6px;
}
.addr-card .ac-foot {
    display: flex;
    align-items: center;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #f5f5f5;
}
.addr-card .ac-tag {
    font-size: 11px;
    color: var(--primary);
    background: #f0faf4;
    border-radius: 4px;
    padding: 2px 6px;
}
.addr-card .ac-default {
    font-size: 11px;
    color: #fff;
    background: var(--primary);
    border-radius: 4px;
    padding: 2px 6px;
    margin-left: 6px;
}
.addr-card .ac-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    font-size: 13px;
    color: #666;
}
.addr-card .ac-actions span {
    margin-left: 16px;
}
/* 选择模式: 整卡片可点击选中 */
.addr-card.addr-selectable {
    cursor: pointer;
}
.addr-card.addr-selectable:active {
    background: #f7f8fa;
}

/* ---------- 订单状态筛选 ---------- */
.order-tabs {
    display: flex;
    background: #fff;
    border-bottom: 1px solid #f2f3f5;
    position: sticky;
    top: 0;
    z-index: 10;
}
.order-tabs .ot-item {
    flex: 1;
    text-align: center;
    padding: 12px 0;
    font-size: 14px;
    color: #666;
    border-bottom: 2px solid transparent;
}
.order-tabs .ot-item.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

/* ---------- 底部操作栏 ---------- */
.action-bar {
    display: flex;
    align-items: center;
    background: #fff;
    padding: 8px 12px;
    border-top: 1px solid #eee;
}
.action-bar .ab-left {
    flex: 1;
}
.action-bar .ab-price {
    font-size: 12px;
    color: var(--text);
}
.action-bar .ab-price .price {
    font-size: 18px;
}
.action-bar .ab-btn {
    border-radius: 20px;
    padding: 8px 24px;
    font-size: 14px;
    margin-left: 10px;
}
.action-bar .ab-btn.primary {
    background: var(--primary);
    color: #fff;
}
.action-bar .ab-btn.warning {
    background: #ff8f1f;
    color: #fff;
}

/* ---------- 弹窗按钮 ---------- */
.bui-dialog-btn.primary {
    background: var(--primary);
    color: #fff;
}

/* ---------- 通用 ---------- */
.bg-white { background: #fff; }
.mt10 { margin-top: 10px; }
.p10 { padding: 10px; }
.flex { display: flex; align-items: center; }
.flex-1 { flex: 1; min-width: 0; }
.text-right { text-align: right; }
.gray { color: var(--text-light); }
.small { font-size: 12px; }

/* 表单 */
.form-group {
    display: flex;
    align-items: center;
    background: #fff;
    padding: 13px 14px;
    border-bottom: 1px solid #f5f5f5;
    font-size: 14px;
}
.form-group .fg-label {
    width: 84px;
    color: var(--text);
}
.form-group input,
.form-group select,
.form-group textarea {
    flex: 1;
    border: none;
    outline: none;
    font-size: 14px;
    color: var(--text);
    background: transparent;
}
.form-group textarea {
    resize: none;
    height: 60px;
    padding-top: 4px;
}
.submit-btn {
    margin: 24px 14px;
    background: var(--primary);
    color: #fff;
    border-radius: 24px;
    font-size: 15px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 底部占位(避免内容被 tab/操作栏遮挡) */
.footer-space { height: 56px; }
