/* * Component: Product Single Page 
 * Theme: Industrial, Sharp, High Contrast
 */

.mx-product-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 40px 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #1a202c;
}

/* --- Hero Section 布局 --- */
.mx-product-hero {
    display: flex;
    gap: 60px;
    margin-bottom: 50px; /* ⚡核心修改：从 80px 缩小至 50px，收紧电脑端上下区块的联系 */
}

/* 左侧画廊区 */
.mx-product-gallery {
    flex: 1;
    min-width: 0;
}

/* 主图容器 */
.mx-product-main-image {
    position: relative;
    width: 100%;
    aspect-ratio: 4/3;
    background-color: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 20px;
    /* 移除了默认的 cursor: crosshair，改由 js/放大状态控制 */
}

.mx-main-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* 缩短过渡时间，让鼠标跟随更加丝滑跟手 */
    transition: transform 0.1s ease-out; 
    /* 默认中心点 */
    transform-origin: center center; 
}

/* 新增：配合 JS 的悬浮放大效果 (放大倍数提升至 2 倍，适合工业细节) */
.mx-product-main-image.is-zooming .mx-main-img {
    transform: scale(2);
    cursor: crosshair;
}

/* 视频播放按钮 */
.mx-video-trigger {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 64px;
    height: 64px;
    background-color: rgba(15, 32, 39, 0.8);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease;
    z-index: 10;
}

.mx-video-trigger:hover {
    background-color: #e53e3e;
    transform: translate(-50%, -50%) scale(1.1);
}

.mx-video-trigger svg {
    width: 32px;
    height: 32px;
}

