/* 移动端响应式布局优化 */

/* ===== 基础移动端设置 ===== */
@media (max-width: 767px) {
    /* 基础布局调整 */
    body {
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        font-size: 14px;
    }
    
    .container {
        padding: 0 15px;
        max-width: 100%;
    }
    
    .container-fluid {
        padding: 0 10px;
    }
    
    /* 头部导航移动端优化 */
    .main-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        background: #fff;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    }
    
    .header-top-area {
        padding: 10px 0;
    }
    
    .header-area {
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex-wrap: wrap;
    }
    
    .header-element {
        margin: 0;
    }
    
    /* Logo 移动端优化 */
    .header-logo {
        flex: 1;
        text-align: center;
    }
    
    .header-theme-logo a.theme-logo img {
        max-height: 40px;
        width: auto;
    }
    
    /* 搜索框移动端优化 */
    .header-search {
        order: 3;
        width: 100%;
        margin-top: 10px;
    }
    
    .search-crap .search-content .search-box form.search-bar .form-search {
        display: flex;
        border: 1px solid #ddd;
        border-radius: 25px;
        overflow: hidden;
    }
    
    .search-crap .search-content .search-box form.search-bar .form-search input.search-input {
        flex: 1;
        border: none;
        padding: 12px 15px;
        font-size: 14px;
    }
    
    .search-crap .search-content .search-box form.search-bar .form-search button.search-btn {
        padding: 12px 20px;
        border: none;
        background: #3a8fc7;
        color: white;
        border-radius: 0 25px 25px 0;
    }
    
    /* 头部图标移动端优化 */
    .header-icon {
        order: 2;
    }
    
    .header-icon-block ul.shop-element {
        display: flex;
        gap: 15px;
        margin: 0;
    }
    
    .header-icon-block ul.shop-element li.side-wrap {
        margin: 0;
    }
    
    /* 头部详情信息移动端隐藏 */
    .header-details {
        display: none;
    }
    
    /* 底部导航移动端优化 */
    .header-bottom-area {
        display: none;
    }
    
    /* 移动端菜单按钮优化 */
    .toggler-btn {
        background: none;
        border: none;
        padding: 8px;
        cursor: pointer;
    }
    
    .toggler-icon svg {
        width: 20px;
        height: 20px;
        color: #333;
    }
}

/* ===== 产品页面移动端优化 ===== */
@media (max-width: 767px) {
    .product-body {
        flex-direction: column;
        margin-top: 80px; /* 为固定头部留出空间 */
        padding: 15px;
    }
    
    .product-body-left,
    .product-body-right {
        width: 100%;
    }
    
    .product-preview {
        width: 100%;
        text-align: center;
        margin-bottom: 20px;
    }
    
    .product-preview img {
        width: 100%;
        max-width: 300px;
        height: auto;
        max-height: 300px;
    }
    
    .product-preview p {
        font-size: 16px;
        margin-top: 15px;
    }
    
    /* 产品信息移动端优化 */
    .product-sku {
        flex-direction: column;
        gap: 10px;
        font-size: 16px;
    }
    
    .product-short-description {
        font-size: 14px;
        line-height: 1.5;
    }
    
    /* 价格表格移动端优化 */
    .product-left-price {
        width: 100%;
        overflow-x: auto;
    }
    
    .product-left-price table {
        min-width: 300px;
        font-size: 12px;
    }
    
    .product-left-price th,
    .product-left-price td {
        padding: 8px 5px;
        font-size: 12px;
    }
    
    /* 联系按钮移动端优化 */
    .buttom_div {
        padding: 0;
        margin-top: 20px;
    }
    
    .contact_online {
        width: 100%;
        height: 45px;
        font-size: 16px;
        border-radius: 25px;
    }
    
    .contact_online span {
        margin-left: 10px;
    }
    
    /* 产品详情移动端优化 */
    .product-info {
        margin-top: 40px;
    }
    
    .product-info-title span {
        font-size: 20px;
        padding: 8px;
    }
    
    .product-introduce {
        padding: 20px 15px;
        margin: 0 10px;
    }
    
    .product-introduce-title {
        font-size: 18px;
    }
    
    /* 详情表格移动端优化 */
    .details_info_tbl {
        font-size: 14px;
        line-height: 1.4;
    }
    
    .details_info_tbl th {
        width: 30%;
        padding: 8px 5px;
        font-size: 12px;
    }
    
    .details_info_tbl td {
        font-size: 12px;
        padding: 8px 10px;
    }
}

