/* 
 * 注意：控制面板相关样式已移至admin.css文件
 * 此文件仅保留产品中心页面相关样式
 * 后台管理系统相关样式请在admin.css中维护
 */

/* 产品中心页面样式 */
.pbk-product-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 20px 0;
    margin-top: 70px; /* 为固定导航栏留出空间 */
}

.pbk-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 面包屑导航 */
.pbk-breadcrumb {
    background: white;
    border-radius: 10px;
    padding: 15px 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
}

.pbk-breadcrumb a {
    color: #EB6630;
    text-decoration: none;
    transition: color 0.3s ease;
}

.pbk-breadcrumb a:hover {
    color: #D45520;
}

.pbk-breadcrumb i {
    color: #adb5bd;
    font-size: 0.8rem;
}

.pbk-breadcrumb span {
    color: #495057;
    font-weight: 500;
}

/* 页面标题区域 - 与分类导航整合 */
.pbk-page-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 40px 0;
    background: linear-gradient(135deg, #EB6630 0%, #D45520 100%);
    border-radius: 15px;
    color: white;
    box-shadow: 0 8px 32px rgba(235, 102, 48, 0.3);
    position: relative;
    overflow: hidden;
}

.pbk-page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="75" cy="75" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="50" cy="10" r="0.5" fill="rgba(255,255,255,0.1)"/><circle cx="10" cy="60" r="0.5" fill="rgba(255,255,255,0.1)"/><circle cx="90" cy="40" r="0.5" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.pbk-page-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    position: relative;
    z-index: 1;
}

.pbk-page-subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
    position: relative;
    z-index: 1;
}

/* 分类导航 - 重新设计 */
.pbk-category-nav {
    background: white;
    border-radius: 15px;
    padding: 0;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    overflow: hidden;
    position: relative;
    z-index: 999; /* 确保导航容器有足够高的层级 */
}

.pbk-category-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 25px 30px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
}

.pbk-category-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #2d3436;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
}

.pbk-category-title i {
    color: #EB6630;
    font-size: 1.2rem;
}

.pbk-category-selector {
    position: relative;
    display: inline-block;
    z-index: 998; /* 确保选择器容器有足够高的层级 */
}

.pbk-select-btn {
    background: linear-gradient(135deg, #EB6630 0%, #D45520 100%);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(235, 102, 48, 0.3);
    position: relative;
    overflow: hidden;
    min-width: 350px; /* 增加按钮最小宽度 */
    justify-content: center; /* 居中对齐 */
}

.pbk-select-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.pbk-select-btn:hover::before {
    left: 100%;
}

.pbk-select-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(235, 102, 48, 0.4);
}

.pbk-select-btn i {
    transition: transform 0.3s ease;
    font-size: 0.9rem;
}

.pbk-select-btn.active i {
    transform: rotate(180deg);
}

.pbk-category-dropdown {
    position: fixed; /* 改为fixed定位，不受容器限制 */
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    z-index: 1000; /* 进一步提高z-index层级 */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #e9ecef;
    min-width: 600px;
    width: max-content;
    /* 移除top、left、right定位，通过JavaScript动态计算 */
    scroll-behavior: smooth; /* 添加平滑滚动 */
}

/* 自定义滚动条样式 */
.pbk-category-dropdown::-webkit-scrollbar {
    width: 8px;
}

.pbk-category-dropdown::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.pbk-category-dropdown::-webkit-scrollbar-thumb {
    background: #EB6630;
    border-radius: 4px;
}

.pbk-category-dropdown::-webkit-scrollbar-thumb:hover {
    background: #D45520;
}

.pbk-category-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.pbk-category-group {
    padding: 25px;
    border-bottom: 1px solid #f1f3f4;
    background: #fafbfc;
}

.pbk-category-group:last-child {
    border-bottom: none;
}

.pbk-category-group:first-child {
    background: white;
}

.pbk-category-group h3 {
    color: #EB6630;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 18px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f1f3f4;
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
}

.pbk-category-group h3::before {
    content: '';
    width: 4px;
    height: 18px;
    background: linear-gradient(135deg, #EB6630 0%, #D45520 100%);
    border-radius: 2px;
}

.pbk-category-group h3::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 50px;
    height: 2px;
    background: linear-gradient(90deg, #EB6630, transparent);
}

.pbk-category-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 10px;
}

.pbk-category-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #495057;
    font-weight: 500;
    text-decoration: none;
    border: 1px solid transparent;
    background: white;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.pbk-category-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(235, 102, 48, 0.1), transparent);
    transition: left 0.5s ease;
}

