/* =====================================================
   1. 全局基础重置
   ===================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #333;
    line-height: 1.6;
    background-color: #f8fafc;
}
a {
    text-decoration: none;
    color: inherit;
}
ul, ol {
    list-style: none !important;
    padding: 0;
    margin: 0;
}
.container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 20px;
}
.d-flex { display: flex; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }

/* =====================================================
   2. 顶部栏 (Top Bar) - 统一蓝色背景
   ===================================================== */
.top-bar {
    background-color: #0056b3 !important; /* 品牌蓝色 */
    color: #ffffff !important;
    font-size: 13px;
    padding: 10px 0;
    border-bottom: none !important;
}
.top-bar a,
.top-bar span,
.top-bar .company-name,
.top-bar .contact-item,
.top-bar .current-lang {
    color: #ffffff !important;
}
.top-contact {
    display: flex;
    align-items: center;
    gap: 20px;
}
.top-contact a {
    text-decoration: none;
}
.language-selector {
    position: relative;
    cursor: pointer;
}
.current-lang {
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}
.lang-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: #fff;
    color: #333;
    list-style: none;
    padding: 8px 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-radius: 4px;
    width: 120px;
    z-index: 1100;
}
.language-selector:hover .lang-dropdown {
    display: block;
}
.lang-dropdown li a {
    display: block;
    padding: 6px 15px;
    color: #333 !important;
    font-size: 13px;
    text-decoration: none;
}
.lang-dropdown li a:hover {
    background: #f1f5f9;
    color: #0056b3 !important;
}

/* =====================================================
   3. 主导航栏 (Main Header) - 统一蓝色背景与导航
   ===================================================== */
.main-header {
    background-color: #0056b3 !important; /* 与顶部栏一致的蓝色 */
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 10px 0;
}
.main-header .container {
    height: 85px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.site-logo img {
    height: 50px;
    width: auto;
    display: block;
}
.site-navigation .nav-menu {
    display: flex;
    align-items: center;
    gap: 22px;
}
.site-navigation .nav-item {
    position: relative;
}
.site-navigation .nav-link {
    font-size: 14px;
    font-weight: 500;
    color: #ffffff !important;
    text-decoration: none;
    padding: 12px 0;
    display: inline-block;
    transition: color 0.2s;
}
.site-navigation .nav-link:hover,
.site-navigation .nav-link.active {
    color: #ffc107 !important; /* 悬停/激活显黄色 */
}

/* 下拉菜单 (Dropdown Menu) */
.site-navigation .has-dropdown .dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    box-shadow: 0 6px 16px rgba(0,0,0,0.1);
    min-width: 220px;
    padding: 8px 0;
    border-radius: 4px;
    z-index: 1050;
    border: 1px solid #e2e8f0;
}
.site-navigation .has-dropdown:hover .dropdown-menu {
    display: block;
}
.site-navigation .dropdown-menu .dropdown-item a {
    display: block;
    padding: 8px 18px;
    color: #334155 !important;
    font-size: 13px;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.2s, color 0.2s;
}
.site-navigation .dropdown-menu .dropdown-item a:hover {
    background-color: #f8fafc;
    color: #0056b3 !important;
}

.header-action .btn-primary {
    background-color: #ffc107;
    color: #0056b3;
    padding: 10px 22px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    transition: background 0.3s;
}
.header-action .btn-primary:hover {
    background-color: #e0a800;
}

/* 汉堡按钮（默认 PC 端隐藏） */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 22px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}
.mobile-menu-toggle .bar {
    width: 100%;
    height: 3px;
    background-color: #ffffff;
    border-radius: 2px;
    transition: all 0.3s ease-in-out;
}

/* =====================================================
   4. 首页产品网格区 (Product Grid)
   ===================================================== */
.home-products-section {
    padding: 60px 0;
}
.section-header {
    text-align: center;
    margin-bottom: 40px;
}
.section-title {
    font-size: 30px;
    color: #0f172a;
    margin-bottom: 10px;
    font-weight: 700;
}
.section-subtitle {
    color: #64748b;
    font-size: 15px;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
}
.product-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
}
.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px -5px rgba(0,0,0,0.1);
}
.product-img-wrap img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}
.product-content {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}
.product-title a {
    font-size: 16px;
    color: #0f172a;
    font-weight: 600;
    text-decoration: none;
}
.product-title a:hover {
    color: #0284c7;
}
.product-desc {
    font-size: 13px;
    color: #64748b;
    margin-top: 8px;
    line-height: 1.4;
    flex-grow: 1;
}
.product-footer {
    margin-top: 15px;
}
.btn-sm {
    display: inline-block;
    background: #0284c7;
    color: #fff;
    padding: 6px 14px;
    border-radius: 4px;
    font-size: 13px;
    text-decoration: none;
    transition: background 0.2s;
}
.btn-sm:hover {
    background: #0369a1;
}

