/* HOANK Core – AJAX product search
   Colors are CSS variables so they can be changed in one place. */
.hk-search {
	--hk-s-bg: #f1f4f8;
	--hk-s-bg-focus: #ffffff;
	--hk-s-text: #14213d;
	--hk-s-muted: #5b6b82;
	--hk-s-border: #dde3ea;
	--hk-s-accent: #1f84c9;
	--hk-s-accent-dark: #0c2340;
	--hk-s-hover: #eaf3fb;
	--hk-s-height: 44px;
	position: relative;
	width: 100%;
	max-width: 680px;
	font-family: inherit;
}

.hk-search .screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden; clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* Pill */
.hk-search__form {
	display: flex;
	align-items: center;
	height: var(--hk-s-height);
	padding: 4px;
	margin: 0;
	background: var(--hk-s-bg);
	border-radius: 999px;
	transition: background-color .2s ease, box-shadow .2s ease;
}
.hk-search__form:focus-within {
	background: var(--hk-s-bg-focus);
	box-shadow: 0 0 0 2px rgba(31, 132, 201, .3);
}

/* Category dropdown ("All") */
.hk-search .hk-search__cat {
	flex: 0 0 auto;
	width: auto;
	max-width: 190px;
	height: 28px !important;
	min-height: 0 !important;
	margin: 0 !important;
	padding: 0 28px 0 16px !important;
	border: 0 !important;
	border-right: 1px solid var(--hk-s-border) !important;
	border-radius: 0 !important;
	background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235b6b82' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center !important;
	box-shadow: none !important;
	color: var(--hk-s-text) !important;
	font-size: 14px !important;
	font-weight: 600 !important;
	line-height: 28px !important;
	text-overflow: ellipsis;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}
.hk-search .hk-search__cat:focus-visible {
	outline: 2px solid var(--hk-s-accent);
	outline-offset: 2px;
	border-radius: 6px !important;
}

/* Text field */
.hk-search .hk-search__input {
	flex: 1 1 auto;
	min-width: 0;
	height: 100% !important;
	min-height: 0 !important;
	margin: 0 !important;
	padding: 0 14px !important;
	border: 0 !important;
	border-radius: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
	color: var(--hk-s-text) !important;
	font-size: 14px !important;
	line-height: normal !important;
	outline: none !important;
}
.hk-search .hk-search__input::placeholder { color: #8a97a8; opacity: 1; }
.hk-search .hk-search__input::-webkit-search-cancel-button { -webkit-appearance: none; }

/* Round button (overrides theme button styles) */
.hk-search .hk-search__btn {
	flex: 0 0 36px;
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	width: 36px !important;
	height: 36px !important;
	min-width: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 50% !important;
	background: var(--hk-s-accent) !important;
	box-shadow: none !important;
	color: #fff !important;
	line-height: 1 !important;
	transform: none !important;
	cursor: pointer;
	transition: background-color .2s ease;
}
.hk-search .hk-search__btn svg { display: block; width: 16px; height: 16px; flex: none; }
.hk-search .hk-search__btn:hover,
.hk-search .hk-search__btn:focus-visible { background: var(--hk-s-accent-dark) !important; }
.hk-search.is-loading .hk-search__btn svg { animation: hk-search-pulse .8s ease-in-out infinite alternate; }
@keyframes hk-search-pulse { to { opacity: .4; } }

/* Results panel */
.hk-search__results {
	position: absolute;
	top: calc(100% + 8px);
	left: 0;
	right: 0;
	z-index: 1000;
	max-height: min(70vh, 460px);
	overflow-y: auto;
	background: #fff;
	border: 1px solid var(--hk-s-border);
	border-radius: 14px;
	box-shadow: 0 6px 18px rgba(12, 35, 64, .08);
	text-align: left;
}
.hk-search__list { list-style: none; margin: 0; padding: 6px; }
.hk-search__list li { margin: 0; padding: 0; }
.hk-search__item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 8px 10px;
	border-radius: 10px;
	color: var(--hk-s-text) !important;
	text-decoration: none !important;
}
.hk-search__item:hover,
.hk-search__item.is-active { background: var(--hk-s-hover); }
.hk-search__thumb {
	flex: 0 0 48px;
	width: 48px;
	height: 48px;
	border-radius: 8px;
	background: #f4f6f8;
	object-fit: contain;
}
.hk-search__meta { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.hk-search__item-cat { font-size: 11px; font-weight: 600; color: #1673b5; }
.hk-search__item-title {
	font-size: 14px;
	font-weight: 600;
	line-height: 1.35;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.hk-search__item-title mark { background: none; color: #1673b5; padding: 0; }
.hk-search__price { flex: 0 0 auto; font-size: 14px; font-weight: 700; color: var(--hk-s-accent-dark); white-space: nowrap; }
.hk-search__price del { color: var(--hk-s-muted); font-weight: 400; margin-right: 4px; }
.hk-search__price ins { text-decoration: none; }
.hk-search__empty { padding: 18px 16px; font-size: 14px; color: var(--hk-s-muted); }
.hk-search__all {
	display: block;
	padding: 12px 16px;
	border-top: 1px solid var(--hk-s-border);
	font-size: 14px;
	font-weight: 600;
	color: #1673b5 !important;
	text-decoration: none !important;
}
.hk-search__all:hover { background: var(--hk-s-hover); }
.hk-search__all span { color: var(--hk-s-muted); font-weight: 500; }

@media (max-width: 1024px) {
	.hk-search .hk-search__cat { max-width: 110px; }
}
@media (prefers-reduced-motion: reduce) {
	.hk-search__form, .hk-search__btn { transition: none; }
	.hk-search.is-loading .hk-search__btn svg { animation: none; }
}
