/* 产品中心页面样式 */

/* 页面标题样式 */
.page-title {
    background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('../images/banners/products.jpg') center/cover;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    margin-bottom: 60px;
}

.page-title h1 {
    font-size: 3.5rem;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.page-title .tagline {
    font-size: 1.5rem;
    font-style: italic;
    color: #f0f0f0;
}

/* 产品筛选样式 */
.product-filter {
    background-color: #f8f9fa;
    padding: 20px 0;
    position: sticky;
    top: var(--nav-h);    /* 紧贴吸顶页眉下方，滚动时始终露出，不被页眉遮挡 */
    z-index: 999;         /* 低于页眉(1000)，高于内容 */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.filter-tabs {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
}

.filter-tab {
    padding: 10px 20px;
    background-color: white;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    border-radius: 30px;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
}

.filter-tab:hover,
.filter-tab.active {
    background-color: var(--primary-color);
    color: white;
}

/* 产品展示样式 */
.products-section {
    padding: 60px 0;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

.product-card {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.product-image {
    height: 220px;
    overflow: hidden;
    position: relative;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-category-tag {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: var(--primary-color);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
}

.product-info {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-name {
    font-size: 1.3rem;
    font-weight: bold;
    margin-bottom: 10px;
    color: var(--primary-color);
    height: 40px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-price {
    font-size: 1.4rem;
    font-weight: bold;
    color: var(--secondary-color);
    margin-bottom: 15px;
}

.product-description {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 20px;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-actions {
    display: flex;
    gap: 10px;
}

.product-actions .btn {
    flex: 1;
    font-size: 0.9rem;
    padding: 8px 15px;
}

/* 产品详情模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    overflow: auto;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 8px;
    width: 90%;
    max-width: 1000px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    margin: 15px 20px 0;
    cursor: pointer;
    transition: var(--transition);
}

.close:hover {
    color: #000;
}

.modal-body {
    display: flex;
    flex-wrap: wrap;
    padding: 0;
}

.modal-product-image {
    flex: 1;
    min-width: 300px;
    padding: 20px;
}

.modal-product-image img {
    width: 100%;
    border-radius: 8px;
}

.modal-product-info {
    flex: 1;
    min-width: 300px;
    padding: 20px;
}

.modal-product-info h2 {
    font-size: 2rem;
    margin-bottom: 15px;
    color: var(--primary-color);
}

.modal-product-price {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--secondary-color);
    margin-bottom: 10px;
}

.modal-product-category {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    padding: 5px 15px;
    border-radius: 30px;
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.modal-product-description {
    color: #555;
    line-height: 1.6;
    margin-bottom: 25px;
}

.modal-product-features h3 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: var(--primary-color);
}

.modal-product-features ul {
    list-style: none;
    padding: 0;
}

.modal-product-features li {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
}

.modal-product-features li::before {
    content: '✓';
    color: var(--primary-color);
    font-weight: bold;
    margin-right: 10px;
}

.modal-product-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.modal-product-actions .btn {
    flex: 1;
}

/* 快速预览：多图缩略图 */
#product-modal .pd-thumbs { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
#product-modal .pd-thumbs img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; border: 2px solid transparent; cursor: pointer; background: #fff; }
#product-modal .pd-thumbs img.active { border-color: var(--primary-color); }

/* 快速预览：规格（SKU）选择器 */
.spec-select { margin: 4px 0 14px; }
.spec-label { font-size: 0.9rem; color: #7f8c8d; margin-bottom: 8px; }
.spec-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.spec-chip { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px 14px; border: 2px solid #dfe6e9; border-radius: 8px; background: #fff; cursor: pointer; font-size: 0.9rem; transition: all .15s; }
.spec-chip:hover { border-color: var(--primary-color); }
.spec-chip.active { border-color: var(--primary-color); background: #f0f7f0; box-shadow: 0 0 0 1px var(--primary-color) inset; }
.spec-chip[data-oos="1"] { opacity: .55; }
.spec-chip-name { font-weight: 600; color: #2c3e50; }
.spec-chip-stock { font-size: 0.75rem; color: #95a5a6; }

/* 快速预览：库存行 */
.modal-product-stock { font-size: 0.9rem; color: var(--primary-color); margin-bottom: 14px; }
.modal-product-stock.out { color: #e74c3c; font-weight: 600; }

/* 快速预览：详细图文介绍 */
.modal-product-detail { margin: 18px 0 8px; }
.modal-product-detail h3 { font-size: 1.3rem; margin-bottom: 12px; color: var(--primary-color); }
.modal-product-detail p { color: #555; line-height: 1.8; margin-bottom: 10px; }

.btn:disabled, .btn[disabled] { opacity: .55; cursor: not-allowed; }

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .page-title h1 {
        font-size: 2.5rem;
    }
    
    .page-title .tagline {
        font-size: 1.2rem;
    }
    
    .filter-tabs {
        flex-direction: column;
        align-items: center;
    }
    
    .filter-tab {
        width: 80%;
        text-align: center;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .modal-body {
        flex-direction: column;
    }
    
    .modal-product-image,
    .modal-product-info {
        min-width: 100%;
    }
}
/* 弹窗多图缩略与完整页链接 */
#modal-thumbs { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
#modal-thumbs img { width: 60px; height: 60px; object-fit: cover; border-radius: 6px; border: 2px solid transparent; cursor: pointer; }
#modal-thumbs img.active { border-color: #2c5f2d; }
.modal-detail-link { display: inline-block; margin-left: 10px; color: #2c5f2d; font-size: 14px; }