/* 分页样式 */
.pagination-container {
    margin-top: 40px;
    display: flex;
    justify-content: center;
}
.pagination-list {
    display: flex;
    gap: 8px;
    list-style: none !important;
}
.page-link {
    padding: 8px 14px;
    border: 1px solid #cbd5e1;
    background: #fff;
    color: #334155;
    border-radius: 4px;
    text-decoration: none;
}
.page-link.active, .page-link:hover {
    background: #0284c7;
    color: #fff;
    border-color: #0284c7;
}

/* =====================================================
   5. 公共黑底底部 (Footer)
   ===================================================== */
.site-footer-dark {
    background-color: #0f172a;
    color: #94a3b8;
    padding-top: 50px;
    margin-top: 60px;
    border-top: 1px solid #1e293b;
    font-size: 14px;
}
.footer-container {
    display: grid;
    grid-template-columns: 2fr 1fr 1.5fr;
    gap: 40px;
    padding-bottom: 40px;
}
.footer-col .footer-logo {
    color: #38bdf8;
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 12px;
}
.footer-col .footer-desc {
    line-height: 1.6;
    color: #94a3b8;
}
.footer-col .footer-title {
    color: #f8fafc;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    position: relative;
    padding-bottom: 8px;
}
.footer-col .footer-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 30px;
    height: 2px;
    background-color: #38bdf8;
}
.footer-links ul li {
    margin-bottom: 8px;
}
.footer-links ul li a {
    color: #cbd5e1;
    text-decoration: none;
    transition: color 0.2s;
}
.footer-links ul li a:hover {
    color: #38bdf8;
}
.contact-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    color: #cbd5e1;
}
.contact-list li a {
    color: #cbd5e1;
    text-decoration: none;
}
.contact-list li a:hover {
    color: #38bdf8;
}
.footer-bottom {
    background-color: #020617;
    padding: 18px 0;
    text-align: center;
    border-top: 1px solid #1e293b;
    font-size: 13px;
    color: #64748b;
}

/* =====================================================
   6. 响应式与手机端自适应 (Responsive Media Queries)
   ===================================================== */

/* 中等屏幕（平板电脑 / 窄屏 PC） */
@media (max-width: 992px) {
    .product-grid { 
        grid-template-columns: repeat(2, 1fr); 
    }
    .footer-container { 
        grid-template-columns: 1fr; 
        gap: 30px; 
    }
}

