/* B2B Products Frontend Styles */

:root {
    --primary-color: #ef4444;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --border-color: #e5e7eb;
    --text-color: #1f2937;
    --text-light: #6b7280;
    --bg-light: #f9fafb;
    --bg-white: #fff;
}

.container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 20px 180px;
}

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--bg-white);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    color: var(--primary-color);
}

.btn-secondary {
    background: white;
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-light);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-large {
    padding: 14px 32px;
    font-size: 16px;
}

.btn-small {
    background: var(--danger-color);
    padding: 6px 16px;
    font-size: 13px;
    color: var(--bg-white);
}

/* 产品列表页面 */
.b2b-products-archive {
    padding: 0;
}

.page-header {
    text-align: center;
    margin-bottom: 40px;
}

.page-title {
    font-size: 36px;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 16px;
}

.products-container {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 40px;
}

/* 侧边栏 */
.products-sidebar {
    position: sticky;
    top: 130px;
    height: fit-content;
}

.pl-sidebar-widget {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
}

.pl-sidebar-widget h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-color);
}

.category-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-list li {
    margin-bottom: 8px;
}

.category-list a {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    color: var(--text-color);
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.2s;
}

.category-list a:hover,
.category-list a.active {
    background: var(--bg-light);
    color: var(--primary-color);
}

.category-list .count {
    color: var(--text-light);
    font-size: 13px;
}

.search-box {
    display: flex;
    gap: 8px;
}

.search-box input {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
}

.search-box button {
    padding: 10px 16px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s;
}

.search-box button:hover {
    background: #1d4ed8;
}

/* 产品工具栏 */
.products-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.results-count {
    color: var(--text-light);
    font-size: 14px;
}

.products-sorting {
    display: flex;
    align-items: center;
    gap: 12px;
}

.products-sorting select {
    padding: 8px 32px 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
}

/* 产品网格 */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.product-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s;
}

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

.product-image {
    position: relative;
    padding-top: 75%;
    overflow: hidden;
}

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

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

.stock-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 6px 12px;
    background: white;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.stock-badge.in_stock {
    color: var(--success-color);
}

.stock-badge.out_of_stock {
    color: var(--danger-color);
}

.stock-badge.pre_order {
    color: var(--warning-color);
}

.product-info {
    padding: 20px;
}

.product-category {
    display: inline-block;
    padding: 4px 12px;
    background: var(--bg-light);
    color: var(--text-light);
    font-size: 12px;
    font-weight: 500;
    border-radius: 4px;
    margin-bottom: 12px;
}

.product-list-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.product-list-title a {
    color: var(--text-color);
    text-decoration: none;
}

.product-list-title a:hover {
    color: var(--primary-color);
}

.product-model {
    color: var(--text-light);
    font-size: 13px;
    margin-bottom: 12px;
}

.product-excerpt {
    color: var(--text-light);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 16px;
}

.product-meta {
    display: flex;
    gap: 16px;
    padding: 12px 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 16px;
}

.product-price,
.product-moq {
    flex: 1;
}

.price-label,
.moq-label {
    display: block;
    color: var(--text-light);
    font-size: 12px;
    margin-bottom: 4px;
}

.price-value {
    color: var(--primary-color);
    font-size: 18px;
    font-weight: 700;
}

.moq-value {
    color: var(--text-color);
    font-size: 16px;
    font-weight: 600;
}

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

.product-actions .btn {
    flex: 1;
    justify-content: center;
}

/* 分页 */
.products-pagination {
    margin: 40px auto;

}

.products-pagination .page-numbers {
    display: inline-flex;
    gap: 8px;
    list-style: none;
}

.products-pagination .page-numbers a,
.products-pagination .page-numbers span {
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.3s;
}

.products-pagination .page-numbers a:hover,
.products-pagination .page-numbers .current {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* 产品详情页 */
.b2b-single-product {
    padding: 40px 0 180px;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
    font-size: 14px;
    color: var(--text-light);
}

.breadcrumb a {
    color: var(--text-light);
    text-decoration: none;
}

.breadcrumb a:hover {
    color: var(--primary-color);
}

.breadcrumb .current {
    color: var(--text-color);
    font-weight: 500;
}

.product-content {
    display: grid;
    grid-template-columns: 60% 40%;
    gap: 40px;
    margin-bottom: 30px;
}

/* 产品图库 */
.product-gallery-section {
    position: sticky;
    top: 130px;
    height: fit-content;
}

.main-image-container {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 16px;
}

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

.thumbnail-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 12px;
}

.thumbnail {
    border: 2px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s;
}

.thumbnail:hover,
.thumbnail.active {
    border-color: var(--primary-color);
}

.thumbnail img {
    width: 100%;
    height: 80px;
    object-fit: cover;
    display: block;
}

/* 产品信息 */
.product-info-section {
    top: 130px; 
}

.product-detail-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-color);
}

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

.stock-status span {
    padding: 4px 12px;
    border-radius: 4px;
    font-weight: 500;
}

.in-stock {
    background: #d1fae5;
    color: var(--success-color);
}

