/* ============ 产品中心页面样式 ============ */

/* 页面横幅 */
.page-banner {
    background: linear-gradient(135deg, #0066cc, #0080ff);
    color: #fff;
    text-align: center;
    padding: 56px 0 48px;
}

.page-banner h2 {
    font-size: 34px;
    letter-spacing: 4px;
    font-weight: bold;
}

.page-banner .en {
    display: block;
    font-size: 13px;
    letter-spacing: 4px;
    text-transform: uppercase;
    opacity: .8;
    margin-top: 8px;
}

.breadcrumb {
    background: #f2f6f9;
    border-bottom: 1px solid #e6eef3;
    padding: 12px 0;
    font-size: 13px;
    color: #666;
}

.breadcrumb a {
    color: var(--primary);
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb .sep {
    margin: 0 8px;
    color: #bbb;
}

.breadcrumb .current {
    color: #333;
}

/* 主体 */
.products-main {
    padding: 50px 0 70px;
    background: #fff;
    min-height: 420px;
}

/* 视图切换 */
.view {
    display: none;
}

.view.active {
    display: block;
    animation: viewFade .35s ease;
}

@keyframes viewFade {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 一级：分类卡片 */
.cat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 26px;
}

.cat-card {
    background: #fff;
    border: 1px solid #e8eef3;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all .35s ease;
    box-shadow: 0 3px 14px rgba(0, 0, 0, .05);
}

.cat-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 14px 30px rgba(39, 123, 167, .18);
    border-color: var(--primary);
}

.cat-card .thumb {
    position: relative;
    height: 190px;
    overflow: hidden;
}

.cat-card .thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s ease;
}

.cat-card:hover .thumb img {
    transform: scale(1.08);
}

.cat-card .thumb .count {
    position: absolute;
    right: 12px;
    top: 12px;
    background: rgba(39, 123, 167, .92);
    color: #fff;
    font-size: 12px;
    padding: 3px 10px;
    border-radius: 20px;
    letter-spacing: 1px;
}

.cat-card .info {
    padding: 18px 20px 20px;
}

.cat-card .info h3 {
    font-size: 17px;
    color: #222;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.cat-card .info .en {
    font-size: 12px;
    color: #999;
    letter-spacing: 1px;
    display: block;
    margin-bottom: 10px;
}

.cat-card .info .more {
    font-size: 13px;
    color: var(--primary);
}

.cat-card .info .more i {
    margin-left: 4px;
    transition: margin .3s;
}

.cat-card:hover .info .more i {
    margin-left: 8px;
}

/* 产品搜索栏 */
.search-bar {
    margin-bottom: 30px;
}

.search-box {
    position: relative;
    max-width: 680px;
    margin: 0 auto;
}

.search-box > i {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #9aa7b2;
    font-size: 16px;
    pointer-events: none;
}

.search-box input {
    width: 100%;
    height: 52px;
    padding: 0 52px 0 50px;
    border: 2px solid #e6eef3;
    border-radius: 26px;
    font-size: 15px;
    color: #333;
    background: #f7fafc;
    outline: none;
    transition: all .3s;
}

.search-box input:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 6px 20px rgba(39, 123, 167, .12);
}

.search-box .search-clear {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #c5d0d8;
    color: #fff;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 13px;
    transition: background .3s;
}

.search-box .search-clear:hover {
    background: var(--red);
}

.search-box .search-clear.show {
    display: flex;
}

/* 二级：产品列表 */
.prod-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 26px;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 20px;
    background: var(--primary);
    color: #fff;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    border: 1px solid var(--primary);
    transition: all .3s;
}

.back-btn:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.prod-toolbar .cat-title {
    font-size: 24px;
    color: #222;
    letter-spacing: 2px;
}

.prod-toolbar .cat-title span {
    color: var(--primary);
    font-size: 14px;
    letter-spacing: 1px;
    margin-left: 10px;
}

.prod-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.prod-card {
    background: #fff;
    border: 1px solid #e8eef3;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all .35s ease;
    box-shadow: 0 3px 14px rgba(0, 0, 0, .05);
    display: flex;
    flex-direction: column;
}

.prod-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 14px 30px rgba(39, 123, 167, .18);
    border-color: var(--primary);
}

.prod-card .thumb {
    position: relative;
    height: 200px;
    overflow: hidden;
    background: #f5f8fa;
}

.prod-card .thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s ease;
}

.prod-card:hover .thumb img {
    transform: scale(1.08);
}

.prod-card .thumb .code {
    position: absolute;
    left: 12px;
    top: 12px;
    background: rgba(25, 108, 148, .92);
    color: #fff;
    font-size: 12px;
    padding: 3px 10px;
    border-radius: 4px;
    letter-spacing: 1px;
}

.prod-card .info {
    padding: 16px 16px 18px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.prod-card .info .name {
    font-size: 14px;
    color: #333;
    line-height: 1.55;
    height: 44px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin-bottom: 12px;
}

.prod-card .info .inquire-tip {
    margin-top: auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--primary);
    font-weight: bold;
}

