/* Product Main Page Styles商品详情页面 */

/* 基础样式 */
.product-main-body {
    font-family: 'Microsoft YaHei', '微软雅黑', 'PingFang SC', sans-serif;
    font-weight: 300;
    margin: 0;
    padding: 0;
}

/* 防止水平滚动条 - 优化版本，不影响导航动画 */
body {
    overflow-x: hidden;
    max-width: 100%;
}

.product-detail-main {
    overflow-x: hidden;
    max-width: 100%;
}

/* 确保导航栏不受overflow影响 */
.navigation-container,
.navbar-scrollable,
.navbar-second {
    overflow: visible !important;
}

.product-main-container-fluid {
    /* min-height: 100vh;*/
    /* padding: 0 0 6rem 0; */
    margin: 0;
}

/* Flex布局容器 */
.product-main-layout-flex {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    max-width: 1600px;
    margin: 0 auto;
}

.product-main-image-container,
.product-main-details-container {
    height: auto;
    overflow-y: visible;
    min-width: 0;
}

.product-main-image-container {
    position: relative;
    background: #f8f9fa;
    flex: 0 0 600px;
    /* min-width: 550px;
    max-width: 800px; */
}

.product-main-details-container {
    position: relative;
    background: white;
    /* border-left: 1px solid #e9ecef; */
    flex: 1;
    min-width: 400px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 0;
}

/* Image Section */
.product-main-image-section {
    position: relative;
    height: 100%;
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow: visible;
}

.product-main-carousel-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 400px;
    height: 100%;
}

#productMainCarousel {
    height: 100%;
    flex: 1;
    position: relative;
}

.carousel-inner,
.carousel-item {
    height: 100%;
    border-radius: 0;
}

/* 缩略图样式 */
.product-main-thumbnail-container {
    flex-shrink: 0;
    background: #ffffff;
    /* border-top: 1px solid #e9ecef; */
}

.product-main-thumbnail-gallery {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 5px 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.product-main-thumbnail-gallery::-webkit-scrollbar {
    display: none;
}

.product-main-thumbnail-item {
    width: 60px;
    height: 60px;
    border: 2px solid transparent;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.product-main-thumbnail-item.active {
    border-color: #212529;
}

.product-main-thumbnail-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 主图样式 */
.product-main-main-product-img {
    width: 100%;
    height: 100%;
    min-height: 400px;
    object-fit: cover;
    object-position: center;
    background: white;
}

/* 自定义轮播控制按钮 */
.product-main-custom-carousel-controls {
    position: absolute;
    bottom: 15px;
    right: 15px;
    z-index: 10;
    display: flex;
    gap: 8px;
}
.product-main-custom-carousel-btn {
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.4);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    cursor: pointer;
    transition: background-color 0.3s ease;
}
.product-main-custom-carousel-btn:hover {
    background: rgba(0, 0, 0, 0.6);
}

/* Product Details Section */
.product-main-details-section {
    padding: 20px 30px;
    width: 100%;
    max-width: 600px;
    min-width: 350px;
    /* 防止文本溢出 */
    overflow-wrap: break-word;
    word-break: break-word;
    box-sizing: border-box;
}

.product-main-price-section {
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 15px;
}

.product-main-stocks-info-section {
    margin-bottom: 15px;
}

.product-main-color-section {
    margin-bottom: 20px;
}

.product-main-size-section .btn,
.product-main-action-buttons .btn {
    font-size: 16px;
    font-weight: 500;
    border-radius: 0 !important;
    height: 70px;
}

.product-main-action-buttons .btn {
    font-size: 14px;
    padding: 12px;
    border-width: 1.5px;
}

.product-main-action-buttons .btn i {
    margin-right: 8px;
}

/* Bootstrap Accordion 样式 */
#productMainAccordion {
    margin-top: 25px;
    border: none;
}

#productMainAccordion .accordion-item {
    border: none;
    border-bottom: 1px solid #f0f0f0;
}

#productMainAccordion .accordion-item:last-child {
    border-bottom: none;
}

#productMainAccordion .accordion-button {
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 30px 15px;
    font-size: 16px;
    font-weight: 600;
    color: #333 !important;
    box-shadow: none !important;
}

#productMainAccordion .accordion-button:focus {
    background: transparent !important;
    color: #000 !important;
    box-shadow: none !important;
    border-color: transparent !important;
    outline: none !important;
}

#productMainAccordion .accordion-button:not(.collapsed) {
    background: transparent !important;
    color: #000 !important;
    box-shadow: none !important;
    border-color: transparent !important;
}

#productMainAccordion .accordion-body {
    padding: 15px;
    background: transparent;
    line-height: 1.6;
}

#productMainAccordion .accordion-body p {
    margin-bottom: 15px;
    color: #666;
    font-size: 14px;
    /* 处理长文本溢出问题 */
    word-wrap: break-word;
    word-break: break-all;
    overflow-wrap: break-word;
    hyphens: auto;
    white-space: normal;
    max-width: 100%;
}

#productMainAccordion .accordion-body p:last-child {
    margin-bottom: 0;
}

