/* 产品列表页面 */
.products-page { max-width: 1200px; margin: 0 auto; }
.products-page h1 {
    font-size: 2.5rem;
    color: #2c3e50;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 3px solid #667eea;
}

/* 分类筛选 */
.category-filter {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 2rem;
}
.category-filter h2 {
    font-size: 1rem;
    color: #666;
    margin-bottom: 1rem;
    font-weight: 500;
}
.category-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    list-style: none;
    padding: 0;
    margin: 0;
}
.category-tags li a {
    display: inline-block;
    padding: 0.5rem 1.2rem;
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 20px;
    text-decoration: none;
    color: #555;
    font-size: 0.9rem;
    transition: all 0.2s;
}
.category-tags li a:hover {
    background: #667eea;
    border-color: #667eea;
    color: white;
    transform: translateY(-2px);
}
.category-tags li a.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: white;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

/* 分类项（包含子分类） */
.category-item {
    position: relative;
}

/* 箭头指示器 */
.arrow-down {
    font-size: 0.7rem;
    margin-left: 0.3rem;
}

.arrow-right {
    font-size: 0.9rem;
    margin-left: auto;
    color: #999;
}

/* 子分类列表 - 二级菜单 */
.sub-category-tags.level-2 {
    display: none;
    position: absolute;
    top: calc(100% - 4px);
    left: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    padding: 0.5rem;
    margin-top: 0;
    min-width: 180px;
    z-index: 100;
    list-style: none;
    flex-direction: column;
    gap: 0.3rem;
}

.category-item:hover > .sub-category-tags.level-2 {
    display: flex;
}

/* 子分类项 */
.sub-category-item {
    position: relative;
}

.sub-category-tags.level-2 li a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.8rem;
    background: transparent;
    border: none;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #555;
    white-space: nowrap;
    text-decoration: none;
}

.sub-category-tags.level-2 li a:hover {
    background: #f0f2ff;
    color: #667eea;
    transform: none;
}

.sub-category-tags.level-2 li a.active {
    background: #667eea;
    color: white;
    box-shadow: none;
}

/* 三级菜单 */
.sub-category-tags.level-3 {
    display: none;
    position: absolute;
    top: 0;
    left: 100%;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    padding: 0.5rem;
    margin-left: 0.3rem;
    min-width: 160px;
    z-index: 101;
    list-style: none;
    flex-direction: column;
    gap: 0.3rem;
}

.sub-category-item:hover > .sub-category-tags.level-3 {
    display: flex;
}

.sub-category-tags.level-3 li a {
    display: block;
    padding: 0.5rem 0.8rem;
    background: transparent;
    border: none;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #555;
    white-space: nowrap;
    text-decoration: none;
}

.sub-category-tags.level-3 li a:hover {
    background: #f0f2ff;
    color: #667eea;
    transform: none;
}

.sub-category-tags.level-3 li a.active {
    background: #667eea;
    color: white;
    box-shadow: none;
}

/* 搜索框 */
.search-box {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 2rem;
}
.search-box form {
    display: flex;
    gap: 1rem;
}
.search-box input {
    flex: 1;
    padding: 0.8rem 1.2rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s;
}
.search-box input:focus {
    outline: none;
    border-color: #667eea;
}
.search-box button {
    padding: 0.8rem 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}
.search-box button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* 搜索结果信息 */
.search-result-info {
    background: #e3f2fd;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    color: #1976d2;
    border-left: 4px solid #2196f3;
}

/* 产品网格 */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}
.product-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
}
.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.product-card h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    line-height: 1.4;
}
.product-card h3 a {
    color: #2c3e50;
    text-decoration: none;
    transition: color 0.2s;
}
.product-card h3 a:hover {
    color: #667eea;
}
.product-card .description {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    flex: 1;
}
.product-card .price {
    font-size: 1.5rem;
    color: #e74c3c;
    font-weight: bold;
    margin-bottom: 0.8rem;
}
.product-card .meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid #ecf0f1;
    font-size: 0.9rem;
    color: #888;
}
.product-card .category {
    background: #f0f0f0;
    padding: 0.3rem 0.8rem;
    border-radius: 12px;
    color: #555;
}
.product-card .stock {
    color: #27ae60;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.empty-state p {
    color: #999;
    font-size: 1.1rem;
}

/* 响应式 */
@media (max-width: 768px) {
    .products-page h1 { font-size: 2rem; }
    .category-filter { padding: 1rem; }
    .category-tags { gap: 0.5rem; }
    .category-tags li a { padding: 0.4rem 1rem; font-size: 0.85rem; }
    .search-box form { flex-direction: column; }
    .search-box button { width: 100%; }
    .product-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1.5rem; }
}

@media (max-width: 480px) {
    .products-page h1 { font-size: 1.6rem; }
    .product-grid { grid-template-columns: 1fr; gap: 1rem; }
    .product-card { padding: 1rem; }
    .product-card h3 { font-size: 1.1rem; }
}

/* ==================== 商品对比 ==================== */
/* 卡片操作区 */
.card-actions {
    padding-top: 1rem;
    border-top: 1px solid #ecf0f1;
    margin-top: 0.8rem;
}
/* 卡片内加入对比按钮 */
.btn-compare-card {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0.5rem 1rem;
    background: #fff;
    color: #764ba2;
    border: 1.5px solid #764ba2;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s;
}
.btn-compare-card:hover {
    background: #764ba2;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(118, 75, 162, 0.3);
}
/* 已加入对比状态 */
.btn-compare-card.added {
    background: #764ba2;
    color: #fff;
    border-color: #764ba2;
}
.btn-compare-card.added:hover {
    background: #5d3a82;
}

/* 对比浮动球 */
.compare-float {
    position: fixed;
    right: 24px;
    bottom: 80px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.45);
    z-index: 900;
    transition: transform 0.25s, box-shadow 0.25s;
}
.compare-float:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 24px rgba(102, 126, 234, 0.6);
}
.compare-count {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: #e74c3c;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
}

/* 轻量提示 toast（加入对比反馈，完整对比页自带 compare.css） */
.compare-toast {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    padding: 12px 24px;
    background: #2c3e50;
    color: #fff;
    border-radius: 8px;
    font-size: 0.9rem;
    z-index: 1100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s, transform 0.25s;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}
.compare-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.compare-toast.success { background: #27ae60; }
.compare-toast.error { background: #e74c3c; }

/* 对比浮动球响应式 */
@media (max-width: 768px) {
    .compare-float {
        right: 16px;
        bottom: 70px;
        width: 48px;
        height: 48px;
    }
}
