/* 搜索页面样式 */

/* 搜索头部 */
.search-header {
    margin-top: 0;
    z-index: 100;
    background: #fff;
    border-bottom: 1px solid #eee;
    padding: 10px 15px;
}

.search-bar {
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-input-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    background: #f5f5f5;
    border-radius: 20px;
    padding: 0 15px;
}

.search-icon {
    width: 16px;
    height: 16px;
    margin-right: 8px;
    flex-shrink: 0;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E") center / 16px 16px no-repeat;
}

.sort-item {
    display: inline-block;
    margin-right: 16px;
    font-size: 13px;
    color: #666;
    padding: 4px 0;
}
.sort-item.active {
    color: #f37021;
    font-weight: 600;
    position: relative;
}
.sort-item.active::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -2px;
    height: 2px;
    background: #f37021;
    border-radius: 1px;
}
.search-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 10px 0;
    font-size: 14px;
    outline: none;
}

.sort-bar {
    background: #fff;
    margin: 0;
    border-bottom: 1px solid #f3f3f3;
}

.coupon-filter-bar {
    margin: 0;
}

.coupon-filter-inner {
    padding: 10px 12px;
    background: #fff5f0;
    border: 1px solid #ffe1d6;
    border-radius: 10px;
    color: #f37021;
    font-size: 13px;
}

.coupon-filter-inner span {
    color: #999;
    margin-left: 4px;
}

.clear-btn {
    background: none;
    border: none;
    font-size: 18px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-btn {
    background: #f37021;
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 10px 20px;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
}

/* 搜索内容 */
.search-content {
    padding: 15px;
    padding-bottom: 80px;
}

/* 搜索区块 */
.search-section {
    margin-bottom: 25px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.clear-history-btn {
    background: none;
    border: none;
    color: #999;
    font-size: 14px;
    cursor: pointer;
}

/* 搜索标签 */
.search-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.search-tag {
    background: #f5f5f5;
    color: #666;
    padding: 8px 15px;
    border-radius: 15px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-tag:hover {
    background: #f37021;
    color: #fff;
}

/* 推荐商品 */
.recommend-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.recommend-item {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.3s ease;
}

.recommend-item:hover {
    transform: translateY(-2px);
}

.recommend-image {
    width: 100%;
    height: 120px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.recommend-info {
    padding: 10px;
}

.recommend-name {
    font-size: 14px;
    color: #333;
    margin-bottom: 5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.recommend-price {
    margin-bottom: 5px;
}

.current-price {
    color: #f37021;
    font-size: 16px;
    font-weight: 600;
}

.original-price {
    color: #999;
    font-size: 12px;
    text-decoration: line-through;
    margin-left: 5px;
}

.recommend-sales {
    color: #999;
    font-size: 12px;
}

/* 搜索结果 */
.search-results {
    margin-top: 20px;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    background: #fff;
    border-radius: 8px;
    margin-bottom: 15px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.filter-item {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-right: 1px solid #eee;
}

.filter-item:last-child {
    border-right: none;
}

.filter-item.active {
    background: #f37021;
    color: #fff;
}

.filter-text {
    font-size: 14px;
}

.sort-icon {
    margin-left: 5px;
    font-size: 12px;
}

/* 结果列表 */
.results-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.result-item {
    display: flex;
    background: #fff;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.3s ease;
}

.result-item:hover {
    transform: translateY(-2px);
}

.result-image {
    width: 80px;
    height: 80px;
    border-radius: 6px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    margin-right: 15px;
    flex-shrink: 0;
}

.result-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.result-name {
    font-size: 16px;
    color: #333;
    font-weight: 500;
    margin-bottom: 5px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.result-brand {
    color: #666;
    font-size: 14px;
    margin-bottom: 3px;
}

.result-category {
    color: #999;
    font-size: 12px;
    margin-bottom: 8px;
}

.result-price {
    margin-bottom: 5px;
}

.result-sales {
    color: #999;
    font-size: 12px;
}

/* 无结果 */
.no-results {
    text-align: center;
    padding: 60px 20px;
}

.no-results-icon {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

.no-results-text {
    font-size: 16px;
    color: #666;
    margin-bottom: 8px;
}

.no-results-tips {
    font-size: 14px;
    color: #999;
}

/* 加载更多 */
.load-more {
    text-align: center;
    padding: 20px;
    cursor: pointer;
}

.load-more-text {
    color: #666;
    font-size: 14px;
}

.load-more.loading .load-more-text {
    color: #999;
}

/* 响应式设计 */
@media (max-width: 480px) {
    .search-content {
        padding: 10px;
    }
    
    .recommend-list {
        grid-template-columns: 1fr;
    }
    
    .result-item {
        padding: 12px;
    }
    
    .result-image {
        width: 70px;
        height: 70px;
        margin-right: 12px;
    }
}

/* 底部导航 */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid #eee;
    display: flex;
    z-index: 100;
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 0;
    text-decoration: none;
    color: #666;
    position: relative;
}

.nav-icon {
    font-size: 20px;
    margin-bottom: 4px;
}

.nav-text {
    font-size: 12px;
}

.nav-badge {
    position: absolute;
    top: 5px;
    right: 50%;
    transform: translateX(50%);
    background: #f37021;
    color: #fff;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 16px;
    text-align: center;
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-item {
    animation: fadeIn 0.3s ease;
}

/* 加载状态 */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* 搜索建议 */
.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #eee;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 101;
}

.suggestion-item {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f5f5f5;
    font-size: 14px;
    color: #333;
}

.suggestion-item:hover {
    background: #f5f5f5;
}

.suggestion-item:last-child {
    border-bottom: none;
} 