/* 专门处理商品摘要中的长文本 */
#productMainAccordion .accordion-body {
    /* 确保容器不会溢出 */
    overflow-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
    box-sizing: border-box;
}

#productMainAccordion .accordion-button::after {
    margin-left: auto;
    transition: transform 0.15s ease-in-out !important;
}

#productMainAccordion .accordion-button:not(.collapsed)::after {
    transform: rotate(180deg) !important;
}

/* 评价区域样式 */
#productMainAccordion .product-main-reviews-title,
.product-main-reviews-title {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    font-size: 16px;
    font-weight: 700;
    color: #333;
    margin: 0;
}

#productMainAccordion .product-main-reviews-title i,
.product-main-reviews-title i {
    color: #000000;
    font-size: 10px;
    margin-right: 1px;
}

#productMainAccordion .product-main-reviews-title span {
    font-weight: 600;
    color: #333;
    margin-left: 6px;
    font-size: 14px;
}

/* Reviews Section */
.product-main-reviews-section {
    padding: 40px 0;
    background: white;
    border-top: 1px solid #e9ecef;
}

.product-main-reviews-header {
    display: flex;
    align-items: baseline;
    margin-bottom: 30px;
    gap: 8px;
    padding: 0 50px;
}

.product-main-reviews-list {
    width: 100%;
    padding: 0 20px;
}

.product-main-review-card {
    background: white;
    padding: 25px;
    margin-bottom: 25px;
    border: none;
}

.product-main-review-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
    line-height: 1.4;
}

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

.product-main-review-stars {
    display: flex;
    gap: 1px;
}

.product-main-review-stars i {
    color: #000000 !important;
    font-size: 9px;
}

.product-main-review-date {
    color: #666;
    font-size: 14px;
    font-weight: 300;
}

.product-main-review-content {
    color: #333;
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 20px;
    font-weight: 300;
}

.product-main-review-info-boxes {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    background: #f5f5f5;
    padding: 12px 15px;
}

.product-main-reviewer-info,
.product-main-info-content {
    background: transparent;
    padding: 20px;
    flex: 1;
    min-width: 200px;
}

.product-main-reviewer-info .product-main-info-item,
.product-main-info-content .product-main-info-item {
    font-size: 13px;
    color: #555;
    margin-bottom: 4px;
    font-weight: 300;
}

.product-main-reviewer-info .product-main-info-item strong,
.product-main-info-content .product-main-info-item strong {
    color: #333;
    font-weight: 600;
}

/* Breadcrumb Navigation */
.product-main-breadcrumb-section {
    width: 100%;
    background: white;
    padding: 15px 0;
    border-top: 1px solid #e9ecef;
    margin-left: 0;
    margin-right: 0;
    position: relative;
    z-index: 5;
}

.product-main-breadcrumb-container {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    padding: 0 50px;
    box-sizing: border-box;
    /* max-width: 1600px; */
    margin: 0 auto;
}

.product-main-breadcrumb-item {
    font-size: 14px;
    font-weight: 300;
    color: #333;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.product-main-breadcrumb-link {
    color: #666;
    text-decoration: none;
    transition: color 0.2s ease;
    font-weight: 300;
    white-space: nowrap;
}

.product-main-breadcrumb-link:hover {
    color: #333;
    text-decoration: underline;
}

.product-main-breadcrumb-current {
    color: #333;
    font-weight: 400;
    cursor: default;
    flex: 1;
    min-width: 0;
}