.prod-card .info .inquire-tip i {
    font-size: 14px;
}

/* 空状态 */
.empty-tip {
    text-align: center;
    padding: 80px 0;
    color: #999;
    font-size: 15px;
}

/* 三级：详情弹窗 */
.modal-mask {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .55);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-mask.show {
    display: flex;
}

.modal {
    background: #fff;
    border-radius: 10px;
    width: 1040px;
    max-width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: modalIn .3s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(.94); }
    to { opacity: 1; transform: scale(1); }
}

.modal-close {
    position: absolute;
    right: 14px;
    top: 12px;
    width: 34px;
    height: 34px;
    background: rgba(0, 0, 0, .35);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    z-index: 5;
    transition: background .3s;
}

.modal-close:hover {
    background: var(--red);
}

/* 顶部：左图 + 右侧核心信息 */
.modal-hero {
    display: flex;
    align-items: stretch;
}

.modal-gallery {
    flex: 0 0 46%;
    background: #f5f8fa;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 34px;
}

.modal-gallery img {
    width: 100%;
    max-height: 460px;
    object-fit: contain;
    border-radius: 6px;
}

.modal-summary {
    flex: 1;
    padding: 34px 34px 30px;
    min-width: 0;
}

.modal-summary .code-tag {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    font-size: 13px;
    padding: 4px 12px;
    border-radius: 4px;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.modal-summary h3 {
    font-size: 22px;
    color: #222;
    line-height: 1.5;
    margin-bottom: 8px;
    letter-spacing: .5px;
}

.modal-summary .name-cn {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 20px;
}

.modal-summary .name-cn:empty {
    display: none;
}

/* 区块标题 */
.block-title {
    font-size: 15px;
    color: #222;
    font-weight: bold;
    letter-spacing: 1px;
    padding-left: 10px;
    border-left: 3px solid var(--primary);
    margin-bottom: 16px;
}

/* 顶部核心属性 */
.key-attr {
    margin-bottom: 20px;
}

.key-attr .spec-list {
    margin-bottom: 0;
}

/* 询价框 */
.modal-summary .inquire-box {
    background: #f0f7fb;
    border: 1px solid #d8e9f2;
    border-radius: 6px;
    padding: 18px;
}

.modal-summary .inquire-box .inq-title {
    font-size: 15px;
    color: var(--primary);
    font-weight: bold;
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.modal-summary .inquire-box .inq-title i {
    margin-right: 6px;
}

.modal-summary .inquire-box p {
    font-size: 13px;
    color: #666;
    line-height: 1.7;
    margin-bottom: 14px;
}

/* 参数网格（默认 2 列） */
.spec-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    column-gap: 12px;
    row-gap: 10px;
    margin-bottom: 22px;
}

.spec-item {
    min-width: 0;
    padding: 10px 12px;
    background: #f7fafc;
    border: 1px solid #eef3f7;
    border-radius: 6px;
}

.spec-item.span-2 {
    grid-column: 1 / -1;
}

.spec-item .spec-label {
    display: block;
    font-size: 12px;
    color: #9aa7b2;
    margin-bottom: 4px;
    letter-spacing: .5px;
}

.spec-item .spec-value {
    display: block;
    font-size: 14px;
    color: #333;
    line-height: 1.55;
    word-break: break-word;
}

/* 下方：完整规格（3 列） */
.modal-detail {
    padding: 26px 34px 34px;
    border-top: 1px solid #eef3f7;
}

.detail-section {
    margin-bottom: 26px;
}

.detail-section:last-child {
    margin-bottom: 0;
}

.modal-detail .spec-list {
    grid-template-columns: repeat(3, 1fr);
    margin-bottom: 0;
}

.btn-mail {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 4px;
    font-size: 15px;
    cursor: pointer;
    letter-spacing: 1px;
    transition: all .3s;
    background: var(--primary);
    color: #fff;
    border: 1px solid var(--primary);
    text-decoration: none;
}

.btn-mail:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: #fff;
}

/* 响应式 */
@media (max-width: 991px) {
    .cat-grid,
    .prod-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .modal-hero {
        flex-direction: column;
    }

    .modal-gallery {
        flex: none;
        padding: 24px;
    }

    .modal-gallery img {
        max-height: 320px;
    }

    .modal-detail .spec-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767px) {
    .cat-grid,
    .prod-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }

    .cat-card .thumb {
        height: 140px;
    }

    .prod-card .thumb {
        height: 150px;
    }

    .page-banner h2 {
        font-size: 26px;
    }

    .prod-toolbar .cat-title {
        font-size: 18px;
    }

    .modal-summary {
        padding: 22px 18px;
    }

    .modal-detail {
        padding: 20px 18px 24px;
    }

    .spec-list,
    .modal-detail .spec-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .cat-grid,
    .prod-grid {
        grid-template-columns: 1fr;
    }
}