.pbk-category-item:hover::before {
    left: 100%;
}

.pbk-category-item:hover {
    background: linear-gradient(135deg, #EB6630 0%, #D45520 100%);
    color: white;
    transform: translateX(5px);
    border-color: rgba(255,255,255,0.2);
    box-shadow: 0 4px 12px rgba(235, 102, 48, 0.3);
}

.pbk-category-item span:first-child {
    flex: 1;
    margin-right: 12px;
    font-size: 0.95rem;
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative;
    z-index: 1;
}

.pbk-category-count {
    background: rgba(255,255,255,0.2);
    color: inherit;
    padding: 6px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    min-width: 45px;
    text-align: center;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    backdrop-filter: blur(5px);
}

/* 产品展示区域 */
.pbk-products-section {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.pbk-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f1f3f4;
}

.pbk-section-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2d3436;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.pbk-section-title i {
    color: #EB6630;
}

.pbk-back-btn {
    background: linear-gradient(135deg, #EB6630 0%, #D45520 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(235, 102, 48, 0.3);
}

.pbk-back-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(235, 102, 48, 0.4);
    color: white;
    text-decoration: none;
}

/* 产品网格 */
.pbk-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

.pbk-product-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.pbk-product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.pbk-product-image {
    position: relative;
    width: 100%;
    height: 250px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
}

.pbk-product-image img {
    max-width: 100% !important;
    max-height: 100% !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    transition: transform 0.3s ease;
}

.pbk-product-card:hover .pbk-product-image img {
    transform: scale(1.05);
}

.pbk-product-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    color: #adb5bd;
    font-size: 3rem;
}

.pbk-product-info {
    padding: 20px;
}

.pbk-product-code {
    color: #EB6630;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.pbk-product-name {
    color: #2d3436;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 10px;
    line-height: 1.4;
}

.pbk-product-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

.pbk-product-category {
    color: #6c757d;
    background: #f8f9fa;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: 500;
}

.pbk-product-count {
    color: #28a745;
    font-weight: 600;
}

