/**
 * Psy Core — header search dropdown
 * Palette tokens (also defined globally — fall back to literals here for safety)
 */
.psy-search {
	--psy-pink: #E54ADA;
	--psy-blue-dark: #050033;
	--psy-indigo: #0C0548;
	--psy-lavender: #B8B3D9;
	--psy-white: #F2F2F2;

	position: relative;
	width: 100%;
	max-width: 320px;
	font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
	color: var(--psy-white);
}

.psy-search__bar {
	display: flex;
	align-items: center;
	gap: 8px;
	background: var(--psy-navy);
	border: 1px solid rgba(229, 74, 218, 0.35);
	border-radius: 999px;
	padding: 6px 6px 6px 18px;
}

.psy-search__input {
	flex: 1;
	background: transparent !important;
	border: 0 !important;
	outline: 0 !important;
	box-shadow: none !important;
	appearance: none;
	-webkit-appearance: none;
	color: var(--psy-white);
	font-size: 15px;
	padding: 8px 0;
	min-width: 0;
	font-family: inherit;
}

.psy-search__input:focus,
.psy-search__input:focus-visible {
	outline: 0 !important;
	box-shadow: none !important;
	border: 0 !important;
}

.psy-search__input::placeholder {
	color: var(--psy-lavender);
	opacity: 1;
}

.psy-search__input::-webkit-search-decoration,
.psy-search__input::-webkit-search-cancel-button,
.psy-search__input::-webkit-search-results-button,
.psy-search__input::-webkit-search-results-decoration {
	-webkit-appearance: none;
	appearance: none;
	display: none;
}

.psy-search__submit {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	border: 0;
	background: var(--psy-pink);
	color: var(--psy-white);
	cursor: pointer;
	transition: filter 0.15s ease;
	padding: 0;
	flex-shrink: 0;
}

.psy-search__submit:hover {
	filter: brightness(1.1);
}

.psy-search__submit svg {
	display: block !important;
	width: 18px !important;
	height: 18px !important;
	color: var(--psy-white) !important;
}

.psy-search__submit svg path,
.psy-search__submit svg circle,
.psy-search__submit svg line {
	stroke: currentColor !important;
}

/* Panel — fixed so it escapes overflow:hidden parents (Elementor headers).
   Portaled to <body> by JS so it no longer inherits tokens from .psy-search:
   redeclare them here. */
.psy-search__panel {
	--psy-pink: #E54ADA;
	--psy-blue-dark: #050033;
	--psy-indigo: #0C0548;
	--psy-lavender: #B8B3D9;
	--psy-white: #F2F2F2;

	position: fixed;
	top: 80px;
	left: 50%;
	transform: translateX(-50%);
	display: grid;
	grid-template-columns: 240px 1fr;
	gap: 0;
	background: var(--psy-blue-dark);
	border: 1px solid var(--psy-pink);
	border-radius: 16px;
	overflow: hidden;
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
	z-index: 99999;
	width: min(920px, calc(100vw - 32px));
	min-width: 320px;
	color: var(--psy-white);
	font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

/* Override the `display: grid` above when the panel is closed. `[hidden]`
   alone is not enough because our `display: grid` beats the UA stylesheet. */
.psy-search__panel[hidden] {
	display: none !important;
}

.psy-search[data-psy-search] .psy-search__panel[hidden] {
	display: none;
}

/* Left rail: categories */
.psy-search__cats {
	background: var(--psy-indigo);
	padding: 18px 14px;
	border-right: 1px solid rgba(184, 179, 217, 0.12);
}

.psy-search__cats-title {
	margin: 0 6px 12px;
	font-size: 11px;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--psy-lavender);
	font-weight: 600;
}

.psy-search__cats-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.psy-search__cat-btn {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	background: transparent;
	border: 0;
	color: var(--psy-white);
	padding: 10px 12px;
	border-radius: 10px;
	font-size: 14px;
	cursor: pointer;
	text-align: left;
	transition: background 0.15s ease;
}

.psy-search__cat-btn:hover,
.psy-search__cat.is-active .psy-search__cat-btn {
	background: rgba(229, 74, 218, 0.15);
}

.psy-search__cat-icon {
	display: inline-flex;
	align-items: center;
	color: var(--psy-pink);
}

.psy-search__cat-icon img {
	width: 18px;
	height: 18px;
	object-fit: contain;
}

.psy-search__cat-label {
	flex: 1;
}

.psy-search__cat-count {
	color: var(--psy-lavender);
	font-size: 13px;
	font-variant-numeric: tabular-nums;
}

