/* ========================================
   响应式全局样式
   适用于所有页面的响应式设计
   ======================================== */

/* ===== 响应式断点 ===== */
/* Mobile: < 640px */
/* Tablet: 640px - 1024px */
/* Desktop: > 1024px */

/* ===== Header 响应式 ===== */

/* 移动端语言切换器 - 桌面端默认隐藏 */
.mobile-lang-switcher {
    display: none;
}

/* 汉堡菜单按钮 (默认隐藏) */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.mobile-menu-toggle span {
    display: block;
    width: 100%;
    height: 3px;
    background: #333;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* 平板及以下 */
@media (max-width: 1024px) {
    /* 顶部黑条 */
    .top-bar {
        font-size: 11px;
        padding: 8px 0;
    }
    
    .top-bar .container {
        flex-direction: column;
        gap: 5px;
        text-align: center;
    }
    
    .top-bar-text {
        font-size: 11px;
    }
    
    .top-bar-social {
        font-size: 10px;
    }
    
    /* Logo */
    .logo {
        font-size: 20px !important;
    }
    
    .logo img {
        width: 35px !important;
    }
    
    .logo-text {
        font-size: 16px !important;
    }
    
    /* 显示汉堡菜单 */
    .mobile-menu-toggle {
        display: flex;
    }
    
    /* 导航菜单 */
    nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: #fff;
        box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
        transition: right 0.3s ease;
        z-index: 1000;
        overflow-y: auto;
        padding-top: 80px;
    }
    
    nav.active {
        right: 0;
    }
    
    nav ul {
        flex-direction: column;
        gap: 0;
        padding: 20px;
    }
    
    nav li {
        width: 100%;
        border-bottom: 1px solid #f0f0f0;
    }
    
    nav a {
        display: block;
        padding: 15px 10px;
        font-size: 14px;
    }
    
    nav a::after {
        display: none;
    }
    
    /* 下拉菜单 */
    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        border-top: 1px solid #f0f0f0;
        background: #f8f9fa;
        min-width: auto;
    }
    
    .dropdown-menu a {
        padding: 12px 20px;
        font-size: 13px;
    }
    
    .dropdown-menu a:hover {
        padding-left: 25px;
    }
    
    /* Contact Us 按钮 */
    .nav-cta {
        margin-top: 10px;
    }
    
    .nav-cta .btn {
        width: 100%;
        text-align: center;
        padding: 12px 20px;
    }
    
    /* 移动端语言切换 */
    .mobile-lang-switcher {
        display: block !important;
        margin-top: 20px;
        padding-top: 20px;
        border-top: 2px solid #e0e0e0;
    }
    
    .mobile-lang-switcher .lang-label {
        display: block;
        padding: 10px;
        font-weight: 600;
        color: #333;
        font-size: 14px;
    }
    
    .mobile-lang-switcher .lang-label i {
        margin-right: 8px;
        color: var(--primary-orange, #ee6723);
    }
    
    .mobile-lang-options {
        display: flex;
        flex-direction: column;
        gap: 0;
        margin-top: 5px;
    }
    
    .mobile-lang-link {
        display: flex;
        align-items: center;
        padding: 12px 20px;
        color: #666;
        text-decoration: none;
        transition: all 0.3s ease;
        border-bottom: 1px solid #f0f0f0;
        font-size: 14px;
    }
    
    .mobile-lang-link i {
        margin-right: 10px;
        color: var(--primary-orange, #ee6723);
        font-size: 12px;
        width: 16px;
    }
    
    .mobile-lang-link:hover {
        background: #f8f9fa;
        padding-left: 25px;
        color: var(--primary-orange, #ee6723);
    }
    
    .mobile-lang-link.active {
        color: var(--primary-orange, #ee6723);
        font-weight: 600;
        background: #fff5f0;
    }
    
    /* 菜单打开时防止背景滚动 */
    body.menu-open {
        overflow: hidden;
    }
    
    /* 菜单遮罩 */
    body.menu-open::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }
}

/* 手机端 */
@media (max-width: 640px) {
    .top-bar {
        display: none; /* 移动端隐藏顶部黑条 */
    }
    
    .header-inner {
        height: 60px;
        padding: 0 15px;
    }
    
    .logo {
        font-size: 16px !important;
    }
    
    .logo img {
        width: 30px !important;
        margin-right: 5px !important;
    }
    
    .logo-text {
        font-size: 14px !important;
    }
    
    nav {
        width: 100%;
        right: -100%;
    }
}

/* ===== Footer 响应式 ===== */
@media (max-width: 1024px) {
    footer {
        padding: 60px 0 20px;
    }
    
    .footer-top {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .footer-col:last-child {
        padding-left: 0;
        max-width: 100%;
    }
    
    .map-section {
        height: 400px;
    }
    
    .contact-form-wrapper {
        width: 90%;
        max-width: 400px;
        padding: 30px;
    }
}

@media (max-width: 640px) {
    footer {
        padding: 40px 0 15px;
        font-size: 13px;
    }
    
    .footer-col h4 {
        font-size: 16px;
        margin-bottom: 15px;
    }
    
    .footer-info-item {
        font-size: 12px;
        margin-bottom: 12px;
    }
    
    .map-section {
        height: 300px;
    }
    
    .contact-form-wrapper {
        width: 95%;
        padding: 20px;
        top: 85%;
    }
    
    .contact-form-wrapper h3 {
        font-size: 18px;
        margin-bottom: 15px;
    }
    
    .form-input {
        padding: 12px;
        font-size: 13px;
    }
    
    .submit-btn {
        padding: 12px;
        font-size: 13px;
    }
}

/* ===== 浮动按钮响应式 ===== */
.float-btn {
    transition: all 0.3s ease;
}

.float-btn:hover {
    transform: scale(1.15) translateX(-5px);
    box-shadow: 0 4px 12px rgba(255, 102, 0, 0.4);
    background-color: #ff7722;
}

@media (max-width: 1024px) {
    .float-sidebar {
        right: 5px;
        top: 50%;
    }
    
    .float-btn {
        width: 40px;
        height: 40px;
        font-size: 18px;
        margin-right: 5px;
    }
}

@media (max-width: 640px) {
    .float-sidebar {
        display: none !important; /* 移动端隐藏浮动按钮 */
    }
}

/* ===== Banner 响应式 ===== */
@media (max-width: 1024px) {
    .banner {
        height: 40vh;
    }
    
    .banner h1 {
        font-size: 36px;
    }
}

@media (max-width: 640px) {
    .banner {
        height: 30vh;
        min-height: 200px;
    }
    
    .banner h1 {
        font-size: 28px;
        letter-spacing: 1px;
    }
}

/* ===== 面包屑导航响应式 ===== */
@media (max-width: 640px) {
    .mbx {
        font-size: 0.875rem;
        padding: 1rem 0;
    }
}

/* ===== Container 响应式 ===== */
@media (max-width: 1024px) {
    .container {
        padding: 0 20px;
    }
}

@media (max-width: 640px) {
    .container {
        padding: 0 15px;
    }
}

/* ===== 通用按钮响应式 ===== */
@media (max-width: 640px) {
    .btn {
        padding: 10px 20px;
        font-size: 12px;
    }
}

/* ===== Section 间距响应式 ===== */
@media (max-width: 1024px) {
    .section-padding,
    section {
        padding: 60px 0;
    }
}

@media (max-width: 640px) {
    .section-padding,
    section {
        padding: 40px 0;
    }
    
    .section-title {
        font-size: 28px;
        margin-bottom: 30px;
    }
}

/* ===== 侧边栏布局响应式 (about2, about3, products) ===== */
@media (max-width: 1024px) {
    .main-container {
        grid-template-columns: 1fr;
        gap: 30px;
        padding: 30px 5%;
    }
    
    aside {
        order: -1; /* 侧边栏移到顶部 */
    }
    
    .sidebar-box {
        margin-bottom: 20px;
    }
}

@media (max-width: 640px) {
    .main-container {
        padding: 20px 15px;
        gap: 20px;
    }
    
    .sidebar-title {
        font-size: 16px;
        padding: 12px;
    }
    
    .sidebar-menu li {
        padding: 12px 15px;
        font-size: 13px;
    }
}

/* ===== 网格布局响应式 ===== */
/* 产品/工厂/新闻网格 */
@media (max-width: 1024px) {
    .factory-grid,
    .product-grid,
    .news-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (max-width: 640px) {
    .factory-grid,
    .product-grid,
    .news-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

/* ===== 卡片响应式 ===== */
@media (max-width: 640px) {
    .card,
    .product-card,
    .news-card {
        margin-bottom: 15px;
    }
    
    .card-label,
    .product-info h4,
    .news-title {
        font-size: 14px;
    }
    
    .news-desc {
        font-size: 12px;
    }
}

/* ===== 分页响应式 ===== */
@media (max-width: 640px) {
    .pagination {
        gap: 5px;
        margin-bottom: 30px;
    }
    
    .page-item {
        width: 28px;
        height: 28px;
        font-size: 11px;
    }
}


/* Hide news module - 隐藏新闻模块 (可通过删除此规则恢复) */
nav a[href="news.php"] {
    display: none !important;
}

nav li:has(a[href="news.php"]) {
    display: none !important;
}
