/* Product Page Specific Styles */

/* 1. Header (Shared Base) */
.product-header {
    background: url("./images/产品中心.png") center center no-repeat;
    background-size: cover;
    height: 50vh;
    min-height: 350px;
    display: flex;
    align-items: center;
    position: relative;
    border-radius: 0 0 30px 30px;
}

.product-header::before {
    content: "";
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to right, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.3));
    z-index: 1; border-radius: 0 0 30px 30px;
}

/* 2. Filter System */
.category-switcher {
    display: flex; justify-content: center; gap: 1.5rem; margin-bottom: 2rem; flex-wrap: wrap;
}
.cat-btn {
    background: rgba(255, 255, 255, 0.5); backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.6); padding: 1rem 2rem;
    border-radius: 50px; font-size: 1.1rem; font-weight: 600; color: var(--text-main);
    cursor: pointer; transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex; align-items: center; gap: 10px; box-shadow: 0 4px 10px rgba(0,0,0,0.03);
}
.cat-btn .cat-icon svg { width: 20px; height: 20px; }
.cat-btn:hover { background: white; transform: translateY(-3px); box-shadow: 0 10px 20px rgba(51, 128, 200, 0.15); }
.cat-btn.active { background: var(--primary-color); color: white; border-color: var(--primary-color); box-shadow: 0 10px 20px rgba(51, 128, 200, 0.3); }

/* Sub Category Tags */
.sub-category-bar {
    display: flex; justify-content: center; gap: 10px; margin-bottom: 3rem; flex-wrap: wrap; min-height: 40px;
}
.sub-tag {
    background: transparent; border: 1px solid rgba(51, 128, 200, 0.2);
    padding: 6px 16px; border-radius: 20px; color: var(--text-sub);
    font-size: 0.95rem; cursor: pointer; transition: all 0.3s ease;
}
.sub-tag:hover { border-color: var(--primary-color); color: var(--primary-color); }
.sub-tag.active { background: rgba(51, 128, 200, 0.1); border-color: var(--primary-color); color: var(--primary-color); font-weight: 600; }

/* 3. Product Grid */
.product-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 2rem;
}
.product-card {
    background: rgba(255, 255, 255, 0.6); backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5); border-radius: 16px;
    overflow: hidden; transition: all 0.4s ease; cursor: pointer;
    opacity: 0; animation: fadeInUp 0.5s forwards;
}
.product-card:hover {
    transform: translateY(-8px); background: #fff;
    box-shadow: 0 20px 40px rgba(51, 128, 200, 0.15); border-color: rgba(51, 128, 200, 0.2);
}
.product-image-box {
    width: 100%; aspect-ratio: 4/3; overflow: hidden; position: relative; background: #f0f4f8;
}
.product-img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.product-card:hover .product-img { transform: scale(1.1); }
.card-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.3); display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: opacity 0.3s ease;
}
.view-btn {
    background: white; color: var(--primary-color); padding: 10px 24px;
    border-radius: 30px; font-weight: 600; transform: translateY(20px); transition: transform 0.3s ease;
}
.product-card:hover .card-overlay { opacity: 1; }
.product-card:hover .view-btn { transform: translateY(0); }
.product-info { padding: 1.5rem; }
.product-tag {
    font-size: 0.8rem; color: var(--primary-color); text-transform: uppercase;
    letter-spacing: 0.5px; font-weight: 600; margin-bottom: 0.5rem;
    display: inline-block; background: rgba(51, 128, 200, 0.08); padding: 2px 8px; border-radius: 4px;
}
.product-title { font-size: 1.2rem; color: var(--text-main); margin-bottom: 0.5rem; font-weight: 700; }
.product-desc {
    font-size: 0.9rem; color: var(--text-light); line-height: 1.5;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.no-result { grid-column: 1 / -1; text-align: center; padding: 4rem; color: var(--text-light); font-size: 1.2rem; }

/* =========================================
   4. Product Modal (Popup) Styles
   ========================================= */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(8px);
    z-index: 2000; opacity: 0; visibility: hidden;
    display: flex; justify-content: center; align-items: center;
    transition: all 0.3s ease; padding: 20px;
}
.modal-overlay.active { opacity: 1; visibility: visible; }

.modal-container {
    background: rgba(255, 255, 255, 0.98);
    width: 900px; max-width: 100%; max-height: 90vh;
    border-radius: 20px; overflow-y: auto;
    position: relative;
    transform: scale(0.95); transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}
.modal-overlay.active .modal-container { transform: scale(1); }

.modal-close-btn {
    position: absolute; top: 15px; right: 15px; z-index: 10;
    background: rgba(0,0,0,0.1); border: none; width: 32px; height: 32px;
    border-radius: 50%; cursor: pointer; font-size: 1.2rem; line-height: 1;
    transition: all 0.2s; display: flex; align-items: center; justify-content: center;
}
.modal-close-btn:hover { background: var(--primary-color); color: white; }

.modal-body { display: grid; grid-template-columns: 1fr 1fr; }

/* Modal Left: Image */
.modal-image-col { background: #f8fafc; padding: 2rem; display: flex; align-items: center; justify-content: center; }
.modal-img-wrapper { width: 100%; height: 100%; max-height: 400px; display: flex; align-items: center; justify-content: center; }
.modal-img-wrapper img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,0.1); }

/* Modal Right: Info */
.modal-info-col { padding: 3rem 2.5rem; display: flex; flex-direction: column; }
.product-tag-large { color: var(--primary-color); font-weight: 700; text-transform: uppercase; font-size: 0.9rem; margin-bottom: 0.5rem; display: block; }
.modal-title { font-size: 2rem; margin: 0 0 1rem 0; line-height: 1.2; color: var(--text-main); }
.modal-desc { color: var(--text-sub); line-height: 1.7; margin-bottom: 2rem; border-bottom: 1px solid rgba(0,0,0,0.05); padding-bottom: 1.5rem; }

/* Specs Grid */
.modal-specs-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-bottom: 2.5rem;
}
.spec-item { display: flex; align-items: flex-start; gap: 12px; }
.spec-icon {
    width: 40px; height: 40px; background: rgba(51, 128, 200, 0.1);
    border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.spec-icon svg { width: 20px; height: 20px; color: var(--primary-color); }
.spec-info { display: flex; flex-direction: column; }
.spec-label { font-size: 0.85rem; color: var(--text-light); margin-bottom: 2px; }
.spec-value { font-weight: 600; color: var(--text-main); font-size: 0.95rem; }

.modal-actions { margin-top: auto; }
.modal-btn { display: inline-block; padding: 12px 30px; font-size: 1.05rem; }

/* Mobile Modal */
@media (max-width: 768px) {
    .product-header { height: 35vh; }
    .page-title { font-size: 2.2rem; }
    .category-switcher { gap: 10px; }
    .cat-btn { padding: 0.8rem 1.2rem; font-size: 0.95rem; }
    
    .modal-body { grid-template-columns: 1fr; }
    .modal-image-col { padding: 1.5rem; height: 250px; }
    .modal-info-col { padding: 1.5rem; }
    .modal-title { font-size: 1.6rem; }
    .modal-specs-grid { grid-template-columns: 1fr; gap: 1rem; }
}