/*
 * tf-search-drawer.css — search flyout for the legacy stacks.
 *
 * All rules are scoped under .tf-search-drawer to avoid clobbering
 * any global styles. Ported from apps/tfs-nuxt4 Search components.
 */

.tf-search-drawer {
	--ui-surface: #fbfafa;
	--ui-surface-container-low: #ffffff;
	--ui-surface-container: #f6f6f6;
	--ui-surface-container-high: #ececec;
	--ui-on-surface: #202020;
	--ui-on-surface-variant: #616161;
	--ui-border: oklch(92.9% 0.013 255.508);
	--ui-outline: #79767c;
	--ui-primary: #160023;

	position: fixed;
	left: 0;
	right: 0;
	top: 72px;
	bottom: 0;
	z-index: 45;
	background-color: var(--ui-surface);
	overflow-x: hidden;
	overflow-y: auto;
	font-family: Inter, system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
	color: var(--ui-on-surface);
}
@media (min-width: 768px){
	.tf-search-drawer { top: 80px; }
}

/* Keep navbar content above the sliding drawer. The drawer is a fixed child
   of <header.tf-header> (z-50 stacking context); without a positive z on the
   inner container, the drawer paints over the logo/nav during the slide. */
.tf-header > .container {
	position: relative;
	z-index: 50;
	background-color: inherit;
}

.tf-search-drawer * { box-sizing: border-box; }
.tf-search-drawer a { text-decoration: none; color: inherit; }
.tf-search-drawer button {
	background: none;
	border: 0;
	padding: 0;
	font: inherit;
	color: inherit;
	cursor: pointer;
}

.tf-search-drawer-inner {
	width: 100%;
	min-height: calc(100vh - 72px);
	padding-top: 8px;
	padding-bottom: 80px;
}
@media (min-width: 768px){
	.tf-search-drawer-inner { min-height: calc(100vh - 80px); padding-top: 40px; }
}

.tf-search-drawer-container {
	width: 100%;
	max-width: 1186px;
	margin-inline: auto;
	padding: 16px;
}

.tf-search-drawer-row {
	display: flex;
	flex-direction: row;
	gap: 8px;
	align-items: flex-start;
}
@media (min-width: 768px){
	.tf-search-drawer-row { gap: 16px; }
}

