/* ============================================
   首页样式
   ============================================ */

.home-page {
    background: #f5f5f5;
}

/* 轮播图 */
.banner {
    position: relative;
    height: 180px;
    overflow: hidden;
}

.banner-list {
    display: flex;
    transition: transform 0.3s;
    height: 100%;
}

.banner-item {
    min-width: 100%;
    height: 100%;
}

.banner-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.banner-dots {
    position: absolute;
    bottom: 10px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 6px;
}

.banner-dot {
    width: 6px;
    height: 6px;
    border-radius: 3px;
    background: rgba(255,255,255,0.5);
    transition: all 0.3s;
}

.banner-dot.active {
    width: 16px;
    background: #fff;
}

/* 分类入口 */
.category-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    padding: 15px;
    background: #fff;
    margin-bottom: 10px;
}

.category-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.category-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #f0f9f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.category-name {
    font-size: 12px;
    color: #666;
}

/* 商品列表 */
.section-title {
    padding: 15px 15px 10px;
    font-size: 16px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.section-title::before {
    content: '';
    width: 4px;
    height: 16px;
    background: #07c160;
    border-radius: 2px;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 0 10px 10px;
}

.product-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
}

.product-card-image {
    width: 100%;
    height: 160px;
    object-fit: cover;
    background: #f5f5f5;
}

.product-card-info {
    padding: 10px;
}

.product-card-name {
    font-size: 14px;
    color: #333;
    line-height: 1.4;
    height: 40px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin-bottom: 8px;
}

.product-card-price-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.product-card-price {
    color: #ff4d4f;
    font-size: 16px;
    font-weight: bold;
}

.product-card-original {
    color: #999;
    font-size: 12px;
    text-decoration: line-through;
}

.product-card-sales {
    color: #999;
    font-size: 11px;
    margin-top: 4px;
}

/* 分类页面 */
.category-page {
    padding-bottom: 56px;
}

.category-container {
    display: flex;
    height: calc(100vh - 100px);
    background: #f5f5f5;
}

.category-sidebar {
    width: 90px;
    background: #f8f8f8;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.category-sidebar-item {
    padding: 15px 10px;
    font-size: 13px;
    color: #333;
    text-align: center;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: all 0.2s;
}

.category-sidebar-item.active {
    background: #fff;
    color: #07c160;
    font-weight: 500;
    border-left: 3px solid #07c160;
}

.category-content {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: #fff;
}

.category-title {
    padding: 12px 15px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    border-bottom: 1px solid #f0f0f0;
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 10;
}

.category-products-list {
    padding: 10px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

/* 子分类样式 */
.sub-category-scroll {
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
    padding: 10px;
}

.sub-category-list {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.sub-category-list.collapsed {
    max-height: 42px;
}

.sub-category-item {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 8px 0;
    font-size: 13px;
    color: #666;
    background: #f5f5f5;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.sub-category-item.active {
    background: #07c160;
    color: #fff;
}

.sub-category-toggle {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 6px 0 2px;
    cursor: pointer;
    color: #999;
    font-size: 12px;
    user-select: none;
}

.sub-category-toggle .toggle-arrow {
    display: inline-block;
    transition: transform 0.3s ease;
    font-size: 14px;
}

.sub-category-toggle .toggle-arrow.expanded {
    transform: rotate(180deg);
}

/* 推荐商品样式 */
.recommend-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0 10px;
}

.recommend-card {
    display: flex;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.recommend-image {
    width: 120px;
    height: 90px;
    object-fit: cover;
    flex-shrink: 0;
}

.recommend-info {
    flex: 1;
    padding: 10px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.recommend-title {
    font-size: 15px;
    font-weight: 500;
    color: #333;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.recommend-desc {
    font-size: 12px;
    color: #999;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.recommend-price {
    font-size: 16px;
    font-weight: 600;
    color: #ff4d4f;
}

/* 下拉刷新 */
.pull-refresh {
    position: relative;
    overflow: hidden;
}

.pull-refresh-content {
    transition: transform 0.3s ease;
}

/* 首页搜索结果 overlay */
.home-search-overlay {
    position: relative;
    background: #fff;
    border-bottom: 1px solid #eee;
    z-index: 20;
}

.home-search-header {
    padding: 10px 15px;
    font-size: 13px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.home-search-keyword {
    color: #07c160;
    font-weight: 500;
}

.home-search-status {
    color: #07c160;
    font-size: 12px;
}

.home-search-count {
    color: #999;
    font-size: 12px;
}

.home-search-body {
    padding: 0 10px 10px;
}

.home-search-loading {
    padding: 30px 0;
    text-align: center;
    font-size: 13px;
    color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.home-search-empty {
    padding: 40px 0;
    text-align: center;
}

.home-search-empty-icon {
    font-size: 40px;
    margin-bottom: 10px;
    display: block;
}

.home-search-empty-text {
    font-size: 13px;
    color: #999;
}
