/* HookLova search popup */
.mm-search-trigger {
	display: grid;
	place-items: center;
	width: 42px;
	height: 42px;
	border-radius: 50%;
	color: var(--mm-ink, #2b1b12);
	transition: background 0.15s, transform 0.15s;
}
.mm-search-trigger:hover { background: var(--mm-linen, #f7eddf); }
.mm-search-trigger:active { transform: scale(0.94); }

html.mm-search-open { overflow: hidden; }

.mm-search {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	justify-content: center;
	align-items: flex-start;
	padding: clamp(0.75rem, 3vh, 2rem) 1rem;
	font-family: var(--wp--preset--font-family--body, system-ui, sans-serif);
	color: var(--mm-ink, #2b1b12);
}
.mm-search[hidden] { display: none; }

.mm-search__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(43, 27, 18, 0.55);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	opacity: 0;
	transition: opacity 0.22s ease;
}
.mm-search__panel {
	position: relative;
	display: flex;
	flex-direction: column;
	width: min(920px, 100%);
	max-height: calc(100dvh - 2 * clamp(0.75rem, 3vh, 2rem));
	background: var(--mm-cream, #fffaf2);
	border-radius: 28px;
	box-shadow: 0 30px 80px -30px rgba(20, 10, 5, 0.65), 0 0 0 1px rgba(43, 27, 18, 0.06);
	overflow: hidden;
	opacity: 0;
	transform: translateY(-14px) scale(0.985);
	transition: opacity 0.22s ease, transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.mm-search.is-open .mm-search__backdrop { opacity: 1; }
.mm-search.is-open .mm-search__panel { opacity: 1; transform: none; }

/* ---------------------------------------------------- input bar */
.mm-search__form {
	position: relative;
	display: flex;
	align-items: center;
	gap: 0.6rem;
	padding: 1rem 1.25rem;
	border-bottom: 2px dashed var(--mm-oat, #e8d8c2);
	background: #fff;
	flex: none;
}
.mm-search__icon { color: var(--mm-accent, #b4501a); flex: none; }
.mm-search__input {
	flex: 1;
	min-width: 0;
	border: 0;
	background: transparent;
	font-family: var(--wp--preset--font-family--display, Georgia, serif);
	font-size: clamp(1.25rem, 2.6vw, 1.6rem);
	font-weight: 500;
	color: inherit;
	padding: 0.4rem 0;
	-webkit-appearance: none;
	appearance: none;
}
.mm-search__input::placeholder { color: var(--mm-bark, #76563f); opacity: 0.55; }
.mm-search__input:focus { outline: none; }
.mm-search__input::-webkit-search-cancel-button,
.mm-search__input::-webkit-search-decoration { -webkit-appearance: none; }
.mm-search__form:focus-within { box-shadow: inset 0 -3px 0 var(--mm-honey, #f4b860); }

.mm-search__clear,
.mm-search__close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.35rem;
	border: 0;
	cursor: pointer;
	font: inherit;
	color: var(--mm-ink, #2b1b12);
	flex: none;
}
.mm-search__clear {
	width: 30px;
	height: 30px;
	border-radius: 50%;
	background: var(--mm-linen, #f7eddf);
}
.mm-search__clear[hidden] { display: none; }
.mm-search__close {
	height: 36px;
	padding: 0 0.6rem 0 0.7rem;
	border-radius: 999px;
	background: transparent;
	box-shadow: inset 0 0 0 1.5px var(--mm-oat, #e8d8c2);
}
.mm-search__close:hover,
.mm-search__clear:hover { background: var(--mm-oat, #e8d8c2); }
.mm-search kbd {
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	font-size: 0.6875rem;
	font-weight: 700;
	padding: 0.1rem 0.35rem;
	border-radius: 5px;
	background: var(--mm-linen, #f7eddf);
	border: 1px solid var(--mm-oat, #e8d8c2);
	color: var(--mm-bark, #76563f);
}
.mm-search__clear:focus-visible,
.mm-search__close:focus-visible,
.mm-search a:focus-visible {
	outline: 3px solid var(--mm-honey, #f4b860);
	outline-offset: 2px;
}

/* ---------------------------------------------------- body */
.mm-search__body {
	flex: 1;
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 1.25rem 1.25rem 1.5rem;
	-webkit-overflow-scrolling: touch;
}
.mm-search__group + .mm-search__group { margin-top: 1.5rem; }
.mm-search__group-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: 0.7rem;
}
.mm-search__group h3 {
	margin: 0;
	font-family: var(--wp--preset--font-family--body, system-ui, sans-serif);
	font-size: 0.6875rem;
	font-weight: 900;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--mm-accent, #b4501a);
}
.mm-search__link {
	border: 0;
	background: none;
	padding: 0;
	cursor: pointer;
	font: inherit;
	font-size: 0.8125rem;
	font-weight: 800;
	color: var(--mm-ink, #2b1b12);
	text-decoration: underline;
	text-decoration-color: var(--mm-honey, #f4b860);
	text-underline-offset: 3px;
}

/* chips */
.mm-search__chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.45rem; }
.mm-chip {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	padding: 0.45rem 0.85rem;
	border-radius: 999px;
	background: #fff;
	border: 1.5px solid var(--mm-oat, #e8d8c2);
	color: var(--mm-ink, #2b1b12);
	font-size: 0.875rem;
	font-weight: 700;
	text-decoration: none;
	transition: border-color 0.15s, background 0.15s, transform 0.15s;
}
.mm-chip svg { color: var(--mm-accent, #b4501a); }
.mm-chip:hover { border-color: var(--mm-ink, #2b1b12); transform: translateY(-1px); }
.mm-chip--recent { background: var(--mm-linen, #f7eddf); border-style: dashed; }

/* collections */
.mm-search__cols { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.75rem; }
.mm-search__cols a {
	display: flex;
	flex-direction: column;
	text-decoration: none;
	color: inherit;
	background: #fff;
	border-radius: 18px;
	overflow: hidden;
	box-shadow: 0 1px 2px rgba(43, 27, 18, 0.06), 0 8px 24px -14px rgba(43, 27, 18, 0.3);
	transition: transform 0.2s, box-shadow 0.2s;
}
.mm-search__cols a:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(43, 27, 18, 0.06), 0 16px 32px -16px rgba(43, 27, 18, 0.4); }
.mm-search__cols img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; background: var(--mm-linen, #f7eddf); }
.mm-search__cols span { display: flex; flex-direction: column; padding: 0.6rem 0.75rem 0.7rem; line-height: 1.25; }
.mm-search__cols b { font-family: var(--wp--preset--font-family--display, Georgia, serif); font-weight: 600; font-size: 0.9375rem; }
.mm-search__cols small { font-size: 0.75rem; color: var(--mm-bark, #76563f); }

/* results */
.mm-search__status { margin: 0 0 0.6rem; font-size: 0.75rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--mm-bark, #76563f); }
.mm-search__results { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; }
.mm-result {
	position: relative;
	display: flex;
	align-items: center;
	gap: 0.85rem;
	padding: 0.55rem 2.2rem 0.55rem 0.55rem;
	border-radius: 16px;
	background: #fff;
	border: 1.5px solid transparent;
	text-decoration: none;
	color: inherit;
	transition: border-color 0.15s, background 0.15s;
	min-height: 84px;
}
.mm-result:hover,
[aria-selected="true"] > .mm-result { border-color: var(--mm-ink, #2b1b12); background: #fff; }
[aria-selected="true"] > .mm-result { box-shadow: 0 0 0 3px var(--mm-honey, #f4b860); }
.mm-result__img {
	width: 68px;
	height: 68px;
	flex: none;
	border-radius: 12px;
	object-fit: cover;
	background: var(--mm-linen, #f7eddf);
}
.mm-result__body { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.mm-result__eyebrow { font-size: 0.625rem; font-weight: 900; letter-spacing: 0.12em; text-transform: uppercase; color: var(--mm-accent, #b4501a); }
.mm-result__name {
	font-family: var(--wp--preset--font-family--display, Georgia, serif);
	font-weight: 600;
	font-size: 0.9375rem;
	line-height: 1.25;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.mm-result__name mark { background: linear-gradient(transparent 55%, rgba(244, 184, 96, 0.7) 55%); color: inherit; padding: 0 1px; }
.mm-result__price { font-size: 0.8125rem; font-weight: 800; }
.mm-result__price .mm-from { font-weight: 600; color: var(--mm-bark, #76563f); }
.mm-result__price del { opacity: 0.55; font-weight: 600; }
.mm-result__go { position: absolute; right: 0.8rem; color: var(--mm-bark, #76563f); opacity: 0; transform: translateX(-4px); transition: opacity 0.15s, transform 0.15s; }
.mm-result:hover .mm-result__go,
[aria-selected="true"] .mm-result__go { opacity: 1; transform: none; }

/* skeleton */
.mm-result--skeleton { pointer-events: none; }
.mm-result--skeleton .mm-result__img,
.mm-result--skeleton .mm-result__body span {
	background: linear-gradient(90deg, var(--mm-linen, #f7eddf) 25%, #fff 50%, var(--mm-linen, #f7eddf) 75%);
	background-size: 200% 100%;
	animation: mm-shimmer 1.1s linear infinite;
	border-radius: 8px;
}
.mm-result--skeleton .mm-result__body { flex: 1; gap: 0.4rem; }
.mm-result--skeleton .mm-result__body span { height: 10px; width: 40%; }
.mm-result--skeleton .mm-result__body span:nth-child(2) { width: 85%; height: 14px; }
.mm-result--skeleton .mm-result__body span:nth-child(3) { width: 30%; }
@keyframes mm-shimmer { to { background-position: -200% 0; } }

.mm-search__empty { text-align: center; padding: 1.5rem 1rem; }
.mm-search__empty[hidden] { display: none; }
.mm-search__empty-title { font-family: var(--wp--preset--font-family--display, Georgia, serif); font-size: 1.25rem; font-weight: 600; margin: 0 0 0.4rem; }
.mm-search__empty a { color: var(--mm-accent, #b4501a); font-weight: 700; }
.mm-search__all {
	display: flex !important;
	justify-content: center;
	margin-top: 1rem;
	padding: 0.85rem 1.2rem !important;
	border-radius: 999px !important;
	background: var(--mm-ink, #2b1b12) !important;
	color: var(--mm-cream, #fffaf2) !important;
	font-weight: 800;
	font-size: 0.9375rem !important;
	text-decoration: none;
}
.mm-search__all[hidden] { display: none !important; }
.mm-search__all:hover { background: var(--mm-accent, #b4501a) !important; }

.mm-search__hint {
	display: flex;
	justify-content: center;
	gap: 1.25rem;
	margin: 0;
	padding: 0.6rem 1rem;
	border-top: 1px solid var(--mm-oat, #e8d8c2);
	background: #fff;
	font-size: 0.75rem;
	color: var(--mm-bark, #76563f);
	flex: none;
}
.mm-search__hint span { display: inline-flex; gap: 0.25rem; align-items: center; }

/* ---------------------------------------------------- tablet */
@media (max-width: 899px) {
	.mm-search__panel { width: 100%; }
	.mm-search__cols { gap: 0.6rem; }
	.mm-search__cols img { aspect-ratio: 1; }
	.mm-search__cols b { font-size: 0.875rem; }
}

/* ---------------------------------------------------- phone: full-screen sheet */
@media (max-width: 599px) {
	.mm-search { padding: 0; }
	.mm-search__panel {
		max-height: none;
		height: 100dvh;
		border-radius: 0;
		transform: translateY(16px);
	}
	.mm-search__form { padding: 0.7rem 0.75rem 0.7rem 1rem; padding-top: calc(0.7rem + env(safe-area-inset-top)); }
	.mm-search__input { font-size: 1.15rem; }
	.mm-search__close kbd { display: none; }
	.mm-search__close { width: 40px; height: 40px; padding: 0; justify-content: center; box-shadow: none; background: var(--mm-linen, #f7eddf); }
	.mm-search__body { padding: 1rem 1rem calc(1.5rem + env(safe-area-inset-bottom)); }
	.mm-search__results { grid-template-columns: 1fr; }
	.mm-search__cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.mm-search__cols img { aspect-ratio: 4 / 3; }
	.mm-search__hint { display: none; }
	.mm-result { min-height: 76px; }
	.mm-result__img { width: 60px; height: 60px; }
}

/* touch devices: no keyboard hints */
@media (hover: none) {
	.mm-search__hint, .mm-search__close kbd { display: none; }
}

@media (prefers-reduced-motion: reduce) {
	.mm-search__backdrop, .mm-search__panel, .mm-chip, .mm-search__cols a, .mm-result__go { transition: none; }
	.mm-result--skeleton .mm-result__img, .mm-result--skeleton .mm-result__body span { animation: none; }
}
