/*
 * 模块: 销售网络组件 (完整未压缩开发版 + V2八向避让引擎)
 * 路径: assets/css/components/sales-network.css
 * 规范: 西门子工业风 / 直角零圆角 / 极简元素选择器 / 主色 #111418, 点缀 #E32D2D
 */

/* =========================================
   🛡️ 第一步：MX Matrix 组件专属防御盾 (对外)
   ========================================= */

/* 1. 外部绝对清零：彻底干掉 WordPress 主题默认的所有上下左右内边距 */
body .inside-article:has(.mx-sales-network-wrapper),
body .entry-content:has(.mx-sales-network-wrapper) {
    padding: 0 !important; 
}

/* 2. 电脑端 (≥769px)：容器接管，上下左右绝对 30px */
@media (min-width: 769px) {
    .mx-matrix-wrapper.mx-sales-network-wrapper .mx-container {
        padding: 30px !important; 
        max-width: 1640px; 
        margin: 0 auto;    
    }
}

/* 3. 手机端 (≤768px)：容器接管，上下 30px，左右 10px */
@media (max-width: 768px) {
    .mx-matrix-wrapper.mx-sales-network-wrapper .mx-container {
        padding: 30px 10px !important; 
    }
}

/* ==========================================
 * 🎨 第二步：组件内部排版与逻辑 (对内)
 * ========================================== */
.mx-sales-network-wrapper {
    background-color: #ffffff;
    color: #111418;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    font-family: inherit;
}

.mx-sn-header {
    padding: 0 0 2rem 0; 
    border-bottom: 1px solid #ebebeb;
    margin-bottom: 2rem;
}

/* 针对移动端进一步压缩 */
@media (max-width: 768px) {
    .mx-sn-header {
        padding: 0 0 1rem 0; 
        margin-bottom: 1rem;
    }
}

