* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
    background: #f5f5f5;
    color: #222;
    font-size: 14px;
    /* 用 clip 而非 hidden：防止横向溢出的同时，不把 body 变成滚动容器（否则会破坏顶部吸顶头 position:sticky） */
    overflow-x: clip;
    width: 100%;
}

/* 顶部店铺头：门店实拍横幅图（高度按图片比例自适应，整图完整展示不裁切） */
.app-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: #ff6000 url('/images/shop-banner.jpg') center center / 100% 100% no-repeat;
    aspect-ratio: 1440 / 326;
}
/* 横幅图上门头文字已含店名/业务，隐藏原叠加文字，避免与图上文字重影 */
.shop-logo, .shop-sub { display: none; }

/* 主体：左分类 + 右商品 */
.menu { display: flex; align-items: flex-start; min-width: 0; }

.cat-nav {
    width: 88px;
    flex: 0 0 88px;
    background: #f0f0f0;
    position: sticky;
    top: var(--hh, 70px);
    height: calc(100vh - var(--hh, 70px));
    overflow-y: auto;
}
.cat-item {
    padding: 16px 8px;
    font-size: 13px;
    text-align: center;
    color: #555;
    border-left: 3px solid transparent;
    cursor: pointer;
    line-height: 1.3;
    overflow: hidden;
    word-break: break-all;
}
.cat-item.active {
    background: #fff;
    color: #ff6000;
    font-weight: 700;
    border-left-color: #ff6000;
}
/* 分类图标：兼容 emoji 文本 与 上传/外链图片 两种形式 */
.cat-emoji {
    display: block;
    font-size: 18px;
    line-height: 1.2;
    margin-bottom: 4px;
}
.cat-icon {
    display: block;
    width: 34px;
    height: 34px;
    object-fit: cover;
    background: #fff;
    border-radius: 4px;
    margin: 0 auto 4px;
}
.cat-name { display: block; }

.goods {
    flex: 1;
    min-width: 0;
    background: #fff;
    padding: 4px 12px 40px;
    min-height: calc(100vh - var(--hh, 70px));
}
.cat-section { padding-top: 8px; }
/* 底部占位：保证最后一个分类也能滚动到顶部（左分类联动滚动的经典处理） */
.cat-section:last-child { min-height: calc(100vh - var(--hh, 70px)); }
.cat-section h2 {
    font-size: 14px;
    color: #999;
    font-weight: 600;
    margin: 10px 0 6px;
    padding-left: 2px;
}

