/* =====================================================
   PRODUCT DETAIL - CLEAN VERSION FINAL
===================================================== */

.product-detail {
    position: relative;
    z-index: 1;
    padding: 20px 0;
}


/* =====================================================
   HEADER
===================================================== */

.product-header {
    position: relative;
    z-index: 1;

    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}


/* ================= IMAGE ================= */

.product-gallery {
    position: relative;
    z-index: 1;
}

.product-gallery .main-image {
    position: relative;
    z-index: 1;

    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #eee;
    background: #fafafa;
}

.product-gallery .main-image img {
    position: relative;
    z-index: 1;

    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumb-list {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.thumb-list img {
    width: 60px;
    height: 60px;
    border-radius: 6px;
    object-fit: cover;
    border: 1px solid #ddd;
    cursor: pointer;
}


/* =====================================================
   INFO
===================================================== */

.product-info {
    position: relative;
    z-index: 1;
}

.product-info h1 {
    font-size: 28px;
    margin-bottom: 10px;
}

.meta {
    display: flex;
    gap: 15px;
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
}

.desc {
    color: #444;
    margin-bottom: 20px;
}


/* =====================================================
   BUTTONS
===================================================== */

.actions {
    display: flex;
    gap: 10px;
}

.btn-primary,
.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 10px 15px;
    border-radius: 4px;

    text-decoration: none;
    cursor: pointer;

    font-size: 14px;
    line-height: 1.4;
}

.btn-primary {
    background: #1677ff;
    color: #fff;
    border: 1px solid #1677ff;
}

.btn-secondary {
    background: #eee;
    color: #333;
    border: 1px solid #eee;
}

.btn-primary:hover {
    background: #0f5bd6;
    border-color: #0f5bd6;
}

.btn-secondary:hover {
    background: #e0e0e0;
    border-color: #e0e0e0;
}

.btn-primary:hover {
    background: #0f5bd6;
}

.btn-secondary:hover {
    background: #e0e0e0;
}


/* =====================================================
   SUMMARY
===================================================== */

.product-summary-box {
    background: #fff;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    border: 1px solid #eee;
}

.product-summary-box h2 {
    font-size: 18px;
    margin-bottom: 12px;
}

.summary-content {
    font-size: 14px;
    color: #444;
    line-height: 1.8;
}


/* =====================================================
   PRODUCT BODY
===================================================== */

.product-body {
    position: relative;
    z-index: 1;
}

.product-body .card {
    background: #fff;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    border: 1px solid #eee;
}

.product-body .card h2 {
    font-size: 18px;
    margin-bottom: 14px;
}

#description {
    font-size: 15px;
    color: #333;
    line-height: 1.85;
}

#description img {
    max-width: 100%;
    height: auto;
    margin: 12px 0;
    border-radius: 6px;
}


/* =====================================================
   TECH PARAMS
===================================================== */

#specTable {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px 16px;
}

.param-row {
    display: flex;
    justify-content: space-between;
    align-items: center;

    padding: 10px 14px;
    border-radius: 8px;

    background: #f7f9fc;
    border: 1px solid #eef2f7;

    transition: 0.2s;
}

.param-row:hover {
    background: #fff;
    border-color: #dbe6ff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.param-name {
    font-size: 13px;
    color: #666;
}

.param-value {
    font-size: 13px;
    color: #1f4fff;
    font-weight: 500;
    text-align: right;
    max-width: 65%;
}


/* =====================================================
   RELATED PRODUCTS
===================================================== */

#relatedProducts {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
}

.product-card {
    display: block;
    text-decoration: none;
    color: #333;
}

.product-img {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 6px;
    background: #f5f5f5;
}

.product-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-name,
.product-info h4 {
    font-size: 13px;
    margin-top: 6px;
    text-align: center;
    line-height: 1.4;
}


/* =====================================================
   TAB SYSTEM
===================================================== */

