/* ================================
   左侧分类栏（PC）
================================ */
.bag-left-panel {
    width: 180px;
    flex-shrink: 0;
    box-sizing: border-box;
    padding: 10px;
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
}


/* ================================
   大分类按钮（PC & Mobile）
================================ */
.category-btn {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    margin-bottom: 8px;
    background: #f5f5f5;
    border-radius: 6px;
    border: 1px solid #ccc;
    cursor: pointer;
    white-space: nowrap;
    width: fit-content;
    max-width: 100%;
}


/* ================================
   小分类弹窗（PC）
================================ */
.subcategory-panel-grid {
    position: absolute;
    top: 0;
    left: 260px;
    max-width: 260px;
    background: #fff;
    border: 1px solid #ddd;
    padding: 10px;
    display: none;
    flex-wrap: wrap;
    gap: 8px;
    z-index: 999;
}


/* ================================
   小分类按钮（PC）
================================ */
.subcategory-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 10px;
    border-radius: 6px;
    background: #f5f5f5;
    border: 1px solid #ccc;
    gap: 6px;
    cursor: pointer;
}
/* PC 端：小分类图片不显示 */
.subcat-img {
    display: none;
}


/* ================================
   移动端（≤768px）
================================ */
@media (max-width: 768px) {

    /* 左侧分类栏横向滚动 */
    .bag-left-panel {
        width: 100%;
        display: flex;
        flex-direction: row !important;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        gap: 10px;
        padding: 10px 12px 0px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: auto;
        position: sticky; 
        top: 0; 
        z-index: 20;
    }

    .bag-left-panel::-webkit-scrollbar {
        height: 8px;
    }

    .category-btn {
        flex-shrink: 0;
        white-space: nowrap;
    }

    /* 小分类面板嵌入到 left 下方 */
    .subcategory-panel-grid {
        position: static !important;
        display: grid !important;
        grid-template-columns: repeat(5, 1fr);   /* ⭐ 永远 5 列 */
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        padding: 0;
        margin: 0;
        gap: 0;
        border: none;
        box-shadow: none;
        overflow: hidden; /* ⭐ 防止横向溢出 */
        z-index: 10;
    }

    /* 小分类按钮（正方形 + 不溢出） */
    .subcategory-btn {
        width: 100%;
        aspect-ratio: 1 / 1;          /* 整个卡片保持正方形 */
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;  /* ⭐ 内容从上往下排 */
        padding: 6px;
        box-sizing: border-box;
        background: #f5f5f5;
        border: 1px solid #ccc;
        border-radius: 6px;
        overflow: hidden;             /* 防止内容溢出卡片 */
    }

    /* 图片区域：固定在上方，水平居中，垂直靠上 */
    .subcat-img {
        width: 70%;
        max-height: 60%;              /* ⭐ 图片最多占卡片高度的 60% */
        object-fit: contain;
        display: block;
        margin: 0 auto;               /* 水平居中 */
    }

    /* 标题区域：占“剩下的空间”，可多行，但不挤压图片 */
    .subcat-label {
        display: -webkit-box;
        -webkit-line-clamp: 2;     /* ⭐ WebKit 私有属性（当前主流浏览器都支持） */
        -webkit-box-orient: vertical;

        line-clamp: 2;             /* ⭐ 标准属性（VS Code 提示你加的） */

        overflow: hidden;
        text-overflow: ellipsis;

        width: 100%;
        text-align: center;
        font-size: 11px;
        line-height: 1.2;
        padding: 0 2px;
        box-sizing: border-box;
    }

}


