/* Product Detail Page Specific Styles */

/* CSS变量定义 */
:root {
    --text-dark: #333333;
    --text-medium: #666666;
}

.product-detail-page {
    /* 确保product-detail页面不受has-fixed-header类影响 */
    padding-top: 0 !important;
}

/* product-detail页面不再需要header-spacer */

/* Product Detail Banner */
.product-detail-banner {
    color: var(--white);
    position: relative;
    z-index: 1;
    padding-top: var(--header-h); /* 为固定header留出空间 */
    overflow: hidden;
}

.product-detail-banner .banner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
}

.product-detail-banner img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    position: relative;
    z-index: 1;
}

.product-detail-banner .container {
    position: relative;
    z-index: 2;
    width: 100%;
}

.product-detail-banner .breadcrumb {
    font-family: Poppins, Poppins;
    font-weight: 500;
    font-size: 16px;
    color: #FFFFFF;
    line-height: 24px;
    text-align: left;
    max-width: 100%;
}

.product-detail-banner .breadcrumb span {
    margin: 0 5px;
}

.product-detail-banner .breadcrumb span:first-child {
    margin-left: 0;
}

.product-detail-banner .breadcrumb .product-name {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
    vertical-align: bottom;
}

/* Product Detail Section */
.product-detail-section {
    padding: 40px 0;
    background-color: #F7F7F7;
}

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

/* Left Section */
.left-section {
    display: flex;
    flex-direction: column;
    gap: 30px;
    width: 1060px;
}

/* Top Section - Product Images and Info (Left-Right Layout) */
.top-section {
    display: flex;
    gap: 30px;
    background-color: var(--white);
    border-radius: 20px;
}

/* Product Images */
.product-images {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.main-image-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px 0 0 20px;
}

.main-image {
    height: 500px;
    width: 500px;
    border-radius: 8px;
    overflow: hidden;
}

.main-image img {
    height: 100%;
    width: 100%;
    transition: transform 0.3s ease;
}

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

/* Thumbnail Swiper */
.thumbnail-swiper {
    width: 100%;
    height: 80px;
    position: relative;
    overflow: hidden;
}

/* 确保缩略图容器宽度精确容纳5张图片 */
.thumbnail-swiper .swiper-wrapper {
    width: calc(100px * 5 + 40px); /* 5张图片宽度 + 4个间距 */
    margin: 0 auto;
}

/* 确保缩略图在容器中正确对齐 */
.thumbnail-swiper .swiper-slide {
    margin-right: 10px; /* 固定间距 */
}

.thumbnail-swiper .swiper-slide:last-child {
    margin-right: 0;
}

.thumbnail-swiper .swiper-wrapper {
    display: flex;
    align-items: center;
    height: 100%;
}

.thumbnail-swiper .swiper-slide {
    flex: 0 0 100px; /* 固定宽度100px，确保5个缩略图 */
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 6px;
    overflow: hidden;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    margin-right: 10px; /* 使用margin代替gap */
}

.thumbnail-swiper .swiper-slide:last-child {
    margin-right: 0;
}

.thumbnail-swiper .swiper-slide.active {
    border-color: var(--btn-blue);
    transform: scale(1.05);
}

.thumbnail-swiper .swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease;
}

.thumbnail-swiper .swiper-slide:hover img {
    opacity: 0.8;
}

/* 缩略图导航箭头 */
.thumbnail-swiper .swiper-button-next,
.thumbnail-swiper .swiper-button-prev {
    color: var(--btn-blue);
    background-color: var(--light-gray) !important;
    width: 36px !important;
    height: 36px !important;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    top: 50% !important;
    transform: translateY(-50%) !important;
    z-index: 10;
    margin-top: 0 !important;
}

.thumbnail-swiper .swiper-button-next:after,
.thumbnail-swiper .swiper-button-prev:after {
    font-size: 14px;
    font-weight: bold;
    line-height: 1;
}

.thumbnail-swiper .swiper-button-next {
    right: 0;
}

