/* Product Detail Page Styles */
/* 产品详情页面样式 */

:root {
    --primary-color: #369CA8;
    --secondary-color: #a29bfe;
    --accent-color: #fd79a8;
    --success-color: #00b894;
    --warning-color: #fdcb6e;
    --danger-color: #e17055;
    --dark-color: #2d3436;
    --light-color: #ddd6fe;
}

/* Product Description Content Styles */
.product-description-content {
    line-height: 1.8;
    color: #333;
}

.product-description-content p {
    margin-bottom: 1rem;
}

.product-description-content picture {
    display: block;
    margin: 1rem 0;
}

.product-description-content picture img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    cursor: pointer;
}

.product-description-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1rem 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    cursor: pointer;
}

.product-description-content a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.product-description-content a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

.product-description-content font {
    color: inherit;
}

/* 产品详情页面容器背景 - 与首页分类展示区域颜色一致 */
.container.my-5 {
    background-color: #EEF1EA !important;
    padding: 10px 20px;
    border-radius: 8px;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

body {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
}

.navbar {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
}

.nav-link {
    color: white !important;
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav-link:hover {
    color: var(--accent-color) !important;
    transform: translateY(-2px);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(54, 156, 168, 0.4);
}

.product-image {
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.product-image img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.price {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
}

.compare-price {
    font-size: 1.2rem;
    color: #999;
    text-decoration: line-through;
}

.rating {
    color: var(--warning-color);
}

.product-info {
    background: #fff;
    border-radius: 15px;
    padding: 30px;
}

/* 产品标题 - 语义清晰，避免使用 .h2 造成混淆 */
.product-title {
    font-size: 1.75rem;
    font-weight: 500;
    line-height: 1.2;
}

.product-model {
    margin-bottom: 1rem;
}

.model-text {
    color: #666;
    font-size: 0.95rem;
    font-weight: 500;
}

.model-text i {
    color: #6c757d;
}

/* Enhanced Breadcrumb Styles */
.breadcrumb {
    background: transparent;
    padding: 0.3rem 0 0.75rem;
    margin-bottom: 0.3rem;
    font-size: 0.875rem;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
}

.breadcrumb-item a {
    color: var(--primary-color);
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
}

.breadcrumb-item a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: #6c757d;
    font-weight: 500;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "/";
    color: #adb5bd;
    padding: 0 0.75rem;
    font-weight: normal;
}

.feature-list {
    list-style: none;
    padding: 0;
}

.feature-list li {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.feature-list li:last-child {
    border-bottom: none;
}

.feature-list i {
    color: var(--success-color);
    margin-right: 10px;
}

.quantity-input {
    width: 80px;
    text-align: center;
}

/* Tab Styles */
.nav-tabs {
    border-bottom: 2px solid #dee2e6;
    margin-bottom: 0;
    background: #ffffff;
    border-radius: 10px 10px 0 0;
}

.nav-tabs .nav-link {
    color: #000000 !important;
    background: #ffffff !important;
    border: 1px solid #dee2e6 !important;
    border-bottom: 3px solid transparent !important;
    padding: 12px 20px !important;
    font-weight: 500 !important;
    transition: all 0.3s ease !important;
    text-decoration: none !important;
}

.nav-tabs .nav-link:hover {
    color: var(--primary-color) !important;
    border-bottom-color: var(--primary-color) !important;
    background: #ffffff !important;
    text-decoration: none !important;
}

.nav-tabs .nav-link.active {
    color: var(--primary-color) !important;
    background: #ffffff !important;
    border-bottom-color: var(--primary-color) !important;
    font-weight: 600 !important;
    text-decoration: none !important;
}

.tab-content {
    background: #fff;
    border: 1px solid #dee2e6;
    border-top: none;
    border-radius: 0 0 10px 10px;
    min-height: 200px;
}

.tab-pane {
    padding: 0;
}

.tab-pane .p-4 {
    padding: 2rem !important;
}

/* Review System Styles */
.rating-input .stars {
    font-size: 1.5rem;
    color: #ddd;
    cursor: pointer;
}

.rating-input .stars i {
    transition: color 0.2s ease;
}

.rating-input .stars i:hover,
.rating-input .stars i.active {
    color: #ffc107;
}

.rating-text {
    font-size: 0.9rem;
    color: #666;
}

.review-item {
    border-bottom: 1px solid #eee;
    padding: 1rem 0;
}

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

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.review-author {
    font-weight: 600;
    color: #333;
}

.review-date {
    font-size: 0.85rem;
    color: #666;
}

.review-rating {
    color: #ffc107;
    margin-bottom: 0.5rem;
}

.review-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #333;
}

.review-content {
    color: #666;
    line-height: 1.5;
}

.rating-distribution {
    font-size: 0.9rem;
}

.rating-bar {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
}

.rating-label {
    width: 30px;
    text-align: left;
    margin-right: 0.75rem;
    font-weight: 500;
    color: #333;
}

.rating-progress {
    flex: 1;
    height: 10px;
    background-color: #e9ecef;
    border-radius: 5px;
    overflow: hidden;
    margin-right: 0.75rem;
    position: relative;
}

.rating-fill {
    height: 100%;
    background: linear-gradient(90deg, #ffc107 0%, #ffb300 100%);
    transition: width 0.5s ease;
    border-radius: 5px;
}

.rating-count {
    width: 40px;
    text-align: right;
    font-size: 0.85rem;
    color: #666;
    font-weight: 500;
}

/* Review Images Styles */
.review-images {
    margin-top: 0.75rem;
}

.review-image-thumbnail {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    border: 2px solid #ddd;
    transition: all 0.3s ease;
}

.review-image-thumbnail:hover {
    border-color: var(--primary-color);
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* Review Item Enhanced Styles */
.review-item {
    border-bottom: 1px solid #e9ecef;
    padding: 1.5rem 0;
    margin-bottom: 0;
}

.review-item:first-child {
    padding-top: 0;
}

.review-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.review-item + .review-item {
    margin-top: 0;
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.review-author {
    font-weight: 600;
    color: #333;
    font-size: 1rem;
}

.review-date {
    font-size: 0.85rem;
    color: #666;
}

.review-rating {
    color: #ffc107;
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.review-rating i {
    margin-right: 2px;
}

.review-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #333;
    font-size: 1.1rem;
}

.review-content {
    color: #666;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
    margin-bottom: 0.5rem;
}

/* Review Summary Enhanced */
#reviewSummary {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

#averageRating {
    font-size: 3rem;
    font-weight: bold;
    line-height: 1;
    margin-bottom: 0.5rem;
}

#ratingStars {
    margin-bottom: 0.5rem;
}

#ratingStars i {
    font-size: 1.5rem;
    margin-right: 2px;
}

#totalReviews {
    font-size: 0.9rem;
    color: #666;
}

/* Rating Distribution Enhanced */
.rating-distribution {
    font-size: 0.9rem;
    padding-top: 0.5rem;
}

.rating-bar {
    display: flex;
    align-items: center;
    margin-bottom: 0.75rem;
}

.rating-bar:last-child {
    margin-bottom: 0;
}

.rating-label {
    width: 30px;
    text-align: left;
    margin-right: 0.75rem;
    font-weight: 500;
    color: #333;
}

.rating-progress {
    flex: 1;
    height: 10px;
    background-color: #e9ecef;
    border-radius: 5px;
    overflow: hidden;
    margin-right: 0.75rem;
    position: relative;
}

.rating-fill {
    height: 100%;
    background: linear-gradient(90deg, #ffc107 0%, #ffb300 100%);
    transition: width 0.5s ease;
    border-radius: 5px;
}

.rating-count {
    width: 40px;
    text-align: right;
    font-size: 0.85rem;
    color: #666;
    font-weight: 500;
}

/* Review Modal Styles */
#reviewModal .modal-body {
    padding: 2rem;
}

#reviewModal .form-label {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
}

