/* 首页样式 */

/* 搜索栏 */
.search-bar {
    background: var(--white);
    padding: 12px 16px;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border-color);
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    background: var(--secondary-color);
    border-radius: 20px;
    padding: 8px 16px;
}

.search-icon {
    width: 18px;
    height: 18px;
    color: var(--text-lighter);
    margin-right: 8px;
    flex-shrink: 0;
}

.search-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 14px;
    outline: none;
    color: var(--text-color);
}

.search-input::placeholder {
    color: var(--text-lighter);
}

/* 轮播图 */
.banner-slider {
    position: relative;
    overflow: hidden;
    background: var(--white);
}

.banner-wrapper {
    display: flex;
    transition: transform 0.5s ease;
}

.banner-item {
    min-width: 100%;
    position: relative;
}

.banner-item img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.banner-dots {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
}

.banner-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: all 0.3s;
}

.banner-dot.active {
    background: var(--white);
    width: 20px;
    border-radius: 4px;
}

/* 公告栏 */
.notice-bar {
    display: flex;
    align-items: center;
    background: #fff8e1;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-color);
}

.notice-icon {
    width: 20px;
    height: 20px;
    color: var(--warning);
    margin-right: 10px;
    flex-shrink: 0;
}

.notice-scroll-wrapper {
    flex: 1;
    overflow: hidden;
    position: relative;
    height: 20px;
}

.notice-scroll {
    position: absolute;
    white-space: nowrap;
    animation: scrollLeft 15s linear infinite;
    font-size: 13px;
    color: var(--text-light);
    line-height: 20px;
}

@keyframes scrollLeft {
    0% {
        transform: translateX(100%);
    }
    100% {
        transform: translateX(-100%);
    }
}

/* 商品分类 */
.category-section {
    background: var(--white);
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}

.category-list {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
}

.category-list::-webkit-scrollbar {
    display: none;
}

.category-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 16px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
    border: 1px solid transparent;
}

.category-item:hover {
    background: var(--secondary-color);
}

.category-item.active {
    background: rgba(74, 144, 217, 0.1);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.category-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--secondary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 6px;
    font-size: 18px;
}

.category-name {
    font-size: 12px;
    color: var(--text-light);
}

.category-item.active .category-name {
    color: var(--primary-color);
}

/* 商品区域 */
.goods-section {
    padding: 16px;
}

.goods-section .section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    font-size: 15px;
    font-weight: 600;
}

.filter-tag {
    font-size: 13px;
    color: var(--primary-color);
    background: rgba(74, 144, 217, 0.1);
    padding: 4px 12px;
    border-radius: 12px;
}

/* 商品网格 - 手机端一行两个 */
.goods-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

/* 商品属性标签 */
.goods-attributes {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}

.goods-attr-tag {
    font-size: 11px;
    color: var(--primary-color);
    background: rgba(74, 144, 217, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
}

/* 响应式 - PC端一行四个 */
@media (min-width: 768px) {
    .goods-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .banner-item img {
        height: 280px;
    }

    .category-list {
        justify-content: center;
    }
}

@media (min-width: 1024px) {
    .goods-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}