/* 手机端专用适配 (屏幕宽度 <= 768px) */
@media screen and (max-width: 768px) {

    /* 顶部小黑条适配 */
    .top-bar .container {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
    .top-contact {
        flex-direction: column;
        gap: 5px;
    }

    /* 页头与导航自适应 */
    .main-header {
        padding: 5px 0;
    }
    .main-header .container {
        height: 60px;
        position: relative;
    }
    .site-logo img {
        height: 40px;
    }
    
    /* 隐藏 Header 右侧的 Get A Quote 按钮，保持手机顶部简洁 */
    .header-action {
        display: none;
    }

    /* 显示汉堡按钮 */
    .mobile-menu-toggle {
        display: flex;
    }

    /* 手机端导航下拉展开层 */
    .site-navigation {
        display: none; /* 默认隐藏 */
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: #004494; /* 稍微深一点的蓝色背景 */
        box-shadow: 0 8px 16px rgba(0,0,0,0.2);
        z-index: 1000;
        padding: 15px 20px;
    }
    /* JS 点击 Toggle 后激活显示 */
    .site-navigation.active {
        display: block;
    }
    .site-navigation .nav-menu {
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
        width: 100%;
    }
    .site-navigation .nav-item {
        width: 100%;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    .site-navigation .nav-link {
        display: block;
        padding: 12px 0;
        font-size: 15px;
        width: 100%;
    }
    
    /* 手机端下拉二级菜单展开排布 */
    .site-navigation .has-dropdown .dropdown-menu {
        position: static;
        display: block; /* 手机端直接展开二级菜单 */
        background: transparent;
        box-shadow: none;
        border: none;
        padding-left: 15px;
        min-width: 100%;
    }
    .site-navigation .dropdown-menu .dropdown-item a {
        color: #dbeafe !important;
        padding: 8px 0;
        font-size: 13px;
    }

    /* 首页 Hero Banner 适配 */
    .hero-banner-section {
        padding: 40px 0 !important;
    }
    .hero-banner-section h1 {
        font-size: 24px !important;
        line-height: 1.3 !important;
    }
    .hero-banner-section p {
        font-size: 14px !important;
        margin-bottom: 20px !important;
    }

    /* 产品网格手机端强制单列 */
    .product-grid {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }

    /* 强制覆盖页脚（Footer）行内写死的死板高度与宽度 */
    .site-footer-dark {
        height: auto !important; /* 解除 70mm 高度限制 */
        padding: 30px 15px 15px !important;
        margin-top: 40px !important;
    }
    .site-footer-dark .footer-container {
        display: flex !important;
        flex-direction: column !important;
        height: auto !important;
        gap: 25px !important;
        padding-bottom: 20px !important;
    }
    .site-footer-dark .footer-col {
        max-width: 100% !important;
        width: 100% !important;
        flex: none !important;
        padding: 0 !important;
    }
    .site-footer-dark .product-category-list {
        display: block !important;
        max-height: none !important;
    }
    .site-footer-dark .product-category-list li {
        width: 100% !important;
        margin-right: 0 !important;
        margin-bottom: 6px !important;
    }
    .site-footer-dark .footer-bottom {
        height: auto !important;
        padding: 12px 10px !important;
    }
    
    /* 悬浮 WhatsApp 按钮手机端位置优化 */
    .whatsapp-float {
        right: 15px !important;
        bottom: 20px !important;
    }
    .whatsapp-float a {
        width: 42px !important;
        height: 42px !important;
    }
    .whatsapp-float svg {
        width: 24px !important;
        height: 24px !important;
    }
}
/* =====================================================
   修复 WhatsApp 悬浮图标（防止放大变形、固定右下角悬浮）
   ===================================================== */
.whatsapp-float {
    position: fixed !important;
    right: 30px !important;
    bottom: 30px !important;
    z-index: 9999 !important;
}

.whatsapp-float a {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 48px !important;
    height: 48px !important;
    background-color: #25D366 !important;
    border-radius: 50% !important;
    box-shadow: 0 4px 10px rgba(0,0,0,0.4) !important;
    text-decoration: none !important;
}

.whatsapp-float svg {
    width: 28px !important;
    height: 28px !important;
    fill: #ffffff !important;
    display: block !important;
}
/* =====================================================
   Product image layout fix (2026-11)
   Keep portrait/landscape source images inside a consistent frame.
   Use contain to avoid cropping refractory product photos.
   ===================================================== */
.product-grid .product-card > a:first-child {
    display: block;
    width: 100%;
    overflow: hidden;
    background: #fff;
}
.product-grid .product-card > a:first-child img,
.product-grid .product-card .product-img-wrap img {
    display: block;
    width: 100%;
    height: 230px;
    max-height: 230px;
    object-fit: contain;
    object-position: center;
    padding: 12px;
    box-sizing: border-box;
    background: #fff;
}
.product-detail-layout > div:first-child > img:first-child {
    display: block;
    width: 100%;
    height: 420px;
    max-height: 420px;
    object-fit: contain;
    object-position: center;
    padding: 12px;
    box-sizing: border-box;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}
.product-detail-layout > div:first-child > img:not(:first-child) {
    width: 84px !important;
    height: 84px !important;
    max-width: 84px;
    max-height: 84px;
    object-fit: contain;
    object-position: center;
    padding: 4px;
    box-sizing: border-box;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 5px;
}
@media (max-width: 768px) {
    .product-grid .product-card > a:first-child img,
    .product-grid .product-card .product-img-wrap img {
        height: 220px;
        max-height: 220px;
    }
    .product-detail-layout {
        grid-template-columns: 1fr !important;
    }
    .product-detail-layout > div:first-child > img:first-child {
        height: 300px;
        max-height: 300px;
    }
}

/* =====================================================
   手机端导航补充：二级菜单默认折叠、菜单过长可滚动、长分类名自动换行
   ===================================================== */
@media screen and (max-width: 768px) {
    .site-navigation {
        max-height: calc(100vh - 110px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    .site-navigation .has-dropdown:not(.open) .dropdown-menu {
        display: none;
    }
    .site-navigation .has-dropdown.open .dropdown-menu {
        display: block;
    }
    .site-navigation .has-dropdown > .nav-link {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    .site-navigation .has-dropdown > .nav-link .arrow {
        padding: 8px 4px 8px 20px;
        transition: transform 0.2s;
    }
    .site-navigation .has-dropdown.open > .nav-link .arrow {
        transform: rotate(180deg);
    }
    .site-navigation .dropdown-menu .dropdown-item a {
        white-space: normal;
        line-height: 1.4;
    }
}
