/* B2B 公共头部样式 · v15
 * 来源：modules/Shop/views/home/index.php
 * 用途：shop_layout 全局引用，覆盖 topbar + mainbar + nav-row
 */

@media(max-width:900px){
    .b2b-mainbar-inner{grid-template-columns:1fr;height:auto;padding:12px 16px;gap:12px}
    .b2b-searchbox{width:100%}
    .b2b-actions{justify-self:stretch;justify-content:flex-end}
}
.b2b-topbar{background:#f8fafc;border-bottom:1px solid #e5e7eb;font-size:12px}
.b2b-topbar-inner{max-width:1400px;margin:0 auto;padding:0 24px;height:32px;display:flex;align-items:center;justify-content:space-between}
.b2b-topbar-right{display:flex;gap:12px;align-items:center}
.b2b-topbar-right a{color:#64748b;text-decoration:none;transition:color .15s}
.b2b-topbar-right a:hover{color:#4f46e5}
.b2b-topbar-right span{color:#cbd5e1}
.b2b-mainbar{background:#fff;border-bottom:1px solid #e5e7eb;box-shadow:0 1px 3px rgba(15,23,42,.04)}
.b2b-mainbar-inner{max-width:1400px;margin:0 auto;padding:0 24px;height:76px;display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:20px}
.b2b-logo{display:flex;align-items:center;gap:10px;text-decoration:none;justify-self:start}
.b2b-logo-mark{width:40px;height:40px;border-radius:10px;background:linear-gradient(135deg,#6366f1,#06b6d4);color:#fff;font-weight:900;font-size:20px;display:flex;align-items:center;justify-content:center}
.b2b-logo-img{width:40px;height:40px;object-fit:contain;border-radius:8px}
.b2b-logo-text{font-size:20px;font-weight:900;color:#0f172a;white-space:nowrap}
.b2b-searchbox{width:780px;max-width:100%;justify-self:center;margin-left:60px;display:flex;align-items:center;height:48px;border:2px solid #0f172a;border-radius:6px;position:relative;background:#fff}
.b2b-cat-wrap{position:relative;flex-shrink:0}
.b2b-cat-btn{display:flex;align-items:center;gap:6px;height:44px;padding:0 16px;background:#f8fafc;border:none;border-right:1px solid #e5e7eb;font-size:14px;font-weight:700;color:#334155;cursor:pointer;font-family:inherit;transition:all .15s;white-space:nowrap}
.b2b-cat-btn:hover,.b2b-cat-wrap.open .b2b-cat-btn{background:#eef2ff;color:#4f46e5}
.b2b-cat-wrap.open .b2b-cat-btn svg{transform:rotate(180deg)}
.b2b-cat-btn svg{transition:transform .2s}
.b2b-search-form{flex:1;display:flex;height:44px}
.b2b-search-form input{flex:1;padding:0 16px;border:none;outline:none;font-size:15px;color:#0f172a;background:transparent}
.b2b-search-form input::placeholder{color:#94a3b8}
.b2b-search-btn{width:64px;background:#0f172a;color:#fff;border:none;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:background .15s}
.b2b-search-btn:hover{background:#1e293b}
.b2b-cat-panel{position:absolute;top:calc(100% + 6px);left:-2px;width:720px;background:#fff;border:1px solid #e5e7eb;border-radius:0 0 12px 12px;box-shadow:0 24px 48px rgba(0,0,0,.15);display:none;z-index:9999;overflow:hidden}
.b2b-cat-wrap.open .b2b-cat-panel{display:grid;grid-template-columns:220px 1fr}
.b2b-cat-left{background:#f8fafc;padding:10px 8px;max-height:460px;overflow-y:auto;border-right:1px solid #e5e7eb}
.b2b-cat-l1{display:flex;align-items:center;gap:8px;padding:10px 14px;border-radius:8px;font-size:13.5px;font-weight:600;color:#334155;text-decoration:none;transition:all .15s;margin-bottom:2px}
.b2b-cat-l1:hover{background:#fff;color:#4f46e5}
.b2b-cat-l1.on{background:#4f46e5;color:#fff}
.b2b-cat-right{padding:20px 24px;max-height:460px;overflow-y:auto}
.b2b-cat-group{display:none}
.b2b-cat-group.on{display:block}
.b2b-cat-gt{font-size:14px;font-weight:800;color:#0f172a;margin:0 0 14px;padding-bottom:10px;border-bottom:2px solid #e5e7eb}
.b2b-cat-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:10px}
.b2b-cat-l2{display:flex;flex-direction:column;align-items:center;gap:6px;padding:12px 6px;border-radius:8px;text-decoration:none;transition:all .15s}
.b2b-cat-l2:hover{background:#eef2ff}
.b2b-cat-l2-icon{width:44px;height:44px;border-radius:10px;background:linear-gradient(135deg,#f1f5f9,#e2e8f0);display:flex;align-items:center;justify-content:center;font-size:18px;font-weight:800;color:#4f46e5}
.b2b-cat-l2-name{font-size:12.5px;font-weight:600;color:#334155;text-align:center;line-height:1.3}
.b2b-cat-empty{padding:40px;text-align:center;color:#94a3b8;font-size:13px}
.b2b-actions{display:flex;align-items:center;gap:10px;justify-self:end}
.b2b-action-link{font-size:14px;font-weight:600;color:#334155;text-decoration:none;padding:8px 4px;transition:color .15s}
.b2b-action-link:hover{color:#4f46e5}
.b2b-action-btn{padding:10px 20px;background:#e11d48;color:#fff;border-radius:6px;font-size:14px;font-weight:700;text-decoration:none;transition:background .15s}
.b2b-action-btn:hover{background:#be123c}
/* 语言切换适配 b2b 位置 */
.b2b-lang-wrap .lang-menu{position:relative}
.b2b-lang-wrap .lang-trigger{display:flex;align-items:center;gap:6px;padding:8px 12px;background:#f8fafc;border:1px solid #e5e7eb;border-radius:6px;font-size:13px;font-weight:600;color:#334155;cursor:pointer;font-family:inherit;transition:all .15s}
.b2b-lang-wrap .lang-trigger:hover{border-color:#4f46e5;color:#4f46e5}
.b2b-lang-wrap .lang-trigger svg{transition:transform .2s}
.b2b-lang-wrap .lang-menu.open .lang-trigger svg,.b2b-lang-wrap .lang-menu:hover .lang-trigger svg{transform:rotate(180deg)}
.b2b-lang-wrap .lang-label{display:none}
.b2b-lang-wrap .lang-dropdown{position:absolute;top:calc(100% + 6px);right:0;background:#fff;border-radius:12px;box-shadow:0 12px 40px rgba(0,0,0,.15);min-width:220px;max-height:420px;overflow-y:auto;display:none;z-index:10000;border:1px solid #f1f5f9;padding:6px}
.b2b-lang-wrap .lang-menu:hover .lang-dropdown,.b2b-lang-wrap .lang-menu.open .lang-dropdown{display:block}
.b2b-lang-wrap .lang-item{display:flex;align-items:center;gap:10px;padding:9px 12px;border-radius:8px;text-decoration:none;color:#334155;font-size:13px;transition:background .15s}
.b2b-lang-wrap .lang-item:hover{background:#eef2ff;color:#4f46e5}
.b2b-lang-wrap .lang-item.active{background:#4f46e5;color:#fff}
.b2b-lang-wrap .lang-item.active .lang-name{color:rgba(255,255,255,.8)}
.b2b-lang-wrap .lang-native{flex:1;font-weight:600}
.b2b-lang-wrap .lang-name{color:#94a3b8;font-size:11.5px}
/* 购物车 */
.b2b-cart{position:relative;display:flex;align-items:center;color:#334155;text-decoration:none;padding:6px;transition:color .15s}
.b2b-cart:hover{color:#4f46e5}
.b2b-cart-badge{position:absolute;top:-4px;right:-4px;min-width:18px;height:18px;padding:0 5px;background:#e11d48;color:#fff;font-size:11px;font-weight:800;line-height:18px;text-align:center;border-radius:9px}

.b2b-nav-row{background:#fff;border-bottom:1px solid #f1f5f9}
.b2b-nav-inner{max-width:1400px;margin:0 auto;padding:0 64px;display:flex;align-items:center;justify-content:flex-start;height:32px;overflow-x:auto;scrollbar-width:none}
.b2b-nav-inner::-webkit-scrollbar{display:none}
.b2b-nav-link{font-size:12.5px;font-weight:500;color:#64748b;text-decoration:none;white-space:nowrap;transition:color .15s;padding:0;line-height:32px}
.b2b-nav-link:hover{color:#4f46e5}
.b2b-nav-link.on{color:#0f172a;font-weight:700}
.b2b-nav-inner > .b2b-nav-link + .b2b-nav-link::before{content:'|';color:#e2e8f0;margin:0 14px;font-weight:400}
@media(max-width:768px){
    .b2b-nav-inner{padding:0 16px;height:30px}
    .b2b-nav-link{font-size:12px;line-height:30px}
    .b2b-nav-inner > .b2b-nav-link + .b2b-nav-link::before{margin:0 10px}
}