/* 商品卡片 */
.product {
    display: flex;
    align-items: stretch;
    padding: 12px 0;
    border-bottom: 1px solid #f2f2f2;
    gap: 10px;
}
.product-img {
    width: 74px; height: 74px;
    border-radius: 8px;
    object-fit: cover;
    background: #eee;
    flex: 0 0 74px;
    align-self: flex-start;
}
.product-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.product-name {
    font-size: 15px; font-weight: 600; line-height: 1.25;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.product-desc {
    font-size: 12px; color: #999; margin-top: 4px; line-height: 1.35;
    display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}
.spec-hint {
    align-self: flex-start;
    font-size: 11px; color: #ff6000; border: 1px solid #ffd1b3;
    border-radius: 4px; padding: 0 5px; line-height: 16px; margin-top: 5px;
}
.product-bottom {
    margin-top: auto;
    display: flex; align-items: center; justify-content: space-between; gap: 6px;
}
.price-line {
    flex: 1 1 auto;
    min-width: 0; display: flex; align-items: baseline;
    overflow: hidden; white-space: nowrap;
}
.price { color: #ff3000; font-weight: 700; flex: 0 0 auto; }
.price .cur { font-size: 11px; }
.price .num { font-size: 16px; }
.origin {
    flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis;
    color: #bbb; font-size: 10px; text-decoration: line-through; margin-left: 4px;
}
.unit { font-size: 11px; color: #999; margin-left: 1px; }
.pick-btn {
    flex: 0 0 auto;
    white-space: nowrap;
    background: #ff6000; color: #fff; border: none;
    border-radius: 15px; padding: 6px 11px; font-size: 12px; font-weight: 600;
}

/* 底部弹层 */
.sheet-mask {
    position: fixed; inset: 0; background: rgba(0,0,0,.5);
    opacity: 0; visibility: hidden; transition: .25s; z-index: 30;
}
.sheet-mask.show { opacity: 1; visibility: visible; }
.sheet {
    position: fixed; left: 0; right: 0; bottom: 0;
    background: #fff; border-radius: 14px 14px 0 0;
    transform: translateY(100%); transition: .28s; z-index: 31;
    max-height: 86vh; overflow-y: auto; padding: 16px 16px 20px;
}
.sheet.show { transform: translateY(0); }
.sheet-close {
    position: absolute; right: 14px; top: 10px; font-size: 22px; color: #999; border: none; background: none;
}
.sheet-title { font-size: 16px; font-weight: 700; margin-bottom: 10px; padding-right: 24px; }
.detail-img { width: 100%; height: 180px; object-fit: cover; border-radius: 10px; background: #eee; }
.detail-desc { font-size: 13px; color: #666; margin: 10px 0; line-height: 1.5; }
.detail-price { color: #ff3000; font-weight: 700; font-size: 20px; margin-bottom: 8px; }

.spec-group { margin: 12px 0; }
.spec-group .label { font-size: 13px; color: #333; margin-bottom: 8px; font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
    border: 1px solid #ddd; background: #fafafa; color: #555;
    border-radius: 16px; padding: 6px 14px; font-size: 13px; cursor: pointer;
}
.chip.active { border-color: #ff6000; color: #ff6000; background: #fff3ec; font-weight: 600; }

.primary-btn {
    width: 100%; background: #ff6000; color: #fff; border: none;
    border-radius: 24px; padding: 13px; font-size: 16px; font-weight: 700; margin-top: 6px;
}
/* 隐藏详情弹层的"立即预约"按钮（仅隐藏该入口，预约表单提交按钮不受影响） */
#toInquiry { display: none; }

/* 预约表单 */
.form-row { margin: 12px 0; }
.form-row label { display: block; font-size: 13px; color: #333; margin-bottom: 6px; font-weight: 600; }
.form-row input, .form-row textarea {
    width: 100%; border: 1px solid #e3e3e3; border-radius: 8px;
    padding: 10px 12px; font-size: 14px; box-sizing: border-box;
}
.form-row textarea { resize: vertical; min-height: 60px; }
.form-info { background: #fff7f1; color: #c05621; border-radius: 8px; padding: 10px 12px; font-size: 13px; margin-bottom: 6px; }

/* toast */
.toast {
    position: fixed; left: 50%; top: 42%; transform: translate(-50%, -50%);
    background: rgba(0,0,0,.8); color: #fff; padding: 12px 20px; border-radius: 8px;
    font-size: 14px; opacity: 0; visibility: hidden; transition: .2s; z-index: 50; max-width: 80%;
}
.toast.show { opacity: 1; visibility: visible; }

.empty { text-align: center; color: #bbb; padding: 40px 0; font-size: 13px; }

/* 可点击查看大图的图片：给放大手势暗示 */
.product-img { cursor: zoom-in; }
.detail-img { cursor: zoom-in; }

/* 图片查看大图（lightbox） */
.img-viewer {
    position: fixed; inset: 0; z-index: 60;
    background: rgba(0,0,0,.9);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden; transition: opacity .2s;
    padding: 20px; box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}
.img-viewer.show { opacity: 1; visibility: visible; }
.img-viewer img {
    max-width: 92vw; max-height: 88vh;
    object-fit: contain; border-radius: 6px;
    -webkit-user-select: none; user-select: none;
    box-shadow: 0 6px 30px rgba(0,0,0,.5);
}
.img-viewer-close {
    position: absolute; top: 14px; right: 18px;
    color: #fff; font-size: 32px; line-height: 1;
    cursor: pointer; opacity: .85; z-index: 1;
    width: 40px; height: 40px; text-align: center;
}
