/* 产品展示交易页面样式 */

/* 产品分类导航 */
.product-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.category {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 15px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    background-color: #f8f9fa;
    min-width: 100px;
}

.category i {
    font-size: 24px;
    color: #666;
}

.category span {
    font-size: 14px;
    color: #333;
}

.category:hover {
    background-color: #f0f0f0;
}

.category.active {
    background-color: #4a6bdf;
}

.category.active i,
.category.active span {
    color: white;
}

/* 产品筛选器 */
.product-filter {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    border: 1px solid #eee;
}

.filter-wrapper {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.filter-group {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-label {
    font-weight: 500;
    min-width: 70px;
    color: #333;
}

.filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-option {
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 13px;
    background-color: #fff;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    border: 1px solid transparent;
}

.filter-option:hover {
    background-color: #e9ecef;
    border-color: #ddd;
    transform: translateY(-1px);
}

.filter-option:hover,
.filter-option.active {
    background-color: #4a6bdf;
    color: white;
}

.filter-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.search-box {
    position: relative;
    flex: 1;
    max-width: 300px;
}

.search-box input {
    width: 100%;
    padding: 10px 40px 10px 15px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 14px;
}

.search-box button {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 16px;
    padding: 5px 10px;
}

.sort-options {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sort-options span {
    color: #666;
}

.sort-options select {
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background-color: white;
}

/* 产品列表 */
.product-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

/* 产品卡片 */
.product-card {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
}

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

.product-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 5px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    color: white;
    z-index: 1;
}

.product-badge.new {
    background-color: #4a6bdf;
}

.product-badge.hot {
    background-color: #f44336;
}

.product-badge.organic {
    background-color: #4caf50;
}

.product-badge.discount {
    background-color: #ff9800;
}

.product-image {
    height: 300px;
    background-color: #f8f9fa;
    overflow: hidden;
    position: relative;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

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

.product-info {
    padding: 15px;
}

.product-info h3 {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 500;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-desc {
    color: #666;
    font-size: 13px;
    margin: 0 0 12px 0;
    height: 40px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.product-price {
    display: flex;
    align-items: center;
    gap: 8px;
}

.price-current {
    color: #f44336;
    font-size: 18px;
    font-weight: 600;
}

.price-original {
    color: #999;
    font-size: 14px;
    text-decoration: line-through;
}

.product-sales {
    font-size: 12px;
    color: #888;
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
}

.product-company {
    font-size: 12px;
    color: #666;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 150px;
}

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

.btn-sm {
    padding: 6px 10px;
    font-size: 12px;
}

.btn-outline {
    background-color: transparent;
    color: #4a6bdf;
    border: 1px solid #4a6bdf;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s;
}

.btn-outline:hover {
    background-color: #4a6bdf;
    color: white;
}

.btn-icon {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    border: 1px solid #ddd;
    background-color: transparent;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-icon:hover {
    background-color: #f0f0f0;
    color: #4a6bdf;
    border-color: #4a6bdf;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    margin: 30px 0;
}

.pagination a,
.pagination span {
    color: #333;
    padding: 8px 12px;
    margin: 0 5px;
    border-radius: 4px;
    text-decoration: none;
    transition: background-color 0.3s, color 0.3s;
}

.pagination a:hover:not(.disabled) {
    background-color: #f0f0f0;
}

.pagination a.active {
    background-color: #4a6bdf;
    color: white;
}

.pagination a.disabled {
    color: #ccc;
    cursor: not-allowed;
}

.pagination .prev,
.pagination .next {
    font-weight: bold;
}

/* 热门品牌 */
.popular-brands {
    margin: 40px 0;
}

.popular-brands h2 {
    margin-bottom: 20px;
    color: #333;
    position: relative;
    padding-left: 15px;
}

.popular-brands h2::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 20px;
    background-color: #4a6bdf;
    border-radius: 2px;
}

.brand-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
}

.brand-item {
    background-color: white;
    border-radius: 8px;
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s, box-shadow 0.3s;
}

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

.brand-item img {
    max-width: 100%;
    max-height: 60px;
    object-fit: contain;
}

/* 交易指南 */
.trade-guide {
    margin: 40px 0;
}

.trade-guide h2 {
    margin-bottom: 20px;
    color: #333;
    position: relative;
    padding-left: 15px;
}

.trade-guide h2::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 20px;
    background-color: #4a6bdf;
    border-radius: 2px;
}

.guide-steps {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}

.guide-step {
    flex: 1;
    text-align: center;
    padding: 20px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    position: relative;
}

.guide-step:not(:last-child)::after {
    content: '\F285';
    font-family: "bootstrap-icons";
    position: absolute;
    right: -15px;
    top: 50%;
    transform: translateY(-50%);
    color: #ddd;
    font-size: 20px;
}

.step-icon {
    width: 60px;
    height: 60px;
    background-color: #e3f2fd;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
}

.step-icon i {
    font-size: 28px;
    color: #4a6bdf;
}

.guide-step h3 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 16px;
}

.guide-step p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

/* 产品预览模态框 */
.product-preview-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 1200px;
    position: relative;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    transition: color 0.3s;
}

.close-modal:hover {
    color: #333;
}

.product-preview {
    display: flex;
    gap: 30px;
}

.preview-gallery {
    width: 50%;
}

.gallery-main {
    width: 100%;
    height: 500px;
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 15px;
}

.gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.gallery-thumbs {
    display: flex;
    gap: 10px;
}

.thumb {
    width: 80px;
    height: 80px;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.3s, border-color 0.3s;
    border: 2px solid transparent;
}

.thumb.active {
    opacity: 1;
    border-color: #4a6bdf;
}

.thumb:hover {
    opacity: 1;
}

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

.preview-details {
    width: 50%;
}

.preview-details h2 {
    margin: 0 0 20px 0;
    color: #333;
}

.preview-price {
    margin-bottom: 20px;
}

.price-current {
    color: #f44336;
    font-size: 24px;
    font-weight: 600;
    margin-right: 10px;
}

.discount-tag {
    background-color: #f44336;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.preview-info {
    margin-bottom: 20px;
    padding: 15px 0;
    border-top: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
}

.info-item {
    display: flex;
    margin-bottom: 10px;
}

.info-label {
    color: #666;
    width: 100px;
    flex-shrink: 0;
}

.info-value {
    color: #333;
}

.preview-select {
    margin-bottom: 20px;
}

.select-item {
    margin-bottom: 15px;
}

.select-label {
    display: block;
    margin-bottom: 10px;
    color: #333;
    font-weight: 500;
}

.select-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.option {
    padding: 8px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.option:hover {
    border-color: #4a6bdf;
}

.option.active {
    border-color: #4a6bdf;
    background-color: #e3f2fd;
    color: #4a6bdf;
}

.quantity-control {
    display: flex;
    align-items: center;
    gap: 10px;
}

.quantity-control button {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    border: 1px solid #ddd;
    background-color: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.quantity-control input {
    width: 60px;
    height: 32px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
}

.stock {
    color: #666;
    font-size: 13px;
    margin-left: 10px;
}

.preview-actions {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
}

.btn-lg {
    padding: 12px 20px;
    font-size: 16px;
}

.btn-primary {
    background-color: #4a6bdf;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.3s;
}

.btn-primary:hover {
    background-color: #3a56b4;
}

.preview-company {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px 0;
    border-top: 1px solid #f0f0f0;
}

.company-logo {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    background-color: #f8f9fa;
}

.company-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.company-info {
    flex: 1;
}

.company-info h4 {
    margin: 0 0 5px 0;
    color: #333;
    font-size: 16px;
}

.company-meta {
    display: flex;
    gap: 15px;
}

.company-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: #666;
}

.company-meta i {
    color: #ff9800;
}

/* 重置筛选按钮样式 */
.filter-actions-bottom {
    display: flex;
    justify-content: center;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed #ddd;
}

.btn-reset-filter {
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    color: #666;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    transition: all 0.3s;
}

.btn-reset-filter:hover {
    background-color: #e9ecef;
    color: #333;
}

.btn-reset-filter i {
    font-size: 16px;
}

/* 无筛选结果提示样式 */
.no-results {
    width: 100%;
    text-align: center;
    padding: 50px 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    margin: 30px 0;
    color: #666;
    font-size: 16px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

/* 当使用active筛选条件时的高亮效果增强 */
.filter-option.active {
    background-color: #4a6bdf;
    color: white;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(74, 107, 223, 0.3);
}

/* 筛选选项的过渡效果优化 */
.filter-option {
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 13px;
    background-color: #fff;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    border: 1px solid transparent;
}

.filter-option:hover {
    background-color: #e9ecef;
    border-color: #ddd;
    transform: translateY(-1px);
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .guide-steps {
        flex-wrap: wrap;
    }

    .guide-step {
        flex-basis: 45%;
    }

    .guide-step:not(:last-child)::after {
        display: none;
    }

    .product-preview {
        flex-direction: column;
    }

    .preview-gallery,
    .preview-details {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .category {
        min-width: 80px;
        padding: 10px;
    }

    .guide-step {
        flex-basis: 100%;
    }

    .filter-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .search-box {
        max-width: none;
    }
}

@media (max-width: 576px) {
    .product-list {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
}