/* --- 缩略图轮播区域 --- */
.mx-product-thumbnail-slider {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

/* 导航箭头按钮 */
.mx-gallery-nav {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #4a5568;
    flex-shrink: 0;
    transition: all 0.2s ease;
    padding: 0;
    outline: none;
}

.mx-gallery-nav:hover:not(:disabled) {
    background: #f7fafc;
    border-color: #cbd5e0;
    color: #0f2027; 
}

/* 轨道遮罩层（限制显示4个） */
.mx-product-thumbnails-wrapper {
    flex: 1;
    overflow: hidden;
    position: relative;
    /* 防止拖拽选中 */
    user-select: none; 
}

/* 实际滑动的轨道 */
.mx-product-thumbnails-track {
    display: flex;
    gap: 15px;
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* 单个缩略图 */
.mx-thumb-item {
    position: relative; /* 新增：必须加这个，为了让里面的播放小图标绝对定位 */
    /* 精确计算：(100% - 3个15px的gap) / 4个项目 = 25% - 11.25px */
    flex: 0 0 calc(25% - 11.25px); 
    aspect-ratio: 1;
    border: 2px solid transparent;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    background-color: #f7fafc;
    transition: border-color 0.2s ease;
}

.mx-thumb-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.mx-thumb-item:hover,
.mx-thumb-item.active {
    border-color: #0f2027;
}

/* 新增：视频缩略图上的小播放标识 */
.mx-thumb-video-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(15, 32, 39, 0.7);
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none; /* 防止遮挡鼠标悬停事件 */
}

.mx-thumb-video-icon svg {
    width: 16px;
    height: 16px;
    margin-left: 2px; /* 视觉微调，让播放三角看起来更居中 */
}

/* 右侧信息区 */
.mx-product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.mx-product-title {
    font-size: 32px;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 10px;
    color: #0f2027;
}

.mx-product-sku {
    font-size: 16px;
    color: #718096;
    margin-bottom: 30px;
    font-weight: 500;
    padding-bottom: 20px;
    border-bottom: 1px solid #e2e8f0;
}

/* mx-key-specs 列表容器重置 */
.mx-key-specs {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

/* 每一行作为 Flex 容器 */
.mx-key-specs li {
    display: flex;
    align-items: flex-start; /* 顶部对齐，防止右侧文字换行时错位 */
    padding: 10px 0; /* 稍微增加一点上下间距，让排版更舒展 */
    border-bottom: 1px dashed #eee;
    font-size: 15px; /* 👉 统一控制整体基础字号 (可根据需要改为 16px) */
    line-height: 1.5;
}

/* 👉 新增：单独干掉最后一行的底边框，完美解决双线冲突 */
.mx-key-specs li:last-child {
    border-bottom: none;
}

/* 图标列：调大 Emoji 尺寸 */
.mx-spec-icon {
    width: 32px; /* 稍微加宽，给放大的图标留出空间 */
    flex-shrink: 0;
    text-align: left;
    font-size: 18px; /* 👉 在这里调大图标尺寸 */
    margin-top: -1px; /* 微调：让图标和右侧文字在视觉上绝对水平居中 */
}

/* ⚡修改后的代码：*/
.mx-spec-label {
    width: 165px;             /* 1. 适当加宽，确保像 Dimensions/Length 这样较长的常规词组能单行显示 */
    flex-shrink: 0;
    font-weight: 600;
    color: #222;
    font-size: 15px;
    padding-right: 12px;      /* 2. 增加右侧安全距离，建立严格的视觉防线，绝对不会再贴在一起 */
    overflow-wrap: break-word; /* 3. 兜底策略：如果以后遇到更加极端的超长单词，强制其向下换行而不是向右溢出 */
}

/* 参数值列 */
.mx-spec-value {
    flex-grow: 1;
    color: #555;
    word-break: break-word; 
    font-size: 15px; /* 独立控制参数字号 */
}

/* 3. 大幅增加按钮组上方的留白（彻底拉开层次） */
.mx-cta-group {
    display: flex;
    gap: 20px;
    margin-top: 60px; /* ⚡核心修改：从 40px 直接拉大到 60px，确立绝对的分界感 */
}

.mx-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 16px 32px;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mx-btn-primary {
    background-color: #0f2027;
    color: #ffffff;
    flex: 1;
}

.mx-btn-primary:hover {
    background-color: #1a3642;
    box-shadow: 0 4px 12px rgba(15, 32, 39, 0.2);
}

.mx-btn-whatsapp {
    background-color: transparent;
    color: #25D366;
    border: 2px solid #25D366;
    gap: 8px;
}

.mx-btn-whatsapp:hover {
    background-color: #25D366;
    color: #ffffff;
}

/* 下方正文基础样式 */
.mx-section-heading {
    text-align: center;
    margin-bottom: 50px;
}

.mx-section-heading h2 {
    font-size: 28px;
    color: #0f2027;
    margin-bottom: 10px;
}

/* 响应式适配 */
@media (max-width: 992px) {
    .mx-product-container {
        /* 上下统一保持 30px，确定对称的基础框架 */
        padding: 30px 15px; 
    }
    .mx-product-hero {
        flex-direction: column;
        gap: 30px; 
        /* ⚡核心修改：彻底归零。消除内部叠加的间距，让底部留白和顶部完全一样 */
        margin-bottom: 0; 
    }
    .mx-product-title {
        font-size: 28px;
    }
    .mx-cta-group {
        flex-direction: column;
    }
    .mx-btn {
        width: 100%;
    }
}

/* 3. 移除 Certs 徽章原有的底边距 */
.mx-cert-badges {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 0; /* ⚡核心修改：改为 0，取消原有的 25px */
    padding-top: 15px;
    border-top: 1px dashed #e2e8f0;
}

.mx-cert-item {
    position: relative;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mx-cert-item img {
    height: 32px; 
    width: auto;
    object-fit: contain;
    filter: grayscale(100%);
    opacity: 0.6;
    transition: all 0.3s ease;
}

.mx-cert-item:hover img {
    filter: grayscale(0%);
    opacity: 1;
}

/* 提示文字框主体 (使用 ::after 读取 data-tooltip) */
.mx-cert-item::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%);
    background-color: #0f2027; /* 严格对齐你项目的高冷色调 */
    color: #ffffff;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4; /* 增加行高，让换行后的文字更易读 */
    padding: 6px 12px;
    border-radius: 4px;
    
    /* 替换了原来的 white-space: nowrap; */
    white-space: normal;
    width: max-content;
    max-width: 220px; /* 限制最大宽度，超过自动换行 */
    text-align: center;
    
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 20;
}

/* 1. 增加防爆区域与上方分割线的留白 */
.mx-zone-badges {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 0;
    padding-top: 25px; /* ⚡核心修改：从 15px 增大到 25px，让虚线下方更有呼吸感 */
    border-top: 1px dashed #e2e8f0;
}

.mx-cert-badges {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 0; 
    padding-top: 25px; /* ⚡核心修改：保持与 Zone 一致，增大到 25px */
    border-top: 1px dashed #e2e8f0;
}

/* 如果 Zone 和 Cert 同时存在时的融合间距也适当放大 */
.mx-zone-badges + .mx-cert-badges {
    border-top: none;
    padding-top: 25px; /* ⚡核心修改：增大到 25px */
}

.mx-zone-item {
    background-color: #f1f5f9;
    color: #475569;
    font-size: 14px;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 4px;
    border: 1px solid #cbd5e1;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

/* 悬停时的反转高冷风格 */
.mx-zone-item:hover {
    background-color: #0f2027;
    color: #ffffff;
    border-color: #0f2027;
}

/* 强制重置 Zone 徽章上 Tooltip 的三角指针位置 (因为没有图片撑高度，需微调) */
.mx-zone-item::before {
    bottom: calc(100% + 4px);
}
.mx-zone-item:hover::before {
    bottom: calc(100% + 8px);
}
.mx-zone-item:hover::after {
    bottom: calc(100% + 14px);
}

/* 提示框下方的向下小三角 (使用 ::before 绘制) */
.mx-cert-item::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px 6px 0 6px;
    border-style: solid;
    border-color: #0f2027 transparent transparent transparent;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    pointer-events: none;
    z-index: 20;
}

/* 悬浮时的动画效果 (向上浮现) */
.mx-cert-item:hover::after {
    opacity: 1;
    visibility: visible;
    bottom: calc(100% + 16px);
}

.mx-cert-item:hover::before {
    opacity: 1;
    visibility: visible;
    bottom: calc(100% + 10px);
}

/* --- PDF 预览链接 (次级操作) --- */
.mx-pdf-action {
    margin-top: 15px; 
    text-align: left;
}

.mx-pdf-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #718096;
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
}