/* ===== 产品卡片移动端优化 ===== */
@media (max-width: 767px) {
    .pro_card {
        margin-bottom: 20px;
        border-radius: 10px;
        overflow: hidden;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    }
    
    .pro_card > .products-thumb {
        height: 200px;
    }
    
    .pro_card > .products-thumb a img {
        height: 180px;
        object-fit: contain;
    }
    
    .pro_card > .products-id {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .pro_card > h3.products-name {
        padding: 0 12px;
        font-size: 14px;
        line-height: 1.3;
        min-height: 40px;
    }
    
    .pro_card > .products-price {
        padding: 8px 12px;
        font-size: 14px;
    }
    
    .pro_card > .products-price table {
        font-size: 12px;
    }
    
    .pro_card > .products-price th,
    .pro_card > .products-price td {
        padding: 4px 6px;
    }
}

/* ===== 搜索页面移动端优化 ===== */
@media (max-width: 767px) {
    .search-product-card {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .search-product-card .search-product-img {
        display: none; /* 在手机端隐藏结构图 */
    }

    .search-product-card .search-product-info {
        width: 100%;
        text-align: left; /* 信息部分左对齐 */
        padding: 0 10px;
    }

    .search-product-card .search-product-price {
        width: 100%;
        margin-top: 15px;
    }

    .search-box {
        margin: 80px 15px 20px;
        padding: 15px;
    }
    
    .search-query {
        font-size: 16px;
        padding: 12px 15px;
    }
    
    .search-tips {
        font-size: 14px;
        margin: 10px 0;
    }
    
    .search-product-card {
        margin: 15px 0;
        padding: 15px;
        border-radius: 10px;
    }
    
    .search-head-img,
    .search-product-img {
        width: 80px;
        height: 80px;
    }
    
    .search-head-info {
        font-size: 14px;
    }
    
    .search-head-price {
        font-size: 14px;
    }
    
    .search-product-info {
        font-size: 12px;
    }
    
    .search-product-info ul {
        margin: 5px 0;
        padding-left: 15px;
    }
    
    .search-product-info-item {
        margin: 3px 0;
        font-size: 12px;
    }
    
    .search-product-price {
        font-size: 12px;
    }
    
    .search-product-price table {
        font-size: 11px;
    }
    
    .search-product-price th,
    .search-product-price td {
        padding: 4px 6px;
    }
    
    /* 分页移动端优化 */
    .pagination {
        justify-content: center;
        flex-wrap: wrap;
        gap: 5px;
    }
    
    .pagination li {
        margin: 0 2px;
    }
    
    .pagination li a {
        padding: 8px 12px;
        font-size: 14px;
    }

    .search-product-info .info-row {
        display: flex;
        flex-wrap: wrap; /* 允许换行 */
        justify-content: space-between;
    }

    .search-product-info .info-row .search-product-info-item {
        width: 48%; /* 让每个项目占据近一半的宽度 */
    }
}

/* ===== 移动端菜单优化 ===== */
@media (max-width: 767px) {
    .mobile-menu {
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: rgba(0,0,0,0.8);
        z-index: 9999;
    }
    
    .mobile-contents {
        width: 100%;
        height: 100%;
        background: #fff;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .mobile-menu.active .mobile-contents {
        transform: translateX(0);
    }
    
    .menu-close {
        position: absolute;
        top: 20px;
        right: 20px;
        z-index: 10001;
    }
    
    .menu-close-btn {
        background: none;
        border: none;
        padding: 10px;
        cursor: pointer;
    }
    
    .menu-close-icon svg {
        width: 24px;
        height: 24px;
        color: #333;
    }
    
    .mobilemenu-content {
        padding: 60px 20px 20px;
        height: 100%;
        overflow-y: auto;
    }
    
    .mobilemenu-content .main-wrap ul.main-menu li.menu-link {
        border-bottom: 1px solid #eee;
    }
    
    .mobilemenu-content .main-wrap ul.main-menu li.menu-link a.link-title {
        padding: 15px 0;
        font-size: 16px;
        color: #333;
        text-decoration: none;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .mobilemenu-content .main-wrap ul.main-menu li.menu-link .menu-dropdown {
        padding-left: 20px;
        background: #f8f9fa;
    }
    
    .mobilemenu-content .main-wrap ul.main-menu li.menu-link .menu-dropdown ul.ul li {
        padding: 10px 0;
        border-bottom: 1px solid #e9ecef;
    }
    
    .mobilemenu-content .main-wrap ul.main-menu li.menu-link .menu-dropdown ul.ul li a {
        color: #666;
        text-decoration: none;
        font-size: 14px;
    }
}

/* ===== 搜索模态框移动端优化 ===== */
@media (max-width: 767px) {
    .search-modal .modal-dialog {
        margin: 10px;
        max-width: calc(100% - 20px);
    }
    
    .search-modal .modal-content {
        border-radius: 15px;
    }
    
    .search-modal .modal-body {
        padding: 20px;
    }
    
    .search-modal .search-box form.search-bar .form-search {
        display: flex;
        border: 2px solid #3a8fc7;
        border-radius: 25px;
        overflow: hidden;
    }
    
    .search-modal .search-box form.search-bar .form-search input.search-input {
        flex: 1;
        border: none;
        padding: 15px 20px;
        font-size: 16px;
    }
    
    .search-modal .search-box form.search-bar .form-search button.search-btn {
        padding: 15px 25px;
        border: none;
        background: #3a8fc7;
        color: white;
        border-radius: 0 25px 25px 0;
    }
}

/* ===== 页脚移动端优化 ===== */
@media (max-width: 767px) {
    .ft-copyright-area .ft-copyright ul {
        flex-direction: column;
        gap: 15px;
        text-align: center;
        padding-left: 0;
    }

    .ft-copyright-area .row {
        flex-direction: column;
        text-align: center;
    }

    .ft-copyright-area .col {
        width: 100%;
        margin-left: 0 !important;
    }

    .ft-copyright-area .col p {
        margin-top: 15px;
        font-size: 12px;
        line-height: 1.5;
    }

    .footer-area {
        padding: 30px 15px;
    }
    
    .footer-area ul.footer-ul {
        flex-direction: column;
        gap: 20px;
    }
    
    .footer-area ul.footer-ul li.footer-li {
        width: 100%;
        text-align: center;
    }
    
    .footer-area ul.footer-ul li.footer-li h6.ftlist-title {
        font-size: 18px;
        margin-bottom: 15px;
    }
    
    .footer-area ul.footer-ul li.footer-li ul.ftlist-ul li.ftlist-li ul.ftlink-ul li.ftlink-li {
        padding: 5px 0;
    }
    
    .footer-area ul.footer-ul li.footer-li ul.ftlist-ul li.ftlist-li ul.ftlink-ul li.ftlink-li a {
        font-size: 14px;
    }
}

/* ===== 通用移动端优化 ===== */
@media (max-width: 767px) {
    /* 隐藏桌面端元素 */
    .desktop-only {
        display: none !important;
    }
    
    /* 显示移动端元素 */
    .mobile-only {
        display: block !important;
    }
    
    /* 按钮移动端优化 */
    .btn-style {
        padding: 12px 20px;
        font-size: 14px;
        border-radius: 25px;
    }
    
    /* 图片响应式 */
    img {
        max-width: 100%;
        height: auto;
    }
    
    /* 表格响应式 */
    table {
        font-size: 12px;
    }
    
    /* 文本优化 */
    h1 { font-size: 24px; }
    h2 { font-size: 20px; }
    h3 { font-size: 18px; }
    h4 { font-size: 16px; }
    h5 { font-size: 14px; }
    h6 { font-size: 12px; }
    
    /* 间距优化 */
    .section-ptb {
        padding: 30px 0;
    }
    
    .section-pt {
        padding-top: 30px;
    }
    
    .section-pb {
        padding-bottom: 30px;
    }
}

/* ===== 超小屏幕优化 (iPhone SE等) ===== */
@media (max-width: 375px) {
    .container {
        padding: 0 10px;
    }
    
    .header-theme-logo a.theme-logo img {
        max-height: 35px;
    }
    
    .search-crap .search-content .search-box form.search-bar .form-search input.search-input {
        font-size: 13px;
        padding: 10px 12px;
    }
    
    .product-preview img {
        max-width: 250px;
    }
    
    .product-left-price table {
        min-width: 280px;
        font-size: 11px;
    }
    
    .product-left-price th,
    .product-left-price td {
        padding: 6px 4px;
    }
    
    .contact_online {
        font-size: 14px;
        height: 40px;
    }
}

/* ===== 横屏模式优化 ===== */
@media (max-width: 767px) and (orientation: landscape) {
    .mobile-menu .mobile-contents {
        height: 100vh;
        overflow-y: auto;
    }
    
    .mobilemenu-content {
        padding: 40px 20px 20px;
    }
    
    .product-body {
        margin-top: 60px;
    }
}

/* ===== 服务区域移动端优化 ===== */
@media (max-width: 767px) {
    .our-service-area .grid-wrap {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-around;
    }

    .our-service-area .grid-wrapper {
        flex: 0 0 48%; /* Two items per row with a small gap */
        max-width: 48%;
        margin-bottom: 20px !important;
    }

    .our-service-area .ser-block a {
        flex-direction: column;
    }

    .our-service-area .service-text h6 {
        font-size: 14px;
        margin-top: 10px;
    }

    .our-service-area .service-text p {
        font-size: 12px;
        line-height: 1.4;
    }
} 