/* ==========================================================================
   站点修复补丁
   用途：修正模板遗留的响应式缺陷。独立文件是为了绕开 CDN 对主样式表的
        长缓存 —— 修改内容后请复制为新文件名，并同步 layout/head.html 的引用。
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. 移动端 logo 与公司名
   原模板只限制 max-height，logo 图实际为 1013x178，在窄屏上宽度会溢出，
   把公司名挤出屏幕。
   -------------------------------------------------------------------------- */
@media only screen and (max-width: 991px) {
    .header-logo {
        width: 100%;
        padding: 10px 0 !important;
        float: none !important;
    }

    .header-logo .header-company-logo {
        width: auto !important;
        max-width: 42%;
        vertical-align: middle;
    }

    .header-logo a {
        display: block;
    }

    .header-logo a img {
        max-height: 26px !important;
        max-width: 100%;
        width: auto;
        height: auto;
        display: block;
    }

    .header-logo .header-company-names {
        width: auto !important;
        max-width: 55%;
        vertical-align: middle;
        padding-left: 8px;
    }

    .header-logo .header-company-name {
        font-size: 11px !important;
        line-height: 1.35;
        letter-spacing: 0;
        white-space: normal;
        word-break: break-all;
    }
}

@media only screen and (max-width: 399px) {
    .header-logo a img {
        max-height: 22px !important;
    }

    .header-logo .header-company-name {
        font-size: 10px !important;
    }
}

/* --------------------------------------------------------------------------
   2. 移动端汉堡按钮
   meanmenu 生成的按钮带 style="background:;color:"（空值），在黑色导航上
   完全看不见。这里补上白底黑图标，并让外层色带透明。
   -------------------------------------------------------------------------- */
.mean-bar {
    background: transparent !important;
    min-height: 0 !important;
    padding: 0 !important;
    height: 0;
}

.meanmenu-reveal {
    background: #ffffff !important;
    color: #111111 !important;
    width: 42px !important;
    height: 42px !important;
    padding: 0 !important;
    line-height: 42px !important;
    font-size: 24px !important;
    text-align: center;
    box-sizing: border-box;
    z-index: 10050;
    border-radius: 3px;
    top: 0;
}

.meanmenu-reveal i,
.meanmenu-reveal i:before {
    color: #111111 !important;
    font-size: 24px !important;
    line-height: 42px !important;
}

.meanmenu-reveal.meanclose i,
.meanmenu-reveal.meanclose i:before {
    color: #111111 !important;
}

/* 展开后的菜单层级与配色，避免与黑色导航混在一起看不清 */
.mean-nav {
    background: #ffffff !important;
    margin-top: 0 !important;
    border-top: 1px solid #eee;
}

.mean-nav ul li a {
    color: #222 !important;
    border-top: 1px solid #eee !important;
    font-size: 14px !important;
}

.mean-nav ul li a:hover {
    background: #f5f5f5 !important;
}

.mean-nav a.mean-expand {
    background: #f0f0f0 !important;
    color: #222 !important;
    border-left: 1px solid #e0e0e0 !important;
    border-bottom: 0 !important;
}

/* --------------------------------------------------------------------------
   3. 首页 / 产品页轮播容器兜底
   若 nivoSlider 因任何原因未初始化，至少只显示第一张，避免多图纵向堆叠。
   （正常情况下 .nivoSlider 生成后此规则不生效）
   -------------------------------------------------------------------------- */
#home-slider.slides > img {
    display: none;
}

#home-slider.slides > img:first-child {
    display: block;
    width: 100%;
    height: auto;
}

#home-slider.slides.nivoSlider > img {
    display: none;
}

/* --------------------------------------------------------------------------
   4. 移动端产品筛选按钮
   原样式 min-width:160px × 3 个 + margin-left:20px，在 390px 屏上把页面
   撑到 477px，产生横向滚动，并把移动端菜单按钮推出视口。
   -------------------------------------------------------------------------- */
@media only screen and (max-width: 767px) {
    .products-product-filter {
        margin-left: 0 !important;
        margin-bottom: 20px !important;
        display: -webkit-box;
        display: -ms-flexbox;
        display: flex;
        -ms-flex-wrap: wrap;
        flex-wrap: wrap;
        -webkit-box-align: center;
        -ms-flex-align: center;
        align-items: center;
        padding: 0 5px;
    }

    .products-product-filter button {
        min-width: 0 !important;
        max-width: none !important;
        width: auto !important;
        display: inline-block !important;
        margin: 0 8px 8px 0 !important;
        padding: 5px 14px !important;
        line-height: 1.3 !important;
        border: 1px solid #cccccc !important;
        border-radius: 3px;
        float: none !important;
    }

    .products-product-filter button h3,
    .products-product-filter button .button-div h3 {
        font-size: 13px !important;
        line-height: 1.3 !important;
        margin: 0 !important;
        font-weight: 600 !important;
        letter-spacing: 0 !important;
        text-transform: none;
    }

    .products-product-filter button.active {
        background-color: #8f8f8f !important;
        border-color: #8f8f8f !important;
    }

    .products-product-filter button.active h3 {
        color: #ffffff !important;
    }
}

/* 说明：不使用 body{overflow-x:hidden} 兜底，因为它会让吸顶导航的
   position:sticky 失效。横向溢出通过上面按钮尺寸修正从根上解决。 */

/* 汉堡图标：纯 CSS 绘制，不依赖图标字体 */
.meanmenu-reveal i {
    display: none !important;
}

