/* --- 产品市场页专属样式 --- */
.container { max-width: 1280px; }

.main-layout {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

/* 左侧边栏 */
.sidebar {
    width: 260px;
    flex-shrink: 0;
    padding: 25px;
}
.sidebar-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #1a1a1a;
}

/* 分类列表（顶级 + 子类折叠） */
.cat-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #555;
    transition: background 0.15s, color 0.15s;
    user-select: none;
}
.cat-item:hover {
    background: #f5f7fa;
    color: #0056b3;
}
.cat-item.active {
    background: #eaf4ff;
    color: #0056b3;
    font-weight: 600;
}
.cat-item .cat-type-icon {
    width: 16px;
    text-align: center;
    color: #999;
    font-size: 13px;
}
.cat-item.active .cat-type-icon { color: #0056b3; }
.cat-icon-img {
    width: 18px;
    height: 18px;
    object-fit: cover;
    border-radius: 3px;
    flex-shrink: 0;
}
.cat-child .cat-icon-img {
    width: 14px;
    height: 14px;
}
.cat-item .cat-toggle-icon {
    color: #bbb;
    font-size: 12px;
    width: 14px;
    text-align: center;
    transition: transform 0.2s;
}
.cat-group.expanded .cat-toggle-icon {
    transform: rotate(90deg);
    color: #0056b3;
}

.cat-all {
    margin-bottom: 8px;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 14px;
}
.cat-all i { color: #0056b3; }

.cat-group { margin-bottom: 4px; }

/* 子分类列表 */
.cat-children {
    list-style: none;
    padding: 0 0 6px 28px;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
}
.cat-group.expanded .cat-children { max-height: 600px; }
.cat-child {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    color: #888;
    transition: background 0.15s, color 0.15s;
}
.cat-child:hover {
    background: #f5f7fa;
    color: #0056b3;
}
.cat-child.active {
    background: #eaf4ff;
    color: #0056b3;
    font-weight: 600;
}
.cat-child i {
    font-size: 10px;
    color: #ccc;
}
.cat-child.active i { color: #0056b3; }


/* 右侧内容 */
.content-area {
    flex: 1;
    min-width: 0;
}
.action-bar {
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}
.action-search {
    position: relative;
    width: 300px;
}
.action-search input {
    width: 100%;
    padding: 10px 15px 10px 40px;
    border-radius: 10px;
    border: 1px solid rgba(0,0,0,0.08);
    background: rgba(255,255,255,0.8);
    outline: none;
    font-size: 14px;
    transition: 0.2s;
}
.action-search input:focus { background: #fff; border-color: #00a0e9; }
.action-search i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 14px;
}
.action-sort {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 14px;
    color: #555;
}
.action-sort select {
    padding: 8px 15px;
    border-radius: 10px;
    border: 1px solid rgba(0,0,0,0.08);
    background: rgba(255,255,255,0.8);
    outline: none;
    font-size: 14px;
    color: #333;
    cursor: pointer;
}

/* 产品网格 */
.product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    align-items: stretch;
}
.product-card {
    padding: 0;
    overflow: hidden;
    background: #fff;
    display: flex;
    flex-direction: column;
    height: 100%;
}
.product-card.glass-container { background: #fff; }
.p-img-box {
    width: 100%;
    height: 180px;
    overflow: hidden;
    position: relative;
    background: #fafafa;
    flex-shrink: 0;
}
.p-img-box img { width: 100%; height: 100%; object-fit: cover; }
.stock-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #4caf50;
    color: white;
    font-size: 11px;
    padding: 2px 10px;
    border-radius: 12px;
}
.stock-badge.out { background: #999; }
.p-info {
    padding: 15px 20px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.p-category {
    font-size: 12px;
    color: #888;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.p-title {
    font-size: 16px;
    font-weight: 500;
    color: #1a1a1a;
    margin-bottom: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.p-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}
.p-price {
    font-size: 20px;
    font-weight: 600;
    color: #00a0e9;
}
.p-price span {
    font-size: 14px;
    font-weight: 400;
    color: #333;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 40px;
}
.page-btn {
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.9);
    background: rgba(255,255,255,0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    color: #666;
    font-size: 14px;
}
.page-btn:hover { background: #fff; border-color: #ddd; }
.page-btn.active {
    background: #0056b3;
    color: #fff;
    border-color: #0056b3;
}
.page-btn.disabled { opacity: 0.4; pointer-events: none; }

/* 响应式 */
@media (max-width: 1024px) {
    .product-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 992px) {
    .main-layout { flex-direction: column; }
    .sidebar { width: 100%; }
    .cat-children { padding-left: 14px; }
}
@media (max-width: 768px) {
    .action-bar { flex-direction: column; align-items: stretch; gap: 15px; }
    .action-search { width: 100%; }
    .product-grid { grid-template-columns: repeat(2, 1fr); }
}
