/**
 * 产品管理与对比系统 - 前端样式
 */

/* 产品列表样式 */
.products-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.product-item {
    border: 1px solid #ddd;
    border-radius: 5px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.product-thumbnail {
    position: relative;
    padding-bottom: 100%;
    overflow: hidden;
}

.product-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-item:hover .product-thumbnail img {
    transform: scale(1.05);
}

.product-info {
    padding: 15px;
}

.product-title {
    margin: 0 0 10px;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
}

.product-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.product-title a:hover {
    color: #0073aa;
}

.product-price {
    margin: 0 0 15px;
    font-size: 20px;
    font-weight: 700;
    color: #e63946;
}

.product-actions {
    display: flex;
    justify-content: space-between;
}

.compare-button {
    background-color: #0073aa;
    color: #fff;
    border: none;
    border-radius: 3px;
    padding: 8px 15px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.compare-button:hover {
    background-color: #005177;
}

.compare-button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* 产品详情样式 */
.product-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.product-images {
    position: relative;
}

.product-main-image {
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    overflow: hidden;
}

.product-main-image img {
    width: 100%;
    height: auto;
    display: block;
}

.product-gallery {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 10px;
}

.gallery-item {
    flex: 0 0 auto;
    width: 80px;
    height: 80px;
    border: 1px solid #ddd;
    border-radius: 3px;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.gallery-item:hover {
    border-color: #0073aa;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-info {
    padding: 0;
}

.product-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.product-brands,
.product-categories,
.product-sku {
    font-size: 14px;
}

.meta-label {
    font-weight: 600;
    margin-right: 5px;
}

.brand-link,
.category-link {
    color: #0073aa;
    text-decoration: none;
    transition: color 0.3s ease;
}

.brand-link:hover,
.category-link:hover {
    color: #005177;
    text-decoration: underline;
}

.product-price {
    font-size: 28px;
    font-weight: 700;
    color: #e63946;
    margin-bottom: 15px;
}

.product-stock,
.product-status {
    margin-bottom: 15px;
    font-size: 16px;
}

.stock-label,
.status-label {
    font-weight: 600;
    margin-right: 5px;
}

.status-instock {
    color: #065f46;
    font-weight: 600;
}

.status-outofstock {
    color: #b91c1c;
    font-weight: 600;
}

.product-description {
    margin-top: 30px;
}

.product-description h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 20px;
    font-weight: 600;
}

.product-parameters {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #eee;
}

.product-parameters h3 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 20px;
    font-weight: 600;
}

.parameters-table {
    width: 100%;
    border-collapse: collapse;
}

.parameters-table th,
.parameters-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.parameters-table th {
    background-color: #f9f9f9;
    font-weight: 600;
    width: 30%;
}

/* 品牌和分类页面样式 */
.term-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.term-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.term-logo,
.term-icon {
    flex: 0 0 auto;
}

.term-logo img,
.term-icon img {
    max-width: 100px;
    max-height: 100px;
    display: block;
}

.term-details {
    flex: 1;
}

.term-title {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 28px;
    font-weight: 700;
}

.term-description {
    margin-bottom: 15px;
    font-size: 16px;
    line-height: 1.6;
    color: #666;
}

.website-link {
    display: inline-block;
    background-color: #0073aa;
    color: #fff;
    padding: 8px 15px;
    border-radius: 3px;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.website-link:hover {
    background-color: #005177;
}

/* 对比页面样式 */
.compare-content {
    margin-bottom: 30px;
}

.compare-view-toggle {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.compare-view-toggle button {
    background-color: #f9f9f9;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 3px;
    padding: 8px 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.compare-view-toggle button.active {
    background-color: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

.compare-table-container {
    overflow-x: auto;
    margin-bottom: 20px;
}

.compare-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

.compare-table th,
.compare-table td {
    padding: 12px 15px;
    text-align: left;
    border: 1px solid #eee;
}

.compare-table th {
    background-color: #f9f9f9;
    font-weight: 600;
}

.parameter-name {
    font-weight: 600;
    background-color: #f9f9f9;
}

.product-info {
    text-align: center;
}

.product-info .product-thumbnail {
    margin-bottom: 10px;
    padding-bottom: 0;
    height: 100px;
}

.product-info .product-title {
    margin-bottom: 10px;
    font-size: 16px;
}

.product-info .product-price {
    margin-bottom: 15px;
    font-size: 18px;
}

.product-remove button {
    background-color: #dc2626;
    color: #fff;
    border: none;
    border-radius: 3px;
    padding: 5px 10px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.product-remove button:hover {
    background-color: #b91c1c;
}

.parameter-value.highlight {
    background-color: #fef3c7;
    font-weight: 600;
}

.no-value {
    color: #9ca3af;
    font-style: italic;
}

.compare-chart-container {
    height: 400px;
    margin-bottom: 20px;
}

.compare-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 20px;
}

.clear-compare-button {
    background-color: #dc2626;
    color: #fff;
    border: none;
    border-radius: 3px;
    padding: 8px 15px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.clear-compare-button:hover {
    background-color: #b91c1c;
}

/* 对比列表小工具样式 */
.compare-products-list {
    list-style: none;
    margin: 0 0 15px;
    padding: 0;
}

.compare-product-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.compare-product-item:last-child {
    border-bottom: none;
}

.compare-product-item a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.compare-product-item a:hover {
    color: #0073aa;
    text-decoration: underline;
}

.compare-product-item .remove-from-compare {
    background: none;
    border: none;
    color: #dc2626;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}

.compare-product-item .remove-from-compare:hover {
    color: #b91c1c;
}

.empty-compare-list {
    color: #666;
    font-style: italic;
}

/* 筛选器样式 */
.product-filters {
    margin-bottom: 30px;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #f9f9f9;
}

.filter-title {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 18px;
    font-weight: 600;
}

.filter-group {
    margin-bottom: 15px;
}

.filter-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.filter-group select,
.filter-group input[type="text"],
.filter-group input[type="number"] {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 3px;
}

.filter-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.apply-filters,
.reset-filters {
    padding: 8px 15px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.apply-filters {
    background-color: #0073aa;
    color: #fff;
}

.apply-filters:hover {
    background-color: #005177;
}

.reset-filters {
    background-color: #f9f9f9;
    color: #333;
    border: 1px solid #ddd;
}

.reset-filters:hover {
    background-color: #e9e9e9;
}

/* 排序样式 */
.product-sort {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 20px;
}

.sort-label {
    margin-right: 10px;
    font-weight: 600;
}

.sort-select {
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 3px;
}

/* 响应式样式 */
@media (max-width: 768px) {
    .products-container {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 15px;
    }
    
    .product-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .term-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .filter-actions {
        flex-direction: column;
    }
    
    .product-sort {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .products-container {
        grid-template-columns: 1fr;
    }
    
    .product-title {
        font-size: 16px;
    }
    
    .product-price {
        font-size: 18px;
    }
    
    .term-title {
        font-size: 24px;
    }
    
    .product-price {
        font-size: 24px;
    }
}