/**
 * B2B Universal — Theme Core Styles
 * Extracted from class-theme-setup.php::inject_tailwind_config()
 *
 * Contains: Dark mode, Typography, Navigation, Mega Menu, Animations
 * Enqueued via wp_enqueue_style( 'b2b-theme-core' )
 */

            /* ── 暗色模式过渡 ── */
            html.dark { color-scheme: dark; }
            html.dark body { background-color: #0f172a; color: #cbd5e1; }
            html.dark .bg-white, html.dark .bg-slate-50 { background-color: #1e293b !important; }
            html.dark .bg-slate-100, html.dark .bg-slate-200 { background-color: #334155 !important; }
            html.dark .bg-brand-blue { background-color: #020617 !important; }
            html.dark .text-brand-blue { color: #e2e8f0 !important; }
            html.dark .text-slate-900, html.dark .text-slate-800 { color: #f1f5f9 !important; }
            html.dark .text-slate-600, html.dark .text-slate-500 { color: #94a3b8 !important; }
            html.dark .text-slate-400 { color: #64748b !important; }
            html.dark .text-slate-300 { color: #475569 !important; }
            html.dark .border-slate-100, html.dark .border-slate-200 { border-color: #334155 !important; }
            html.dark .border-slate-800 { border-color: #334155 !important; }
            html.dark .shadow-sm { box-shadow: 0 1px 3px rgba(0,0,0,0.3) !important; }
            html.dark .shadow-lg { box-shadow: 0 10px 15px rgba(0,0,0,0.3) !important; }
            html.dark .shadow-xl { box-shadow: 0 10px 25px rgba(0,0,0,0.4) !important; }
            html.dark header#site-header { background-color: #1e293b; border-color: #334155; }
            html.dark #mobile-drawer { background-color: #1e293b; }
            html.dark input, html.dark textarea, html.dark select {
                background-color: #0f172a !important;
                border-color: #334155 !important;
                color: #e2e8f0 !important;
            }
            html.dark .prose { color: #94a3b8; }
            html.dark .prose strong { color: #e2e8f0; }

            /* ── 排版基础（Manta 风格）── */
            h1, h2, h3, h4, h5, h6,
            .font-heading {
                font-family: var(--b2b-font-heading, "Inter", "Aptos", "Segoe UI Variable", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif);
                font-weight: 700;
                letter-spacing: 0em;
                line-height: 1;
            }
            @media (max-width: 767px) {
                h1, h2, h3, h4, h5, h6,
                .font-heading {
                    line-height: 1.2;
                }
            }
            body, p, li, span, td, th, label, input, textarea, select, a {
                letter-spacing: 0.025em;
                line-height: 1.4;
            }

            /* ── 导航栏（Manta 风格 — 全高项）── */
            #desktop-nav {
                position: relative;
                height: 100%;
            }
            #desktop-nav ul {
                list-style: none;
                margin: 0;
                padding: 0;
                display: flex;
                align-items: stretch;
                height: 100%;
                gap: 0;
            }
            #desktop-nav > ul > li {
                position: static;
                display: flex;
                align-items: stretch;
            }
            #desktop-nav > ul > li > a {
                display: flex;
                align-items: center;
                gap: 4px;
                padding: 0 18px;
                font-size: 13.5px;
                font-weight: 600;
                color: #64748b;
                letter-spacing: 0.025em;
                transition: color 0.2s, background 0.2s;
                text-decoration: none;
                border-radius: 0;
                margin: 0;
            }
            #desktop-nav > ul > li > a:hover,
            #desktop-nav > ul > li.current-menu-item > a,
            #desktop-nav > ul > li.current-menu-ancestor > a,
            #desktop-nav > ul > li.mega-open > a {
                color: #0f172a;
                background: #f1f5f9;
            }

            #mobile-nav-content ul {
                list-style: none;
                margin: 0;
                padding: 0;
            }
            #mobile-nav-content > ul > li {
                border-bottom: 1px solid #f1f5f9;
            }
            #mobile-nav-content > ul > li > a {
                display: flex;
                align-items: center;
                justify-content: space-between;
                padding: 14px 0;
                font-size: 15px;
                font-weight: 600;
                color: #1e293b;
                text-decoration: none;
                transition: color 0.15s;
            }
            #mobile-nav-content > ul > li > a:hover {
                color: #10b981;
            }
            #mobile-nav-content > ul > li.current-menu-item > a {
                color: #10b981;
            }
            /* 有子菜单的父级 → 点击展开 */
            #mobile-nav-content .menu-item-has-children > a {
                cursor: pointer;
            }
            #mobile-nav-content .menu-item-has-children > a::after {
                content: '+';
                font-size: 18px;
                font-weight: 300;
                color: #94a3b8;
                transition: transform 0.2s;
                margin-left: 8px;
            }
            #mobile-nav-content .menu-item-has-children.is-open > a::after {
                content: '−';
                color: #10b981;
            }
            #mobile-nav-content .sub-menu {
                list-style: none;
                padding: 0 0 0 16px;
                margin: 0;
                max-height: 0;
                overflow: hidden;
                will-change: max-height;
                transition: max-height 0.35s cubic-bezier(0.16, 1, 0.3, 1);
            }
            #mobile-nav-content .sub-menu li a {
                display: block;
                font-size: 13.5px;
                font-weight: 500;
                padding: 10px 0;
                color: #64748b;
                text-decoration: none;
                border-bottom: none;
            }
            #mobile-nav-content .sub-menu li:last-child a {
                padding-bottom: 4px;
            }
            #mobile-nav-content .sub-menu li a:hover {
                color: #10b981;
            }
            /* ── Mega Menu 移动端适配（drawer 内手风琴展开）── */
            #mobile-nav-content .mega-menu {
                position: relative;
                top: auto;
                left: auto;
                right: auto;
                visibility: visible;
                opacity: 1;
                transform: none;
                pointer-events: auto;
                padding: 8px 0;
                margin: 0;
                background: transparent;
                border-radius: 0;
                box-shadow: none;
                z-index: auto;
                will-change: auto;
                transition: none;
                max-height: 0;
                overflow: hidden;
                transition: max-height 0.35s cubic-bezier(0.16, 1, 0.3, 1);
            }
            #mobile-nav-content .mega-menu.is-open {
                max-height: none;
                overflow: visible;
            }
            #mobile-nav-content .mega-menu-inner {
                flex-direction: column;
                gap: 8px;
            }
            #mobile-nav-content .mega-menu-grid {
                grid-template-columns: 1fr;
                gap: 4px;
            }
            #mobile-nav-content .mega-menu-row {
                gap: 12px;
                padding: 8px 0;
                border-radius: 8px;
            }
            #mobile-nav-content .mega-menu-row:hover {
                transform: none;
            }
            #mobile-nav-content .mega-row-img {
                width: 48px;
                height: 48px;
                border-radius: 8px;
            }
            #mobile-nav-content .mega-row-title {
                font-size: 13px;
            }
            #mobile-nav-content .mega-row-desc {
                font-size: 11px;
            }
            #mobile-nav-content .mega-menu-cta-panel {
                width: 100%;
                min-height: 120px;
                border-radius: 8px;
            }
            #mobile-nav-content .mega-menu-cta-bottom {
                padding-top: 8px;
            }

            /* ── 按钮 CTA 风格 ── */
            .btn-brand {
                font-family: var(--b2b-font-sans, "Inter", "Aptos", "Segoe UI Variable", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif);
                font-weight: 800;
                letter-spacing: 0.3em;
                text-transform: uppercase;
                line-height: 1.42;
            }

            /* ── 全局 hover 变换元素 GPU 加速 ── */
            [class*="hover:"]:where([class*="translate"], [class*="scale"]) {
                will-change: transform;
            }

            /* ── 动画 ── */
            @keyframes fadeInUp {
                from { opacity: 0; transform: translateY(20px); }
                to   { opacity: 1; transform: translateY(0);    }
            }
            @media (prefers-reduced-motion: reduce) {
                *, *::before, *::after {
                    animation-duration: 0.01ms !important;
                    animation-iteration-count: 1 !important;
                    transition-duration: 0.01ms !important;
                }
            }
            .animate-fade-in-up {
                animation: fadeInUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
                will-change: transform, opacity;
            }

            /* Scroll 进场动画（JS 添加 .is-visible 触发） */
            .reveal {
                opacity: 0;
                transform: translateY(24px);
                transition: opacity 0.45s cubic-bezier(0.16, 1, 0.3, 1),
                            transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
                will-change: transform, opacity;
            }
            .reveal.is-visible {
                opacity: 1;
                transform: translateY(0);
            }
            .reveal-delay-1 { transition-delay: 0.1s; }
            .reveal-delay-2 { transition-delay: 0.2s; }
            .reveal-delay-3 { transition-delay: 0.3s; }

            .no-scrollbar::-webkit-scrollbar { display: none; }
            .no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

            /* ══════════════════════════════════════════════════════════════
               Mega Menu — Manta 风格（宽屏 · 大图 · 大间距 · 右侧CTA面板）
               ══════════════════════════════════════════════════════════════ */
            .mega-menu {
                visibility: hidden;
                opacity: 0;
                position: absolute;
                top: 100%;
                left: 0;
                right: 0;
                transform: translateY(-12px);
                margin: 0;
                background: #fff;
                border: none;
                border-radius: 0 0 16px 16px;
                box-shadow: none;
                padding: 28px;
                z-index: 100;
                pointer-events: none;
                will-change: transform, opacity;
                transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1),
                            transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
            }
            #desktop-nav .menu-item-has-children.mega-open > .mega-menu {
                visibility: visible;
                opacity: 1;
                transform: translateY(0);
                pointer-events: auto;
            }
            .mega-menu-inner {
                display: flex;
                gap: 36px;
            }
            .mega-menu-grid {
                flex: 1;
                display: grid;
                gap: 6px;
                min-width: 0;
            }
            .mega-menu-grid.cols-2 {
                grid-template-columns: repeat(2, 1fr);
            }
            .mega-menu-grid.cols-3 {
                grid-template-columns: repeat(3, 1fr);
            }
            /* Mega Menu 行（图片左 + 文字右） */
            .mega-menu-row {
                display: flex;
                align-items: center;
                gap: 18px;
                padding: 5px;
                border-radius: 10px;
                text-decoration: none;
                will-change: transform;
                transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1);
            }
            .mega-menu-row:hover {
                transform: translateX(3px);
            }
            .mega-menu-row:hover .mega-row-title {
                color: #059669;
            }
            .mega-menu-row:hover .mega-row-desc {
                color: #059669;
            }
            .mega-row-img {
                width: 72px;
                height: 72px;
                border-radius: 10px;
                object-fit: cover;
                flex-shrink: 0;
                background: #f1f5f9;
            }
            .mega-row-img-placeholder {
                display: flex;
                align-items: center;
                justify-content: center;
                color: #cbd5e1;
            }
            .mega-row-body {
                min-width: 0;
                flex: 1;
            }
            .mega-row-title {
                font-size: 15px;
                font-weight: 700;
                color: #0f172a;
                margin: 0;
                line-height: 1.2;
                letter-spacing: 0;
                transition: color 0.15s ease;
            }
            .mega-row-desc {
                font-size: 12.5px;
                color: #64748b;
                margin: 5px 0 0;
                line-height: 1.45;
                transition: color 0.15s ease;
                display: -webkit-box;
                -webkit-line-clamp: 2;
                -webkit-box-orient: vertical;
                overflow: hidden;
            }
            /* ══════════════════════════════════════════════════════════════
               Mega Menu CTA 面板 — 方案四：极简专业型
               ══════════════════════════════════════════════════════════════ */
            .mega-menu-cta-panel {
                width: 240px;
                flex-shrink: 0;
                border-radius: 12px;
                overflow: hidden;
                background: #0f172a;
                display: flex;
                align-items: center;
                justify-content: center;
                position: relative;
                min-height: 200px;
            }
            /* 装饰性背景图片（模糊） */
            .mega-menu-cta-panel .mega-cta-bg-blur {
                position: absolute;
                inset: 0;
                background-size: cover;
                background-position: center;
                filter: blur(8px) brightness(0.4);
                opacity: 0.35;
                z-index: 0;
            }
            .mega-menu-cta-panel .mega-cta-body {
                position: relative;
                z-index: 1;
                text-align: center;
                color: #fff;
                padding: 32px 24px;
                display: flex;
                flex-direction: column;
                align-items: center;
            }
            .mega-menu-cta-panel .mega-card-title {
                font-size: 22px;
                font-weight: 700;
                letter-spacing: -0.3px;
                margin: 0 0 6px;
                line-height: 1.2;
            }
            .mega-menu-cta-panel .mega-cta-accent {
                width: 36px;
                height: 2.5px;
                background: #3b82f6;
                border-radius: 2px;
                margin: 0 auto 14px;
            }
            .mega-menu-cta-panel .mega-card-desc {
                font-size: 12px;
                color: #94a3b8;
                margin: 0 0 22px;
                line-height: 1.5;
            }
            .mega-menu-cta-panel .mega-cta-link {
                display: inline-flex;
                align-items: center;
                gap: 6px;
                padding: 9px 24px;
                border: 1.5px solid rgba(255,255,255,0.2);
                border-radius: 100px;
                color: #fff;
                font-size: 12px;
                font-weight: 500;
                text-decoration: none;
                will-change: transform;
                transition: background 0.2s ease, border-color 0.2s ease;
                letter-spacing: 0.02em;
            }
            .mega-menu-cta-panel .mega-cta-link:hover {
                background: rgba(255,255,255,0.08);
                border-color: rgba(255,255,255,0.4);
                transform: none;
            }

            /* Mega Menu CTA 底部按钮（≤3 项时的独立按钮） */
            .mega-menu-cta-bottom {
                border-top: 1px solid #1e293b;
                padding-top: 14px;
                margin-top: 0;
            }
            .mega-menu-cta-bottom .mega-cta-btn-large {
                display: flex;
                align-items: center;
                justify-content: center;
                gap: 8px;
                width: 100%;
                padding: 12px 20px;
                background: #0f172a;
                color: #fff;
                font-size: 13px;
                font-weight: 600;
                border-radius: 100px;
                text-decoration: none;
                will-change: transform;
                transition: background 0.15s ease, border-color 0.15s ease;
                letter-spacing: 0.025em;
                border: 1.5px solid rgba(255,255,255,0.15);
            }
            .mega-menu-cta-bottom .mega-cta-btn-large:hover {
                background: #1e293b;
                border-color: rgba(255,255,255,0.3);
            }

            /* 无子菜单的普通顶级项 — 用原有的 sub-menu 样式 */
            @keyframes megaFadeIn {
                0%   { opacity: 0; transform: translateX(-50%) translateY(-4px); }
                100% { opacity: 1; transform: translateX(-50%) translateY(0); }
            }
            .sub-menu {
                display: none;
                position: absolute;
                top: 100%;
                left: 50%;
                transform: translateX(-50%);
                min-width: 200px;
                background: #fff;
                border: 1px solid #e2e8f0;
                border-radius: 12px;
                box-shadow: 0 20px 40px -8px rgba(0,0,0,0.12), 0 8px 16px -6px rgba(0,0,0,0.06);
                padding: 8px;
                z-index: 100;
                list-style: none;
                margin: 8px 0 0;
            }
            .sub-menu::before {
                content: '';
                position: absolute;
                top: -6px;
                left: 50%;
                transform: translateX(-50%) rotate(45deg);
                width: 12px;
                height: 12px;
                background: #fff;
                border-left: 1px solid #e2e8f0;
                border-top: 1px solid #e2e8f0;
                border-radius: 3px 0 0 0;
            }
            #desktop-nav .menu-item-has-children.mega-open > .sub-menu {
                display: block;
                will-change: transform, opacity;
                animation: megaFadeIn 0.15s cubic-bezier(0.16, 1, 0.3, 1);
            }
            .sub-menu li a {
                display: block;
                padding: 9px 16px;
                font-size: 13px;
                font-weight: 500;
                color: #64748b;
                border-radius: 8px;
                transition: all 0.12s;
                text-decoration: none;
                white-space: nowrap;
            }
            .sub-menu li a:hover {
                color: #0f172a;
                background: #f8fafc;
            }
        


/* Homepage polish: avoid overly tall mobile hero and make category cards cleaner. */
.b2b-home-hero { min-height: 520px; }
@media (min-width: 768px) { .b2b-home-hero { min-height: 620px; } }
.b2b-home-hero .container { width: 100%; }
