﻿/* ============================================================
   WSTPARTS - 响应式样式 (Mobile First)
   ============================================================ */

/* ==================== 汉堡菜单按钮 ==================== */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 44px;
    height: 44px;
    background: none;
    border: 2px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    padding: 8px;
    gap: 5px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: #1A1A1A;
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: center;
}

.hamburger.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.hamburger.active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
.hamburger.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ==================== 手机端抽屉遮罩 ==================== */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 1998;
    opacity: 0;
    transition: opacity 0.3s;
}
.mobile-menu-overlay.active {
    display: block;
    opacity: 1;
}

/* ==================== 手机端抽屉菜单 ==================== */
.mobile-menu {
    position: fixed;
    top: 0;
    left: -100%;
    width: 85%;
    max-width: 320px;
    height: 100%;
    background: #1a1a1a;
    z-index: 1999;
    overflow-y: auto;
    transition: left 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    -webkit-overflow-scrolling: touch;
}

.mobile-menu.open {
    left: 0;
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 18px;
    border-bottom: 1px solid #333;
    background: #111;
}

.mobile-menu-close {
    background: none;
    border: none;
    color: #aaa;
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    line-height: 1;
}
.mobile-menu-close:hover { color: #F5A623; }

/* 手机端导航列表 */
.mobile-nav-list {
    list-style: none;
    padding: 8px 0;
    flex: 1;
}

.mobile-nav-list > li > a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    color: #e0e0e0;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    border-bottom: 1px solid #2a2a2a;
    transition: all 0.2s;
    gap: 8px;
}

.mobile-nav-list > li > a:hover,
.mobile-nav-list > li > a.active {
    color: #F5A623;
    background: rgba(255,193,7,0.08);
    padding-left: 22px;
}

/* 手机端子菜单展开箭头 */
.mobile-has-sub > a .arrow {
    margin-left: auto;
    font-size: 18px;
    color: #666;
    transition: transform 0.25s;
    flex-shrink: 0;
}
.mobile-has-sub > a .arrow.rotated {
    transform: rotate(90deg);
    color: #F5A623;
}

/* 手机端子菜单 */
.mobile-submenu {
    list-style: none;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
    background: #111;
}
.mobile-submenu.open {
    max-height: 400px;
}
.mobile-submenu li a {
    display: block;
    padding: 11px 18px 11px 36px;
    color: #aaa;
    text-decoration: none;
    font-size: 14px;
    border-bottom: 1px solid #222;
    transition: all 0.2s;
}
.mobile-submenu li a:hover {
    color: #F5A623;
    padding-left: 42px;
}

