/* ============================================================
   products.css — 迈驰智能技术（江苏）有限公司
                  "产品中心" 列表页 + 详情页 合并样式
   版本: 2.0
   说明: 产品列表页（products.html）与产品详情页（product-detail.html）
         的完整样式。全局基础、导航、页面横幅、底部版权等请引用 common.css。
   ============================================================ */

/* ============================================================
   第一部分：布局（列表页与详情页共用）
   ============================================================ */

.product-layout,
.detail-layout {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

/* ============================================================
   第二部分：左侧分类树（列表页与详情页共用）
   ============================================================ */

.category-sidebar {
    flex: 0 0 280px;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 0 0 12px 0;
    box-shadow: var(--shadow);
    position: sticky;
    top: 100px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}
.category-sidebar::-webkit-scrollbar {
    width: 4px;
}
.category-sidebar::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}
.category-sidebar::-webkit-scrollbar-track {
    background: var(--bg-light);
}

.category-sidebar .sidebar-title {
    font-size: 20px;
    font-weight: 700;
    padding: 16px 20px;
    background: var(--bg-dark);
    color: #fff;
    border-radius: var(--radius) var(--radius) 0 0;
    border-bottom: none;
    letter-spacing: 0.5px;
}

/* 一级分类 */
.cat-level-1 {
    border-bottom: 1px solid var(--border-color);
}
.cat-level-1:last-child {
    border-bottom: none;
}

.cat-1-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    cursor: pointer;
    transition: background var(--transition);
    font-weight: 700;
    font-size: 17px;
    color: var(--text-dark);
    user-select: none;
}
.cat-1-header:hover {
    background: var(--bg-light);
}
.cat-1-header .arrow {
    font-size: 14px;
    color: var(--text-light);
    transition: transform var(--transition);
}
.cat-1-header .arrow.open {
    transform: rotate(90deg);
}

/* 二级分类展开 */
.cat-level-2-wrap {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.4s ease;
}
.cat-level-2-wrap.open {
    max-height: 600px;
}

.cat-2-item {
    display: block;
    padding: 12px 20px 12px 40px;
    font-size: 16px;
    font-weight: 500;
    color: var(--text-gray);
    transition: all var(--transition);
    border-left: 3px solid transparent;
    position: relative;
}
.cat-2-item:hover {
    background: var(--bg-light);
    color: var(--text-dark);
}
.cat-2-item.active {
    background: var(--primary-light);
    color: var(--primary);
    border-left-color: var(--primary);
    font-weight: 600;
}

/* ============================================================
   第三部分：产品列表页专属（products.html）
   ============================================================ */

/* --- 右侧产品列表 --- */
.product-content {
    flex: 1;
    min-width: 0;
}

.product-content .current-cat {
    font-size: 30px;
    font-weight: 800;
    margin-bottom: 6px;
    color: var(--text-dark);
    letter-spacing: -0.5px;
}
.product-content .current-cat .highlight {
    color: var(--primary);
}
.product-content .current-desc {
    color: var(--text-gray);
    font-size: 15px;
    margin-bottom: 28px;
}

/* 产品卡片网格 */
.product-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.product-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all var(--transition);
    box-shadow: var(--shadow);
}
.product-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.08);
    border-color: var(--primary);
}

.product-card .img-link {
    display: block;
    overflow: hidden;
}
.product-card .img-link img {
    width: 100%;
    height: 260px;
    object-fit: cover;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-light);
    transition: transform 0.4s ease;
}
.product-card:hover .img-link img {
    transform: scale(1.03);
}

.product-card .product-body {
    padding: 18px 20px 24px;
}
.product-card .product-body .title-link {
    display: block;
    transition: color var(--transition);
}
.product-card .product-body .title-link h3 {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--text-dark);
}
.product-card .product-body .title-link:hover h3 {
    color: var(--primary);
}
.product-card .product-body p {
    font-size: 14px;
    color: var(--text-gray);
    line-height: 1.7;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.product-card .product-body .link {
    color: var(--primary);
    font-weight: 600;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: gap var(--transition);
}
.product-card .product-body .link:hover {
    gap: 10px;
}

/* ============================================================
   第四部分：产品详情页专属（product-detail.html）
   ============================================================ */

.detail-content {
    flex: 1;
    min-width: 0;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 40px 36px 48px;
    box-shadow: var(--shadow);
}
.detail-content .content-title {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 12px;
}
.detail-content .content-title .highlight {
    color: var(--primary);
}
.detail-content .divider {
    width: 60px;
    height: 3px;
    background: var(--primary);
    border-radius: 4px;
    margin-bottom: 20px;
}
.detail-content .content-body {
    color: var(--text-gray);
    font-size: 16px;
    line-height: 1.9;
}
.detail-content .content-body p {
    margin-bottom: 16px;
}
.detail-content .content-body p:last-child {
    margin-bottom: 0;
}
.detail-content .content-body strong {
    color: var(--text-dark);
}

/* ============================================================
   第五部分：产品页导航高亮（纯 CSS 控制）
   ============================================================ */
.nav-menu > li > a[href="/products.html"].active {
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
}
.navbar.scrolled .nav-menu > li > a[href="/products.html"].active {
    color: var(--primary);
    background: rgba(0, 82, 217, 0.06);
}

/* ============================================================
   第六部分：响应式
   ============================================================ */

/* 1024px 以下 */
@media (max-width: 1024px) {
    /* 列表页 */
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    /* 公共 */
    .category-sidebar {
        flex: 0 0 240px;
    }
}

/* 768px 以下 */
@media (max-width: 768px) {
    /* 公共：布局改为纵向 */
    .product-layout,
    .detail-layout {
        flex-direction: column;
        gap: 30px;
    }
    .category-sidebar {
        flex: none;
        width: 100%;
        position: relative;
        top: 0;
        max-height: none;
        padding: 0 0 12px 0;
    }
    .category-sidebar .sidebar-title {
        font-size: 18px;
    }
    .cat-1-header {
        font-size: 16px;
        padding: 12px 18px;
    }
    .cat-2-item {
        font-size: 15px;
        padding: 10px 18px 10px 34px;
    }

    /* 列表页 */
    .product-grid {
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }
    .product-content .current-cat {
        font-size: 26px;
    }

    /* 详情页 */
    .detail-content {
        padding: 30px 24px 36px;
    }
    .detail-content .content-title {
        font-size: 24px;
    }
}

/* 480px 以下 */
@media (max-width: 480px) {
    /* 公共 */
    .category-sidebar .sidebar-title {
        font-size: 17px;
        padding: 14px 16px;
    }
    .cat-1-header {
        font-size: 15px;
        padding: 10px 16px;
    }
    .cat-2-item {
        font-size: 14px;
        padding: 10px 16px 10px 30px;
    }

    /* 列表页 */
    .product-grid {
        grid-template-columns: 1fr;
    }
    .product-content .current-cat {
        font-size: 22px;
    }
    .product-card .img-link img {
        height: 160px;
    }

    /* 详情页 */
    .detail-content {
        padding: 24px 16px 28px;
    }
    .detail-content .content-title {
        font-size: 20px;
    }
    .detail-content .content-body {
        font-size: 14px;
    }
}