/* --- 基础重置 --- */
:root {
    --primary-color: #1a1a1a;
    --text-color: #333;
    --text-light: #888;
    --border-color: #eaeaea;
    --bg-color: #fff;
    --hover-bg: #f9f9f9;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--text-color);
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
}

/* --- 导航头 --- */
.site-header {
    border-bottom: 1px solid var(--border-color);
    padding: 20px 0;
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.95);
    z-index: 100;
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 2px;
}

nav a {
    text-decoration: none;
    color: var(--text-light);
    margin-left: 30px;
    font-size: 14px;
    transition: color 0.2s;
}

nav a:hover, nav a.active {
    color: var(--primary-color);
    font-weight: 500;
}

/* --- 主体内容 --- */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px 80px 20px;
}

.page-title {
    text-align: center;
    margin-bottom: 50px;
}

.page-title h1 {
    font-size: 32px;
    font-weight: 400;
    margin: 0 0 10px 0;
    letter-spacing: 1px;
}

.page-title p {
    color: var(--text-light);
    font-size: 14px;
    margin: 0;
}

/* --- 商品网格 (自适应 CSS Grid) --- */
.product-grid {
    display: grid;
    /* 核心响应式逻辑：最小宽度240px，自动填充剩余空间 */
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 40px 20px;
    margin-bottom: 60px;
}

/* --- 商品卡片 --- */
.product-card {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: transform 0.3s ease;
}

.product-card:hover {
    transform: translateY(-5px);
}

.image-wrapper {
    width: 100%;
    aspect-ratio: 3 / 4; /* 保持服装类经典的3:4比例 */
    background-color: #f5f5f5;
    overflow: hidden;
    margin-bottom: 15px;
    position: relative;
}

.image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.product-card:hover .image-wrapper img {
    transform: scale(1.05); /* 悬停图片轻微放大 */
}

.product-info {
    text-align: center;
}

.title {
    font-size: 15px;
    font-weight: 400;
    margin: 0 0 5px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sku {
    font-size: 12px;
    color: var(--text-light);
    margin: 0 0 10px 0;
}

.price {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-color);
}

/* --- 移动端适配：强制显示为2列 --- */
@media (max-width: 600px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px 10px;
    }

    .image-wrapper {
        margin-bottom: 10px;
    }

    .title {
        font-size: 13px;
    }

    .price {
        font-size: 14px;
    }
}

/* --- 分页控件 --- */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 60px;
    border-top: 1px solid var(--border-color);
    padding-top: 40px;
}

.page-numbers {
    display: flex;
    gap: 5px;
}

.page-btn {
    text-decoration: none;
    color: var(--text-color);
    padding: 8px 16px;
    border: 1px solid transparent;
    font-size: 14px;
    transition: all 0.2s;
    border-radius: 2px;
}

.page-btn:hover:not(.disabled) {
    background-color: var(--hover-bg);
    border-color: var(--border-color);
}

.page-btn.active {
    background-color: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

.page-btn.disabled {
    color: #ccc;
    cursor: not-allowed;
}