/*
Theme Name: Boyomac
Theme URI: https://boyomac.cn/
Author: BOYOMAC 官网复刻团队
Description: 1:1 高保真复刻 BOYOMAC 历史企业官网，支持产品多维参数、公司介绍、新闻资讯、在线留言与手机响应式适配。
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 8.2
Text Domain: boyomac
*/

/* Reset & Basic Box Model */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: "Microsoft YaHei", "微软雅黑", SimSun, "宋体", Arial, sans-serif;
    color: #333333;
    background-color: #f7f7f7;
    font-size: 12px;
    line-height: 1.5;
}

a {
    color: #333;
    text-decoration: none;
}

a:hover {
    color: #da0000;
    text-decoration: underline;
}

ul, ol, li, p, h1, h2, h3, h4, h5, h6 {
    margin: 0;
    padding: 0;
}

ul, ol {
    list-style: none;
}

img {
    border: none;
    max-width: 100%;
    height: auto;
    vertical-align: middle;
}

.clearBoth {
    clear: both;
    height: 0;
    overflow: hidden;
    line-height: 0;
}

/* Page Layout & Container */
#box_root, .pageWidth {
    width: 100%;
    margin: 0 auto;
}

#box_main {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    background-color: #ffffff;
}

/* Header Styles */
#box_header {
    width: 100%;
    margin: 0 auto;
    background-color: #ffffff;
}

#box_header_sub1 {
    background-color: #da0000;
    border-bottom: 1px solid #e5e5e5;
    padding: 6px 15px;
    font-size: 12px;
    color: #fff;
    position: relative;
    width: 100%;
    box-sizing: border-box;
}

#box_header_sub1_sub1 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100% !important;
    max-width: 1200px;
    box-sizing: border-box;
}

.header-top-left {
    float: left;
}

.header-top-right {
    float: right;
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-top-right a {
    color: #fff;
}

.header-top-right a:hover {
    color: #da0000;
}

#box_header_sub2 {
    padding: 15px 0 0 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    box-sizing: border-box;
}

.site-logo {
    flex: 0 0 auto;
    padding-left: 10px;
    padding-bottom: 6px;
}

.site-logo img {
    height: 87px;
    width: auto;
    display: block;
}

/* Navigation Menu */
.boyomac-nav {
    flex: 0 0 auto;
    position: relative;
    z-index: 999;
}

.boyomac-nav ul.nav-first {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    margin: 0;
    padding: 0;
    list-style: none;
}

.boyomac-nav ul.nav-first > li {
    flex: 0 0 auto !important;
    position: relative;
    list-style: none;
}

.boyomac-nav ul.nav-first > li > a {
    display: block;
    height: 44px;
    line-height: 44px;
    padding: 0 16px;
    font-size: 15px;
    font-family: "Microsoft YaHei", "微软雅黑", Arial, sans-serif;
    color: #222222;
    font-weight: 500;
    white-space: nowrap !important;
    word-break: keep-all !important;
    text-decoration: none;
    transition: all 0.2s ease;
}

.boyomac-nav ul.nav-first > li:hover > a,
.boyomac-nav ul.nav-first > li.current-menu-item > a {
    background-color: #da0000;
    color: #ffffff !important;
    text-decoration: none;
}

/* Dropdown Submenus */
.boyomac-nav ul.sub-menu,
.boyomac-nav .ddsubmenustyle {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 160px;
    background-color: #ffffff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-top: 2px solid #da0000;
    z-index: 1000;
    padding: 5px 0;
}

.boyomac-nav ul.nav-first > li:hover > ul.sub-menu,
.boyomac-nav ul.nav-first > li:hover > .ddsubmenustyle {
    display: block;
}

.boyomac-nav ul.sub-menu li,
.boyomac-nav .ddsubmenustyle li {
    width: 100%;
}

.boyomac-nav ul.sub-menu li a,
.boyomac-nav .ddsubmenustyle li a {
    display: block;
    padding: 8px 16px;
    font-size: 13px;
    color: #444444;
    line-height: 1.4;
    transition: background 0.15s;
    text-align: left;
}

.boyomac-nav ul.sub-menu li a:hover,
.boyomac-nav .ddsubmenustyle li a:hover {
    background-color: #f8f8f8;
    color: #da0000;
    text-decoration: none;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: 1px solid #ccc;
    padding: 6px 12px;
    font-size: 18px;
    cursor: pointer;
    border-radius: 4px;
}

/* Banner Slider */
.boyomac-slider {
    position: relative;
    width: 100%;
    margin: 0;
    overflow: hidden;
    background-color: #f7f7f7;
}

.boyomac-slider .slide-item {
    display: none;
}

.boyomac-slider .slide-item.active {
    display: block;
}

.boyomac-slider img {
    width: 100%;
    height: auto;
    aspect-ratio: 1920 / 532;
    object-fit: cover;
    display: block;
}

/* Homepage Product Showcase */
.home-section {
    padding: 25px 15px;
    background: #fff;
}

