/* 产品详情页专用样式 */
:root {
    --primary-color: #2e7d32;
    --primary-dark: #1b5e20;
    --primary-light: #4caf50;
    --secondary-color: #ff9800;
    --text-dark: #333333;
    --text-light: #666666;
    --background-light: #f8f9fa;
    --white: #ffffff;
    --border-color: #e0e0e0;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --border-radius: 8px;
}

/* 页面标题区域 */
.page-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--white);
    padding: 100px 0 40px;
    margin-top: 99px;
    text-align: center;
}

.breadcrumb {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.breadcrumb a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.3s;
}

.breadcrumb a:hover {
    color: var(--white);
}

.breadcrumb .separator {
    margin: 0 0.5rem;
    opacity: 0.6;
}

.breadcrumb .current {
    color: var(--white);
    font-weight: 600;
}

/* 产品详情内容区域 */
.product-detail-section {
    padding: 3rem 0;
}

.product-detail-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

/* 产品图片画廊 */
.product-gallery {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.main-image {
    position: relative;
    width: 100%;
    /* height: 400px; */
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.main-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.main-image:hover img {
    transform: scale(1.02);
}

.thumbnail-list {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 0.5rem 0;
}

.thumbnail-item {
    flex: 0 0 auto;
    width: 80px;
    height: 80px;
    border-radius: var(--border-radius);
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s;
}

.thumbnail-item.active {
    border-color: var(--primary-color);
}

.thumbnail-item:hover {
    border-color: var(--primary-light);
}

.thumbnail-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 产品信息区域 */
.product-info {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.product-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.3;
}

.product-meta {
    display: flex;
    gap: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-light);
}

.product-sku {
    background: var(--background-light);
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
}

.product-rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.product-price {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.5rem;
}

.current-price {
    color: var(--primary-color);
    font-weight: 700;
}

.original-price {
    color: var(--text-light);
    text-decoration: line-through;
    font-size: 1.2rem;
}

.discount-badge {
    background: var(--secondary-color);
    color: var(--white);
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
}

.product-stock {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
}

.stock-status {
    color: var(--primary-color);
    font-weight: 600;
}

.stock-count {
    color: var(--text-light);
}

.product-description h3,
.product-specs h3 {
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.product-description p {
    color: var(--text-light);
    line-height: 1.6;
}

.product-specs ul {
    list-style: none;
    padding: 0;
}

.product-specs li {
    padding: 0.3rem 0;
    color: var(--text-light);
    border-bottom: 1px solid var(--border-color);
}

.product-specs li:last-child {
    border-bottom: none;
}

.product-specs li strong {
    color: var(--text-dark);
    min-width: 80px;
    display: inline-block;
}

/* 购买选项 */
.purchase-options {
    background: var(--background-light);
    padding: 1.5rem;
    border-radius: var(--border-radius);
}

.quantity-selector {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.quantity-controls {
    display: flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.quantity-btn {
    background: var(--white);
    border: none;
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-size: 1.2rem;
    transition: background 0.3s;
}

.quantity-btn:hover {
    background: var(--primary-light);
    color: var(--white);
}

.quantity-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.quantity-btn:disabled:hover {
    background: var(--white);
    color: inherit;
}

#quantity {
    width: 60px;
    text-align: center;
    border: none;
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    padding: 0.5rem;
    font-size: 1rem;
}

.unit {
    color: var(--text-light);
    font-size: 0.9rem;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.add-to-cart-btn,
.buy-now-btn,
.wishlist-btn {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    flex: 1;
    min-width: 120px;
}

.add-to-cart-btn {
    background: var(--primary-color);
    color: var(--white);
}

.add-to-cart-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.buy-now-btn {
    background: var(--secondary-color);
    color: var(--white);
}

.buy-now-btn:hover {
    background: #e68900;
    transform: translateY(-2px);
}

.wishlist-btn {
    background: var(--white);
    color: var(--text-dark);
    border: 1px solid var(--border-color);
}

.wishlist-btn:hover {
    background: var(--background-light);
    transform: translateY(-2px);
}

.wishlist-btn.active {
    background: #ff4757;
    color: var(--white);
    border-color: #ff4757;
}

/* 分享功能 */
.product-share {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 0;
    border-top: 1px solid var(--border-color);
}

.share-buttons {
    display: flex;
    gap: 0.5rem;
}

.share-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    background: var(--white);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9rem;
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.share-btn.wechat:hover {
    border-color: #07c160;
    color: #07c160;
}

.share-btn.weibo:hover {
    border-color: #e6162d;
    color: #e6162d;
}

.share-btn.qq:hover {
    border-color: #12b7f5;
    color: #12b7f5;
}

/* 产品详情选项卡 */
.product-tabs {
    margin-top: 3rem;
}

.tab-headers {
    display: flex;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 2rem;
}

.tab-header {
    background: none;
    border: none;
    padding: 1rem 2rem;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-light);
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
}

.tab-header.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-header:hover:not(.active) {
    color: var(--text-dark);
}

.tab-content {
    display: none;
    padding: 2rem;
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.5s ease-in;
}

.tab-content h3 {
    color: var(--primary-dark);
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.tab-content h4 {
    color: var(--text-dark);
    margin: 1.5rem 0 0.5rem;
    font-size: 1.1rem;
}

.tab-content p {
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.tab-content ul {
    color: var(--text-light);
    line-height: 1.6;
    padding-left: 1.5rem;
}

.tab-content li {
    margin-bottom: 0.5rem;
}

/* 规格参数表格 */
.specs-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.specs-table th,
.specs-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.specs-table th {
    background: var(--background-light);
    color: var(--primary-dark);
    font-weight: 600;
}

.specs-table tr:hover {
    background: var(--background-light);
}

/* 评价系统 */
.reviews-summary {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--background-light);
    border-radius: var(--border-radius);
}

.average-rating {
    text-align: center;
}

.rating-score {
    display: block;
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color);
}

.rating-stars {
    display: block;
    font-size: 1.2rem;
    margin: 0.5rem 0;
}

.rating-count {
    color: var(--text-light);
    font-size: 0.9rem;
}

.rating-bars {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.rating-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.rating-label {
    min-width: 40px;
    font-size: 0.9rem;
}

.bar-container {
    flex: 1;
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: var(--primary-color);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.rating-percent {
    min-width: 40px;
    text-align: right;
    font-size: 0.9rem;
    color: var(--text-light);
}

.reviews-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.review-item {
    padding: 1.5rem;
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.reviewer-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.reviewer-name {
    font-weight: 600;
    color: var(--text-dark);
}

.review-date {
    color: var(--text-light);
    font-size: 0.9rem;
}

.review-rating {
    color: var(--secondary-color);
}

.review-content {
    color: var(--text-light);
    line-height: 1.6;
}

.view-all-reviews-btn {
    display: block;
    margin: 2rem auto 0;
    padding: 0.8rem 2rem;
    background: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s;
}

.view-all-reviews-btn:hover {
    background: var(--primary-dark);
}

/* 相关产品推荐 */
.related-products {
    margin-top: 3rem;
    padding-top: 3rem;
    border-top: 1px solid var(--border-color);
}

.section-title {
    text-align: center;
    font-size: 2rem;
    color: var(--primary-dark);
    margin-bottom: 2rem;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--secondary-color);
}

.related-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.related-product-card {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.3s;
    text-align: center;
}

.related-product-card:hover {
    transform: translateY(-5px);
}

.related-product-card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.related-product-card h3 {
    padding: 1rem 1rem 0.5rem;
    color: var(--text-dark);
    font-size: 1.1rem;
}

.product-price {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 1rem;
}

.view-product-btn {
    display: inline-block;
    padding: 0.6rem 1.5rem;
    background: var(--primary-color);
    color: var(--white);
    text-decoration: none;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    transition: background 0.3s;
}

.view-product-btn:hover {
    background: var(--primary-dark);
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .product-detail-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .main-image {
        /* height: 300px; */
    }

    .product-title {
        font-size: 1.5rem;
    }

    .product-meta {
        flex-direction: column;
        gap: 0.5rem;
    }

    .action-buttons {
        flex-direction: column;
    }

    .tab-headers {
        flex-wrap: wrap;
    }

    .tab-header {
        flex: 1;
        min-width: 120px;
        text-align: center;
    }

    .reviews-summary {
        grid-template-columns: 1fr;
    }

    .related-products-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

@media (max-width: 480px) {
    .page-header {
        padding: 80px 0 30px;
    }

    .product-title {
        font-size: 1.3rem;
    }

    .product-price {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .thumbnail-list {
        justify-content: center;
    }

    .tab-content {
        padding: 1rem;
    }
}

/* 性能优化 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 图片懒加载样式 */
img[data-src] {
    opacity: 0;
    transition: opacity 0.3s;
}

img.loaded {
    opacity: 1;
}