.thumbnail-swiper .swiper-button-prev {
    left: 0;
}

/* 强制覆盖Swiper默认样式，确保箭头垂直居中 */
.thumbnail-swiper .swiper-button-next,
.thumbnail-swiper .swiper-button-prev {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: absolute !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    background-color:  rgba(0, 0, 0, 0.3) !important;
}

/* 确保箭头图标在按钮内垂直居中 */
.thumbnail-swiper .swiper-button-next:after,
.thumbnail-swiper .swiper-button-prev:after {
    margin: 0 !important;
    padding: 0 !important;
    display: block !important;
    line-height: 1 !important;
    position: relative !important;
    top: 0 !important;
    left: 0 !important;
    transform: none !important;
}

/* 覆盖Swiper的默认按钮样式 */
.thumbnail-swiper .swiper-button-next.swiper-button-disabled,
.thumbnail-swiper .swiper-button-prev.swiper-button-disabled {
    opacity: 0.35 !important;
    cursor: auto !important;
    pointer-events: none !important;
}

/* 箭头hover效果 */
.thumbnail-swiper .swiper-button-next:hover,
.thumbnail-swiper .swiper-button-prev:hover {
    background-color: rgba(0, 0, 0, 0.5) !important;
    transform: translateY(-50%) scale(1.1) !important;
    transition: all 0.3s ease;
}

/* 自动轮播时的视觉提示 */
.thumbnail-swiper.swiper-container-auto-playing .swiper-button-next,
.thumbnail-swiper.swiper-container-auto-playing .swiper-button-prev {
    opacity: 0.8;
}

/* Product Inquiry Modal - 使用与contactModal一致的样式 */
#productInquiryModal {
    z-index: 1001;
}

#productInquiryModal .modal__header {
    height: 171px;
}

#productInquiryModal .modal__header h2 {
    font-family: Poppins, Poppins;
    font-weight: bold;
    font-size: 44px;
    color: #FFFFFF;
    line-height: 65px;
    text-align: center;
}

#productInquiryModal .modal__header p {
    font-family: Poppins, Poppins;
    font-weight: 500;
    font-size: 18px;
    color: #FFFFFF;
    line-height: 27px;
    text-align: center;
}

#productInquiryModal .modal__form {
    margin-top: 20px;
}

/* 弹框水平垂直居中 */
#productInquiryModal .modal__dialog {
    position: fixed;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    margin: 0 !important;
    width: 990px;
    height: 647px;
}

#productInquiryModal .btn-primary {
    margin-top: 40px;
}

/* 关闭按钮样式 */
.modal__close {
    position: absolute;
    top: 15px;
    right: 20px;
    width: 16px;
    height: 16px;
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.modal__close img {
    width: 100%;
    height: 100%;
}

/* 覆盖floating.css中的旋转动画 */
.modal__close:hover {
    transform: scale(1.04) !important; /* 只保留缩放，移除旋转 */
}

/* 更强优先级的选择器来覆盖floating.css */
#productInquiryModal .modal__close:hover {
    transform: scale(1.04) !important; /* 只保留缩放，移除旋转 */
}

/* 最强优先级选择器，确保覆盖所有旋转动画 */
#productInquiryModal .modal__close:hover,
#productInquiryModal .modal__close:focus,
#productInquiryModal .modal__close:active {
    transform: scale(1.04) !important; /* 只保留缩放，移除旋转 */
}


/* 响应式调整 */
@media (max-width: 768px) {
    .thumbnail-swiper {
        height: 70px;
        padding: 0 30px; /* 平板端减少箭头预留空间 */
    }
    
    .thumbnail-swiper .swiper-wrapper {
        width: calc(80px * 3 + 20px); /* 3张图片宽度 + 2个间距 */
    }
    
    .thumbnail-swiper .swiper-slide {
        flex: 0 0 80px; /* 平板端固定宽度80px */
        height: 70px;
    }
    
    .thumbnail-swiper .swiper-button-next,
    .thumbnail-swiper .swiper-button-prev {
        width: 25px !important;
        height: 25px !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
    }
    
    .thumbnail-swiper .swiper-button-next:after,
    .thumbnail-swiper .swiper-button-prev:after {
        font-size: 12px;
        line-height: 1;
    }
}