.meanmenu-reveal::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 2px;
    margin: -8px 0 0 -9px;
    background-color: #111111;
    box-shadow: 0 6px 0 #111111, 0 -6px 0 #111111;
}

.meanmenu-reveal.meanclose::before {
    width: 18px;
    height: 2px;
    margin: -1px 0 0 -9px;
    box-shadow: none;
    transform: rotate(45deg);
}

.meanmenu-reveal.meanclose::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 2px;
    margin: -1px 0 0 -9px;
    background-color: #111111;
    transform: rotate(-45deg);
}

/* --------------------------------------------------------------------------
   5. 移动端「发展历程」时间线
   页面里那个 row 带内联 style="padding:0 200px"，在 390px 屏上把内容区
   压到 0 宽，年份圆圈与正文各占 80px/80%，导致文字逐字换行、与圆圈重叠。
   -------------------------------------------------------------------------- */
@media only screen and (max-width: 991px) {
    /* 用 !important 覆盖内联 padding */
    .blog-section .container > .row {
        padding-left: 15px !important;
        padding-right: 15px !important;
        margin-top: 30px !important;
    }

    .history-circle {
        width: 58px !important;
        height: 58px !important;
        line-height: 58px !important;
        border-radius: 29px !important;
        font-size: 17px !important;
        margin-right: 0 !important;
        display: inline-block !important;
        vertical-align: middle;
    }

    /* 正文改为块级、占满宽度，落在圆圈下方 */
    .history-content {
        display: block !important;
        width: 100% !important;
        height: auto !important;
        margin-top: 10px;
    }

    .history-content p.languageCn,
    .history-content p.languageEn {
        font-size: 13.5px !important;
        line-height: 1.75 !important;
        letter-spacing: 0 !important;
        margin-bottom: 6px !important;
        word-break: break-word;
    }

    /* 时间线各段之间的间距收紧，避免手机上一屏只有一条 */
    .blog-section .col-md-12.mt-50 {
        margin-top: 22px !important;
    }
}

/* --------------------------------------------------------------------------
   6. 移动端页脚
   原模板页脚 6 个 footer-widget 在 xs 下全部 col-xs-12 单列堆叠（4 个导航块
   + 6 个子项 + 4 行公司信息），在手机上要占两屏。这里改为两列并收紧间距。
   -------------------------------------------------------------------------- */
@media only screen and (max-width: 767px) {
    .footer-top-section {
        padding-top: 28px !important;
        padding-bottom: 16px !important;
    }

    /* 只消除 row 的负外边距，保留 container 的 15px 内边距，
       否则内容会贴屏幕边缘甚至被裁切 */
    .footer-top-section .row {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    /* 导航块：两列 */
    .footer-top-section .footer-widget.col-md-1 {
        width: 50% !important;
        max-width: 50% !important;
        float: left !important;
        clear: none !important;
        padding: 0 8px 0 14px !important;
        margin-bottom: 12px !important;
    }

    /* 公司信息块：整行，并清掉浮动 */
    .footer-top-section .footer-widget.col-md-4 {
        width: 100% !important;
        max-width: 100% !important;
        float: none !important;
        clear: both !important;
        padding: 0 14px !important;
        margin-top: 4px !important;
    }

    /* 空占位块不占高度 */
    .footer-top-section .footer-widget.col-md-4:empty {
        display: none !important;
    }

    /* 标题与子项 */
    .footer-widget .widget-title {
        font-size: 13px !important;
        line-height: 1.4 !important;
        margin-bottom: 5px !important;
        letter-spacing: 0 !important;
    }

    .footer-widget ul {
        margin: 0 !important;
        padding: 0 !important;
        list-style: none !important;
    }

    .footer-widget ul li {
        margin: 0 !important;
        padding: 0 !important;
    }

    .footer-widget ul li a {
        font-size: 12px !important;
        line-height: 1.95 !important;
        display: inline-block;
    }

    /* 公司信息（地址/电话/传真）—— 覆盖内联 font-size:16px */
    .footer-widget.col-md-4 h5 {
        font-size: 12.5px !important;
        line-height: 1.8 !important;
        margin-bottom: 2px !important;
        letter-spacing: 0 !important;
    }

    .footer-widget.col-md-4 h5.widget-title {
        font-size: 13px !important;
        margin-bottom: 6px !important;
    }

    /* 版权区 */
    .footer-bottom-section {
        padding: 12px 0 !important;
    }

    .footer-bottom-section .copyright p {
        font-size: 11.5px !important;
        line-height: 1.8 !important;
        margin: 0 !important;
    }
}

/* --------------------------------------------------------------------------
   9. 英文站页头
   英文公司名 "ZHEJIANG FUXIN HARDWARE CORP." 比中文长，会把右侧导航挤到
   重叠位置。这里限制 logo 区宽度并缩小公司名字号。
   -------------------------------------------------------------------------- */
@media only screen and (min-width: 992px) {
    body.lang-en .header-logo {
        max-width: 46%;
        padding-right: 24px;
    }

    body.lang-en .header-company-name {
        font-size: 12px !important;
        letter-spacing: 0 !important;
        white-space: nowrap;
    }
}

@media only screen and (max-width: 991px) {
    body.lang-en .header-company-name {
        font-size: 10px !important;
        letter-spacing: 0 !important;
        white-space: normal;
        line-height: 1.3;
    }
}
