/**
 * 产品详情页通用样式
 * 所有产品子页面共享此样式文件
 * 便于统一管理和维护
 */

/* ========== 产品导航栏 ========== */
.product-nav {
    display: none;
}

/* ========== 新产品卡片样式 - 与广电设备页面一致 ========== */
.product-item-new {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
    transition: all 0.4s ease;
    cursor: pointer;
    position: relative;
    width: 100%;
    max-width: 280px; /* 减小宽度，做竖长卡片 */
}

.product-item-new:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.15);
}

.product-image-wrapper {
    position: relative;
    height: 350px; /* 增加高度，竖长容器 */
    overflow: hidden;
    background: #f5f5f5;
}

.product-image-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.4s ease;
}

.product-item-new:hover .product-image-wrapper img {
    transform: scale(1.1);
}

.product-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    padding: 6px 14px;
    background: #DE2910;
    color: #ffffff;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
}

.product-info-new {
    padding: 24px;
}

.product-category-new {
    font-size: 13px;
    color: #DE2910;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.product-title-new {
    font-size: 20px;
    font-weight: 600;
    color: #171717;
    margin-bottom: 12px;
    line-height: 1.4;
}

.product-desc-new {
    font-size: 14px;
    color: #737373;
    line-height: 1.6;
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-footer-new {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid #f5f5f5;
}

.product-specs {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #737373;
}

.product-spec {
    display: flex;
    align-items: center;
    gap: 4px;
}

.product-spec svg {
    width: 16px;
    height: 16px;
}

.view-details-btn {
    padding: 8px 20px;
    background: #DE2910;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.view-details-btn:hover {
    background: #C4182C;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
}

/* 产品详情页对话框 */
.product-dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
}

.product-dialog-overlay.active {
    display: flex;
}

.product-dialog {
    background: white;
    border-radius: 12px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.product-dialog-header {
    padding: 24px;
    border-bottom: 1px solid #e5e5e5;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.product-dialog-header h2 {
    font-size: 24px;
    font-weight: 600;
    color: #171717;
    margin: 0;
}

.close-dialog-btn {
    background: none;
    border: none;
    font-size: 28px;
    color: #737373;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-dialog-btn:hover {
    background: #f5f5f5;
    color: #DE2910;
}

.product-dialog-body {
    padding: 24px;
}

.product-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}

.product-detail-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
}

.product-detail-info h3 {
    font-size: 20px;
    font-weight: 600;
    color: #171717;
    margin-bottom: 16px;
}

.product-specs-table {
    width: 100%;
    margin-top: 20px;
    border-collapse: collapse;
}

.product-specs-table td {
    padding: 12px;
    border-bottom: 1px solid #f5f5f5;
    font-size: 14px;
}

.product-specs-table td:first-child {
    font-weight: 600;
    color: #737373;
    width: 40%;
}

.product-specs-table td:last-child {
    color: #171717;
}

@media (max-width: 768px) {
    .product-detail-grid {
        grid-template-columns: 1fr;
    }
    
    .products-grid-new {
        grid-template-columns: 1fr;
    }
}

/* ========== 产品导航占位 ========== */
#product-nav-placeholder {
    display: none;
}

/* ========== 产品主视觉区 ========== */
.product-hero {
    position: relative;
    padding: 150px 0 100px;
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-size: cover !important;
    background-position: center !important;
    background-attachment: fixed;
    margin-top: 70px !important;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1;
}

.product-hero .container {
    position: relative;
    z-index: 2;
    width: 100%;
    text-align: center;
}

.product-hero h1 {
    font-size: 56px;
    margin-bottom: 20px;
    font-weight: 700;
    line-height: 1.2;
    color: white !important;
}

.product-hero p {
    font-size: 20px;
    opacity: 0.95;
    max-width: 800px;
    line-height: 1.6;
    margin: 0 auto;
    color: white !important;
}

