/**
 * 首页 AJAX 加载区域样式
 * NEW PRODUCTS 和 NEWS CENTER
 * 参考: https://www.hbfeiao.com/
 */

/* ===== Products Grid ===== */
.products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    margin-top: 40px;
}

/* Product Card */
.product-card {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.product-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transform: translateY(-5px);
}

.product-card a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.product-image {
    position: relative;
    width: 100%;
    height: 260px;
    overflow: hidden;
    background: #f8f8f8;
}

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

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

.product-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(227, 30, 36, 0.9);
    color: #fff;
    padding: 12px;
    text-align: center;
    opacity: 0;
    transform: translateY(100%);
    transition: all 0.3s ease;
}

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

.view-details {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.product-title {
    font-size: 16px;
    font-weight: 500;
    padding: 15px;
    margin: 0;
    color: #333;
    line-height: 1.4;
    min-height: 60px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 65px;
    margin-bottom: 5px;
}

.product-card:hover .product-title {
    color: #E31E24;
}

/* ===== News Grid ===== */
.news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-top: 40px;
}

/* News Card */
.news-card {
    background: #fff;
    border-radius: 4px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.news-card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    transform: translateY(-5px);
}

.news-card a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.news-image {
    position: relative;
    width: 100%;
    height: 240px;
    overflow: hidden;
    background: #f8f8f8;
}

.news-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.news-card:hover .news-image img {
    transform: scale(1.1);
}

.news-date {
    position: absolute;
    top: 15px;
    left: 15px;
    background: #C41E3A;
    color: #fff;
    padding: 8px 15px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.news-content {
    padding: 20px;
}

.news-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0 0 12px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 50px;
}

.news-card:hover .news-title {
    color: #C41E3A;
}

.news-summary {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    margin: 0 0 15px 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.read-more {
    display: inline-block;
    color: #C41E3A;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.news-card:hover .read-more {
    transform: translateX(5px);
}

/* ===== Loading Spinner ===== */
.loading-spinner {
    text-align: center;
    padding: 60px 20px;
    color: #999;
    font-size: 16px;
    grid-column: 1 / -1;
}

.loading-spinner::before {
    content: "";
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #E31E24;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
    vertical-align: middle;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== Responsive Design ===== */

/* Tablet */
@media (max-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 25px;
    }
    
    .news-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .news-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .product-image,
    .news-image {
        height: 200px;
    }
    
    .product-title {
        font-size: 14px;
        padding: 12px;
        min-height: 50px;
    }
    
    .news-title {
        font-size: 16px;
    }
    
    .news-summary {
        font-size: 13px;
    }
    
    .news-content {
        padding: 15px;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .product-image,
    .news-image {
        height: 220px;
    }
}

/* ===== Section Enhancements ===== */
.section-header {
    text-align: center;
    margin-bottom: 20px;
}

.section-header h2 {
    font-size: 36px;
    font-weight: 700;
    color: #333;
    margin: 0 0 10px 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.section-header p {
    font-size: 16px;
    color: #666;
    margin: 0;
}

/* Button Styles */
.btn {
    display: inline-block;
    padding: 12px 30px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 3px;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.btn-primary {
    background: #E31E24;
    color: #fff;
    border-color: #E31E24;
}

.btn-primary:hover {
    background: #b71820;
    border-color: #b71820;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(227, 30, 36, 0.3);
}

.btn-secondary {
    background: #fff;
    color: #E31E24;
    border-color: #fff;
}

.btn-secondary:hover {
    background: transparent;
    color: #fff;
    border-color: #fff;
}