@media (max-width: 480px) {
    .thumbnail-swiper {
        height: 60px;
        padding: 0 25px; /* 小屏幕进一步减少箭头预留空间 */
    }
    
    .thumbnail-swiper .swiper-wrapper {
        width: calc(60px * 3 + 16px); /* 3张图片宽度 + 2个间距 */
    }
    
    .thumbnail-swiper .swiper-slide {
        flex: 0 0 60px; /* 小屏幕固定宽度60px */
        height: 60px;
    }
}

/* Right Section */
.right-section {
    display: flex;
    flex-direction: column;
    gap: 30px;
    width: 310px;
}

/* Product Info */
.product-info {
    padding: 20px 0 0 40px;
    height: fit-content;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 500px; /* 确保最小高度 */
}

.product-info .info-top-section {
    flex: 1;
}

.product-info .info-middle-section {
    flex: 1;
}

.product-info .info-bottom-section {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    align-self: stretch;         /* ← 覆盖上层可能的 align-items:center */
    width: 100%; 
}

.product-info .product-title {
    font-family: Poppins, Poppins;
    font-weight: 500;
    font-size: 24px;
    color: #001C33;
    line-height: 29px;
    text-align: left;
    margin-bottom: 30px;
}

.product-features h3,
.product-shipping h3 {
    font-family: Poppins, Poppins;
    font-weight: 500;
    font-size: 18px;
    color: #222226;
    line-height: 27px;
    text-align: left;
    margin-bottom: 8px;
}

.product-features ul {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
}

.product-features li {
    font-family: Poppins, Poppins;
    font-weight: 400;
    font-size: 15px;
    color: #3D3D40;
    line-height: 26px;
    text-align: left;
    padding: 6px 0;
    border-bottom: 1px solid #f0f0f0;
    position: relative;
    padding-left: 18px;
}

.product-features li:before {
    content: "•";
    color: var(--btn-blue);
    font-weight: bold;
    position: absolute;
    left: 0;
}

.product-features li:last-child {
    border-bottom: none;
}

.product-shipping p {
    font-family: Poppins, Poppins;
    font-weight: 400;
    font-size: 13px;
    color: var(--text-medium);
    line-height: 1.5;
    margin-bottom: 20px;
    text-align: left;
}

.product-actions {
    width: 200px;
    height: 52px;
    border-radius: 26px;
    background: #0B85E6;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--white);
    font-family: Poppins, Poppins;
    font-weight: 500;
    font-size: 20px;
    line-height: 30px;
    text-align: center;
}

.btn-inquiry {
    background-color: var(--btn-blue);
    color: white;
    border: none;
    padding: 12px 30px;
    font-family: Poppins, Poppins;
    font-weight: 600;
    font-size: 15px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.btn-inquiry:hover {
    background-color: var(--btn-blue-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.25);
}

/* Popular Products Sidebar */
.popular-products-sidebar {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    height: fit-content;
}

.popular-products-sidebar h3 {
    font-family: Poppins, Poppins;
    font-weight: 600;
    font-size: 20px;
    color: #001C33;
    line-height: 30px;
    text-align: left;
    margin-bottom: 15px;
    text-align: left;
}

.popular-products-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.popular-product-item {
    display: flex;
    gap: 10px;
    padding: 10px;
    border-radius: 6px;
    transition: background-color 0.3s ease;
    cursor: pointer;
    height: 90px; /* 增加高度以支持4行标题 */
    overflow: hidden; /* 确保图片缩放效果不超出容器 */
}

.popular-product-item .pop-product-info {
    padding: 5px;
    height: 100%;
}


/* 使用更强优先级的选择器来覆盖其他CSS文件中的hover效果 */
#popular-products-sidebar .popular-product-item:hover {
    background-color: transparent !important; /* 移除背景色变化 */
}

