/* ============ Prolist Page ============ */

/* Page Banner */
.page-banner { position: relative; height: 280px; overflow: hidden; }
.page-banner img { width: 100%; height: 100%; object-fit: cover; display: block; }
.page-banner-overlay { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.35); }
.page-banner h1 { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); color: #fff; font-size: 44px; font-weight: 600; letter-spacing: 1px; margin: 0; }

/* Breadcrumb */
.breadcrumb-bar { background: #f2f2f2; padding: 14px 0; font-size: 14px; color: #666; }
.breadcrumb-bar .container, .prolist-wrap .container { max-width: 1500px; margin: 0 auto; }
.breadcrumb-bar a { color: #666; transition: color 0.3s; }
.breadcrumb-bar a:hover { color: #4C4C4C; }
.breadcrumb-label { margin-right: 8px; }
.breadcrumb-sep { margin: 0 8px; color: #999; }
.breadcrumb-current { color: #999; }

/* Layout */
.prolist-wrap { padding: 40px 0 60px; }
.prolist-layout { display: flex; gap: 25px; align-items: flex-start; }
.prolist-sidebar { flex: 0 0 300px; }
.prolist-main { flex: 1; min-width: 0; }

/* Mobile Sidebar Toggle (hidden on desktop) */
.sidebar-toggle { display: none; }
.side-toggle { display: none; }

/* Sidebar Boxes */
.side-box { margin-bottom: 25px; }
.side-box-title { background: #4C4C4C; color: #fff; font-size: 17px; font-weight: 600; padding: 14px 18px; margin: 0; }

/* Category List */
.cate-list { list-style: none; margin: 0; padding: 0; border: 1px solid #e8e8e8; border-top: none; }
.cate-item { border-bottom: 1px solid #eee; }
.cate-item:last-child { border-bottom: none; }
.cate-item > a { display: flex; align-items: center; justify-content: space-between; padding: 12px 18px; font-size: 14px; color: #333; transition: all 0.3s; }
.cate-item > a:hover { color: #4C4C4C; background: #fafafa; }
.cate-arrow { font-size: 12px; color: #999; transition: transform 0.3s; }
.cate-item.open .cate-arrow { transform: rotate(180deg); }
.cate-sub { list-style: none; margin: 0; padding: 0 0 8px; display: none; }
.cate-item.open .cate-sub { display: block; }
.cate-sub li a { display: block; padding: 8px 18px 8px 30px; font-size: 13px; color: #666; position: relative; transition: all 0.3s; }
.cate-sub li a::before { content: "•"; position: absolute; left: 20px; color: #4C4C4C; }
.cate-sub li a:hover { color: #4C4C4C; }
.cate-sub li.current a { color: #4C4C4C; }

/* Inquire Form */
.inquire-form { border: 1px solid #e8e8e8; border-top: none; padding: 18px; }
.inquire-row { display: flex; gap: 10px; margin-bottom: 12px; }
.inquire-row input { flex: 1; min-width: 0; }
.inquire-form input, .inquire-form textarea { width: 100%; padding: 10px 12px; border: 1px solid #ddd; font-size: 13px; font-family: inherit; color: #333; margin-bottom: 12px; outline: none; transition: border-color 0.3s; box-sizing: border-box; }
.inquire-form input:focus, .inquire-form textarea:focus { border-color: #4C4C4C; }
.inquire-form textarea { resize: vertical; }
.captcha-box { background: #fff; border: 1px dashed #ccc; padding: 8px 14px; font-size: 20px; font-style: italic; font-weight: 600; letter-spacing: 6px; color: #555; user-select: none; text-decoration: line-through; display: inline-block; margin-bottom: 15px; }
.inquire-submit { background: #4C4C4C; color: #fff; border: none; padding: 10px 30px; font-size: 14px; cursor: pointer; font-family: inherit; transition: background 0.3s; }
.inquire-submit:hover { background: #2a938c; }

/* Knowledge List */
.knowledge-list { border: 1px solid #e8e8e8; border-top: none; padding: 15px; }
.knowledge-item { display: block; margin-bottom: 20px; text-decoration: none; }
.knowledge-item:last-child { margin-bottom: 0; }
.knowledge-img { width: 100%; aspect-ratio: 16/9; overflow: hidden; margin-bottom: 10px; }
.knowledge-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.4s; }
.knowledge-item:hover .knowledge-img img { transform: scale(1.05); }
.knowledge-item h4 { font-size: 15px; font-weight: 600; color: #333; margin: 0 0 6px; transition: color 0.3s; }
.knowledge-item:hover h4 { color: #4C4C4C; }
.knowledge-item p { font-size: 13px; color: #999; margin: 0; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Filter Bar */
.filter-bar { background: #f5f5f5; padding: 5px 0; margin-bottom: 20px; }
.filter-row { display: flex; align-items: center; border-bottom: 1px solid #e5e5e5; }
.filter-row:last-child { border-bottom: none; }
.filter-label { flex: 0 0 180px; padding: 12px 18px; font-size: 14px; color: #555; border-right: 1px solid #e5e5e5; }
.filter-input { flex: 1; margin: 8px 15px; max-width: 260px; border: 1px solid #c8e6c9; background: #e8f5e9; padding: 7px 12px; font-size: 13px; outline: none; font-family: inherit; }
.filter-input:focus { border-color: #4C4C4C; }
.filter-actions { padding: 10px 0 10px 180px; }
.btn-search { background: #4C4C4C; color: #fff; border: none; padding: 8px 24px; font-size: 14px; cursor: pointer; font-family: inherit; margin-right: 12px; transition: background 0.3s; }
.btn-search:hover { background: #2a938c; }
.btn-reset { background: none; border: none; color: #666; font-size: 14px; cursor: pointer; font-family: inherit; }
.btn-reset:hover { color: #4C4C4C; }

/* Selected Lines Bar */
.selected-lines { background: #efefef; padding: 12px 18px; font-size: 14px; color: #555; letter-spacing: 0.5px; margin-bottom: 25px; }

/* All Products Title */
.prolist-title { font-size: 32px; font-weight: 600; color: #222; margin: 0 0 25px; }

/* Product Grid */
.prolist-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.prolist-card { border: 1px solid #e5e5e5; padding: 12px 15px 18px; transition: box-shadow 0.3s, border-color 0.3s; background: #fff; }
.prolist-card:hover { border-color: #4C4C4C; box-shadow: 0 4px 15px rgba(0,0,0,0.08); }
.compare-check { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #666; cursor: pointer; margin-bottom: 8px; }
.compare-check input { accent-color: #4C4C4C; cursor: pointer; }
.prolist-img { display: block; aspect-ratio: 16/10; overflow: hidden; margin-bottom: 15px; }
.prolist-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.4s; }
.prolist-card:hover .prolist-img img { transform: scale(1.05); }
.prolist-name { display: block; text-align: center; font-size: 14px; color: #444; line-height: 1.5; transition: color 0.3s; }
.prolist-name:hover { color: #4C4C4C; }

/* Pagination */
.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 40px; list-style: none; padding: 0; flex-wrap: wrap; }
.pagination li { list-style: none; }
.pagination li a { min-width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; color: #666; font-size: 14px; text-decoration: none; padding: 0 8px; }
.pagination li a[href] { border: 1px solid #ddd; transition: all 0.3s; }
.pagination li a[href]:hover { border-color: #4C4C4C; color: #4C4C4C; }
.pagination li.active a { background: #4C4C4C; border-color: #4C4C4C; color: #fff; }
.page-num, .page-next { min-width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border: 1px solid #ddd; color: #666; font-size: 14px; transition: all 0.3s; padding: 0 8px; }
.page-num:hover, .page-next:hover { border-color: #4C4C4C; color: #4C4C4C; }
.page-num.active { background: #4C4C4C; border-color: #4C4C4C; color: #fff; }

/* ============ Responsive ============ */
@media (max-width: 1024px) {
    .prolist-sidebar { flex: 0 0 260px; }
    .prolist-grid { grid-template-columns: repeat(2, 1fr); }
    .page-banner { height: 220px; }
    .page-banner h1 { font-size: 36px; }
}

@media (max-width: 768px) {
    .prolist-wrap { padding: 20px 0 40px; }
    .page-banner { height: 150px; }
    .page-banner h1 { font-size: 28px; }
    .breadcrumb-bar { padding: 10px 0; font-size: 13px; }

    /* Sidebar collapsed by default, toggle button */
    .sidebar-toggle { display: flex; align-items: center; gap: 8px; width: 100%; background: #4C4C4C; color: #fff; border: none; padding: 13px 18px; font-size: 15px; font-family: inherit; cursor: pointer; margin-bottom: 15px; justify-content: center; }
    .sidebar-toggle .toggle-arrow { margin-left: auto; font-size: 16px; transition: transform 0.3s; }
    .sidebar-toggle.open .toggle-arrow { transform: rotate(180deg); }

    .prolist-layout { flex-direction: column; }
    .prolist-sidebar { display: none; flex: unset; width: 100%; }
    .prolist-layout.sidebar-open .prolist-sidebar { display: block; }

    /* Product Category box collapsible */
    .side-box.collapsible .side-box-title { display: flex; align-items: center; justify-content: space-between; cursor: pointer; }
    .side-box.collapsible .side-toggle { display: block; font-size: 16px; transition: transform 0.3s; }
    .side-box.collapsible.open .side-toggle { transform: rotate(180deg); }
    .side-box.collapsible .cate-list { max-height: 0; overflow: hidden; transition: max-height 0.3s ease; }
    .side-box.collapsible.open .cate-list { max-height: 800px; }

    .filter-label { flex: 0 0 110px; padding: 10px 12px; font-size: 13px; }
    .filter-actions { padding-left: 110px; }
    .filter-input { margin: 6px 10px; }

    /* Knowledge list: horizontal swipe carousel */
    .knowledge-list { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 15px; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding: 15px; padding-bottom: 10px; }
    .knowledge-list::-webkit-scrollbar { display: none; }
    .knowledge-item { flex: 0 0 85%; scroll-snap-align: center; margin-bottom: 0; }

    .prolist-title { font-size: 24px; margin-bottom: 15px; }
    .prolist-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .prolist-card { padding: 10px 10px 14px; }
    .compare-check { font-size: 12px; }
    .prolist-name { font-size: 13px; }

    .pagination { margin-top: 25px; }
    .page-num, .page-next { min-width: 32px; height: 32px; font-size: 13px; }
}

/* ==================== Compare Bar ==================== */
.compare-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 950; background: #23272f; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 12px 30px; transform: translateY(110%); transition: transform 0.3s; box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.25); }
.compare-bar.show { transform: translateY(0); }
.compare-list { display: flex; align-items: center; gap: 14px; overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none; }
.compare-list::-webkit-scrollbar { display: none; }
.compare-item { position: relative; flex: 0 0 auto; display: flex; align-items: center; gap: 10px; background: #fff; padding: 8px 30px 8px 12px; width: 180px; }
.compare-item img { width: 56px; height: 46px; object-fit: contain; flex-shrink: 0; }
.compare-item .ci-name { font-size: 12px; color: #333; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.compare-item .ci-close { position: absolute; top: 4px; right: 4px; width: 20px; height: 20px; border-radius: 50%; border: none; background: #23272f; color: #fff; font-size: 12px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.compare-item .ci-close:hover { background: #e74c3c; }
.compare-actions { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.compare-btn { background: #e74c3c; color: #fff; border: none; padding: 12px 24px; font-size: 14px; font-family: inherit; cursor: pointer; transition: background 0.3s; }
.compare-btn:hover { background: #c0392b; }
.compare-empty { background: #fff; color: #333; border: none; padding: 12px 24px; font-size: 14px; font-family: inherit; cursor: pointer; transition: background 0.3s; }
.compare-empty:hover { background: #d6d6d6; }
.compare-toast { position: fixed; left: 50%; bottom: 110px; transform: translateX(-50%); background: rgba(0, 0, 0, 0.75); color: #fff; font-size: 14px; padding: 10px 22px; border-radius: 4px; z-index: 960; pointer-events: none; opacity: 0; transition: opacity 0.3s; }
.compare-toast.show { opacity: 1; }

@media (max-width: 768px) {
    .compare-bar { padding: 10px 15px; flex-wrap: wrap; }
    .compare-item { width: 150px; }
    .compare-actions { width: 100%; justify-content: flex-end; }
    .compare-btn, .compare-empty { padding: 9px 18px; font-size: 13px; }
}