/* ========== 面包屑导航 ========== */
.breadcrumb {
    background: #f8f9fa;
    padding: 15px 0;
    border-bottom: 1px solid #e0e0e0;
}

.breadcrumb a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 14px;
}

.breadcrumb a:hover {
    color: var(--primary-color);
}

.breadcrumb span {
    color: var(--text-light);
    font-size: 14px;
}

/* ========== 产品展示网格 ========== */
.product-showcase-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1px;
    margin-top: 0;
    background: #ffffff;
}

.showcase-card {
    background: white;
    border: none;
    overflow: hidden;
    transition: all 0.3s ease;
}

.showcase-card:hover {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    transform: translateY(-5px);
}

.showcase-image {
    height: 200px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding: 20px;
}

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

.showcase-card:hover .showcase-image img {
    transform: scale(1.08);
}

.showcase-info {
    padding: 25px;
    text-align: center;
}

.showcase-category {
    display: none;
}

.showcase-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 10px;
}

.showcase-model {
    font-size: 14px;
    color: var(--text-light);
    margin: 0;
}

.showcase-desc {
    display: none;
}

/* ========== 产品分类筛选 ========== */
.category-filter {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin: 40px 0;
}

.category-btn {
    padding: 10px 25px;
    background: white;
    border: 2px solid #e0e0e0;
    color: var(--text-color);
    border-radius: 50px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.category-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.category-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* ========== 响应式设计 ========== */
@media (max-width: 768px) {
    /* 导航栏移动端适配 */
    .navbar .container {
        padding: 0 20px !important;
    }
    
    .logo-img {
        height: 50px !important;
    }
    
    .navbar.navbar-shrink .logo-img {
        height: 45px !important;
    }
    
    /* 产品英雄区 */
    .product-hero {
        padding: 80px 0 60px;
        min-height: 300px;
        margin-top: 60px;
    }

    .product-hero h1 {
        font-size: 36px;
    }

    .product-hero p {
        font-size: 18px;
    }

    /* 产品展示网格 */
    .product-showcase-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }

    /* 移动端：左侧分类栏改为横向滚动 */
    .products-layout-wrapper {
        flex-direction: column !important;
        gap: 20px !important;
    }
    
    .category-sidebar {
        width: 100% !important;
        flex-direction: row !important;  /* 横向排列 */
        overflow-x: auto !important;  /* 横向滚动 */
        gap: 10px !important;
        padding: 10px 0 !important;
        border-right: none !important;
        border-bottom: 2px solid #f0f0f0 !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    .category-sidebar::-webkit-scrollbar {
        height: 4px !important;
    }
    
    .category-sidebar::-webkit-scrollbar-thumb {
        background: #ccc !important;
        border-radius: 2px !important;
    }
    
    .category-label {
        padding: 10px 20px !important;
        font-size: 14px !important;
        flex-shrink: 0 !important;  /* 不被压缩 */
        white-space: nowrap !important;  /* 不换行 */
        border-radius: 8px !important;  /* 圆角 */
        border-left: none !important;  /* 移除左侧边框 */
        border-bottom: 3px solid transparent !important;  /* 底部边框 */
    }
    
    .category-label.active {
        border-left: none !important;
        border-bottom-color: var(--china-red) !important;
    }
    
    /* 产品网格 - 移动端优化 */
    .products-grid-new {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
        gap: 15px !important;
    }
    
    /* 产品卡片移动端适配 */
    .product-card {
        max-width: 100% !important;
        height: auto !important;  /* 自动高度 */
    }
    
    .product-card-image {
        height: 250px !important;  /* 减少高度，让卡片更扁平 */
    }
    
    .product-card-body {
        padding: 12px !important;
        flex: 1 !important;
    }
    
    .product-card-title {
        font-size: 16px !important;
    }
    
    /* 产品详情弹窗 */
    .product-detail-modal-content {
        max-height: 90vh !important;
        overflow-y: auto !important;
    }
    
    .product-detail-grid {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }
    
    .product-detail-image {
        max-height: 400px !important;
    }
}
