/* =========================================================
   Search Popup
   ========================================================= */

.search-popup {
	position: fixed;
	inset: 0;
	z-index: 1500;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding-top: clamp(60px, 10vh, 120px);
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.25s ease;
}

.search-popup.is-open {
	opacity: 1;
	pointer-events: auto;
}

.search-popup__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.6);
	backdrop-filter: blur(4px);
	cursor: pointer;
}

.search-popup__box {
	position: relative;
	z-index: 1;
	width: min(100% - 32px, 640px);
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 24px 64px rgba(0, 0, 0, 0.18);
	overflow: hidden;
	transform: translateY(-16px);
	transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-popup.is-open .search-popup__box {
	transform: translateY(0);
}

/* Form */
.search-popup__form {
	display: flex;
	align-items: center;
	gap: 0;
	padding: 0 16px 0 20px;
	border-bottom: 1px solid #f0f0f0;
}

.search-popup__icon {
	display: block;
	width: 18px;
	height: 18px;
	flex-shrink: 0;
	background-image: url("data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 18 18' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='7.5' cy='7.5' r='5.5' stroke='%23888' stroke-width='1.6'/%3E%3Cpath d='M13 13l2.5 2.5' stroke='%23888' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-size: contain;
}

.search-popup__input {
	flex: 1;
	height: 58px;
	padding: 0 14px;
	border: none;
	outline: none;
	font-size: 1rem;
	font-family: inherit;
	color: #111;
	background: transparent;
}

.search-popup__input::placeholder {
	color: #aaa;
}

.search-popup__close {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border: none;
	border-radius: 8px;
	background: #f5f5f5;
	color: #555;
	cursor: pointer;
	flex-shrink: 0;
	transition: background 0.2s;
}

.search-popup__close:hover {
	background: #eee;
}

/* Results */
.search-popup__results {
	max-height: 420px;
	overflow-y: auto;
}

.search-popup__results:empty {
	display: none;
}

.search-popup__result-item {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 12px 20px;
	text-decoration: none;
	color: #111;
	border-bottom: 1px solid #f5f5f5;
	transition: background 0.15s;
}

.search-popup__result-item:last-child {
	border-bottom: none;
}

.search-popup__result-item:hover {
	background: #fafafa;
}

.search-popup__result-thumb {
	width: 48px;
	height: 48px;
	border-radius: 8px;
	object-fit: cover;
	flex-shrink: 0;
	background: #eee;
}

.search-popup__result-thumb--placeholder {
	width: 48px;
	height: 48px;
	border-radius: 8px;
	background: #eee;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	font-size: 0.6rem;
	font-weight: 700;
	color: #aaa;
	text-transform: uppercase;
}

.search-popup__result-body {
	flex: 1;
	min-width: 0;
}

.search-popup__result-type {
	font-size: 0.68rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--primary-color, #ed1c24);
	margin: 0 0 3px;
}

.search-popup__result-title {
	font-size: 0.9rem;
	font-weight: 600;
	color: #111;
	margin: 0 0 3px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.search-popup__result-excerpt {
	font-size: 0.78rem;
	color: #777;
	margin: 0;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.search-popup__see-all {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 14px;
	font-size: 0.85rem;
	font-weight: 700;
	color: var(--primary-color, #ed1c24);
	text-decoration: none;
	border-top: 1px solid #f0f0f0;
	transition: background 0.15s;
}

.search-popup__see-all:hover {
	background: #fafafa;
}

.search-popup__message {
	padding: 20px;
	text-align: center;
	font-size: 0.88rem;
	color: #888;
}

/* main-header__search button reset */
button.main-header__search {
	background: none;
	border: none;
	padding: 0;
	cursor: pointer;
}