#reviewModal .form-control {
    border-radius: 8px;
    border: 1px solid #ddd;
    padding: 0.75rem;
    transition: all 0.3s ease;
}

#reviewModal .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(54, 156, 168, 0.25);
}

#reviewModal textarea.form-control {
    resize: vertical;
    min-height: 120px;
}

/* 商品图 / 评论图 / 写评论：弹窗需高于导航栏(z-index 10003+)。模态节点由 product_detail_new.js 挂到 body，避免 main.content-wrapper 的层叠上下文压住弹窗 */
#imageModal.modal,
#reviewImageModal.modal,
#reviewModal.modal {
    z-index: 10050 !important;
}

/* 商品详情页：若某模态启用 backdrop，遮罩需高于导航(≈10003)、低于模态本体(10050) */
body[data-product-id].modal-open .modal-backdrop {
    z-index: 10040 !important;
}

/* 商品图弹窗：主图可点击关闭（见 product_detail_new.js handleBlankAreaClose） */
#imageModal #modalMainImage {
    cursor: pointer;
}

/* Review Image Modal */
#reviewImageModal .modal-body {
    padding: 1rem;
    text-align: center;
}

#reviewImageModal .modal-body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

/* No Reviews Message */
#noReviewsMessage {
    text-align: center;
    padding: 3rem 1rem;
}