/* 手机端菜单底部联系 */
.mobile-menu-footer {
    padding: 16px 18px 24px;
    border-top: 1px solid #333;
}
.mobile-contact-btn {
    display: block;
    text-align: center;
    padding: 13px;
    background: #F5A623;
    color: #1a1a1a;
    text-decoration: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 700;
}
.mobile-contact-btn:hover { background: #FFA000; }

/* ==================== 手机端搜索栏 ==================== */
.mobile-search-bar {
    display: none;
    padding: 8px 0 10px;
    background: #f5f5f5;
    border-top: 1px solid #e0e0e0;
}
.mobile-search-inner {
    display: flex;
    gap: 8px;
}
.mobile-search-inner .search-input {
    flex: 1;
    width: auto;
    font-size: 14px;
}

/* 桌面端隐藏手机搜索 */
.desktop-search { display: flex; }

/* ==================== 平板端 (≤992px) ==================== */
@media (max-width: 992px) {
    /* 隐藏桌面导航 */
    .main-nav {
        display: none !important;
    }
    /* 隐藏桌面搜索 */
    .desktop-search {
        display: none !important;
    }
    /* 显示汉堡按钮 */
    .hamburger {
        display: flex;
    }
    /* 显示手机搜索栏 */
    .mobile-search-bar {
        display: block;
    }
    /* Header高度固定，保持单行 */
    .header-content {
        height: 56px !important;
        padding: 0;
        flex-direction: row !important;
        align-items: center;
    }
    /* Logo适配 */
    .logo img {
        height: 40px;
    }
    .logo-text {
        font-size: 20px;
    }
    /* Hero字体 */
    .hero-title {
        font-size: 32px;
    }
    .carousel-title {
        font-size: 34px;
    }
    .carousel-container {
        height: 380px;
    }
}

/* ==================== 手机端 (≤768px) ==================== */
@media (max-width: 768px) {
    /* 顶部联系栏：手机端完全隐藏，汉堡菜单底部已有联系方式 */
    .top-bar {
        display: none;
    }

    /* 导航栏优化 */
    .main-header {
        position: sticky;
        top: 0;
        z-index: 1000;
        background: #fff;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }
    .header-content {
        padding: 0 10px !important;
        height: 52px !important;
    }
    .logo {
        flex: 1;
        min-width: 0;
    }
    .logo img {
        height: 38px;
        max-width: 100%;
        object-fit: contain;
    }
    .logo-text {
        font-size: 18px;
        line-height: 1;
    }
    .logo-text span {
        color: #F5A623;
    }

    /* 汉堡菜单按钮优化 */
    .hamburger {
        width: 40px;
        height: 40px;
        border-width: 1px;
        padding: 6px;
    }
    .hamburger span {
        width: 20px;
        height: 2px;
    }

    /* 轮播图 - 支持触摸滑动 */
    .carousel-container {
        height: 220px;
        overflow: hidden;
        -webkit-overflow-scrolling: touch;
    }
    .carousel-slide {
        touch-action: pan-y;
    }
    .carousel-title {
        font-size: 18px;
        margin-bottom: 8px;
        line-height: 1.3;
    }
    .carousel-subtitle {
        font-size: 12px;
        margin-bottom: 14px;
        line-height: 1.4;
        max-width: 90%;
        margin-left: auto;
        margin-right: auto;
    }
    .carousel-content {
        padding: 0 20px;
        text-align: center;
    }
    .carousel-btn {
        width: 32px;
        height: 32px;
        opacity: 0.7;
    }
    .carousel-btn:hover {
        opacity: 1;
    }
    .carousel-indicators {
        bottom: 12px;
        gap: 6px;
    }
    .carousel-indicator {
        width: 6px;
        height: 6px;
    }
    .carousel-indicator.active {
        width: 20px;
        height: 6px;
        border-radius: 3px;
    }

    /* 按钮优化 */
    .btn-large {
        padding: 10px 18px;
        font-size: 14px;
        min-width: 120px;
    }
    .btn-primary {
        width: 100%;
        max-width: 200px;
    }

    /* 分类区域 */
    .categories-section {
        padding: 24px 0;
        background: #f9f9f9;
    }
    .category-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
        padding: 0 5px;
    }
    .category-item {
        min-height: 100px;
        padding: 12px 6px;
    }
    .category-item h3 {
        font-size: 12px;
        margin-bottom: 4px;
    }
    .category-item p {
        font-size: 10px;
        display: none;
    }
    .category-placeholder .ph-icon {
        font-size: 24px;
        margin-bottom: 6px;
    }
    .ph-brand {
        font-size: 8px;
        letter-spacing: 0.5px;
    }

    /* 产品网格 */
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 0 5px;
    }
    .product-card {
        border-radius: 8px;
        overflow: hidden;
    }
    .product-image {
        height: 140px;
        aspect-ratio: 1;
    }
    .product-badge {
        top: 8px;
        left: 8px;
        padding: 3px 8px;
        font-size: 11px;
    }
    .product-name {
        font-size: 13px;
        margin-bottom: 4px;
    }
    .product-code {
        font-size: 11px;
        margin-bottom: 6px;
    }
    .product-price {
        gap: 6px;
    }
    .price-current {
        font-size: 14px;
    }
    .btn-small {
        padding: 6px 12px;
        font-size: 12px;
    }

    /* 促销区域 */
    .promotions-section {
        padding: 24px 0;
        background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    }
    .promo-grid {
        grid-template-columns: 1fr;
    }
    .promo-item {
        max-width: 320px;
        margin: 0 auto;
    }
    .promo-info {
        padding: 16px;
    }
    .promo-desc {
        font-size: 13px;
        margin-bottom: 8px;
    }
    .promo-old {
        font-size: 14px;
    }
    .promo-new {
        font-size: 20px;
    }
    .promo-time {
        font-size: 11px;
        margin-top: 8px;
        color: #888;
    }

    /* 新闻区域 */
    .news-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .news-item {
        padding: 14px;
    }
    .news-date {
        width: 50px;
        min-width: 50px;
        height: 50px;
        min-height: 50px;
        font-size: 14px;
    }
    .news-date .day {
        font-size: 20px;
    }
    .news-date .month {
        font-size: 11px;
    }
    .news-title {
        font-size: 14px;
        margin-bottom: 6px;
    }
    .news-summary {
        font-size: 12px;
        line-height: 1.5;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    .news-more {
        font-size: 12px;
        margin-top: 8px;
    }

    /* 页脚：手机端极简布局 */
    .footer-partners {
        display: none;
    }
    .main-footer {
        margin-top: 24px !important;
        background: #1a1a1a !important;
    }
    .footer-top {
        padding: 16px 0 12px;
        background: #1e1e1e !important;
    }
    /* 手机端改单列，隐藏「快速链接」(nth-child 2)和「合作品牌」(nth-child 4) */
    .footer-grid {
        grid-template-columns: 1fr !important;
        gap: 0 !important;
    }
    .footer-grid .footer-section:nth-child(2),
    .footer-grid .footer-section:nth-child(4) {
        display: none;
    }
    /* 关于简介：单行截断 */
    .footer-section:nth-child(1) p {
        -webkit-line-clamp: 2;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    .footer-section h3 {
        font-size: 13px;
        margin-bottom: 6px;
        padding-bottom: 5px;
        color: #fff !important;
    }
    .footer-section p {
        font-size: 12px;
        line-height: 1.5;
        color: #aaa !important;
    }
    .footer-section li {
        font-size: 12px;
        padding: 3px 0;
        color: #aaa !important;
    }
    .footer-section a {
        color: #aaa !important;
    }
    /* 关于板块缩减间距 */
    .footer-section:nth-child(1) {
        padding-bottom: 12px;
        border-bottom: 1px solid #2a2a2a;
        margin-bottom: 12px;
    }
    /* 联系方式板块（第3个）横排显示 */
    .footer-section:nth-child(3) ul {
        display: flex;
        flex-wrap: wrap;
        gap: 4px 16px;
    }
    .footer-section:nth-child(3) li {
        font-size: 11px;
        white-space: nowrap;
    }
    .social-links {
        gap: 6px;
        margin-top: 8px;
    }
    .social-links a {
        padding: 4px 10px;
        font-size: 12px;
    }
    .footer-bottom {
        padding: 10px 0;
        background: #141414 !important;
    }
    .footer-bottom p {
        font-size: 11px;
        line-height: 1.8;
        text-align: center;
        color: #666 !important;
    }
    .footer-bottom a {
        color: #888 !important;
    }

    /* 在线客服悬浮按钮：手机端适配 */
    .customer-service {
        bottom: 20px;
        right: 12px;
        min-width: 110px;
    }
    .cs-toggle {
        padding: 10px;
        font-size: 18px;
    }
    .cs-content h4 {
        padding: 8px 12px 5px;
        font-size: 12px;
    }
    .cs-item {
        padding: 9px 12px;
        font-size: 12px;
    }

    /* 容器通用优化 */
    .container {
        padding: 0 12px;
        max-width: 100%;
    }
    section {
        padding: 24px 0;
    }
    .section-title {
        font-size: 20px;
        margin-bottom: 6px;
    }
    .section-subtitle {
        font-size: 13px;
        margin-bottom: 20px;
    }
}

/* ==================== 小屏手机 (≤480px) ==================== */
@media (max-width: 480px) {
    /* 顶部栏只显示电话简短版 */
    .top-bar-phone {
        font-size: 11px;
    }

    /* Logo文字缩小 */
    .logo-text {
        font-size: 18px;
    }
    .logo img {
        height: 34px;
    }

    /* 轮播更矮 */
    .carousel-container {
        height: 200px;
    }
    .carousel-title {
        font-size: 17px;
    }
    .carousel-subtitle {
        display: none;
    }
    .carousel-content .btn {
        padding: 8px 14px;
        font-size: 13px;
    }

    /* 分类改2列 */
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    /* 产品单列 */
    .product-grid {
        grid-template-columns: 1fr;
    }

    /* 区块标题 */
    .section-title {
        font-size: 20px;
    }
    .section-subtitle {
        font-size: 13px;
    }

    /* 容器边距 */
    .container {
        padding: 0 12px;
    }
    section {
        padding: 20px 0;
    }

    /* 按钮 */
    .btn {
        padding: 10px 18px;
        font-size: 14px;
    }
}

/* ==================== 产品详情页移动端 ==================== */
@media (max-width: 768px) {
    .product-detail-grid {
        grid-template-columns: 1fr !important;
    }
    .product-detail-images {
        margin-bottom: 16px;
    }
    .product-table th,
    .product-table td {
        padding: 8px 10px;
        font-size: 13px;
    }
}

/* ==================== VIP批量查询移动端 ==================== */
@media (max-width: 768px) {
    .vip-batch-box {
        padding: 16px;
    }
    .vip-result-table {
        font-size: 12px;
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .vip-result-table th,
    .vip-result-table td {
        white-space: nowrap;
        padding: 6px 8px;
    }
}

/* ==================== 表格横向滚动（全局） ==================== */
@media (max-width: 768px) {
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    table {
        min-width: 500px;
    }
    /* 但不强制所有表格，用wrapper */
    .table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 6px;
    }
}

/* ==================== 悬浮客服按钮移动端 ==================== */
@media (max-width: 768px) {
    .cs-widget {
        bottom: 16px;
        right: 12px;
    }
    .cs-btn {
        width: 48px;
        height: 48px;
        font-size: 22px;
    }
    .cs-panel {
        right: 0;
        width: 200px;
    }
}

/* ==================== 搜索结果页移动端 ==================== */
@media (max-width: 768px) {
    .search-filters {
        flex-direction: column;
        gap: 8px;
    }
    .search-filter-item {
        width: 100%;
    }
    .search-result-item {
        flex-direction: column;
        gap: 8px;
    }
    .pagination {
        gap: 4px;
    }
    .pagination a,
    .pagination span {
        padding: 6px 10px;
        font-size: 13px;
    }
}

/* ==================== 联系页移动端 ==================== */
@media (max-width: 768px) {
    .contact-grid {
        grid-template-columns: 1fr !important;
    }
    .contact-map {
        height: 220px;
    }
    .contact-info-item {
        flex-direction: row;
        gap: 10px;
    }
}

/* ==================== 登录/注册页移动端 ==================== */
@media (max-width: 480px) {
    .auth-box {
        margin: 20px 12px;
        padding: 24px 16px;
    }
    .auth-title {
        font-size: 22px;
    }
}

/* ==================== 购物车页移动端 ==================== */
@media (max-width: 768px) {
    .cart-table {
        display: block;
        overflow-x: auto;
    }
    .cart-table th,
    .cart-table td {
        white-space: nowrap;
        padding: 8px 10px;
        font-size: 13px;
    }
    .cart-summary {
        margin-top: 16px;
    }
}

/* ==================== 防止水平溢出 ==================== */
html, body {
    overflow-x: hidden;
}
img {
    max-width: 100%;
    height: auto;
}
