/* home.css - 首页特定样式 */

/* 英雄区域 */
.hero-section {
    background: linear-gradient(135deg, #0066cc 0%, #00A859 100%);
    background-size: cover;
    background-position: center;
    color: white;
    padding: 100px 0;
    text-align: center;
}

.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: 20px;
}

.hero-content .lead {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.hero-content .sub-lead {
    font-size: 1.2rem;
    margin-bottom: 30px;
    opacity: 0.9;
}

/* ==================== 产品区域样式优化 ==================== */

/* 产品区域整体 */
.products-section {
    padding-top: 2rem; /* 减少顶部内边距 */
    padding-bottom: 3rem; /* 减少底部内边距 */
}

/* 产品标题优化 */
.products-section h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 0.75rem; /* 减少底部边距 */
    position: relative;
}

.products-section h2::after {
    content: '';
    position: absolute;
    bottom: -0.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(135deg, #0066cc 0%, #00A859 100%);
    border-radius: 2px;
}

.products-section .lead {
    font-size: 1.1rem;
    color: #6c757d;
    margin-bottom: 1.5rem; /* 减少底部边距 */
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* 产品容器布局优化 */
#products-container {
    margin-top: 1.5rem; /* 减少顶部边距 */
}

#products-container .row {
    margin-left: -10px;
    margin-right: -10px;
}

#products-container .col {
    padding-left: 10px;
    padding-right: 10px;
    margin-bottom: 20px;
}

/* 产品卡片主样式 */
.product-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 10px; /* 使用原设计中的10px */
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    height: 100%; /* 确保卡片填满容器高度 */
}

.product-card:hover {
    transform: translateY(-5px); /* 保持原设计的大幅度上移效果 */
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
    border-color: #0066cc;
}

/* 产品图片区域 */
.product-image {
    position: relative;
    height: 180px; /* 保持原设计的200px高度 */
    overflow: hidden;
    background: #f8f9fa;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.08); /* 保持原设计的放大效果 */
}

.product-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: linear-gradient(135deg, #ff6b6b, #ff8e8e);
    color: white;
    padding: 3px 8px;
    border-radius: 15px;
    font-size: 0.7rem;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    z-index: 2; /* 确保徽章在图片上方 */
}

/* 产品信息区域 */
.product-info {
    padding: 1rem !important;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-title {
    font-size: 1rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0.5rem;
    line-height: 1.4;
    height: 2.8em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-description {
    font-size: 0.85rem;
    color: #718096;
    line-height: 1.4;
    margin-bottom: 0.75rem;
    flex-grow: 1;
    height: 4.2em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    /* autoprefixer: ignore next */
    -webkit-box-orient: vertical;
}

/* 产品底部操作区域 */
.product-info > .d-flex {
    margin-top: auto;
    padding-top: 0.75rem;
    border-top: 1px solid #edf2f7;
}

.product-info .badge {
    background: #edf2f7;
    color: #4a5568;
    font-size: 0.7rem;
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    border-radius: 15px;
}

.product-info .btn-outline-primary {
    border-color: #0066cc;
    color: #0066cc;
    font-size: 0.85rem;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    transition: all 0.3s ease;
}

.product-info .btn-outline-primary:hover {
    background: #0066cc;
    color: white;
    transform: translateY(-1px);
}

/* 市场卡片 */
.market-card {
    padding: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.market-card:hover {
    transform: translateY(-5px);
}

/* 优势项 */
.advantage-item {
    padding: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    margin-bottom: 20px;
}

/* 新闻卡片 */
.news-card {
    transition: transform 0.3s ease;
    border-radius: 10px;
    overflow: hidden;
}

.news-card:hover {
    transform: translateY(-5px);
}

.news-card img {
    height: 200px;
    object-fit: cover;
    width: 100%;
}

/* ==================== 响应式调整 ==================== */

@media (max-width: 1200px) {
    .product-image {
        height: 180px;
    }
    
    .product-title {
        font-size: 1.05rem;
    }
}

@media (max-width: 992px) {
    .product-image {
        height: 160px;
    }
    
    .product-info {
        padding: 1rem !important;
    }
    
    .hero-content h1 {
        font-size: 3rem;
    }
    
    .hero-content .lead {
        font-size: 1.3rem;
    }
}

@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 2.5rem;
    }
    
    .hero-content .lead {
        font-size: 1.2rem;
    }
    
    .hero-content .sub-lead {
        font-size: 1rem;
    }
    
    .product-image {
        height: 180px;
    }
    
    #products-container .col {
        margin-bottom: 24px;
    }
    
    /* 在手机屏幕上，产品卡片可能需要更紧凑 */
    .product-card {
        border-radius: 8px;
    }
    
    .product-info {
        padding: 0.875rem !important;
    }
}