.breadcrumb-title-full {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.product-main-breadcrumb-separator {
    color: #999;
    font-size: 12px;
    margin: 0 2px;
    flex-shrink: 0;
}

/* Animation for thumbnail selection */
.product-main-thumbnail-item.active img {
    transform: scale(1.05);
}

/* 响应式设计 */

/* 桌面端 */
@media (min-width: 1200px) {
    .product-main-layout-flex {
        max-width: 1400px;
        margin: 0 auto;
        padding: 0 30px;
    }
    
    .product-main-image-container {
        flex-basis: 60%;
        min-width: 600px;
        max-width: 900px;
        flex-shrink: 0;
        margin-left: 0;
    }
    
    .product-main-details-container {
        flex-basis: 40%;
        min-width: 400px;
        max-width: 500px;
        flex-shrink: 1;
    }
}

/* 超大屏幕 */
@media (min-width: 1400px) {
    .product-main-layout-flex {
        max-width: 1600px;
        margin: 0 auto;
        padding: 0 50px;
    }
    
    .product-main-image-container {
        flex-basis: 60%;
        min-width: 600px;
        max-width: 900px;
        margin-left: 0;
    }
    
    .product-main-details-container {
        flex-basis: 40%;
        min-width: 500px;
        max-width: 700px;
    }
}

/* 中等屏幕 */
@media (max-width: 1199px) and (min-width: 1024px) {
    .product-main-layout-flex {
        flex-direction: column;
        max-width: 100%;
    }
    
    .product-main-image-container {
        flex: 0 0 45vh;
        width: 100%;
    }
    
    .product-main-details-container {
        flex: 1;
        width: 100%;
        min-width: 0;
        margin-left: 0;
        margin-right: 0;
        border-left: none;
        border-top: 1px solid #e9ecef;
    }
    
    .product-main-details-section {
        max-width: none;
        width: 100%;
        padding: 20px;
        margin: 0 auto;
    }
    
    .product-main-thumbnail-gallery {
        padding: 10px;
    }
}

/* 移动端 */
@media (max-width: 767px) {
    .product-main-container-fluid {
        padding: 0 !important;
        margin: 0 !important;
    }
    
    .product-main-layout-flex {
        flex-direction: column;
        max-width: 100%;
        margin: 0;
        padding: 0;
    }
    
    .product-main-image-container {
        width: 100%;
        margin: 0;
        padding: 0;
    }
    
    .product-main-details-container {
        flex: 1;
        width: 100%;
        min-width: 0;
        margin-left: 0;
        margin-right: 0;
        border-left: none;
        border-top: 1px solid #e9ecef;
    }
    
    .product-main-details-section {
        width: 100%;
        max-width: none;
        padding: 15px;
        margin: 0;
        box-sizing: border-box;
        /* 移动端文本溢出处理 */
        overflow-wrap: break-word;
        word-break: break-word;
    }
    
    /* 移动端商品信息容器padding */
    .product-main-reviewer-info,
    .product-main-info-content {
        padding: 10px;
    }
    
    .product-main-thumbnail-item {
        width: 50px;
        height: 50px;
    }
    
    .product-main-main-product-img {
        min-height: 250px;
    }
    
    .product-main-action-buttons .btn {
        font-size: 13px;
        padding: 10px;
        height: 60px;
    }
    
    .product-main-custom-carousel-controls {
        bottom: 8px;
        right: 8px;
    }
    
    .product-main-custom-carousel-btn {
        width: 32px;
        height: 32px;
        font-size: 11px;
    }
    
    /* 移动端面包屑 */
    .product-main-breadcrumb-section {
        padding: 12px 0;
        margin-left: 0;
        margin-right: 0;
        width: 100%;
    }
    
    .product-main-breadcrumb-container {
        /* padding: 0 15px; */
        gap: 6px;
        justify-content: flex-start;
    }
    
    .product-main-breadcrumb-item {
        font-size: 13px;
    }
    
    .product-main-breadcrumb-current {
        max-width: calc(100vw - 120px); /* 为首页链接和分隔符留出空间 */
    }
    
    .breadcrumb-title-full {
        max-width: 100%;
    }
    
    .product-main-breadcrumb-separator {
        font-size: 11px;
        margin: 0 1px;
    }
    
    /* 移动端评价区 */
    .product-main-reviews-section {
        margin-top: 30px;
        padding: 20px 0;
    }
    
    .product-main-review-info-boxes {
        flex-direction: column;
        gap: 10px;
    }
    
    .product-main-review-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

/* 平板端 */
@media (max-width: 1023px) and (min-width: 768px) {
    .product-main-layout-flex {
        flex-direction: column;
        max-width: 100%;
    }
    
    .product-main-image-container {
        flex: 0 0 50vh;
        width: 100%;
    }
    
    .product-main-details-container {
        flex: 1;
        width: 100%;
        min-width: 0;
        margin-left: 0;
        margin-right: 0;
        border-left: none;
        border-top: 1px solid #e9ecef;
    }
    
    .product-main-details-section {
        max-width: none;
        width: 100%;
        padding: 20px;
        margin: 0 auto;
    }
    
    /* .product-main-image-section {
        padding: 15px;
    } */
    
    .product-main-thumbnail-gallery {
        padding: 10px;
    }
    
    .product-main-custom-carousel-controls {
        bottom: 12px;
        right: 12px;
    }
}

/* 超小屏幕适配 (320px - 480px) */
@media (max-width: 480px) {
    .product-main-breadcrumb-container {
        /* padding: 0 10px; */
        gap: 4px;
        justify-content: flex-start;
    }
    
    .product-main-breadcrumb-item {
        font-size: 12px;
    }
    
    .product-main-breadcrumb-current {
        max-width: calc(100vw - 100px); /* 超小屏幕进一步减少空间占用 */
    }
    
    .product-main-breadcrumb-separator {
        font-size: 10px;
        margin: 0;
    }
    
    /* 超长标题处理 */
    .breadcrumb-title-full {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

/* 面包屑导航SEO优化样式 */
.product-main-breadcrumb-section[itemscope] {
    /* 确保结构化数据正确显示 */
    position: relative;
}

.product-main-breadcrumb-item[itemscope] {
    /* 结构化数据项样式 */
    position: relative;
}

/* 面包屑导航可访问性优化 */
.product-main-breadcrumb-section[aria-label] {
    /* 确保屏幕阅读器能正确识别 */
    position: relative;
}

.product-main-breadcrumb-separator[aria-hidden="true"] {
    /* 隐藏装饰性分隔符，避免屏幕阅读器读取 */
    position: relative;
}