/* ---- Back / close button ---- */
.tf-search-drawer .tf-search-back {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 48px;
	width: 48px;
	height: 48px;
	border-radius: 9999px;
	background-color: #e2ccef;
	color: #2b0046;
	flex-shrink: 0;
}
.tf-search-drawer .tf-search-back:hover { background-color: #d9c1ea; }
.tf-search-back .material-symbols-outlined { font-size: 24px; }

/* ---- Input + dropdown wrapper ---- */
.tf-search-input-wrap {
	position: relative;
	width: 100%;
}

.tf-search-input-shell {
	position: relative;
	display: flex;
	align-items: center;
	width: 100%;
}

.tf-search-input-icon {
	position: absolute;
	left: 16px;
	top: 50%;
	transform: translateY(-50%);
	font-size: 20px;
	color: #9ca3af;
	pointer-events: none;
}

.tf-search-input {
	width: 100%;
	height: 48px;
	padding: 12px 44px 12px 44px;
	border-radius: 8px;
	border: 1px solid #d1d5db;
	background-color: #fff;
	color: #111827;
	font-size: 16px;
	line-height: 24px;
	font-family: inherit;
	outline: none;
	transition: border-color 150ms ease, box-shadow 150ms ease;
}
.tf-search-input::placeholder { color: #9ca3af; }
.tf-search-input:focus {
	border-color: #442957;
	box-shadow: 0 0 0 3px rgba(68, 41, 87, 0.2);
}

.tf-search-clear {
	position: absolute;
	right: 12px;
	top: 50%;
	transform: translateY(-50%);
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 4px 8px;
	border-radius: 6px;
	color: var(--ui-on-surface-variant);
	line-height: 1;
}
.tf-search-clear:hover { background-color: rgba(0, 0, 0, 0.06); }
.tf-search-clear .material-symbols-outlined { font-size: 18px; }
.tf-search-clear-label {
	display: none;
	font-size: 14px;
	font-weight: 600;
	color: var(--ui-on-surface-variant);
}
@media (min-width: 640px) {
	.tf-search-clear-label { display: inline; }
}

/* ---- Results dropdown ---- */
.tf-search-results {
	position: absolute;
	top: calc(100% + 4px);
	left: 0;
	right: 0;
	z-index: 10;
	max-height: 70vh;
	overflow-y: auto;
	background-color: #fff;
	border-radius: 8px;
	box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
	border: 1px solid #e5e7eb;
	display: flex;
	flex-direction: column;
	transform-origin: top;
	animation: tf-search-fade-slide 150ms ease-out;
}

@keyframes tf-search-fade-slide {
	from { opacity: 0; transform: translateY(-4px); }
	to { opacity: 1; transform: translateY(0); }
}

.tf-search-results-label {
	font-size: 14px;
	font-weight: 700;
	padding: 12px;
	color: var(--ui-on-surface);
}

.tf-search-drawer .tf-search-result-item {
	display: flex;
	align-items: center;
	justify-content: flex-start;
	gap: 8px;
	padding: 12px;
	width: 100%;
	text-align: left;
	color: var(--ui-on-surface);
	transition: background-color 100ms ease;
}
.tf-search-drawer .tf-search-result-item:hover,
.tf-search-drawer .tf-search-result-item--active { background-color: rgba(0, 0, 0, 0.08); }
.tf-search-drawer .tf-search-result-item .material-symbols-outlined { font-size: 24px; color: var(--ui-on-surface-variant); }
.tf-search-result-text { font-size: 14px; }
.tf-search-result-text strong { font-weight: 700; }

.tf-search-results--empty {
	align-items: center;
	padding: 64px 16px;
	text-align: center;
}
.tf-search-empty-icon {
	font-size: 80px !important;
	color: var(--ui-surface-container-high);
}
.tf-search-empty-title {
	margin: 8px 0 0;
	font-size: 16px;
	font-weight: 500;
	color: #4b5563;
}
.tf-search-empty-subtitle {
	margin: 4px 0 0;
	font-size: 14px;
	color: #9ca3af;
}

/* ---- Inline divider between input and category strip ---- */
.tf-search-divider-inline {
	margin: 24px 0;
	height: 1px;
	width: 100%;
	background-color: var(--ui-outline);
}

/* ---- Category chips ---- */
.tf-search-categories {
	display: flex;
	flex-direction: row;
	gap: 8px;
	overflow-x: auto;
	scrollbar-width: none;
	-ms-overflow-style: none;
	justify-content: flex-start;
	align-items: center;
}
.tf-search-categories::-webkit-scrollbar { display: none; }
@media (min-width: 768px){
	.tf-search-categories {
		flex-wrap: wrap;
		overflow-x: visible;
		justify-content: space-evenly;
	}
}

.tf-search-category {
	display: inline-flex;
	align-items: center;
	gap: 16px;
	flex-shrink: 0;
	flex-grow: 1;
	min-width: 189px;
	padding: 16px;
	border-radius: 12px;
	background-color: var(--ui-surface-container-low);
	box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
	color: var(--ui-on-surface);
}
.tf-search-category:hover { box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.08); }
.tf-search-category-emoji {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	flex-shrink: 0;
	border-radius: 8px;
	background-color: var(--ui-surface-container);
	font-size: 32px;
	line-height: 40px;
}
.tf-search-category-label {
	font-size: 16px;
	font-weight: 700;
	color: var(--ui-on-surface);
}

/* ---- Popular searches ---- */
.tf-search-popular { margin-top: 40px; }
.tf-search-popular-heading {
	font-size: 20px;
	font-weight: 700;
	color: var(--ui-on-surface);
}
.tf-search-popular-grid {
	margin-top: 16px;
	display: grid;
	grid-template-columns: 1fr;
	gap: 12px;
}
@media (min-width: 768px){
	.tf-search-popular-grid { grid-template-columns: 1fr 1fr; }
}

.tf-search-popular-item {
	display: inline-flex;
	align-items: center;
	gap: 16px;
	height: 56px;
	padding: 16px;
	border-radius: 12px;
	background-color: var(--ui-surface-container-low);
	box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
	width: 100%;
	text-align: left;
}
.tf-search-popular-item:hover { box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.08); }
.tf-search-popular-icon {
	font-size: 24px !important;
	flex-shrink: 0;
	color: var(--ui-primary);
}
.tf-search-popular-label {
	min-width: 0;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	color: var(--ui-on-surface);
}

/* ---- Material Symbols inside the drawer (matches tf-header.css block) ---- */
.tf-search-drawer .material-symbols-outlined {
	font-family: 'Material Symbols Outlined';
	font-style: normal;
	font-weight: 300;
	line-height: 1;
	letter-spacing: normal;
	text-transform: none;
	display: inline-block;
	white-space: nowrap;
	overflow-wrap: normal;
	direction: ltr;
	font-feature-settings: 'liga';
	-webkit-font-feature-settings: 'liga';
	-webkit-font-smoothing: antialiased;
}

/* ---- Slide-down transition ---- */
.tf-search-drawer-transition-enter-active,
.tf-search-drawer-transition-leave-active {
	transition: transform 220ms ease-out, opacity 220ms ease-out;
}
.tf-search-drawer-transition-enter,
.tf-search-drawer-transition-enter-from,
.tf-search-drawer-transition-leave-to {
	transform: translateY(-100%);
	opacity: 0;
}
.tf-search-drawer-transition-enter-to,
.tf-search-drawer-transition-leave,
.tf-search-drawer-transition-leave-from {
	transform: translateY(0);
	opacity: 1;
}

/* ---- Full-width divider painted by the header when search is open ---- */
.tf-search-divider {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 1px;
	background-color: oklch(92.9% 0.013 255.508);
	z-index: 55;
	pointer-events: none;
}

/* ---- carousel-bleed-until-md (port from apps/tfs-nuxt4 main.css 436-490) ---- */
.tf-search-drawer .carousel-bleed-until-md {
	margin-inline: -16px;
	padding-inline: 16px;
	scroll-padding-inline: 16px;
}
@media (min-width: 640px){
	.tf-search-drawer .carousel-bleed-until-md {
		margin-inline: calc(320px - 50vw - 16px);
		padding-inline: calc(50vw - 320px + 16px);
		scroll-padding-inline: calc(50vw - 320px + 16px);
	}
}
@media (min-width: 768px){
	.tf-search-drawer .carousel-bleed-until-md {
		margin-inline: 0;
		padding-inline: 0;
		scroll-padding-inline: 0;
	}
}