@media (max-width: 576px) {
    .product-image {
        height: 160px;
    }
    
    .product-title {
        font-size: 1rem;
        height: 2.8em;
    }
    
    .product-description {
        font-size: 0.8125rem;
        height: 4em;
    }
    
    .hero-section {
        padding: 80px 0;
    }
    
    .hero-content h1 {
        font-size: 2.2rem;
    }
}

/* ==================== 产品类别筛选样式 ==================== */

.product-categories-filter {
    margin: 1rem 0 1.5rem;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

.product-categories-filter .btn {
    border-radius: 20px;
    padding: 0.5rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border-width: 2px;
    margin: 0.25rem;
}

.product-categories-filter .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.product-categories-filter .btn.active {
    background: linear-gradient(135deg, #0066cc 0%, #00A859 100%);
    color: white;
    border-color: #0066cc;
    box-shadow: 0 4px 8px rgba(0, 102, 204, 0.2);
}

/* 空状态提示 */
.no-products-message {
    text-align: center;
    padding: 2rem 1rem;
    background: #f8f9fa;
    border-radius: 10px;
    margin: 1.5rem 0;
}

.no-products-message i {
    font-size: 2.5rem;
    color: #6c757d;
    margin-bottom: 1.1rem;
}

.no-products-message h5 {
    color: #495057;
    margin-bottom: 0.9rem;
}

.no-products-message p {
    color: #6c757d;
}

/* 响应式调整 */
@media (max-width: 992px) {
    .products-section {
        padding-top: 1.5rem;
        padding-bottom: 2rem;
    }
    
    .products-section h2 {
        font-size: 2rem;
    }
    
    .products-section .lead {
        font-size: 1rem;
        margin-bottom: 1.25rem;
    }
    
    .product-categories-filter {
        margin: 0.75rem 0 1.25rem;
        padding: 0.5rem;
    }
    
    .product-categories-filter .btn {
        padding: 0.375rem 1rem;
        font-size: 0.85rem;
        margin: 0.2rem;
    }
    
    .product-image {
        height: 140px;
    }
    
    #products-container {
        margin-top: 1.25rem;
    }
}

@media (max-width: 768px) {
    .products-section h2 {
        font-size: 1.8rem;
    }
    
    .products-section .lead {
        font-size: 0.95rem;
        margin-bottom: 1rem;
    }
    
    .product-categories-filter {
        margin: 0.5rem 0 1rem;
    }
    
    .product-categories-filter .btn {
        padding: 0.375rem 0.875rem;
        font-size: 0.8rem;
        margin: 0.15rem;
    }
    
    .product-image {
        height: 150px;
    }
    
    .product-info {
        padding: 0.875rem !important;
    }
    
    #products-container .col {
        margin-bottom: 15px;
    }
}

@media (max-width: 576px) {
    .products-section h2 {
        font-size: 1.6rem;
    }
    
    .products-section .lead {
        font-size: 0.9rem;
        margin-bottom: 0.75rem;
    }
    
    .product-categories-filter {
        margin: 0.5rem 0;
        padding: 0.5rem;
    }
    
    .product-categories-filter .btn {
        padding: 0.25rem 0.75rem;
        font-size: 0.75rem;
        margin: 0.1rem;
    }
    
    .product-image {
        height: 130px;
    }
    
    .product-title {
        font-size: 0.95rem;
        height: 2.6em;
    }
    
    .product-description {
        font-size: 0.8rem;
        height: 3.8em;
    }
    
    .no-products-message {
        padding: 1.5rem 1rem;
        margin: 1rem 0;
    }
    
    .no-products-message i {
        font-size: 2rem;
    }
}