#popular-products-sidebar .popular-product-item:hover img {
    transform: scale(1.1) !important; /* 添加图片缩放效果 */
}

/* 确保移除所有可能的hover动画效果 */
#popular-products-sidebar .popular-product-item:hover * {
    transform: none !important; /* 移除所有子元素的变换效果 */
}

#popular-products-sidebar .popular-product-item:hover::before,
#popular-products-sidebar .popular-product-item:hover::after {
    display: none !important; /* 移除所有伪元素的hover效果 */
}

.popular-product-item img {
    width: 90px;
    height: 90px; /* 保持图片尺寸不变 */
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
    transition: transform 0.3s ease; /* 添加过渡效果 */
    cursor: pointer; /* 添加手型光标 */
}


.popular-product-item .product-title {
    font-family: Poppins, Poppins;
    font-weight: 400;
    font-size: 14px;
    color: #001C33;
    line-height: 20px;
    text-align: left;
    
    display: -webkit-box;         /* 关键：设置伸缩盒子 */
    -webkit-box-orient: vertical; /* 关键：垂直排列 */
    -webkit-line-clamp: 4;        /* 关键：限制为 4 行 */
    overflow: hidden;             /* 关键：超出隐藏 */
    text-overflow: ellipsis;      /* 关键：结尾显示 … */
    word-break: break-word;       /* 确保长单词能正确换行 */
}

/* Key Attributes Section */
.key-attributes-section {
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    background-color: var(--white);
}

.key-attributes-section .specs-table {
    margin: 0;
    border-radius: 0;
}

.specs-table .specs-table-line {
    display: block;           /* 关键 */
    width: 100%;
    height: 1px;
    background: #EDEFF2;
    padding: 0 40px  ;
    margin-bottom: 30px;
}


.key-attributes-section .specs-table h3 {
    margin: 0;
    padding: 10px 0 30px 0;
}



.key-attributes-section .specs-table-content {
    margin: 0;
    border: 1px solid #E8EAED;
    border-radius: 0;
}

/* Product Specifications Section */
.product-specs-section {
    padding: 30px 0;
    background-color: var(--white);
}

.specs-layout {
    display: flex;
    justify-content: center;
    gap: 30px;
}

.specs-table {
    background-color: var(--white);
    border-radius: 8px;
    padding: 20px 40px 40px 40px;
/*    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);*/
}

.specs-table h3 {
    font-family: Poppins, Poppins;
    font-weight: bold;
    font-size: 30px;
    color: #001C33;
    line-height: 46px;
    text-align: center;
    margin-bottom: 15px;
}

.specs-table-content {
    width: 100%;
    border-collapse: collapse;
    border: 2px solid #dee2e6;
    overflow: hidden;
}

.specs-table-content tr {
    border-bottom: 2px solid #dee2e6;
}

.specs-table-content tr:last-child {
    border-bottom: none;
}

.specs-table-content tr:nth-child(even) {
    background-color: #f8f9fa;
}

.specs-table-content td {
    padding: 15px 14px;
    font-family: Poppins, Poppins;
    font-size: 13px;
    line-height: 1.5;
    border-right: 2px solid #dee2e6;
    vertical-align: top;
}

.specs-table-content td:last-child {
    border-right: none;
}

.spec-label {
    font-family: Poppins, Poppins;
    font-weight: 400;
    font-size: 16px;
    color: #5C5C66;
    line-height: 50px;
    text-align: left;
    width: 175px;
    background-color: #e9ecef;
}

.spec-value {
    background-color: var(--white);
    font-family: Poppins, Poppins;
    font-weight: 400;
    font-size: 16px;
    color: #001C33;
    line-height: 50px;
    text-align: left;
}

/* 每行显示两组属性的样式 */
.specs-table-content tr {
    display: table-row;
    transition: background-color 0.2s ease;
}

.specs-table-content tr:hover {
    background-color: #f8f9fa;
}

