:root {
    --primary-blue: #00558c;
    --text-dark: #333;
    --text-grey: #666;
    --border-light: #e0e0e0;
    --bg-light: #f8f9fa;
}

/* =========================================
   Theme Compatibility (Astra & General)
   ========================================= */
/* Force full width for Astra and standard themes on Product pages */
body.single-liangji_product .ast-container,
body.single-liangji_product #primary,
body.single-liangji_product .site-content {
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Hide Astra specific elements if filters fail */
body.single-liangji_product .ast-breadcrumb,
body.single-liangji_product .ast-single-post-order,
body.single-liangji_product .entry-header {
    display: none !important;
}

/* =========================================
   Block Patterns Styles (Press Brake & Robotics)
   ========================================= */

/* Component A: Hero Section */
.lj-hero-section {
    padding: 80px 0;
}
.lj-hero-section h1 {
    font-size: 48px;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 20px;
}
.lj-hero-section h2 {
    font-size: 24px;
    font-weight: 300;
    margin-bottom: 30px;
}
.lj-hero-section .cert-icons img {
    height: 30px;
    margin-right: 15px;
    opacity: 0.8;
}

/* Component B: Product Intro */
.lj-intro-section {
    background: #fff;
    padding: 60px 0;
}
.lj-intro-subhead {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--primary-blue);
}

/* Component C/F: Config Diagram & Feature Highlight */
.lj-config-diagram, .lj-feature-highlight {
    padding: 80px 0;
}
.lj-config-diagram.bg-dark, .lj-feature-highlight.bg-dark {
    background: #1a1a2e;
    color: #fff;
}
.lj-config-diagram.bg-dark h2, .lj-feature-highlight.bg-dark h2 {
    color: #fff;
}
.lj-config-diagram.bg-light, .lj-feature-highlight.bg-light {
    background: #fff;
    color: #333;
}
.lj-config-diagram.bg-gray, .lj-feature-highlight.bg-gray {
    background: #f8f9fa;
    color: #333;
}
.lj-config-diagram.bg-eco, .lj-feature-highlight.bg-eco {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: #fff;
}

/* Numbered List for Config Diagram */
.lj-config-list ol {
    counter-reset: lj-counter;
    list-style: none;
    padding: 0;
    margin: 0;
}
.lj-config-list li {
    position: relative;
    padding-left: 45px;
    margin-bottom: 20px;
    font-size: 16px;
    line-height: 1.5;
    font-weight: 500; /* Refined typography */
}
.lj-config-list li::before {
    counter-increment: lj-counter;
    content: counter(lj-counter);
    position: absolute;
    left: 0;
    top: -2px;
    width: 30px;
    height: 30px;
    background: var(--primary-blue);
    color: #fff;
    border-radius: 50%;
    text-align: center;
    line-height: 30px;
    font-size: 14px;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* Component D: Standard Equipment */
.lj-standard-equipment {
    background: #f8f9fa;
    padding: 80px 0;
}
.lj-standard-equipment h2 {
    color: var(--primary-blue);
    font-weight: 800;
    font-size: 36px;
    margin-bottom: 30px;
    line-height: 1.2;
}
.lj-specs-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.lj-specs-list li {
    position: relative;
    padding-left: 30px;
    margin-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 10px;
}
.lj-specs-list li:last-child {
    border-bottom: none;
}
.lj-specs-list li::before {
    content: '\f00c';
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    left: 0;
    top: 3px;
    color: #28a745;
    font-size: 16px;
}

/* Component E: Features Grid */
.lj-features-grid {
    background: #fff;
    padding: 80px 0;
}
.lj-feature-card {
    background: #f8f9fa;
    padding: 40px 30px;
    border-radius: 10px;
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
    height: 100%;
}
.lj-feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}
.lj-feature-icon {
    font-size: 48px;
    color: var(--primary-blue);
    margin-bottom: 25px;
    display: block;
}
.lj-feature-card h4 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--text-dark);
}
.lj-feature-card p {
    color: var(--text-grey);
    font-size: 15px;
    line-height: 1.6;
}