.section-header {
    border-bottom: 2px solid #da0000;
    padding-bottom: 8px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.section-title {
    font-size: 20px;
    font-weight: bold;
    color: #222;
    margin: 0;
}

.section-more a {
    font-size: 13px;
    color: #888;
}

.section-more a:hover {
    color: #da0000;
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 15px;
}

.product-card {
    border: 1px solid #eee;
    background: #fff;
    border-radius: 4px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    text-align: center;
    padding: 10px;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.1);
    border-color: #da0000;
}

.product-thumb {
    width: 100%;
    height: 160px;
    object-fit: contain;
    background-color: #fafafa;
    padding: 4px;
    border-radius: 2px;
    margin-bottom: 10px;
    display: block;
}

.product-card-title {
    font-size: 14px;
    font-weight: bold;
    color: #333;
    margin-bottom: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-card-model {
    font-size: 12px;
    color: #777;
    margin-bottom: 8px;
}

/* Homepage News & Intro Columns */
.home-columns {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    padding: 20px 15px;
}

.news-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px dashed #eee;
}

.news-item-title {
    font-size: 14px;
    color: #333;
    flex-grow: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-right: 15px;
}

.news-item-date {
    font-size: 12px;
    color: #999;
    flex-shrink: 0;
}

/* Intro & R&D Box */
.intro-box {
    background: #f9f9f9;
    padding: 15px;
    border: 1px solid #eee;
    border-radius: 4px;
    margin-bottom: 15px;
}

.intro-box h3 {
    font-size: 16px;
    color: #da0000;
    margin-bottom: 8px;
}

.intro-box p {
    font-size: 13px;
    color: #666;
    line-height: 1.6;
}

/* Archived homepage sections, adapted to the fluid 1200px content layout. */
.section-en {
    color: #aaa;
    font-size: .78em;
    font-weight: 400;
}

.home-marquee {
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
    touch-action: pan-x pan-y;
}

.home-marquee .home-marquee-track {
    display: flex;
    width: max-content;
    gap: 15px;
    align-items: stretch;
}

.home-marquee .product-card {
    flex: 0 0 clamp(220px, calc((min(100vw, 1200px) - 75px) / 4), 282px);
}

.home-about {
    padding: 54px 15px 62px;
    background: #eeeef3 url('assets/images/abg.jpg') center top / cover no-repeat;
}

.home-about .home-columns {
    padding: 22px 0 0;
    grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
    align-items: stretch;
}

.home-about-left,
.home-about-right {
    min-width: 0;
}

.home-about-right {
    display: flex;
    flex-direction: column;
}

.home-about .home-feature-cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 15px;
    margin-top: 16px;
    padding: 0;
}

.home-about .home-feature-cards .intro-box {
    min-height: 205px;
    margin: 0;
}

.home-about-visual {
    display: block;
    position: relative;
    height: 285px;
    overflow: hidden;
    background: #e8eef2;
}

.home-about-visual img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.home-about-visual span {
    position: absolute;
    right: 0;
    bottom: 0;
    padding: 10px 18px;
    color: #fff;
    background: rgba(40, 40, 40, .75);
    font-size: 14px;
}

.home-about-right .home-about-panel {
    margin-top: 16px;
    flex: 1;
}

.home-about .news-column,
.home-about .intro-box {
    background: #fff;
    padding: 20px;
}

.home-about .intro-box {
    min-width: 0;
    margin-bottom: 15px;
    border: 0;
}

.home-about .intro-box:first-child {
    background: #fff url('assets/images/ybg.jpg') right bottom / auto 90px no-repeat;
}

.home-about .intro-box:nth-child(2) {
    background: #fff url('assets/images/jbg.jpg') right bottom / auto 90px no-repeat;
}

.home-about-panel {
    padding: 23px;
    color: #fff;
    background: #da0000;
}

.home-about-panel p {
    line-height: 1.8;
    margin-bottom: 18px;
}

.home-about-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.home-about-links a {
    display: block;
    padding: 11px 4px;
    border: 1px solid rgba(255,255,255,.75);
    text-align: center;
    color: #fff;
}

.home-about-links a:hover,
.home-about-links a:focus-visible {
    color: #da0000;
    background: #fff;
    text-decoration: none;
}

.home-power {
    padding: 48px 15px 60px;
    background: #fff;
}

.home-power .home-marquee-track {
    gap: 6px;
}

.home-power-item {
    flex: 0 0 clamp(220px, 27vw, 300px);
    height: 205px;
    overflow: hidden;
    display: block;
}

.home-power-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.home-power-item:hover img {
    transform: scale(1.035);
}

.home-power-item img {
    transition: transform .3s ease;
}

@media (prefers-reduced-motion: no-preference) {
    .home-motion-enabled .home-reveal:not(.is-visible) {
        opacity: 0;
        transform: translateY(48px);
    }
    .home-reveal {
        transition: opacity .7s ease, transform .7s ease;
    }
}