.specs-table-content tr td {
    display: table-cell;
    transition: background-color 0.2s ease;
}

/* 确保每行最多显示两组属性 */
.specs-table-content tr td:nth-child(3),
.specs-table-content tr td:nth-child(4) {
    border-left: 2px solid #dee2e6;
}

/* 响应式设计：在小屏幕上每行只显示一组属性 */
@media (max-width: 768px) {
    .specs-table-content tr td {
        width: 50%;
        min-width: 120px;
    }
    
    .specs-table-content tr td:nth-child(3),
    .specs-table-content tr td:nth-child(4) {
        border-left: none;
        border-top: 2px solid #dee2e6;
    }
}


.specs-table .subtitle {
    font-family: Poppins, Poppins;
    font-weight: 600;
    font-size: 20px;
    color: #001C33;
    line-height: 30px;
    text-align: left;
    padding-bottom: 10px;
}

/* 1440px-1920px 范围优化 */
@media (min-width: 1441px) and (max-width: 1920px) {
    .product-detail-layout {
        max-width: 1400px;
        margin: 0 auto;
        grid-template-columns: 1000px 320px; /* 保持原始比例 */
        gap: 30px;
    }
    
    .product-detail-container {
        max-width: 1400px;
        margin: 0 auto;
        padding: 0 40px;
    }
}

/* Responsive Design */
@media (max-width: 1400px) {
    .product-detail-layout {
        grid-template-columns: 900px 280px; /* 稍微缩小但保持比例 */
        gap: 25px;
    }
}

@media (max-width: 992px) {
    .product-detail-layout {
        grid-template-columns: 1fr; /* 平板端改为单列布局 */
        gap: 25px;
        max-width: 800px; /* 限制最大宽度 */
    }
    
    .left-section,
    .right-section {
        gap: 25px;
    }
    
    .top-section {
        grid-template-columns: 1fr; /* 产品图片和信息改为上下布局 */
        gap: 25px;
    }
    
    .popular-products-sidebar {
        order: -1;
    }
}

@media (max-width: 768px) {
    .product-detail-layout {
        max-width: 100%;
        padding: 0 15px;
    }
    
    .product-detail-banner .breadcrumb .product-name {
        max-width: 200px;
    }
    
    .main-image {
        height: 300px;
    }
    
    .left-section,
    .right-section {
        gap: 20px;
    }
    
    .top-section {
        gap: 20px;
    }
    
    .product-info {
        padding: 20px;
    }
    
    .product-title {
        font-size: 20px;
    }
    
    .specs-table {
        padding: 20px;
    }
    
    .specs-table-content td {
        padding: 10px 6px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .product-detail-banner .breadcrumb {
        font-size: 14px;
    }
    
    .product-detail-banner .breadcrumb .product-name {
        max-width: 150px;
    }
    
    .main-image {
        height: 250px;
    }
    
    .thumbnail-swiper {
        height: 60px;
    }
    
    .product-info {
        padding: 15px;
    }
    
    .product-title {
        font-size: 18px;
    }
    
    .btn-inquiry {
        padding: 12px 30px;
        font-size: 14px;
    }
    
    .specs-table {
        padding: 15px;
    }
    
    .specs-table h3 {
        font-size: 18px;
    }
    
    .specs-table-content td {
        padding: 8px 4px;
        font-size: 12px;
    }
}

/* Animation for product images */
.product-images img {
/*    opacity: 0;*/
/*    transform: scale(0.8);*/
    transition: opacity 1s ease-out, transform 1s ease-out;
}

.product-images img.loaded {
    opacity: 1;
    transform: scale(1);
}

/* Hover effects for popular products - 移除扫描动画 */
.popular-product-item {
    position: relative;
    overflow: hidden;
}


/* Loading state for images */
.image-loading {
    position: relative;
    background-color: #f0f0f0;
    border-radius: 8px;
    overflow: hidden;
}

.image-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { left: -100%; }
    100% { left: 100%; }
}