.tab-header {
    display: flex;
    width: 100%;
    gap: 0;
    border-bottom: 1px solid #eee;
    margin-bottom: 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tab-btn {
    flex: 1;
    min-width: 96px;
    text-align: center;

    padding: 10px 8px;
    cursor: pointer;

    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;

    font-size: 14px;
    color: #666;
    white-space: nowrap;

    transition: all 0.2s ease;
}

.tab-btn:hover {
    color: #1677ff;
}

.tab-btn.active {
    background: #1677ff;
    color: #fff;
    border-bottom: 2px solid #1677ff;
    font-weight: 500;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}


/* =====================================================
   RELATION LIST
===================================================== */

.tab-link-item {
    display: block;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    color: #333;
    text-decoration: none;
    font-size: 14px;
}

.tab-link-item:hover {
    color: #1677ff;
    background: #f5f7ff;
    padding-left: 6px;
}


/* =====================================================
   DOWNLOAD ROW
===================================================== */

.download-row {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 12px 14px;
    border-bottom: 1px solid #eee;

    text-decoration: none;
    color: #333;

    transition: background 0.2s;
}

.download-row:hover {
    background: #f7faff;
}

.dl-name {
    flex: 2;
    font-size: 14px;
    font-weight: 500;
}

.dl-meta {
    flex: 2;
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: #666;
    justify-content: center;
}

.dl-action {
    flex: 0;
    color: #1677ff;
    font-size: 13px;
    white-space: nowrap;
}


/* =====================================================
   EMPTY
===================================================== */

.empty {
    color: #999;
    font-size: 13px;
    padding: 10px 0;
}


/* =====================================================
   LAYER FIX
   防止产品详情图片压住顶部搜索栏
===================================================== */

.product-detail,
.product-header,
.product-gallery,
.main-image,
.main-image img,
.product-info,
.product-body {
    position: relative;
    z-index: 1;
}


/* =====================================================
   RESPONSIVE
===================================================== */

@media (max-width: 1024px) {

    #relatedProducts {
        grid-template-columns: repeat(3, 1fr);
    }

}


@media (max-width: 768px) {

    .product-detail {
        padding: 12px 0;
    }

    .product-header {
        grid-template-columns: 1fr;
        gap: 18px;
        margin-bottom: 18px;
    }

    .product-info h1 {
        font-size: 22px;
        line-height: 1.35;
    }

    .meta {
        flex-direction: column;
        gap: 4px;
        font-size: 13px;
    }

    .desc {
        font-size: 14px;
        line-height: 1.7;
    }

    .actions {
        flex-direction: column;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
    }

    #specTable {
        grid-template-columns: 1fr;
    }

    .param-row {
        padding: 12px;
    }

    .param-name,
    .param-value {
        font-size: 14px;
    }

    #relatedProducts {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .tab-header {
        overflow-x: auto;
        flex-wrap: nowrap;
    }

    .tab-btn {
        flex: 0 0 auto;
        min-width: 110px;
    }

    .download-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
        padding: 12px 0;
    }

    .dl-name,
    .dl-meta,
    .dl-action {
        width: 100%;
        flex: none;
    }

    .dl-meta {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

}


@media (max-width: 420px) {

    .product-info h1 {
        font-size: 20px;
    }

    .product-summary-box,
    .product-body .card {
        padding: 14px;
    }

    .tab-btn {
        min-width: 104px;
        font-size: 13px;
    }

    #relatedProducts {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

}

/* =====================================================
   MOBILE PRODUCT INFO SPACING
   手机端产品信息区四周留白
===================================================== */

@media (max-width: 768px) {

    .product-info {
        background: #fff;
        padding: 18px 16px 20px;
        border-radius: 10px;
        border: 1px solid #eef1f5;
    }

    .product-info h1 {
        margin-bottom: 12px;
    }

    .product-info .meta {
        margin-bottom: 14px;
    }

    .product-info .desc {
        margin-bottom: 18px;
        line-height: 1.8;
    }

    .product-info .actions {
        padding: 0;
        margin-top: 16px;
        gap: 10px;
    }

    .product-info .actions .btn-primary,
    .product-info .actions .btn-secondary {
        width: 100%;
        border-radius: 6px;
    }

}