/* 金达保健品商城 - 前台样式 */

:root {
    --primary: #f3a2cc;
    --primary-dark: #e83e8c;
    --primary-light: #fce4f0;
    --secondary: #ff7eb3;
    --bg: #f8f9fa;
    --card-bg: #ffffff;
    --text: #2d3436;
    --text-light: #636e72;
    --border: #e9ecef;
    --radius-sm: 10px;
    --radius: 16px;
    --shadow: 0 4px 20px rgba(0,0,0,0.06);
    --shadow-lg: 0 12px 40px rgba(243, 162, 204, 0.2);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.6;
}

/* ===== 导航栏 ===== */
.navbar {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #fff;
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}
.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo {
    font-size: 22px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.nav-links {
    display: flex;
    gap: 24px;
}
.nav-links a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: color 0.3s;
}
.nav-links a:hover {
    color: var(--primary);
}
.nav-user {
    display: flex;
    align-items: center;
    gap: 8px;
}
.nav-user .btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

/* ===== 容器 ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

/* ===== Banner ===== */
.banner {
    background: linear-gradient(135deg, var(--primary-light) 0%, #fff 50%, var(--primary-light) 100%);
    padding: 60px 40px;
    text-align: center;
    border-radius: var(--radius);
    margin-bottom: 32px;
    box-shadow: var(--shadow);
}
.banner h1 {
    font-size: 42px;
    margin-bottom: 16px;
    background: linear-gradient(135deg, var(--primary-dark), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
}
.banner p {
    font-size: 18px;
    color: var(--text-light);
    margin-bottom: 24px;
}

/* ===== 按钮 ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: 50px;
    border: none;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    box-shadow: 0 4px 16px rgba(243, 162, 204, 0.4);
}
.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}
.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary-dark);
    box-shadow: none;
}
.btn-outline:hover {
    background: var(--primary-light);
}
.btn-sm {
    padding: 10px 20px;
    font-size: 13px;
    border-radius: var(--radius-sm);
}

/* ===== 搜索框 ===== */
.search-box {
    max-width: 600px;
    margin: 24px auto;
    display: flex;
    gap: 12px;
    padding: 0 20px;
}
.search-box input {
    flex: 1;
    padding: 14px 24px;
    border: 2px solid var(--primary-light);
    border-radius: 50px;
    font-size: 15px;
    outline: none;
    transition: all 0.3s;
    background: #fff;
}
.search-box input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(243, 162, 204, 0.1);
}

/* ===== 分类滚动 ===== */
.category-scroll {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding: 16px 0;
    margin-bottom: 32px;
    scrollbar-width: none;
}
.category-scroll::-webkit-scrollbar { display: none; }

.category-item {
    flex-shrink: 0;
    text-align: center;
    padding: 20px 28px;
    background: white;
    border-radius: var(--radius);
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    cursor: pointer;
    transition: all 0.3s;
    min-width: 120px;
}
.category-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}
.category-icon {
    font-size: 40px;
    margin-bottom: 10px;
}

/* ===== 区块标题 ===== */
.section-title {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 24px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
}
.section-title::before {
    content: '';
    width: 4px;
    height: 24px;
    background: linear-gradient(180deg, var(--primary), var(--secondary));
    border-radius: 2px;
}

/* ===== 商品网格 ===== */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
}

.product-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s;
    cursor: pointer;
}
.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}
.product-img {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, var(--primary-light), #fff5f8);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.product-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.product-info {
    padding: 20px;
}
.product-name {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text);
    line-height: 1.4;
}
.product-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.product-price {
    font-size: 20px;
    font-weight: 800;
    color: var(--primary-dark);
}
.product-price .original {
    font-size: 14px;
    color: #b2bec3;
    text-decoration: line-through;
    margin-left: 8px;
    font-weight: 500;
}
.product-sales {
    font-size: 13px;
    color: var(--text-light);
}

/* ===== 空状态 ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
    grid-column: 1 / -1;
}
.empty-state .icon {
    font-size: 64px;
    margin-bottom: 16px;
}
.empty-state p {
    font-size: 16px;
}

/* ===== 动画 ===== */
.animate-in {
    animation: fadeIn 0.6s ease;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .nav-container { padding: 12px 16px; }
    .nav-links { gap: 16px; }
    .nav-links a { font-size: 14px; }
    .banner { padding: 40px 20px; }
    .banner h1 { font-size: 28px; }
    .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; }
    .product-img { height: 160px; }
}


/* ===== 手机端精细优化 ===== */
@media (max-width: 768px) {
    .nav-container { 
        padding: 12px 16px; 
        flex-wrap: wrap;
    }
    .logo { font-size: 18px; }
    .nav-links { 
        gap: 12px; 
        width: 100%;
        justify-content: center;
        margin-top: 8px;
    }
    .nav-links a { font-size: 13px; }
    .nav-user { 
        width: 100%;
        justify-content: center;
        margin-top: 8px;
    }

    .banner { 
        padding: 30px 16px; 
        margin-bottom: 20px;
    }
    .banner h1 { font-size: 24px; }
    .banner p { font-size: 14px; }
    .banner .btn {
        padding: 10px 20px;
        font-size: 13px;
    }

    .search-box {
        padding: 0 12px;
    }
    .search-box input {
        padding: 10px 16px;
        font-size: 14px;
    }
    .search-box .btn {
        padding: 10px 16px;
    }

    .category-scroll {
        gap: 12px;
        padding: 10px 12px;
    }
    .category-item {
        padding: 12px 16px;
        min-width: 90px;
    }
    .category-icon {
        font-size: 32px;
    }

    .section-title {
        font-size: 18px;
        padding: 0 12px;
    }

    .grid { 
        grid-template-columns: repeat(2, 1fr); 
        gap: 12px; 
        padding: 0 12px;
    }
    .product-card {
        border-radius: 12px;
    }
    .product-img { 
        height: 140px; 
    }
    .product-info {
        padding: 12px;
    }
    .product-name {
        font-size: 14px;
    }
    .product-price {
        font-size: 16px;
    }
}

/* 超小屏幕 */
@media (max-width: 375px) {
    .grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    .product-img {
        height: 120px;
    }
}