/**
 * 产品详情页样式表
 * 
 * 这个文件定义了产品详情页的所有样式
 * 包括：页面布局、导航栏、产品详情卡片、规格卡片、图片画廊等
 */

/* ==========================================================================
   1. 全局变量
   ========================================================================== */
:root {
    /* 颜色变量 */
    --primary-color: #007bff;
    --secondary-color: #00bcd4;
    --text-primary: #333;
    --text-secondary: #666;
    --text-muted: #6c757d;
    --bg-white: #fff;
    --bg-light: #f5f5f5;
    --border-color: #e0e0e0;
    
    /* 尺寸变量 */
    --topbar-height: 36px;
    --navbar-height: 58px;
    --header-total-height: calc(var(--topbar-height) + var(--navbar-height));
    --border-radius-sm: 5px;
    --border-radius-lg: 15px;
    
    /* 间距变量 */
    --spacing-xs: 0.4rem;
    --spacing-sm: 0.7rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.25rem;
    --spacing-xl: 1.5rem;
    --spacing-xxl: 2rem;
    
    /* 阴影变量 */
    --shadow-sm: 0 5px 15px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 15px 40px rgba(0, 123, 255, 0.15);
    
    /* 过渡变量 */
    --transition-base: all 0.3s ease;
    --transition-transform: transform 0.3s ease;
    
    /* 渐变变量 */
    --gradient-primary: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

/* ==========================================================================
   2. 基础布局样式
   ========================================================================== */
main {
    margin-top: 5px;
    padding-top: var(--spacing-xs);
    position: relative;
    z-index: 900;
    transition: margin-top 0.3s ease;
}

.product-detail {
    position: relative;
    z-index: 900;
    padding-top: 0;
}

/* 滚动状态下的布局调整 */
body.scrolled main {
    margin-top: var(--navbar-height);
}

/* ==========================================================================
   3. 产品详情卡片样式
   ========================================================================== */
.product-detail-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-xxl);
    height: 100%;
    transition: var(--transition-base);
    position: relative;
    overflow: hidden;
}

.product-detail-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-md);
    background: rgba(255, 255, 255, 0.9);
}

/* 标题样式 */
.product-detail-card h3 {
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: var(--spacing-xl);
    position: relative;
    padding-bottom: var(--spacing-lg);
    text-align: center;
}

.product-detail-card h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: var(--gradient-primary);
    border-radius: 3px;
}

/* 列表样式 */
.product-detail-card ul {
    margin: 0;
    padding: 0;
}

.product-detail-card ul li {
    display: flex;
    align-items: center;
    margin-bottom: var(--spacing-md);
    padding: var(--spacing-md);
    border-radius: var(--border-radius-sm);
    transition: var(--transition-base);
    background: rgba(255, 255, 255, 0.5);
}

.product-detail-card ul li:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: translateX(5px);
}

.product-detail-card ul li i {
    font-size: 1.2rem;
    margin-right: var(--spacing-lg);
    color: var(--primary-color);
    transition: var(--transition-base);
}

.product-detail-card ul li:hover i {
    transform: scale(1.2);
    color: var(--secondary-color);
}

.product-detail-card ul li span {
    color: var(--text-secondary);
    font-size: 1rem;
    transition: color 0.3s ease;
}

.product-detail-card ul li:hover span {
    color: var(--text-primary);
}

/* ==========================================================================
   4. 产品规格卡片样式
   ========================================================================== */
.specification-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-xxl);
    margin-bottom: var(--spacing-xxl);
    transition: var(--transition-base);
}

.specification-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    background: rgba(255, 255, 255, 0.9);
}

/* 标题样式 */
.specification-card h4 {
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: var(--spacing-xl);
    position: relative;
    padding-bottom: var(--spacing-md);
}

.specification-card h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 3px;
    background: var(--gradient-primary);
    border-radius: 3px;
}

/* 表格样式 */
.specification-card table {
    width: 100%;
    margin-bottom: 0;
}