.mx-sn-title {
    font-size: clamp(1.5rem, 4vw, 2.25rem);
    font-weight: 700;
    color: #111418;
    margin: 0 0 0.5rem 0 !important; 
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mx-sn-desc {
    font-size: 1.1rem;
    color: #555555;
    margin: 0;
}

/* ==========================================
 * 地图骨架与绝对定位核心
 * ========================================== */
.mx-sn-map-container {
    position: relative;
    width: 100%;
    /* 🚀 核心修复 1：强制锁定 2:1 的宽高比，锁死坐标系 */
    aspect-ratio: 2 / 1; 
    margin: 0 auto 3rem auto;
    background-color: #fcfcfc;
    border: 1px solid #ebebeb;
    /* 🚀 核心修复 2：彻底设为 0！ */
    padding: 0; 
    overflow: hidden;
    /* 全局缩放变量，PC端默认 1:1 */
    --mx-map-scale: 1; 
}

/* 📱 响应式：根据屏幕宽度，阶梯式缩小内部红点和文字大小 */
@media (max-width: 1024px) { .mx-sn-map-container { --mx-map-scale: 0.85; } }
@media (max-width: 768px)  { .mx-sn-map-container { --mx-map-scale: 0.65; } }
@media (max-width: 576px)  { .mx-sn-map-container { --mx-map-scale: 0.45; } }
@media (max-width: 400px)  { .mx-sn-map-container { --mx-map-scale: 0.35; } }

.mx-sn-map-bg {
    width: 100%;
    height: 100%; 
    display: block;
    opacity: 0.6;
    object-fit: cover; 
}

/* 容器基本属性（以红点为变形中心） */
.mx-map-node {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    transform: translate(-50%, -50%) scale(var(--mx-map-scale));
    z-index: 2;
}

/* 核心标签定位（默认挂在红点正下方） */
.mx-node-label {
    position: absolute;
    top: 16px; 
    left: 50%;
    transform: translateX(-50%);
    margin-top: 0;
    font-size: 0.7rem; 
    font-weight: 700;
    color: #111418;
    background: rgba(255, 255, 255, 0.95);
    padding: 2px 5px;
    border: 1px solid #111418;
    letter-spacing: 0.2px;
    white-space: nowrap;
    z-index: 5;
    transition: z-index 0.2s ease;
}

/* 🚀 悬浮层级提升：鼠标放上去时，被遮挡的标签弹到最上层 */
.mx-map-node:hover { 
    z-index: 20; 
}
.mx-map-node:hover .mx-node-label { 
    z-index: 20; 
    box-shadow: 2px 2px 0px rgba(227, 45, 45, 0.3); 
}

/* ==========================================
 * 📍 坐标与防重叠引擎 V2：27国+总部 八向避让法则
 * ========================================== */

/* >>>>>>>>>>> 1. 中国制造总部 (HQ) <<<<<<<<<<< */
.mx-node-hq { top: 34%; left: 79.3%; z-index: 10; } /* 总部红点 */
.mx-node-hq .mx-node-label { 
    background: #ffffff; 
    border: 2px solid #0056b3; /* 边框改为科技蓝 */
    top: 22px; 
    padding: 4px 8px; 
    display: flex;
    align-items: center;
    justify-content: center;
    width: max-content; 
}
.mx-hq-logo {
    height: 18px !important;
    width: auto !important;
    max-width: none !important; 
    display: block;
    flex-shrink: 0;
}

/* >>>>>>>>>>> 2. 美洲出口区 (Americas) <<<<<<<<<<< */
/* 基础坐标 */
.mx-node-us { top: 27%; left: 18%; } /* 美国 */
.mx-node-mx { top: 37%; left: 18%; } /* 墨西哥 */
.mx-node-gt { top: 40.8%; left: 21%; } /* 危地马拉 */
.mx-node-br { top: 54%; left: 31%; } /* 巴西 */
.mx-node-bo { top: 59%; left: 28.3%; } /* 玻利维亚 */

/* V2 避让规则 */
.mx-node-mx .mx-node-label { top: -8px; left: auto; right: 14px; transform: none; } /* 墨西哥: 推向正左 */
.mx-node-gt .mx-node-label { top: 10px; left: 10px; transform: none; } /* 危地马拉: 推向右下 */
.mx-node-bo .mx-node-label { top: 10px; left: auto; right: 8px; transform: none; } /* 玻利维亚: 推向左下 */

/* >>>>>>>>>>> 3. EMEA区 (欧洲/中东/非洲) <<<<<<<<<<< */
/* 基础坐标 */
.mx-node-fr { top: 23%; left: 47%; } /* 法国 */
.mx-node-de { top: 20.5%; left: 49%; } /* 德国 */
.mx-node-pl { top: 19.5%; left: 49.5%; } /* 波兰 */
.mx-node-gh { top: 44.7%; left: 45.9%; } /* 加纳 */
.mx-node-sa { top: 36%; left: 58.5%; } /* 沙特阿拉伯 */
.mx-node-ae { top: 36%; left: 61.5%; } /* 阿联酋 */
.mx-node-om { top: 38%; left: 61.8%; } /* 阿曼 */

/* V2 避让规则 */
.mx-node-de .mx-node-label { top: auto; bottom: 16px; left: 50%; transform: translateX(-50%); } /* 德国: 推向正上 */
.mx-node-fr .mx-node-label { top: 8px; left: auto; right: 8px; transform: none; } /* 法国: 推向左下 */
.mx-node-pl .mx-node-label { top: 8px; left: 8px; transform: none; } /* 波兰: 推向右下 */
.mx-node-sa .mx-node-label { top: -8px; left: auto; right: 14px; transform: none; } /* 沙特: 推向正左 */
.mx-node-ae .mx-node-label { top: -20px; left: auto; right: 6px; transform: none; } /* 阿联酋: 推向左上 */
.mx-node-om .mx-node-label { top: 8px; left: 8px; transform: none; } /* 阿曼: 推向右下 */

/* >>>>>>>>>>> 4. 亚太及独联体区 (Asia & CIS) <<<<<<<<<<< */
/* 基础坐标 */
.mx-node-ru { top: 14%; left: 74%; } /* 俄罗斯 */
.mx-node-kz { top: 22%; left: 65%; } /* 哈萨克斯坦 */
.mx-node-tm { top: 27%; left: 62.7%; } /* 土库曼斯坦 */
.mx-node-pk { top: 32%; left: 66%; } /* 巴基斯坦 */
.mx-node-in { top: 37%; left: 68%; } /* 印度 */
.mx-node-lk { top: 45.1%; left: 68.7%; } /* 斯里兰卡 */
.mx-node-mm { top: 37%; left: 72.8%; } /* 缅甸 */
.mx-node-vn { top: 42%; left: 76.3%; } /* 越南 */
.mx-node-th { top: 40.5%; left: 74.3%; } /* 泰国 */
.mx-node-my { top: 47%; left: 74.5%; } /* 马来西亚 */
.mx-node-sg { top: 48.5%; left: 75%; } /* 新加坡 */
.mx-node-id { top: 51%; left: 80%; } /* 印度尼西亚 */
.mx-node-kr { top: 29%; left: 81.7%; } /* 韩国 */
.mx-node-jp { top: 28.7%; left: 85%; } /* 日本 */
.mx-node-au { top: 63%; left: 83.5%; } /* 澳大利亚 */

/* V2 避让规则 */
.mx-node-kz .mx-node-label { top: auto; bottom: 16px; left: 50%; transform: translateX(-50%); } /* 哈萨克斯坦: 推向正上 */
.mx-node-tm .mx-node-label { top: auto; bottom: 16px; left: 50%; transform: translateX(-50%); } /* 土库曼斯坦: 推向正上 */
.mx-node-pk .mx-node-label { top: -8px; left: auto; right: 14px; transform: none; } /* 巴基斯坦: 推向正左 */
.mx-node-in .mx-node-label { top: 8px; left: auto; right: 8px; transform: none; } /* 印度: 推向左下 */
.mx-node-mm .mx-node-label { top: -16px; left: auto; right: 4px; transform: none; } /* 缅甸: 推向左上 */
.mx-node-th .mx-node-label { top: 8px; left: auto; right: 8px; transform: none; } /* 泰国: 推向左下 */
.mx-node-vn .mx-node-label { top: 0px; left: 14px; right: auto; transform: none; } /* 越南: 推向正右 */
.mx-node-my .mx-node-label { top: -8px; left: auto; right: 14px; transform: none; } /* 马来西亚: 推向正左 */
.mx-node-sg .mx-node-label { top: 12px; left: 12px; transform: none; z-index: 6; } /* 新加坡: 推向右下 */
.mx-node-kr .mx-node-label { top: auto; bottom: 16px; left: 50%; transform: translateX(-50%); } /* 韩国: 推向正上 */
.mx-node-jp .mx-node-label { top: -8px; left: 14px; right: auto; transform: none; } /* 日本: 推向正右 */
.mx-node-id .mx-node-label { top: 20px; } /* 印尼   默认是 16px，改为 20px 给新加坡腾出呼吸空间 */

/* ==========================================
 * 雷达动画与光圈扩散特效 (展开格式)
 * ========================================== */
/* 常规节点红光信号 */
.mx-node-pulse {
    width: 12px;
    height: 12px;
    background-color: #E32D2D;
    border-radius: 50%;
    position: relative;
    box-shadow: 0 0 0 rgba(227, 45, 45, 0.6);
    animation: mx-radar-pulse 2s infinite;
}

/* 制造总部信号源 (改为科技蓝) */
.mx-pulse-hq {
    background-color: #0056b3; 
    box-shadow: 0 0 0 rgba(0, 86, 179, 0.6);
    animation: mx-radar-pulse-hq 2.5s infinite;
}

/* 红色雷达呼吸动画 */
@keyframes mx-radar-pulse {
    0% { box-shadow: 0 0 0 0 rgba(227, 45, 45, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(227, 45, 45, 0); }
    100% { box-shadow: 0 0 0 0 rgba(227, 45, 45, 0); }
}

/* 总部雷达扩散动画 (改为科技蓝 rgba: 0,86,179) */
@keyframes mx-radar-pulse-hq {
    0% { box-shadow: 0 0 0 0 rgba(0, 86, 179, 0.8); }
    70% { box-shadow: 0 0 0 18px rgba(0, 86, 179, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 86, 179, 0); }
}

/* ==========================================
 * 下方三栏大区网格排版布局
 * ========================================== */
.mx-sn-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.mx-sn-region {
    border: 1px solid #ebebeb;
    background-color: #fcfcfc;
    padding: 1.5rem;
    border-radius: 0; 
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.mx-sn-region:hover {
    border-color: #111418;
    box-shadow: 4px 4px 0px rgba(17, 20, 24, 0.05); 
}

.mx-sn-region-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #111418;
    padding-bottom: 0.75rem;
    margin-bottom: 1rem;
}

.mx-sn-region-header h3 {
    font-size: 1.25rem;
    margin: 0;
    color: #111418;
    font-weight: 700;
}

/* 合规认证等级标签 */
.mx-badge {
    background-color: #0056b3;
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.6rem;
    border-radius: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mx-sn-country-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mx-sn-country-list li {
    padding: 0.6rem 0;
    border-bottom: 1px dashed #e0e0e0;
    font-size: 0.95rem;
    color: #111418;
    font-weight: 700;
    display: flex;
    justify-content: space-between;
}

.mx-sn-country-list li:last-child {
    border-bottom: none;
}

.mx-sn-country-list li span {
    font-weight: 400;
    color: #666666;
    font-size: 0.85rem;
}

/* ==========================================
 * CTA (行动号召栏) 模块 (完整修复版)
 * ========================================== */

/* 1. 恢复外层黑底容器与排版 */
.mx-sn-cta {
    background-color: #111418 !important; /* 强制黑底，防止被覆盖 */
    color: #ffffff;
    padding: 2.5rem 2rem;
    text-align: center;
    border-left: 6px solid #0056b3; 
}

/* 2. 恢复段落文字为白色 */
.mx-sn-cta p {
    margin: 0 0 1.25rem 0;
    font-size: 1.15rem;
    color: #ffffff !important; 
}

/* 3. 科技蓝高亮按钮（已修复被全局污染的问题） */
.mx-sn-cta .mx-btn-primary {
    display: inline-block;
    background-color: #0056b3 !important; 
    color: #ffffff !important; 
    text-decoration: none;
    padding: 0.75rem 2rem;
    font-weight: 700;
    font-size: 0.95rem;
    text-transform: uppercase;
    border-radius: 0;
    border: none !important; 
    box-shadow: none !important;
    transition: all 0.2s ease !important; 
}

/* 4. 按钮悬浮动效 */
.mx-sn-cta .mx-btn-primary:hover,
.mx-sn-cta .mx-btn-primary:focus {
    background-color: #006ce6 !important; 
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(0, 108, 230, 0.4) !important; 
    transform: translateY(-2px) !important; 
}