<template>
	<view class="search-entry-wrap">
		<view class="search-entry" @click="onTap">
			<view class="search-entry__icon">
				<u-icon name="search" color="#2e7d32" size="20" />
			</view>
			<text class="search-entry__placeholder">搜索兽药、饲料、店铺</text>
			<view class="search-entry__btn">
				<text>搜索</text>
			</view>
		</view>
	</view>
</template>

<script setup>
import { goSearchInput } from '@/utils/searchNav'

function onTap() {
	goSearchInput()
}
</script>

<style lang="scss" scoped>
.search-entry-wrap {
	padding: 16rpx 24rpx;
	background: #e8f5e9;
}

.search-entry {
	display: flex;
	align-items: center;
	height: 76rpx;
	padding: 0 8rpx 0 20rpx;
	background: #f5faf6;
	border: 2rpx solid #a5d6a7;
	border-radius: 40rpx;
	box-shadow: 0 4rpx 16rpx rgba(46, 125, 50, 0.08);
}

.search-entry__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48rpx;
	height: 48rpx;
	margin-right: 12rpx;
	background: rgba(46, 125, 50, 0.1);
	border-radius: 50%;
	flex-shrink: 0;
}

.search-entry__placeholder {
	flex: 1;
	font-size: 28rpx;
	color: #999;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.search-entry__btn {
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	height: 60rpx;
	padding: 0 28rpx;
	margin-left: 12rpx;
	background: linear-gradient(135deg, #43a047 0%, #2e7d32 100%);
	border-radius: 30rpx;
}

.search-entry__btn text {
	font-size: 26rpx;
	color: #fff;
	font-weight: 500;
	letter-spacing: 2rpx;
}
</style>