/* 产品详情页 */
.pbk-product-detail {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.pbk-detail-header {
    text-align: center;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.pbk-detail-header-content {
    flex: 1;
    text-align: left;
}

.pbk-detail-title {
    font-size: 2rem;
    font-weight: 700;
    color: #2d3436;
    margin-bottom: 10px;
}

.pbk-detail-subtitle {
    color: #EB6630;
    font-size: 1.1rem;
    font-weight: 500;
}

.pbk-back-to-list-btn {
    background: linear-gradient(135deg, #EB6630 0%, #D45520 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 25px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(235, 102, 48, 0.3);
    white-space: nowrap;
}

.pbk-back-to-list-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(235, 102, 48, 0.4);
    color: white;
    text-decoration: none;
}

.pbk-back-to-list-btn i {
    font-size: 0.9rem;
}

/* 产品详情页图片 - 固定3列布局 */
.pbk-detail-images {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.pbk-detail-image {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
}

.pbk-detail-image:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.pbk-detail-image img {
    max-width: 100% !important;
    max-height: 100% !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    display: block;
}

.pbk-detail-content {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 25px;
}

.pbk-detail-section {
    margin-bottom: 20px;
}

.pbk-detail-section:last-child {
    margin-bottom: 0;
}

.pbk-detail-section h4 {
    color: #EB6630;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pbk-detail-section p {
    color: #495057;
    line-height: 1.6;
    margin: 0;
}

/* 产品信息网格 */
.pbk-product-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.pbk-info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.pbk-info-label {
    font-weight: 500;
    color: #6c757d;
}

.pbk-info-value {
    font-weight: 600;
    color: #2d3436;
}

/* 相关产品 */
.pbk-related-products {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.pbk-image-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    box-sizing: border-box;
}

.pbk-enlarged-container {
    position: relative;
    max-width: 95%;
    max-height: 95%;
    border-radius: 10px;
    overflow: visible; /* 改为visible，不裁剪图片 */
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent; /* 改为透明背景 */
}

.pbk-enlarged-image {
    max-width: 100% !important;
    max-height: 100% !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    display: block;
    border-radius: 8px; /* 给图片本身添加圆角 */
    box-shadow: 0 5px 20px rgba(0,0,0,0.3); /* 给图片添加阴影 */
}

.pbk-close-overlay {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0,0,0,0.7);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.pbk-close-overlay:hover {
    background: rgba(0,0,0,0.9);
    transform: scale(1.1);
}

.pbk-loading {
    text-align: center;
    padding: 50px 20px;
    color: #6c757d;
}

.pbk-loading i {
    font-size: 2rem;
    color: #EB6630;
    margin-bottom: 15px;
    animation: spin 1s linear infinite;
}

.pbk-error {
    text-align: center;
    padding: 50px 20px;
    color: #dc3545;
}

.pbk-error i {
    font-size: 3rem;
    margin-bottom: 15px;
}

.pbk-no-products {
    text-align: center;
    padding: 50px 20px;
    color: #6c757d;
}

.pbk-no-products i {
    font-size: 3rem;
    color: #adb5bd;
    margin-bottom: 15px;
}

.pbk-retry-btn {
    background: linear-gradient(135deg, #EB6630 0%, #D45520 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 15px;
    box-shadow: 0 4px 15px rgba(235, 102, 48, 0.3);
}

.pbk-retry-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(235, 102, 48, 0.4);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 移除水印样式 */

/* 产品卡片图片容器 */
.pbk-product-image-container {
    position: relative;
    width: 100%;
    height: 250px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
}

.pbk-product-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(235, 102, 48, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.pbk-product-card:hover .pbk-product-overlay {
    opacity: 1;
}

.pbk-product-overlay-content {
    color: white;
    text-align: center;
    font-weight: 600;
    font-size: 1.1rem;
}

.pbk-product-overlay-content i {
    font-size: 2rem;
    margin-bottom: 8px;
    display: block;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .pbk-container {
        padding: 0 15px;
    }
    
    .pbk-breadcrumb {
        flex-wrap: wrap;
        gap: 5px;
        font-size: 0.8rem;
    }
    
    .pbk-page-header {
        padding: 20px 0;
        margin-bottom: 20px;
    }
    
    .pbk-page-title {
        font-size: 2rem;
    }
    
    .pbk-category-nav,
    .pbk-products-section,
    .pbk-product-detail,
    .pbk-related-products {
        padding: 20px;
        margin-bottom: 20px;
    }
    
    .pbk-category-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .pbk-category-selector {
        width: 100%;
    }
    
    .pbk-select-btn {
        width: 100%;
        justify-content: center;
        min-width: unset; /* 移动端取消最小宽度限制 */
        padding: 12px 20px; /* 调整移动端内边距 */
    }
    
    .pbk-category-dropdown {
        min-width: 100%; /* 移动端全宽显示 */
        width: 100%;
        z-index: 9; /* 确保移动端层级正确 */
        left: 0; /* 确保左对齐 */
        right: auto; /* 取消右对齐 */
    }
    
    .pbk-category-list {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    
    .pbk-category-item {
        padding: 10px 12px;
        font-size: 0.9rem;
    }
    
    .pbk-products-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
    }
    
    .pbk-product-image {
        height: 200px;
    }
    
    /* 移动端产品详情页图片 - 改为单列布局 */
    .pbk-detail-images {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .pbk-detail-title {
        font-size: 1.5rem;
    }
    
    .pbk-detail-header {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .pbk-detail-header-content {
        text-align: center;
    }
    
    .pbk-back-to-list-btn {
        width: 100%;
        justify-content: center;
        padding: 10px 15px;
        font-size: 0.9rem;
    }
    
    .pbk-product-info-grid {
        grid-template-columns: 1fr;
    }
    
    .pbk-info-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    /* 移动端弹出层优化 */
    .pbk-image-overlay {
        padding: 10px;
    }
    
    .pbk-enlarged-container {
        max-width: 98%;
        max-height: 98%;
    }
    
    .pbk-close-overlay {
        top: 10px;
        right: 10px;
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
    
    /* 移除移动端水印样式 */
}

@media (max-width: 480px) {
    .pbk-products-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .pbk-product-image {
        height: 180px;
    }
    
    .pbk-page-title {
        font-size: 1.8rem;
    }
    
    .pbk-section-title {
        font-size: 1.3rem;
    }
    
    .pbk-detail-title {
        font-size: 1.3rem;
    }
    
    /* 小屏幕弹出层进一步优化 */
    .pbk-image-overlay {
        padding: 5px;
    }
    
    .pbk-enlarged-container {
        max-width: 100%;
        max-height: 100%;
    }
    
    .pbk-enlarged-image {
        border-radius: 4px;
    }
    
    .pbk-close-overlay {
        top: 5px;
        right: 5px;
        width: 30px;
        height: 30px;
        font-size: 0.9rem;
    }
}