﻿/* ============================================
   信永成咨询 - 响应式样式
   ============================================ */

/* ---------- 平板设备 (768px - 1024px) ---------- */
@media screen and (max-width: 1024px) {
    .container {
        max-width: 95%;
        padding: 0 15px;
    }

    .product-list {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 15px !important;
    }

    .product-detail {
        flex-direction: column;
        gap: 30px;
        padding: 20px;
    }

        .product-detail .gallery .main-image {
            height: 350px;
        }
}

/* ---------- 手机设备 (小于 768px) ---------- */
@media screen and (max-width: 768px) {
    body {
        padding-top: 60px;
        padding-bottom: 65px;
    }

    .container {
        max-width: 100%;
        padding: 0 12px;
    }

    /* ----- 头部 ----- */
    .header {
        padding: 10px 0;
    }

    .logo h1 {
        font-size: 18px;
    }

    .menu-toggle {
        display: block;
        font-size: 24px;
    }

    .header-right {
        display: none;
        flex-direction: column;
        align-items: center;
        width: 100%;
        padding: 10px 0;
        gap: 8px;
        border-top: 1px solid #eee;
        margin-top: 8px;
    }

        .header-right.open {
            display: flex;
        }

        .header-right .nav-link {
            font-size: 15px;
            padding: 6px 12px;
            width: 100%;
            text-align: center;
        }

    /* ----- 导航 ----- */
    .nav {
        top: 60px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

        .nav .container {
            padding: 0;
        }

        .nav ul {
            flex-wrap: nowrap;
            padding: 0 10px;
        }

            .nav ul li a {
                padding: 12px 14px;
                font-size: 12px;
                white-space: nowrap;
            }

    /* ----- 移动端底部导航 ----- */
    .mobile-bottom-nav {
        display: flex;
    }

    /* ----- 商品列表 ----- */
    .product-list {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }

    .product-item .product-image {
        height: 140px !important;
    }

    .product-item .product-info h4 {
        font-size: 13px !important;
    }

    .product-item .product-info .price {
        font-size: 16px !important;
    }

    /* ----- 商品详情 ----- */
    .product-detail {
        flex-direction: column;
        gap: 20px;
        padding: 15px;
    }

        .product-detail .gallery .main-image {
            height: 220px;
        }

        .product-detail .gallery .thumbnails img {
            width: 60px;
            height: 60px;
        }

        .product-detail .info h1 {
            font-size: 20px;
        }

        .product-detail .info .price {
            font-size: 24px;
        }

        .product-detail .info .original-price {
            font-size: 15px;
        }

        .product-detail .info .btn-cart {
            width: 100%;
            padding: 14px;
            font-size: 16px;
        }

    /* ----- 分类筛选 ----- */
    .category-filter {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 4px;
        padding: 8px 0;
    }

        .category-filter a.tree-item {
            font-size: 12px !important;
            padding: 4px 10px !important;
            white-space: nowrap;
        }

    /* ----- 页脚 ----- */
    .footer {
        padding: 30px 0 15px;
    }

        .footer .footer-content {
            grid-template-columns: 1fr 1fr;
            gap: 20px;
        }

        .footer .footer-section h3 {
            font-size: 16px;
        }

        .footer .footer-section h4 {
            font-size: 14px;
        }

        .footer .footer-section p,
        .footer .footer-section a {
            font-size: 13px;
        }

    /* ----- 表单 ----- */
    .form-row {
        flex-direction: column;
        gap: 0;
    }

        .form-row .half {
            flex: none;
        }

    /* ----- 分页 ----- */
    .pager a {
        padding: 6px 10px !important;
        font-size: 13px !important;
    }

    /* ----- 页面标题 ----- */
    .page-title h2 {
        font-size: 22px;
    }

    .page-title p {
        font-size: 13px;
    }

    /* ----- 滤镜栏 ----- */
    .filter-bar {
        flex-direction: column !important;
        gap: 10px !important;
    }

        .filter-bar .search-box {
            width: 100% !important;
            display: flex;
            gap: 8px;
        }

            .filter-bar .search-box .search-input {
                flex: 1;
                min-width: 0;
            }

        .filter-bar .filter-options {
            width: 100%;
        }

            .filter-bar .filter-options select {
                width: 100%;
            }
}

/* ---------- 小手机 (小于 480px) ---------- */
@media screen and (max-width: 480px) {
    .logo h1 {
        font-size: 16px;
    }

    .product-list {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }

    .product-item .product-image {
        height: 110px !important;
    }

    .product-item .product-info {
        padding: 8px 10px !important;
    }

        .product-item .product-info h4 {
            font-size: 12px !important;
        }

        .product-item .product-info .price {
            font-size: 14px !important;
        }

        .product-item .product-info .stock {
            font-size: 11px !important;
        }

    .product-detail .gallery .main-image {
        height: 180px;
    }

    .product-detail .gallery .thumbnails img {
        width: 50px;
        height: 50px;
    }

    .product-detail .info h1 {
        font-size: 18px;
    }

    .product-detail .info .price {
        font-size: 20px;
    }

    .page-title h2 {
        font-size: 18px;
    }

    .footer .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer .footer-section a {
        text-align: center;
    }
}

/* ---------- 平板横屏 (1024px - 1366px) ---------- */
@media screen and (min-width: 1025px) and (max-width: 1366px) {
    .product-list {
        grid-template-columns: repeat(4, 1fr) !important;
    }
}

/* ---------- 大屏 (大于 1366px) ---------- */
@media screen and (min-width: 1367px) {
    .product-list {
        grid-template-columns: repeat(5, 1fr) !important;
    }

    .container {
        max-width: 1400px;
    }
}

/* ---------- 打印样式 ---------- */
@media print {
    .header,
    .nav,
    .footer,
    .mobile-bottom-nav {
        display: none !important;
    }

    body {
        padding: 20px !important;
        background: #fff !important;
    }

    .main {
        padding: 0 !important;
    }
}