@media screen and (max-width: 900px) {
    .home-about { padding: 36px 15px 42px; }
    .home-about .home-columns { grid-template-columns: minmax(0, 1fr); }
    .home-power { padding: 36px 15px 42px; }
    .home-power-item { height: 175px; }
}

@media screen and (max-width: 520px) {
    .home-about .home-feature-cards { grid-template-columns: minmax(0, 1fr); }
    .home-about .home-feature-cards .intro-box { min-height: 0; }
    .home-about-visual { height: 205px; }
}

/* Footer Styles */
#box_footer {
    width: 100%;
    margin: 20px auto 0 auto;
    background-color: #2b2b2b;
    color: #cccccc;
    font-size: 12px;
}

.footer-inner {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px 20px 20px;
}

.footer-nav-cols {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 15px;
    padding-bottom: 25px;
    border-bottom: 1px solid #3d3d3d;
}

.footer-col h4 {
    font-size: 14px;
    color: #ffffff;
    margin-bottom: 12px;
    border-left: 3px solid #da0000;
    padding-left: 8px;
}

.footer-col ul li {
    margin-bottom: 6px;
}

.footer-col ul li a {
    color: #aaaaaa;
}

.footer-col ul li a:hover {
    color: #ffffff;
    text-decoration: underline;
}

.footer-contact-info {
    padding: 20px 0;
    line-height: 1.8;
    color: #aaaaaa;
}

.footer-contact-info strong {
    color: #ffffff;
}

.footer-bottom {
    border-top: 1px solid #3d3d3d;
    padding-top: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #888888;
}

.footer-bottom a {
    color: #888888;
}

.footer-bottom a:hover {
    color: #ffffff;
}

/* Product Detail & Parameter Table */
.product-detail-wrap {
    padding: 25px 20px;
}

.product-detail-header {
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
}

.product-detail-img {
    width: 450px;
    flex-shrink: 0;
}

.product-detail-img img {
    width: 100%;
    border: 1px solid #eee;
    border-radius: 4px;
}

.product-detail-info {
    flex-grow: 1;
}

.product-detail-title {
    font-size: 24px;
    font-weight: bold;
    color: #222;
    margin-bottom: 15px;
}

.product-spec-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.product-spec-table th,
.product-spec-table td {
    border: 1px solid #ddd;
    padding: 10px 14px;
    font-size: 13px;
    text-align: left;
}

.product-spec-table th {
    background-color: #f5f5f5;
    color: #333;
    font-weight: bold;
    width: 25%;
}

/* Online Message Form */
.message-form-wrap {
    background: #ffffff;
    padding: 30px;
    border: 1px solid #eee;
    border-radius: 6px;
    max-width: 700px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: bold;
    color: #333;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}

.btn-submit {
    background-color: #da0000;
    color: #ffffff;
    border: none;
    padding: 12px 28px;
    font-size: 15px;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-submit:hover {
    background-color: #b30000;
}

/* Mobile Responsive Adjustments (Max 992px) */
@media screen and (max-width: 1000px) {
    #box_root, .pageWidth, #box_header, #box_header_sub2, .boyomac-slider, #box_footer {
        width: 100% !important;
    }

    .boyomac-slider img {
        width: 100% !important;
        height: auto !important;
        aspect-ratio: 1920 / 532;
    }

    #box_header_sub1_sub1 {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    #box_header_sub2 {
        flex-direction: column;
        align-items: flex-start;
        padding: 10px 15px;
    }

    .mobile-menu-toggle {
        display: block;
        margin-top: 10px;
    }

    .boyomac-nav {
        width: 100%;
        display: none;
    }

    .boyomac-nav.active {
        display: block;
    }

    .boyomac-nav ul.nav-first {
        flex-direction: column;
        width: 100%;
    }

    .boyomac-nav ul.nav-first > li > a {
        border-bottom: 1px solid #eee;
    }

    .boyomac-nav ul.sub-menu,
    .boyomac-nav .ddsubmenustyle {
        position: static;
        display: block;
        box-shadow: none;
        border-top: none;
        background: #f9f9f9;
        padding-left: 20px;
    }

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .home-columns {
        grid-template-columns: minmax(0, 1fr);
    }

    .news-column, .intro-column, .news-item-title {
        min-width: 0;
    }

    .footer-nav-cols {
        grid-template-columns: repeat(2, 1fr);
    }

    .product-detail-header {
        flex-direction: column;
    }

    .product-detail-img {
        width: 100%;
    }

    .content-with-sidebar,
    #box_main > div[style*="display: flex; gap: 25px;"],
    #box_main > div[style*="display: flex; gap: 25px"] {
        flex-direction: column !important;
    }

    .content-with-sidebar > aside,
    #box_main > div[style*="display: flex"] > aside {
        width: 100% !important;
    }

    .content-with-sidebar > div,
    #box_main > div[style*="display: flex"] > div:not(aside) {
        width: 100% !important;
    }
}

@media screen and (max-width: 480px) {
    .products-grid {
        grid-template-columns: 1fr;
    }
    .footer-nav-cols {
        grid-template-columns: 1fr;
    }
    .footer-bottom {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
}