/* Component G: Tech Specs Charts */
.lj-charts-grid {
    background: #f8f9fa;
    padding: 80px 0;
}
.lj-chart-card {
    background: #fff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    text-align: center;
}
.lj-chart-card h3 {
    margin-bottom: 25px;
    color: var(--text-dark);
    font-size: 22px;
}
.lj-chart-card img {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
}

/* Component H: Tech Specs Table */
.lj-tech-specs-table {
    padding: 80px 0;
    background: #fff;
}
.lj-tech-specs-table h2 {
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 40px;
}
.lj-tech-specs-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 16px;
    border: 1px solid #eee;
}
.lj-tech-specs-table td {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
}
.lj-tech-specs-table tr:nth-child(odd) {
    background-color: #f9f9f9;
}
.lj-tech-specs-table td:first-child {
    font-weight: 600;
    color: var(--text-dark);
    width: 40%;
}
.lj-tech-specs-table td:last-child {
    color: var(--text-grey);
}

/* =========================================
   Top Navigation Styles (Horizontal)
   ========================================= */

/* Top Nav Container */
.top-nav {
    display: flex;
    justify-content: center;
    border-bottom: 1px solid var(--border-light);
    padding: 0 20px;
    background: #fff;
    position: relative;
    z-index: 1000;
}
.nav-menu {
    display: flex;
    list-style: none;
    align-items: center;
}
.nav-item {
    position: relative;
}
.nav-link {
    display: block;
    padding: 25px 20px;
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    transition: 0.3s;
    display: flex;
    align-items: center;
}
.nav-link:hover, .nav-link.active {
    color: var(--primary-blue);
}
.nav-link i {
    font-size: 12px;
    margin-left: 8px;
}

/* Dropdown Menu Styles */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    width: 280px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s ease-in-out;
    z-index: 1100;
    border-radius: 0 0 4px 4px;
    padding: 10px 0;
    list-style: none;
    border-top: 3px solid var(--primary-blue);
}

.nav-item:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: block;
    position: relative;
}

.dropdown-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 25px;
    color: var(--text-dark);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: 0.2s;
}

.dropdown-link:hover {
    background-color: #f5f5f5;
    color: var(--primary-blue);
}

.dropdown-link.active {
    background-color: var(--primary-blue);
    color: #fff;
}

.dropdown-link i {
    font-size: 10px;
    color: #999;
}
.dropdown-link:hover i {
    color: var(--primary-blue);
}
.dropdown-link.active i {
    color: #fff;
}

/* Submenu (Flyout) */
.submenu {
    position: absolute;
    top: -10px; /* Align with parent top */
    left: 100%;
    width: 240px;
    background: #fff;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateX(10px);
    transition: all 0.2s ease;
    list-style: none;
    padding: 10px 0;
    border-radius: 4px;
    margin-left: 2px; /* Spacing */
    border-top: 3px solid var(--primary-blue);
}

