/*
 * ==========================================
 * 模块定位：全局侧边栏 - 产品分类导航样式
 * 代码类型：CSS
 * ==========================================
 */

.mx-sidebar-pcat {
    background-color: #ffffff;
    margin-bottom: 30px;
    padding: 30px; /* 这里将原来的 20px 修改为了 30px */
    box-sizing: border-box;
    border: 1px solid #f2f2f2;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
    transform: translateZ(0); 
}

.mx-sidebar-pcat__title.widget-title {
    font-size: 20px;
    font-weight: 700;
    color: #222222;
    margin: 0 0 25px 0;
    position: relative;
    padding-bottom: 12px;
    border-bottom: none;
    line-height: 1.3;
}

.mx-sidebar-pcat__title.widget-title::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 30px;
    height: 3px;
    background-color: #0056b3;
}

.mx-sidebar-pcat__title-link {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
    display: inline-block; 
}

.mx-sidebar-pcat__title-link:hover {
    color: #0056b3; 
}

.mx-sidebar-pcat__title-link:focus-visible,
.mx-sidebar-pcat__summary:focus-visible,
.mx-sidebar-pcat__link:focus-visible,
.mx-sidebar-pcat__sublink:focus-visible {
    outline: 2px solid #0056b3;
    outline-offset: -2px;
}

.mx-sidebar-pcat__list,
.mx-sidebar-pcat__sublist {
    list-style: none !important; 
    margin: 0 !important; 
    padding: 0 !important;
}

.mx-sidebar-pcat__item {
    border-bottom: 1px solid #f4f5f7;
    margin-bottom: 6px; 
}

.mx-sidebar-pcat__item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.mx-sidebar-pcat__summary {
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    padding: 0; 
    cursor: pointer; 
    user-select: none; 
    list-style: none;
    transition: background-color 0.2s ease;
    border-radius: 0; 
    min-height: 48px; 
    will-change: background-color; 
}

.mx-sidebar-pcat__summary::-webkit-details-marker { 
    display: none; 
}

.mx-sidebar-pcat__link {
    flex-grow: 1; 
    font-size: 15px; 
    color: #222222; 
    text-decoration: none; 
    transition: color 0.2s ease;
    padding: 12px; 
    display: block;
    transform: translateZ(0); 
}

.mx-sidebar-pcat__count { 
    color: #666666; 
    font-size: 13px; 
    margin-left: 4px; 
    font-weight: 400; 
}

.mx-sidebar-pcat__summary.is-current {
    background-color: #f5f5f5; 
}

.mx-sidebar-pcat__summary.is-current .mx-sidebar-pcat__link {
    font-weight: 600; 
    color: #000000;
}

.mx-sidebar-pcat__summary:hover .mx-sidebar-pcat__link { 
    color: #0056b3; 
}

.mx-sidebar-pcat__details > summary::after {
    content: "+"; 
    color: #aaaaaa; 
    font-size: 18px; 
    font-weight: 300;
    line-height: 1; 
    margin-left: 10px; 
    flex-shrink: 0; 
    width: 24px; 
    text-align: center;
    padding: 12px 0; 
}

.mx-sidebar-pcat__details[open] > summary::after { 
    content: "\2013"; 
}

.mx-sidebar-pcat__summary--no-child { 
    cursor: default; 
}

.mx-sidebar-pcat__sublist { 
    padding-bottom: 8px !important; 
}

.mx-sidebar-pcat__subitem { 
    border-top: 1px solid #fcfcfc; 
}

.mx-sidebar-pcat__sublink {
    display: flex; 
    align-items: center;
    padding: 12px 10px 12px 25px; 
    font-size: 14px; 
    color: #222222; 
    text-decoration: none;
    transition: all 0.2s ease; 
    margin: 4px 0; 
    border-radius: 0;
    min-height: 48px; 
    transform: translateZ(0); 
    will-change: color, background-color;
}

.mx-sidebar-pcat__sublink.is-current {
    background-color: #f5f5f5; 
    color: #000000;
    font-weight: 500;
}

.mx-sidebar-pcat__sublink:hover { 
    color: #0056b3; 
}

.mx-sidebar-pcat__sublink::before {
    content: ""; 
    display: block; 
    width: 4px; 
    height: 4px;
    border-top: 1px solid #aaaaaa; 
    border-right: 1px solid #aaaaaa;
    transform: rotate(45deg); 
    margin-right: 10px; 
    transition: border-color 0.2s ease;
}

.mx-sidebar-pcat__sublink.is-current::before,
.mx-sidebar-pcat__sublink:hover::before {
    border-color: #0056b3;
}

/* ==========================================
 * 移动端适配：隐藏指定侧边栏分类导航
 * ========================================== */