.out-of-stock {
    background: #fee2e2;
    color: var(--danger-color);
}

.pre-order {
    background: #fef3c7;
    color: var(--warning-color);
}

.product-summary {
    padding: 20px;
    background: var(--bg-light);
    border-radius: 8px;
    margin: 24px 0;
    line-height: 1.8;
}

.product-pricing {
    padding: 24px;
    background: white;
    border: 2px solid var(--primary-color);
    border-radius: 12px;
    margin: 24px 0;
}

.price-info,
.moq-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
}

.price-info:not(:last-child),
.moq-info:not(:last-child) {
    border-bottom: 1px solid var(--border-color);
}

.price-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-color);
}

.moq-value {
    font-size: 20px;
    font-weight: 600;
}

.product-categories {
    margin: 20px 0;
    padding: 16px;
    background: var(--bg-light);
    border-radius: 8px;
}

.product-categories a {
    color: var(--primary-color);
    text-decoration: none;
}

.product-cta {
    display: flex;
    gap: 12px;
    margin: 32px 0;
}

.product-meta-info {
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    font-size: 14px;
    color: var(--text-light);
}

/* 产品详情标签 */
.product-details-tabs {
    margin: 60px 0;
}

.tabs-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    list-style: none;
    padding: 0;
    margin: 0 0 24px 0;
    border-bottom: 2px solid var(--border-color);
}

.tabs-nav li {
    margin: 0;
}

.tabs-nav a {
    display: block;
    padding: 16px 12px;
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
}

.tabs-nav li.active a,
.tabs-nav a:hover {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tabs-content {
    background: white;
    padding: 32px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

.product-description {
    line-height: 1.8;
    color: var(--text-color);
}

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

.specifications-table th,
.specifications-table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.specifications-table th {
    background: var(--bg-light);
    font-weight: 600;
}

.specifications-table tr:last-child td {
    border-bottom: none;
}

.product-video {
    position: relative;
    padding-top: 56.25%;
}

.product-video iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 8px;
}

/* 询盘表单 */
.inquiry-section {
    max-width: 100%;
    margin: 60px auto;
    padding: 40px;
    background: white;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.inquiry-section h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 12px;
    text-align: center;
}

.inquiry-intro {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 32px;
}

.inquiry-form-container {
    position: relative;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-color);
}

.required {
    color: var(--danger-color);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-help {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-light);
}

.checkbox-group {
    margin: 24px 0;
}

.checkbox-label {
    display: flex;
    align-items: start;
    gap: 12px;
    font-size: 14px;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin-top: 2px;
}

.form-actions {
    text-align: center;
    margin-top: 32px;
}

.form-message {
    margin-top: 20px;
    padding: 16px;
    border-radius: 6px;
    text-align: center;
}

.error-message {
    background: #fee2e2;
    color: var(--danger-color);
    padding: 16px;
    border-radius: 6px;
}

.inquiry-success {
    text-align: center;
    padding: 60px 40px;
}

.success-icon {
    margin-bottom: 24px;
}

.inquiry-success h3 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--success-color);
}

.inquiry-success p {
    color: var(--text-light);
    margin-bottom: 12px;
}

.inquiry-info {
    margin-top: 40px;
    padding-top: 40px;
    border-top: 1px solid var(--border-color);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.info-item {
    display: flex;
    gap: 16px;
    align-items: start;
}

.info-item svg {
    color: var(--primary-color);
    flex-shrink: 0;
}

.info-item strong {
    display: block;
    margin-bottom: 4px;
    color: var(--text-color);
}

.info-item p {
    font-size: 14px;
    color: var(--text-light);
    margin: 0;
}

/* 相关产品 */
.related-products {
    margin-top: 80px;
    padding-top: 60px;
    border-top: 1px solid var(--border-color);
}

.related-product-title{
    color: var(--bg-white);
}

.related-products h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 32px;
    text-align: center;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .products-container {
        grid-template-columns: 1fr;
    }
    
    .products-sidebar {
        position: static;
    }
    
    .product-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }
}

@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .product-cta {
        flex-direction: column;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .products-toolbar {
        flex-direction: column;
        align-items: start;
        gap: 16px;
    }
}

/* 可定制项样式 */

.customization-intro {
    color: var(--text-light);
    margin-bottom: 24px;
    font-size: 15px;
    line-height: 1.6;
}

.customization-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.customization-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-light);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: all 0.3s;
}

.customization-item:hover {
    background: white;
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.1);
}

.customization-item svg {
    flex-shrink: 0;
}

.customization-item span {
    color: var(--text-color);
    font-size: 14px;
    font-weight: 500;
}

.customization-cta {
    text-align: center;
    padding: 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    color: white;
}

.customization-cta p {
    margin: 0 0 16px 0;
    font-size: 16px;
}

.customization-cta .btn {
    background: white;
    color: var(--primary-color);
}

.customization-cta .btn:hover {
    background: var(--bg-light);
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .customization-grid {
        grid-template-columns: 1fr;
    }
}