/* 移动端适配样式 */

/* 基础设置 */
* {
    box-sizing: border-box;
}

/* 移动端断点 */
@media (max-width: 1024px) {
    .products-banner {
        margin: 80px auto 1.5rem;
        margin-top: 100px!important;
    }
    
    .section-container {
        padding: 0 1.5rem;
    }
    
    .products-layout {
        flex-direction: column;
    }
    
    .product-categories {
        flex: 1;
        margin-bottom: 2rem;
    }
    .product-gallery-info {
        gap: 0;
    }
    #products-list{
        padding: 3rem 0rem;
    }
    
    /* 移动端新闻分类横向排列 */
    .product-categories .category-list {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 1rem !important;
        padding: 0 !important;
    }
    
    .product-categories .category-item {
        margin: 0 !important;
        flex: 1 1 calc(50% - 0.5rem) !important;
        text-align: center !important;
        border-radius: 8px !important;
        border: 1px solid #e0e0e0 !important;
    }
    
    .product-categories .category-item a {
        display: block !important;
        padding: 0.8rem !important;
        text-decoration: none !important;
        color: #333 !important;
        transition: all 0.3s ease !important;
    }
    
    .product-categories .category-item.active a {
        background-color: #f0f0f0 !important;
        color: #000 !important;
    }
    
    .product-categories .category-item:hover a {
        background-color: #f5f5f5 !important;
    }
    
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    #news .news-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .contact-content {
        flex-direction: column;
    }
    
    .contact-info-section {
        flex: 1;
        margin-bottom: 2rem;
    }
}

