/* 产品卡片（2026-11-27 从 products.html 的内联样式里抽出来）
 *
 * 谁在用：/products 页（build_static_lists.js 生成）与四个品类页（build_category_pages.js
 * 生成）。两边必须是同一套尺寸与外观，所以样式只留这一份。
 *
 * 网格：.seo-card-grid 是 flex 容器，卡片按 25% 一行四张；≤1024 三列、≤768 两列、≤480 一列。
 * 注意卡片宽度是父容器的百分比，所以「父容器内宽」决定卡片实际宽度——这也是为什么
 * /products 与品类页的容器内宽要对齐。
 */
.seo-card-grid {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: flex-start;
}

.image-card {
    width: calc(25% - 15px);
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
}

.image-card:hover {
    transform: translateY(-5px);
}

.image-container {
    aspect-ratio: 100 / 66;
    overflow: hidden;
}

/* 图片外面还包着一层链接（.image-link）。那层高度是 auto 时，img 的 height:100%
   落不到容器上，宽图的可见高度只有方框的五六成，下面空出一条，各图比例不同还会
   显得大小不一。让这一层撑满容器，图片才真正填满方框。 */
.image-container > * {
    display: block;
    height: 100%;
}

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

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

/* 产品卡现在是真链接：锚点只负责跳转，不改变卡片外观 */
.image-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.title-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.image-card:hover .title-link {
    text-decoration: underline;
}

.title {
    padding: 8px 10px 4px;
    text-align: center;
    color: #333;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.image-info {
    padding: 0 10px 6px;
    text-align: center;
    color: #666;
    font-size: 12px;
}

.image-info:empty {
    display: none;
}

.price,
.size {
    margin-top: 5px;
}

@media (max-width: 1024px) {
    .image-card {
        width: calc(33.333% - 14px);
    }
}

@media (max-width: 768px) {
    .image-card {
        width: calc(50% - 10px);
    }
}

@media (max-width: 480px) {
    .image-card {
        width: 100%;
    }
}