.specification-card table td {
    padding: var(--spacing-md);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

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

.specification-card table td:first-child {
    font-weight: 500;
    color: var(--text-primary);
    width: 40%;
}

.specification-card table td:last-child {
    color: var(--text-secondary);
}

/* ==========================================================================
   5. 产品图库样式
   ========================================================================== */
.product-gallery {
    display: flex;
    position: relative;
    margin-bottom: var(--spacing-xxl);
}

/* 缩略图导航 */
.gallery-thumbnails {
    width: 100px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-right: var(--spacing-lg);
}

.thumbnail-container {
    height: 360px;
    overflow: hidden;
    position: relative;
}

.thumbnail-wrapper {
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: var(--transition-transform);
}

.thumbnail {
    width: 80px;
    height: 80px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    overflow: hidden;
    cursor: pointer;
    opacity: 0.7;
    transition: var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.thumbnail img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* 主图区域 */
.gallery-main {
    flex: 1;
    max-width: calc(100% - 120px);
    position: relative;
}

.main-image-container {
    width: 100%;
    height: 400px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.main-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease-out;
}

.main-image.zoomed {
    transform: scale(2.5);
}

/* 移除旧的放大镜样式 */
.gallery-zoom,
.zoom-container,
.zoom-image-wrapper,
.zoom-image,
.zoom-lens {
    display: none;
}

/* 响应式调整 */
@media (max-width: 1400px) {
    .gallery-zoom {
        width: 350px;
        height: 350px;
    }
}

@media (max-width: 991px) {
    .gallery-zoom {
        display: none !important; /* 在平板及以下设备禁用放大镜功能 */
    }
    
    .main-image-container {
        cursor: default;
    }
}

/* ==========================================================================
   6. 相关产品样式
   ========================================================================== */
.related-products .section-title {
    position: relative;
    padding-bottom: var(--spacing-lg);
    margin-bottom: var(--spacing-xxl);
}

.related-products .section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 80px;
    height: 3px;
    background: var(--gradient-primary);
    border-radius: 3px;
}

/* 产品卡片 */
.product-card {
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-base);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-md);
}

.product-card .card-img-top {
    height: 250px;
    object-fit: contain;
    border-bottom: 1px solid #f0f0f0;
    background-color: transparent;
    padding: var(--spacing-md);
}

.product-card .card-body {
    padding: var(--spacing-lg);
    display: flex;
    flex-direction: column;
    flex: 1;
    height: 30%;
    min-height: 110px;
    text-align: center;
}

.product-card .card-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
    color: var(--text-primary);
    text-align: center;
}

.product-card .card-text {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: var(--spacing-sm);
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}

.product-card .btn {
    margin-top: auto;
    border-radius: 50px;
    padding: var(--spacing-xs) var(--spacing-md);
    font-size: 0.85rem;
    align-self: center;
}

/* ==========================================================================
   7. 响应式设计
   ========================================================================== */
/* 大屏幕设备 (1200px以下) */
@media (max-width: 1199px) {
    .product-card .card-img-top {
        height: 220px;
    }
    
    .product-card .card-body {
        min-height: 100px;
    }
}

/* 中等屏幕设备 (992px以下) */
@media (max-width: 991px) {
    .product-gallery {
        flex-wrap: wrap;
    }
    
    .gallery-main {
        max-width: calc(100% - 115px);
    }
    
    .product-card .card-img-top {
        height: 190px;
    }
    
    .product-card .card-body {
        min-height: 90px;
    }
}

/* 平板设备 (768px以下) */
@media (max-width: 768px) {
    /* 布局调整 */
    main {
        margin-top: 80px;
    }
    
    /* 图库布局调整 */
    .product-gallery {
        flex-direction: column;
    }
    
    .gallery-thumbnails {
        width: 100%;
        flex-direction: row;
        order: 2;
        margin-right: 0;
        margin-top: var(--spacing-lg);
        height: 100px;
    }
    
    .thumbnail-container {
        height: auto;
        width: 100%;
    }
    
    .thumbnail-wrapper {
        flex-direction: row;
        transform: translateX(0) !important;
    }
    
    .gallery-main {
        order: 1;
        max-width: 100%;
        margin-right: 0;
    }
    
    /* 导航按钮调整 */
    .thumb-nav.prev i,
    .thumb-nav.next i {
        transform: rotate(90deg);
    }
    
    /* 产品卡片调整 */
    .product-card .card-img-top {
        height: 160px;
    }
    
    .product-card .card-body {
        min-height: 80px;
    }
}

/* 手机设备 (576px以下) */
@media (max-width: 576px) {
    .product-card .card-img-top {
        height: 180px;
    }
    
    body.scrolled main {
        margin-top: 106px;
    }
}

/* ==========================================================================
   8. 容器统一样式
   ========================================================================== */
#siteHeader .container,
.navbar .container,
.top-bar .container {
    max-width: var(--container-width) !important;
    margin: 0 auto !important;
}

/* 添加顶部通知栏样式 */
.top-bar, #topBarContainer {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    height: var(--topbar-height) !important;
    margin: 0 !important;
    padding: 0 !important;
    z-index: 1002 !important;
    border-bottom: none !important;
    transition: all 0.3s ease !important;
    background-color: #3B8AD9 !important;  /* 设置背景色为 #3B8AD9 */
    overflow: hidden !important;
}