#noReviewsMessage i {
    font-size: 4rem;
    color: #ddd;
    margin-bottom: 1rem;
}

#noReviewsMessage h5 {
    color: #666;
    margin-bottom: 0.5rem;
}

#noReviewsMessage p {
    color: #999;
    margin-bottom: 1.5rem;
}

/* Load More Button */
#loadMoreContainer {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #eee;
}

#loadMoreBtn {
    border-radius: 25px;
    padding: 0.75rem 2rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

#loadMoreBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Product Images Styles */
.thumbnail-image {
    transition: all 0.3s ease;
}

.thumbnail-image:hover {
    transform: scale(1.05);
    border-color: var(--primary-color) !important;
}

.thumbnail-image.active {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 2px rgba(54, 156, 168, 0.2);
}

.main-image-container {
    position: relative;
    width: 100%;
}

.main-image-container::before {
    content: '';
    display: block;
    padding-bottom: 100%; /* 创建正方形比例 */
}

.main-image-container img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transition: transform 0.3s ease;
}

.main-image-container img:hover {
    transform: scale(1.02);
}

/* Image Modal Navigation Styles */
.image-viewer-container {
    position: relative;
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #ddd;
    transition: all 0.3s ease;
    opacity: 0.8;
}

.image-nav-btn:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transform: translateY(-50%) scale(1.1);
}

.image-nav-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.image-nav-prev {
    left: 10px;
}

.image-nav-next {
    right: 10px;
}

.image-counter {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 14px;
    z-index: 10;
}

.modal-thumbnail {
    transition: all 0.2s ease;
}

.modal-thumbnail:hover {
    transform: scale(1.05);
    border-color: var(--primary-color) !important;
}

.modal-thumbnail.active {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 2px rgba(54, 156, 168, 0.2);
}

/* Product Options Validation Styles */
.product-option-select.is-invalid {
    border-color: var(--danger-color) !important;
    box-shadow: 0 0 0 0.2rem rgba(225, 112, 85, 0.25) !important;
}

.product-option-select.is-invalid:focus {
    border-color: var(--danger-color) !important;
    box-shadow: 0 0 0 0.2rem rgba(225, 112, 85, 0.5) !important;
}

#product-options-section .form-label .text-danger {
    font-weight: 600;
}

/* Mobile Optimization Styles */
@media (max-width: 768px) {
    .main-image-container::before {
        padding-bottom: 100%; /* 移动端也保持正方形 */
    }
    
    .product-info {
        padding: 20px !important;
    }
    
    .thumbnail-container .col-3 {
        flex: 0 0 25%;
        max-width: 25%;
    }
    
    .thumbnail-image {
        height: 60px !important;
    }
    
    /* Optimize font sizes for mobile */
    .price {
        font-size: 1.5rem !important;
    }
    
    .product-title {
        font-size: 1.5rem !important;
    }
    
    /* Reduce padding on mobile */
    .tab-pane .p-4 {
        padding: 1rem !important;
    }
}

/* Image Loading Optimization */
img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

/* Related products (You May Also Like) - square images */
.product-card .card-img-top {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
}

/* Prevent layout shift */
.product-images img,
.product-card img {
    background-color: #f8f9fa;
    background-image: linear-gradient(45deg, #f0f0f0 25%, transparent 25%, transparent 75%, #f0f0f0 75%, #f0f0f0),
                      linear-gradient(45deg, #f0f0f0 25%, transparent 25%, transparent 75%, #f0f0f0 75%, #f0f0f0);
    background-size: 20px 20px;
    background-position: 0 0, 10px 10px;
}

/* Touch-friendly buttons on mobile */
@media (max-width: 768px) {
    .btn {
        min-height: 44px;
        padding: 10px 20px;
    }
    
    .wishlist-btn {
        width: 44px !important;
        height: 44px !important;
    }
}

/* Optimize animations for mobile */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}




