.psy-search__cat-arrow {
	color: var(--psy-lavender);
	font-size: 18px;
	line-height: 1;
}

.psy-search__cats-note {
	display: flex;
	align-items: center;
	gap: 6px;
	margin: 18px 6px 0;
	font-size: 11px;
	color: var(--psy-lavender);
	opacity: 0.85;
}

/* Right rail: results */
.psy-search__results {
	padding: 18px 20px;
	display: flex;
	flex-direction: column;
	gap: 12px;
	min-height: 320px;
}

.psy-search__results-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
}

.psy-search__results-title {
	margin: 0;
	font-size: 13px;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--psy-lavender);
	font-weight: 600;
}

.psy-search__results-total {
	color: var(--psy-lavender);
	font-size: 13px;
}

.psy-search__results-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.psy-search__result-link {
	display: grid;
	grid-template-columns: 56px 1fr auto;
	align-items: center;
	gap: 14px;
	padding: 10px 12px;
	border-radius: 12px;
	background: var(--psy-indigo);
	color: var(--psy-white);
	text-decoration: none;
	transition: background 0.15s ease, transform 0.15s ease;
}

.psy-search__result-link:hover {
	background: rgba(229, 74, 218, 0.15);
	transform: translateY(-1px);
}

.psy-search__result-thumb {
	width: 56px;
	height: 56px;
	border-radius: 10px;
	overflow: hidden;
	background: var(--psy-blue-dark);
	display: flex;
	align-items: center;
	justify-content: center;
}

.psy-search__result-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.psy-search__result-body {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.psy-search__result-title {
	font-weight: 600;
	font-size: 15px;
	color: var(--psy-white);
}

.psy-search__result-sub {
	font-size: 13px;
	color: var(--psy-pink);
}

.psy-search__result-loc {
	font-size: 12px;
	color: var(--psy-lavender);
}

.psy-search__result-tags {
	display: flex;
	gap: 6px;
	flex-wrap: wrap;
	justify-content: flex-end;
}

.psy-search__tag {
	border: 1px solid rgba(184, 179, 217, 0.4);
	color: var(--psy-white);
	font-size: 11px;
	padding: 3px 10px;
	border-radius: 999px;
	background: rgba(12, 5, 72, 0.6);
}

.psy-search__results-empty {
	color: var(--psy-lavender);
	font-size: 14px;
	padding: 20px 4px;
}

/* Recent searches */
.psy-search__recent {
	margin-top: 8px;
	padding-top: 12px;
	border-top: 1px solid rgba(184, 179, 217, 0.12);
}

.psy-search__recent-title {
	margin: 0 0 8px;
	font-size: 12px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--psy-lavender);
	font-weight: 600;
}

.psy-search__recent-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.psy-search__recent-pill {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	background: var(--psy-indigo);
	border: 1px solid rgba(184, 179, 217, 0.25);
	color: var(--psy-white);
	border-radius: 999px;
	padding: 4px 12px;
	font-size: 12px;
	cursor: pointer;
	transition: background 0.15s ease;
}

.psy-search__recent-pill:hover {
	background: rgba(229, 74, 218, 0.15);
}

/* View all + key hint */
.psy-search__view-all,
.psy-search__view-all:visited,
.psy-search__view-all:active {
	color: var(--psy-pink) !important;
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-top: 6px;
}

.psy-search__view-all:hover {
	color: var(--psy-white) !important;
	text-decoration: underline;
}

.psy-search__keyhint {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	align-self: flex-end;
	color: var(--psy-lavender);
	font-size: 11px;
	margin-top: -22px;
}

.psy-search__keyhint kbd {
	background: var(--psy-indigo);
	border: 1px solid rgba(184, 179, 217, 0.3);
	border-radius: 4px;
	padding: 2px 6px;
	font-family: inherit;
	font-size: 11px;
}

/* Responsive */
@media ( max-width: 900px ) {
	.psy-search__panel {
		grid-template-columns: 1fr;
		width: calc(100vw - 24px);
		max-height: calc(100dvh - 100px);
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
		overscroll-behavior: contain;
		touch-action: pan-y;
	}

	.psy-search__cats {
		border-right: 0;
		border-bottom: 1px solid rgba(184, 179, 217, 0.12);
	}

	.psy-search__results {
		min-height: 0;
	}
}

/* Lock body scroll while search panel is open (mobile) */
body.psy-search-open {
	overflow: hidden !important;
	touch-action: none;
}