@media (max-width: 768px) {

    
    .navbar {
        padding: 1rem 0;
        top: 71px ;
    }
    
    .navbar-container {
        padding: 0 1rem;
    }
    
    /* 移动端导航菜单完全重写 */
    .nav-menu {
        position: fixed !important;
        display: block;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        flex-direction: column !important;
        background-color: #fff !important;
        width: 100% !important;
        height: 100vh !important;
        text-align: left !important;
        transform: translateX(-100%) !important;
        transition: transform 0.3s ease-in-out !important;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1) !important;
        padding: 0 !important;
        z-index: 10000 !important;
        overflow-y: auto !important;
    }
    
    .nav-menu.active {
        transform: translateX(0) !important;
    }
    
    /* 移动端导航头部 */
    .mobile-nav-header {
        padding: 1.5rem 2rem !important;
        border-bottom: 1px solid #f0f0f0 !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        background-color: #f9f9f9 !important;
    }
    
    .mobile-nav-logo {
        font-size: 1.5rem !important;
        font-weight: 700 !important;
        color: #000 !important;
        text-decoration: none !important;
    }
    
    .mobile-nav-close {
        font-size: 1.5rem !important;
        color: #333 !important;
        cursor: pointer !important;
    }
    
    /* 移动端导航菜单项 */
    .nav-item {
        margin: 0 !important;
        border-bottom: 1px solid #f0f0f0 !important;
        position: relative !important;
        background-color: #fff !important;
    }
    
    .nav-item a {
        display: block !important;
        padding: 1.5rem 1rem !important;
        font-size: 1.4rem !important;
        color: #333 !important;
        text-decoration: none !important;
        transition: all 0.3s ease !important;
        background-color: #fff !important;
        border: none !important;
        width: 100% !important;
        text-align: left !important;
        font-weight: 500 !important;
    }
    
    .nav-item a:hover {
        background-color: #f5f5f5 !important;
    }
    
    /* 移动端下拉菜单 */
    .dropdown-menu {
        position: static !important;
        background-color: #f9f9f9 !important;
        box-shadow: none !important;
        padding: 0 !important;
        margin: 0 !important;
        display: none !important;
        border: none !important;
        width: 100% !important;
    }
    
    .nav-item.active .dropdown-menu {
        display: block !important;
    }
    
    .dropdown-item {
        border-bottom: 1px solid #e9e9e9 !important;
        background-color: #f9f9f9 !important;
        position: relative !important;
    }
    
    .dropdown-item a {
               display: block !important;
        padding: 1.5rem 2rem !important;
        font-size: 1.6rem !important;
        color: #333 !important;
        text-decoration: none !important;
        transition: all 0.3s ease !important;
        background-color: #fff !important;
        border: none !important;
        width: 100% !important;
        text-align: left !important;
        font-weight: 500 !important;
    }
    
    .dropdown-item a:hover {
        background-color: #f0f0f0 !important;
    }
    .service-container{
            right: 1rem;
    top: 65%;
    }
    .footer{
        padding: 0;
    }
    
    /* 移动端三级菜单 */
    .sub-dropdown-menu {
        position: static !important;
        background-color: #f9f9f9 !important;
        box-shadow: none !important;
        padding: 0 !important;
        margin: 0 !important;
        display: none !important;
        border: none !important;
        width: 100% !important;
    }
    
    .dropdown-item.active .sub-dropdown-menu {
        display: block !important;
    }
    
    .sub-dropdown-menu li {
        border-bottom: 1px solid #e9e9e9 !important;
        background-color: #f9f9f9 !important;
        position: relative !important;
    }
    
    .sub-dropdown-menu li a {
        padding: 1.3rem 3rem !important;
        font-size: 1.2rem !important;
        color: #666 !important;
        background-color: #f9f9f9 !important;
        font-weight: 400 !important;
        display: block !important;
        text-decoration: none !important;
        transition: all 0.3s ease !important;
        border: none !important;
        width: 100% !important;
        text-align: left !important;
        padding-right: 3.5rem !important;
    }
    
    .sub-dropdown-menu li a:hover {
        background-color: #f0f0f0 !important;
    }
    
    /* 移动端导航箭头 */
    .nav-arrow {
        position: absolute !important;
        right: 2rem !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        font-size: 1rem !important;
        color: #999 !important;
        transition: transform 0.3s ease !important;
        z-index: 1 !important;
    }
    
    .nav-item.active .nav-arrow {
        transform: translateY(-50%) rotate(180deg) !important;
    }
    
    /* 确保所有菜单项的箭头方向一致 */
    .dropdown-item .nav-arrow {
        transform: translateY(-50%) !important;
    }
    
    .dropdown-item.active .nav-arrow {
        transform: translateY(-50%) rotate(180deg) !important;
    }
    
    /* 隐藏原始箭头，使用伪元素显示箭头 */
    .nav-arrow {
        visibility: hidden !important;
    }
    
    .nav-arrow::before {
        content: '▼' !important;
        display: block !important;
        visibility: visible !important;
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
    }
    
    .nav-item.active .nav-arrow::before,
    .dropdown-item.active .nav-arrow::before {
        content: '▲' !important;
    }
    
    /* 调整导航链接的 padding-right，为箭头留出空间 */
    .nav-item a {
        padding-right: 3.5rem !important;
    }
    
    .dropdown-item a {
        padding-right: 3.5rem !important;
    }
    
    .sub-dropdown-menu li a {
        padding-right: 3.5rem !important;
    }
    
    /* 移动端汉堡菜单按钮 */
    .hamburger {
        display: block !important;
        cursor: pointer !important;
        z-index: 10001 !important;
        position: relative !important;
    }
    
    .hamburger span {
        background: #333 !important;
    }
    
    .hamburger.active span {
        background: #333 !important;
    }
    
    .hamburger {
        display: block;
        cursor: pointer;
    }
    
    /* 移动端语言选择器 */
    .language-selector {
        position: relative !important;
        z-index: 9999 !important;
    }
    
    /* 隐藏语言选择器中的箭头符号 */
    .language-selector .nav-arrow {
        display: none !important;
    }
    
    .language-selector .dropdown-menu {
        position: absolute !important;
        top: 100% !important;
        left: 0 !important;
        background-color: #fff !important;
        box-shadow: 0 5px 15px rgba(0,0,0,0.1) !important;
        border-radius: 8px !important;
        padding: 1rem 0 !important;
        min-width: 180px !important;
        opacity: 0 !important;
        visibility: hidden !important;
        transform: translateY(10px) !important;
        transition: all 0.3s ease !important;
        z-index: 9999 !important;
        border-top: 1px solid #000 !important;
        display: block !important;
    }
    
    .language-selector.active .dropdown-menu {
        opacity: 1 !important;
        visibility: visible !important;
        transform: translateY(0) !important;
        display: block !important;
    }
    
    /* 确保导航栏容器不会遮挡下拉菜单 */
    .navbar-container {
        position: relative !important;
        z-index: 1 !important;
    }
    
    .section {
        padding: 3rem 0;
    }
    
    .section-container {
        padding: 0 1rem;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .products-banner {
        margin: 70px auto 1rem;
        border-radius: 5px;
    }
    
    /* 移动端banner样式 */
    .banner {
        height: 250px !important;
            margin-top: 111px !important;
    }
    
    .banner-container {
        height: 100% !important;
    }
    
    .banner-slide {
        height: 100% !important;
    }
    
    .banner-image {
        height: 100% !important;
    }
    
    .banner-img {
        height: 100% !important;
        object-fit: cover !important;
    }
    
    .banner-content {
        padding: 1rem 0rem !important;
        left: 0rem !important;
    }
    
    .banner-title {
        font-size: 1.2rem !important;
    }
    
    .banner-subtitle {
        font-size: 0.8rem !important;
        margin-bottom: 0.8rem !important;
    }
    
    .banner-btn {
        padding: 0.4rem 1.2rem !important;
        font-size: 0.8rem !important;
    }
    
    .product-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    #news .news-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .footer-container {
        padding: 3rem 1rem !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }
    
    .footer-grid {
        grid-template-columns: 1fr !important;
        gap: 3rem !important;
        max-width: 100% !important;
        display: block;
    }
    
    .footer-column {
        padding: 0 !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    
    .footer-column h3 {
        margin-bottom: 1.5rem !important;
        font-size: 1.2rem !important;
        color: #333 !important;
    }
    
    .footer-column p,
    .footer-column ul {
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .footer-column ul li {
        margin-bottom: 0.8rem !important;
        list-style: none !important;
    }
    
    .footer-column ul li a {
        color: #666 !important;
        text-decoration: none !important;
        font-size: 1rem !important;
    }
    
    .footer-bottom {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        gap: 1.5rem !important;
        margin-top: 3rem !important;
        padding-top: 2rem !important;
        border-top: 1px solid #eee !important;
    }
    
    .social-icons {
        justify-content: center !important;
        gap: 1rem !important;
    }
    
    .copyright {
        font-size: 0.9rem !important;
        color: #999 !important;
    }
    
    .news-card {
        flex-direction: column;
    }
    
    .news-card img {
        width: 100%;
        height: 200px;
    }
    
    .news-content {
        padding: 1.5rem;
    }
    
    .related-news-list {
        grid-template-columns: 1fr;
    }
    
    /* 移动端分页控件样式 */
    .pagination {
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 0.5rem !important;
    }
    
    .page-btn {
        padding: 0.5rem 0.8rem !important;
        font-size: 0.9rem !important;
        margin: 0 !important;
    }
    
    /* 移动端产品详情页面样式 */
    .product-detail-layout {
        flex-direction: column !important;
    }
    
    .product-categories {
        margin-bottom: 2rem !important;
    }
    
    /* 移动端产品分类横向排列 */
    .product-categories .category-list {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 1rem !important;
        padding: 0 !important;
    }
    
    .product-categories .category-item {
        margin: 0 !important;
        flex: 1 1 calc(50% - 0.5rem) !important;
        text-align: center !important;
        border-radius: 8px !important;
        border: 1px solid #e0e0e0 !important;
    }
    
    .product-categories .category-item a {
        display: block !important;
        padding: 0.8rem !important;
        text-decoration: none !important;
        color: #333 !important;
        transition: all 0.3s ease !important;
    }
    
    .product-categories .category-item.active a {
        background-color: #f0f0f0 !important;
        color: #000 !important;
    }
    
    .product-categories .category-item:hover a {
        background-color: #f5f5f5 !important;
    }
    
    /* 隐藏产品分类的子菜单和三级菜单在移动端 */
    .product-categories .sub-category-list,
    .product-categories .sub-sub-category-list {
        display: none !important;
    }
    
    /* 移动端产品图片和信息垂直堆叠 */
    .product-gallery-info {
        flex-direction: column !important;
    }
    
    .product-gallery {
        margin-right: 0 !important;
        margin-bottom: 2rem !important;
    }
    
    .main-image img {
        max-width: 100% !important;
        height: auto !important;
    }
    
    .thumbnails {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 0.5rem !important;
        justify-content: center !important;
    }
    
    .thumbnail-img {
        width: 80px !important;
        height: 80px !important;
    }
    
    /* 移动端产品详情标签页 */
    .details-tabs {
        flex-direction: column !important;
    }
    
    .tab-btn {
        margin-right: 0 !important;
        margin-bottom: 0.5rem !important;
        border-radius: 4px !important;
    }
    
    /* 移动端购买弹窗 */
    .modal-content {
        max-width: 90% !important;
        width: 90% !important;
        padding: 1.5rem !important;
    }
    
    .form-group {

        align-items: flex-start !important;
    }
    
    .form-group label {
        margin-bottom: 0.5rem !important;
    }
    
    .form-group input,
    .form-group textarea {
        width: 100% !important;
    }
    
    .product-detail-content {
        flex-direction: column;
    }
    
    .product-images {
        flex: 1;
        margin-right: 0;
        margin-bottom: 2rem;
    }
    
    .product-info {
        flex: 1;
    }
    
    .product-tabs {
        flex-direction: column;
    }
    
    .tab-btn {
        margin-right: 0;
        margin-bottom: 0.5rem;
        border-radius: 4px;
    }
    
    .service-info {
        right: -280px;
        width: 280px;
    }
    
    .service-info.active {
        right: 60px;
    }
}

@media (max-width: 480px) {
    .section {
        padding: 2rem 0;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .section-container {
        padding: 0 0.8rem;
    }
    
    .products-banner {
        margin: 70px auto 0.8rem;
    }
    
    .product-categories {
        padding: 1.5rem;
    }
    
    .news-card {
        gap: 0.8rem;
    }
    
    .news-content {
        padding: 1.2rem;
    }
    
    .news-title {
        font-size: 1.1rem;
    }
    
    .footer-column {
        padding: 0 1rem;
    }
    
    .contact-form-group input,
    .contact-form-group textarea {
        padding: 0.6rem;
        font-size: 0.9rem;
    }
    
    .contact-submit-btn {
        padding: 0.8rem;
        font-size: 0.9rem;
    }
    
    .service-container {
        display: none !important;
    }
    
    /* 移动端底部固定悬浮按钮 */
    .mobile-bottom-buttons {
        display: flex !important;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 999;
    }
    
    .mobile-button {
        background-color: #222;
        color: #fff;
        padding: 15px;
        font-size: 14px;
        font-weight: 600;
        cursor: pointer;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
        transition: all 0.3s ease;
        text-decoration: none;
        flex: 1;
        text-align: center;
        margin: 0;
        border-radius: 0;
        position: relative;
    }
    
    .mobile-button:first-child {
        border-right: 1px solid #333;
    }
    
    .mobile-button:hover {
        background-color: #444;
    }
    
    /* 触摸设备优化 */
    @media (hover: none) and (pointer: coarse) {
        .mobile-button:active {
            background-color: #444;
        }
    }
    
    /* 联系我们弹窗 */
    .contact-modal {
        display: flex !important;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0,0,0,0.5);
        align-items: center;
        justify-content: center;
        z-index: 1000;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }
    
    .contact-modal.active {
        opacity: 1;
        visibility: visible;
    }
    
    .contact-modal-content {
        background-color: #fff;
        border-radius: 10px;
        padding: 20px;
        width: 90%;
        max-width: 400px;
        max-height: 80vh;
        overflow-y: auto;
    }
    
    .contact-modal-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 20px;
    }
    
    .contact-modal-title {
        font-size: 18px;
        font-weight: 600;
        color: #000;
    }
    
    .contact-modal-close {
        font-size: 24px;
        cursor: pointer;
        color: #999;
    }
    
    .contact-modal-item {
        display: flex;
        align-items: center;
        margin-bottom: 15px;
        padding: 10px;
        border-bottom: 1px solid #f0f0f0;
    }
    
    .contact-modal-icon {
        font-size: 20px;
        margin-right: 15px;
        color: #000;
    }
    
    .contact-modal-text {
        font-size: 14px;
        color: #333;
    }
    
    .back-to-top {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
        bottom: 70px;
    }
}