@media screen and (max-width: 768px) {
    .mx-sidebar-pcat {
        display: none !important;
    }
}
/* ----------产品侧边栏 CSS 结束---------- */

/*
 * ==========================================
 * 模块定位：全局侧边栏 - 置顶产品推荐样式 (图文升级版)
 * 代码类型：CSS
 * ==========================================
 */

.mx-sticky-product {
    background-color: #ffffff;
    padding: 30px; /* 👈 此处由 20px 修改为 30px */
    box-sizing: border-box;
    border: 1px solid #f2f2f2;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
    transform: translateZ(0); 
    margin-bottom: 24px;
}

.mx-sticky-product__title {
    font-size: 20px;
    font-weight: 700;
    color: #222222;
    margin: 0 0 20px 0;
    position: relative;
    padding-bottom: 12px;
}

.mx-sticky-product__title::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 30px;
    height: 3px;
    background-color: #0056b3;
}

/* 核心布局升级：固定最大高度并开启内部滚动 */
.mx-sticky-product__list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 420px; /* 高度精算：大约显示 4.5 个产品，视觉上暗示可滑动 */
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 8px; /* 给滚动条留出呼吸空间 */
    
    /* 现代浏览器标准滚动条样式 (Firefox) */
    scrollbar-width: thin;
    scrollbar-color: #cccccc transparent;
}

/* 极简工业风滚动条定制 (Chrome/Safari/Edge) */
.mx-sticky-product__list::-webkit-scrollbar {
    width: 4px; /* 极细的科技感线条 */
}

.mx-sticky-product__list::-webkit-scrollbar-track {
    background-color: transparent; /* 轨道透明 */
}

.mx-sticky-product__list::-webkit-scrollbar-thumb {
    background-color: #e0e0e0; /* 默认浅灰，不抢视觉焦点 */
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.mx-sticky-product__list::-webkit-scrollbar-thumb:hover {
    background-color: #0056b3; /* 悬停时点亮品牌高冷蓝 */
}

/* 确保最后一个元素的边框不会和滚动区域底部粘连 */
.mx-sticky-product__item:last-child {
    border-bottom: none;
    padding-bottom: 5px;
}

.mx-sticky-product__item {
    margin-bottom: 0;
    border-bottom: 1px dashed #f5f5f5;
}

.mx-sticky-product__item:last-child {
    border-bottom: none;
}

/* 核心布局升级：Flexbox 左图右文 */
.mx-sticky-product__link {
    display: flex; 
    align-items: center; /* 垂直居中对齐 */
    gap: 15px; /* 图片和文字的间距 */
    padding: 15px 0; /* 增加上下内边距，让图片呼吸感更好 */
    text-decoration: none;
    color: #222222;
    transition: background-color 0.2s ease;
    outline: none;
}

/* 缩略图外框 */
.mx-sticky-product__thumb {
    flex-shrink: 0;
    width: 60px; /* 固定缩略图宽度 */
    height: 60px; /* 固定缩略图高度 */
    background-color: #f8f9fa;
    border-radius: 4px;
    overflow: hidden; /* 配合圆角和图片缩放 */
}

/* 缩略图本体 */
.mx-sticky-product__img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* 工业品图片通常有留白，用 contain 比 cover 更好 */
    display: block;
    transition: transform 0.3s ease; /* 图片悬停动画参数 */
}

/* 文本容器 */
.mx-sticky-product__info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

/* 产品名称 */
.mx-sticky-product__name {
    font-size: 14px;
    line-height: 1.4;
    font-weight: 500;
    transition: color 0.2s ease;
    /* 开启多行文本截断 (超2行显示省略号) */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 交互状态：文字变色，图片微放大 */
.mx-sticky-product__link:hover .mx-sticky-product__name {
    color: #0056b3;
}
.mx-sticky-product__link:hover .mx-sticky-product__img {
    transform: scale(1.08); /* 图片轻微放大，提升高级感 */
}

/* 无障碍键盘导航 */
.mx-sticky-product__link:focus-visible {
    outline: 2px dashed #0056b3;
    outline-offset: -2px;
}

/* 预留折叠机制 */
.mx-sticky-product .mx-ad-placeholder {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    margin-top: 20px;
    background-color: transparent;
}
.mx-sticky-product .mx-ad-placeholder:empty {
    display: none;
}
/* ----------逻辑结束---------- */

/* ==========================================================
   移动端响应式适配
   ========================================================== */
@media screen and (max-width: 768px) {
    .mx-sticky-product {
        display: none !important; /* 👈 核心修改：在宽度小于等于 768px 时彻底隐藏该模块 */
    }
}