.dropdown-item:hover .submenu {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

/* 1. Mega Menu 容器 (垂直标签页结构) */
.mega-menu-container {
    display: flex;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    min-height: 600px;
    border: 1px solid var(--border-light);
    margin-top: 20px; /* 适当增加顶部间距 */
    font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: #fff;
    color: var(--text-dark);
}

/* 左侧分类侧边栏 */
.sidebar {
    width: 280px;
    background: #fff;
    border-right: 1px solid var(--border-light);
    flex-shrink: 0;
}
.category-item {
    padding: 18px 30px;
    cursor: pointer;
    font-weight: 600;
    font-size: 15px;
    color: var(--text-dark);
    text-align: center;
    transition: all 0.2s ease;
    border-bottom: 1px solid transparent;
    border-radius: 4px;
    margin: 4px 8px;
}
.category-item:hover {
    background-color: #e9ecef;
    color: var(--text-dark);
}
.category-item.active {
    background: #333333;
    color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* 右侧产品内容区 */
.content-area {
    flex: 1;
    padding: 25px; /* Reduced from 40px to optimize spacing */
    background: #fff;
}
.products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px; /* Reduced from 30px */
}

/* 产品卡片样式 */
.product-card {
    text-align: center;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: 0.3s;
}
.product-card:hover {
    transform: translateY(-5px);
}
.product-image-wrapper {
    width: 100%;
    height: 200px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.product-image-wrapper img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.product-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 10px;
    line-height: 1.4;
    min-height: 42px;
}
.product-divider {
    width: 80%;
    height: 1px;
    background: #ddd;
    margin: 10px 0;
}
.product-desc {
    font-size: 13px;
    color: var(--text-grey);
    line-height: 1.5;
    padding: 0 10px;
}

/* 隐藏不活跃的面板 */
.tab-panel {
    display: none;
}
.tab-panel.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 响应式调整  简单*/
@media (max-width: 768px) {
    .mega-menu-container {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        display: flex;
        overflow-x: auto;
    }
    .category-item {
        white-space: nowrap;
    }
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Component I: Control System */
.lj-control-system {
    padding: 80px 0;
}
.lj-control-system h2 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 20px;
    line-height: 1.2;
}
.lj-control-system ul {
    list-style: none;
    padding: 0;
    margin-top: 30px;
}
.lj-control-system ul li {
    position: relative;
    padding-left: 25px;
    margin-bottom: 15px;
    font-size: 16px;
    color: #ddd;
}
.lj-control-system ul li::before {
    content: '\f058'; /* fa-check-circle */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    left: 0;
    top: 3px;
    color: var(--primary-blue);
}
.lj-controller-img img {
    border: 5px solid #333;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

/* Component J: Video Gallery */
.lj-video-gallery {
    background: #fff;
    padding: 60px 0;
}
.lj-video-gallery h2 {
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 10px;
}
.lj-video-wrapper {
    position: relative;
    margin-top: 40px;
    cursor: pointer;
}
.lj-video-placeholder {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}
.lj-video-placeholder::after {
    content: '\f144'; /* fa-play-circle */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 80px;
    color: #fff;
    opacity: 0.8;
    text-shadow: 0 5px 15px rgba(0,0,0,0.3);
    transition: 0.3s;
}
.lj-video-wrapper:hover .lj-video-placeholder::after {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
}

/* =========================================
   Astra Theme Compatibility Fixes
   ========================================= */

/* 1. 强制 Mega Menu 容器宽度 */
.mega-menu-container {
    width: 100%;
    max-width: 1400px; /* 保持与设计一致的最大宽度 */
    margin: 20px auto;
    display: flex; /* 确保是 Flex 布局 (左侧边栏 + 右内容) */
}

/* 2. 强制内容区域布局 */
.mega-menu-container .content-area {
    flex: 1; /* 占据剩余空间 */
    width: auto; /* 覆盖可能得固定宽度 */
    padding: 25px;
    box-sizing: border-box; /* 确保 Padding 不增加宽度 */
}

/* 3. 核心修复：强制 4 列网格布局 */
.mega-menu-container .products-grid {
    display: grid !important; /* 提高优先级 */
    grid-template-columns: repeat(4, 1fr) !important; /* 强制 4 列 */
    gap: 20px !important; /* 强制间距 */
    width: 100% !important;
}

/* 4. 修复产品卡片样式 (防止被主题样式覆盖) */
.mega-menu-container .product-card {
    width: 100%; /* 填满网格单元 */
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin: 0 !important; /* 清除可能的外边距 */
}

/* 5. 确保图片容器尺寸正确 */
.mega-menu-container .product-image-wrapper {
    width: 100%;
    height: 180px; /* 稍微减小高度以适应 */
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    margin-bottom: 15px;
}

.mega-menu-container .product-image-wrapper img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain; /* 保持图片比例 */
    width: auto;
    height: auto;
}

/* =========================================
   Responsive Adjustments (响应式适配)
   ========================================= */

/* 平板端 (Tablet) - 变为 3 列或 2 列 */
@media (max-width: 1024px) {
    .mega-menu-container .products-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

/* 移动端 (Mobile) - 堆叠布局 */
@media (max-width: 768px) {
    .mega-menu-container {
        flex-direction: column;
    }
    
    .mega-menu-container .sidebar {
        width: 100%;
        overflow-x: auto; /* 允许横向滚动 */
        display: flex;
        border-right: none;
        border-bottom: 1px solid #eee;
    }

    .mega-menu-container .category-item {
        white-space: nowrap;
        flex-shrink: 0;
    }

    .mega-menu-container .products-grid {
        grid-template-columns: repeat(2, 1fr) !important; /* 手机端保持 2 列 */
        gap: 10px !important;
    }
}