/* 小屏幕设备适配 */
@media (max-width: 768px) {
    .product-name {
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
        font-size: 1rem;
        line-height: 1.4;
    }
    
    /* 产品列表页移动端适配 - 恢复默认布局 */
    .product-list-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .product-list-grid .product-img-wrapper {
        height: auto;
    }
    
    .product-list-grid .product-name {
        -webkit-line-clamp: 2;
        min-height: 2.8em;
        max-height: 2.8em;
        font-size: 0.9rem;
    }
}

/* 产品列表页平板适配 */
@media (max-width: 1024px) and (min-width: 769px) {
    .product-list-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }
    
    .product-list-grid .product-img-wrapper {
        height: 160px;
    }
    
    .product-list-grid .product-name {
        -webkit-line-clamp: 2;
        min-height: 2.8em;
        max-height: 2.8em;
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .nav-item a {
        padding: 0.8rem 0;
    }
    
    .product-card {
        touch-action: manipulation;
    }
    
    .product-name {
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
        font-size: 1rem;
        line-height: 1.4;
    }
    
    .read-more-btn {
        touch-action: manipulation;
    }
    
    .submit-btn {
        touch-action: manipulation;
    }
}

/* 横屏适配 */
@media (orientation: landscape) and (max-height: 500px) {
    .section {
        padding: 2rem 0;
    }
    
    .products-banner {
        margin: 70px auto 1rem;
    }
    
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    #news .news-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 友情链接响应式样式 */
@media (max-width: 768px) {
    .links-container {
        gap: 1rem;
        justify-content: center;
    }
    
    .link-item {
        padding: 0.6rem 1.2rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .links-container {
        gap: 0.8rem;
    }
    
    .link-item {
        padding: 0.5rem 1rem;
        font-size: 0.75rem;
    }
}