.mx-pdf-link:hover {
    color: #0f2027; 
    text-decoration: underline;
}

/* 针对预览图标的微动效：轻微放大，暗示凑近查看 */
.mx-pdf-link svg {
    transition: transform 0.3s ease;
}

.mx-pdf-link:hover svg {
    transform: scale(1.15); 
}

/* ==========================================
   修复手机端边缘 Tooltip 被屏幕裁切的问题
   ========================================== */
@media (max-width: 992px) {
    /* 1. 稍微收拢移动端提示框的最大宽度 */
    .mx-cert-item::after {
        max-width: 210px; 
    }
    
    /* 2. 靠左的边缘元素 (如 Zone 1 等，以及认证图标的前 2 个)
       策略：取消居中，强制提示框向右展开 */
    .mx-zone-badges .mx-cert-item:nth-child(3n+1)::after,
    .mx-cert-badges .mx-cert-item:nth-child(1)::after,
    .mx-cert-badges .mx-cert-item:nth-child(2)::after {
        left: -5px; 
        transform: translateX(0);
    }
    /* 同步修正小三角指针的位置，对准图标中心 */
    .mx-zone-badges .mx-cert-item:nth-child(3n+1)::before,
    .mx-cert-badges .mx-cert-item:nth-child(1)::before,
    .mx-cert-badges .mx-cert-item:nth-child(2)::before {
        left: 20px; 
        transform: translateX(0);
    }

    /* 3. 靠右的边缘元素 (如 Zone 20 等，以及认证图标的最后 2 个)
       策略：取消居中，强制提示框向左展开 
       注意：这里的 CSS 必须放在左侧元素的下方，确保如果只有 2 个图标时，右侧对齐优先级更高 */
    .mx-zone-badges .mx-cert-item:nth-child(3n)::after,
    .mx-cert-badges .mx-cert-item:nth-last-child(1)::after,
    .mx-cert-badges .mx-cert-item:nth-last-child(2)::after {
        left: auto;
        right: -5px;
        transform: translateX(0);
    }
    /* 同步修正小三角指针的位置，对准图标中心 */
    .mx-zone-badges .mx-cert-item:nth-child(3n)::before,
    .mx-cert-badges .mx-cert-item:nth-last-child(1)::before,
    .mx-cert-badges .mx-cert-item:nth-last-child(2)::before {
        left: auto;
        right: 20px;
        transform: translateX(0);
    }
}