/* ========================================
   🎨 新产品卡片设计系统 - 正式版
   ======================================== */


/* 产品展示区域 */
.products-section {
    background: var(--bg-light);
    padding: 2rem 0;
    min-height: 400px;
}

/* 产品网格布局 - 移动优先响应式设计 */
.products-grid {
    display: grid;
    grid-template-columns: 1fr; /* 默认1列 - 手机端 */
    gap: 1rem;
    padding: 1rem 0;
}

/* 小手机 >= 640px - 2列 */
@media (min-width: 640px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

/* 平板 >= 1024px - 3列 */
@media (min-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.75rem;
    }
}

/* 桌面 >= 1280px - 4列 */
@media (min-width: 1280px) {
    .products-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 2rem;
    }
}

/* ========================================
   新产品卡片设计
   ======================================== */

.product-card {
    background: var(--bg-white);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
    transition: all 0.4s cubic-bezier(0.4, 0.0, 0.2, 1);
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.05);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    border-color: rgba(var(--primary-color-rgb), 0.3);
}

/* 产品图片区域 */
.product-image {
    position: relative;
    height: 240px;
    overflow: hidden;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.6s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.02);
}

/* 产品标签 */
.product-badges {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 2;
}

.product-badge {
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: var(--font-weight-medium);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.badge-hot {
    background: linear-gradient(135deg, #ff4757 0%, #ff3838 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 71, 87, 0.4);
}

.badge-premium {
    background: linear-gradient(135deg, #ffa726 0%, #fb8c00 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 167, 38, 0.4);
}

.badge-classic {
    background: linear-gradient(135deg, #42a5f5 0%, #1e88e5 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(66, 165, 245, 0.4);
}

.badge-new {
    background: linear-gradient(135deg, #26c6da 0%, #00acc1 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(38, 198, 218, 0.4);
}

.badge-versatile {
    background: linear-gradient(135deg, #ab47bc 0%, #8e24aa 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(171, 71, 188, 0.4);
}

.badge-high-temp {
    background: linear-gradient(135deg, #ff6f00 0%, #e65100 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 111, 0, 0.4);
}

.badge-lightweight {
    background: linear-gradient(135deg, #66bb6a 0%, #43a047 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 187, 106, 0.4);
}

.badge-special {
    background: linear-gradient(135deg, #7e57c2 0%, #5e35b1 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(126, 87, 194, 0.4);
}

/* 产品内容区域 */
.product-content {
    padding: 1.5rem;
    position: relative;
    z-index: 1;
}

.product-title {
    font-size: 1.25rem;
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    line-height: 1.3;
    transition: color 0.3s ease;
}

.product-card:hover .product-title {
    color: var(--primary-color);
}

.product-description {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 应用领域标签 */
.product-applications {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.app-tag {
    padding: 0.25rem 0.75rem;
    background: linear-gradient(135deg, rgba(var(--primary-color-rgb), 0.1), rgba(var(--primary-color-rgb), 0.05));
    color: var(--primary-color);
    font-size: 0.8rem;
    font-weight: var(--font-weight-medium);
    border-radius: 12px;
    border: 1px solid rgba(var(--primary-color-rgb), 0.2);
    transition: all 0.3s ease;
}

.app-tag:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-1px);
}

/* ========================================
   悬停遮罩层设计
   ======================================== */

.hover-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        135deg,
        rgba(0, 0, 0, 0.45) 0%,
        rgba(0, 0, 0, 0.35) 50%,
        rgba(0, 0, 0, 0.45) 100%
    );
    backdrop-filter: blur(1px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.4, 0.0, 0.2, 1);
    z-index: 5;
}

.product-card:hover .hover-overlay {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.overlay-content {
    text-align: center;
    color: white;
    transform: translateY(20px);
    transition: transform 0.4s cubic-bezier(0.4, 0.0, 0.2, 1);
    width: 100%;
}

.product-card:hover .overlay-content {
    transform: translateY(0);
}

.overlay-title {
    font-size: 1.1rem;
    font-weight: var(--font-weight-semibold);
    margin-bottom: 1.5rem;
    color: white;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8), 0 1px 3px rgba(0, 0, 0, 0.9);
}

/* 技术规格展示 */
.tech-specs {
    margin-bottom: 2rem;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 12px;
    padding: 1.5rem;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.spec-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
}

.spec-item:last-child {
    border-bottom: none;
}

.spec-label {
    color: rgba(255, 255, 255, 0.9);
    font-weight: var(--font-weight-medium);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.spec-value {
    color: white;
    font-weight: var(--font-weight-semibold);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

/* 操作按钮 */
.overlay-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.overlay-actions .btn {
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: var(--font-weight-medium);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    cursor: pointer;
    min-width: 120px;
    justify-content: center;
}

.btn-primary {
    background: linear-gradient(135deg, #4CAF50 0%, #2E7D32 100%);
    color: white;
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.3);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(76, 175, 80, 0.6);
    background: linear-gradient(135deg, #388E3C 0%, #1B5E20 100%);
    border-color: rgba(255, 255, 255, 0.5);
}

.btn-secondary {
    background: linear-gradient(135deg, #2196F3 0%, #1565C0 100%);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    box-shadow: 0 6px 20px rgba(33, 150, 243, 0.4);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #1976D2 0%, #0D47A1 100%);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-3px);
    color: white;
    box-shadow: 0 12px 35px rgba(33, 150, 243, 0.6);
}

/* ========================================
   响应式设计
   ======================================== */

@media (max-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }

    .product-image {
        height: 220px;
    }
}

@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    .product-image {
        height: 200px;
    }

    .product-content {
        padding: 1.25rem;
    }

    /* 移动端：点击激活overlay */
    .hover-overlay {
        padding: 1rem;
        overflow-y: auto;
        align-items: flex-start;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }

    /* 移动端激活状态 - 通过JavaScript添加 */
    .product-card.mobile-active .hover-overlay {
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
    }

    /* 添加关闭按钮样式 */
    .product-card.mobile-active .hover-overlay::before {
        content: '×';
        position: absolute;
        top: 10px;
        right: 15px;
        font-size: 32px;
        line-height: 1;
        color: white;
        cursor: pointer;
        z-index: 100;
        width: 36px;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(0, 0, 0, 0.3);
        border-radius: 50%;
    }

    .overlay-content {
        width: 100%;
        max-height: 100%;
        overflow-y: auto;
    }

    .overlay-title {
        font-size: 1rem;
        margin-bottom: 1rem;
    }

    /* 技术规格区域优化 */
    .tech-specs {
        margin-bottom: 1rem;
        padding: 1rem;
        max-height: 25vh;
        overflow-y: auto;
    }

    .spec-item {
        padding: 0.4rem 0;
        font-size: 0.8rem;
    }

    .spec-label, .spec-value {
        font-size: 0.8rem;
    }

    /* 操作按钮固定在底部 */
    .overlay-actions {
        flex-direction: column;
        gap: 0.5rem;
        position: sticky;
        bottom: 0;
        background: rgba(0, 0, 0, 0.85);
        padding: 0.75rem;
        margin: 0 -1rem -1rem;
        border-radius: 0 0 16px 16px;
    }

    .overlay-actions .btn {
        width: 100%;
        padding: 0.65rem 1rem;
        font-size: 0.85rem;
        min-width: auto;
    }

    /* 移动端优化：减少动画复杂度 */
    .product-card:hover .product-image img {
        transform: scale(1.02);
    }

    /* 移动端触摸优化 */
    .product-card {
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .product-image {
        height: 180px;
    }

    .product-title {
        font-size: 1.05rem;
    }

    .product-description {
        font-size: 0.85rem;
        -webkit-line-clamp: 2;
    }

    .product-content {
        padding: 1rem;
    }

    /* 进一步压缩overlay内容 */
    .hover-overlay {
        padding: 0.75rem;
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }

    .overlay-title {
        font-size: 0.95rem;
        margin-bottom: 0.75rem;
    }

    .tech-specs {
        padding: 0.75rem;
        margin-bottom: 0.75rem;
        max-height: 20vh;
    }

    .spec-item {
        font-size: 0.75rem;
        padding: 0.3rem 0;
    }

    .spec-label, .spec-value {
        font-size: 0.75rem;
    }

    .overlay-actions {
        padding: 0.6rem;
        margin: 0 -0.75rem -0.75rem;
        gap: 0.4rem;
    }

    .overlay-actions .btn {
        padding: 0.55rem 0.75rem;
        font-size: 0.8rem;
    }

    /* 应用标签优化 */
    .app-tag {
        font-size: 0.75rem;
        padding: 0.2rem 0.6rem;
    }

    /* 徽章优化 */
    .product-badge {
        font-size: 0.7rem;
        padding: 0.25rem 0.6rem;
    }
}

/* ========================================
   动画增强
   ======================================== */

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

.product-card {
    animation: slideInUp 0.6s ease forwards;
}

.product-card:nth-child(1) { animation-delay: 0.1s; }
.product-card:nth-child(2) { animation-delay: 0.2s; }
.product-card:nth-child(3) { animation-delay: 0.3s; }
.product-card:nth-child(4) { animation-delay: 0.4s; }
.product-card:nth-child(5) { animation-delay: 0.5s; }
.product-card:nth-child(6) { animation-delay: 0.6s; }

/* 卡片动画和加载状态 */

/* 产品筛选隐藏状态 - 使用class而非内联样式 */
.product-card.product-hidden {
    display: none !important;
    opacity: 0 !important;
}

/* 焦点状态（键盘导航支持） */
.product-card:focus-within {
    outline: 2px solid var(--primary-color);
    outline-offset: 4px;
}

.overlay-actions .btn:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

/* ========================================
   兼容旧版本样式
   ======================================== */

/* 保持与现有HTML结构兼容 */
.product-specs {
    display: none; /* 隐藏旧版本的specs，使用overlay中的tech-specs */
}

/* 旧版本的hover-content映射到新版本 */
.product-hover-overlay {
    /* 使用新版本的hover-overlay样式 */
}

.hover-content {
    /* 使用新版本的overlay-content样式 */
}

.hover-title {
    /* 使用新版本的overlay-title样式 */
}

.hover-desc {
    display: none; /* 新版本不显示描述在overlay中 */
}

.action-buttons {
    /* 使用新版本的overlay-actions样式 */
}

.btn-inquiry {
    /* 使用新版本的btn-primary样式 */
}

.btn-details {
    /* 使用新版本的btn-secondary样式 */
}