
:root {
    --card-bg: #ffffff;
    --primary-color: #4397fd; /* 主题色 */
    --text-main: #2c3e50;
    --text-muted: #95a5a6;
    --price-color: #ed3c2b;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* 容器使用 Grid 布局 */
.product-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    padding: 15px;
}

/* 卡片基础样式 */
.modern-product-card {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #f0f0f0;
    transition: var(--transition);
    height: 100%;
    position: relative;
}

.modern-product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}

/* 图片比例锁定 (1:1) */
.product-image-box {
    position: relative;
    width: 100%;
    padding-top: 100%; /* 保持正方形 */
    background: #f8f9fa;
    overflow: hidden;
}

.product-image-box img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; /* 裁剪填充，保证比例一致 */
    transition: var(--transition);
}

.modern-product-card:hover .product-image-box img {
    transform: scale(1.08);
}

/* 内容布局 */
.product-info {
    padding: 15px;
}

.product-title {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-main);
    margin: 0 0 10px 0;
    line-height: 1.4;
    height: 42px; /* 固定高度防止标题长短不一导致卡片错位 */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.price-wrapper {
    color: var(--price-color);
    font-weight: 700;
}

.main-price {
    font-size: 20px;
}

.currency-symbol {
    font-size: 14px;
    margin-right: 2px;
}

.sales-tag {
    font-size: 11px;
    background: #fff5f5;
    color: #ff4d4f;
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid #ffccc7;
}

/* 移动端适配 */
@media (max-width: 576px) {
    .product-grid-container {
        grid-template-columns: repeat(2, 1fr); /* 手机端双列 */
        gap: 10px;
        padding: 10px;
    }
    .product-title {
        font-size: 13px;
    }
    .main-price {
        font-size: 17px;
    }
}
