/**
 * Floating AI search FAB + centered modal (prefix: fnbr-fab).
 * Isolated from theme utilities — does not style .header-bot / .search-box.
 */

.fnbr-fab {
	--fnbr-fab-size: 58px;
	--fnbr-fab-pad: max(16px, env(safe-area-inset-right, 0px));
	--fnbr-fab-bottom: max(20px, env(safe-area-inset-bottom, 0px));
	font-family: "Be Vietnam Pro", "Segoe UI", system-ui, sans-serif;
	box-sizing: border-box;
}

.fnbr-fab *,
.fnbr-fab *::before,
.fnbr-fab *::after {
	box-sizing: border-box;
}

.fnbr-fab__btn {
	position: fixed;
	z-index: 99980;
	right: var(--fnbr-fab-pad);
	bottom: var(--fnbr-fab-bottom);
	width: var(--fnbr-fab-size);
	height: var(--fnbr-fab-size);
	border: 0;
	border-radius: 50%;
	padding: 0;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	background:
		radial-gradient(120% 120% at 20% 15%, rgba(255, 255, 255, 0.28), transparent 45%),
		linear-gradient(145deg, var(--fnb-primary, #b48c66) 0%, var(--fnb-primary-hover, #9a734f) 100%);
	box-shadow:
		0 10px 28px rgba(var(--fnb-primary-rgb, 180, 140, 102), 0.42),
		0 2px 6px rgba(15, 23, 42, 0.12);
	transition: transform 0.18s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.18s ease;
	-webkit-tap-highlight-color: transparent;
}

.fnbr-fab__btn:hover,
.fnbr-fab__btn:focus-visible {
	transform: translateY(-2px) scale(1.04);
	box-shadow:
		0 14px 32px rgba(var(--fnb-primary-rgb, 180, 140, 102), 0.5),
		0 4px 10px rgba(15, 23, 42, 0.14);
	outline: none;
}

.fnbr-fab__btn:active {
	transform: scale(0.96);
}

.fnbr-fab.is-open .fnbr-fab__btn {
	opacity: 0;
	pointer-events: none;
	transform: scale(0.7);
}

.fnbr-fab__pulse {
	position: absolute;
	inset: -4px;
	border-radius: 50%;
	border: 2px solid rgba(var(--fnb-primary-rgb, 180, 140, 102), 0.45);
	animation: fnbr-fab-pulse 2.4s ease-out infinite;
	pointer-events: none;
}

.fnbr-fab__icon {
	display: flex;
	line-height: 0;
	position: relative;
	z-index: 1;
}

.fnbr-fab__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 50%;
	display: block;
}

.fnbr-fab__btn.has-custom-icon {
	padding: 0;
	background: #fff;
	overflow: hidden;
	border: 2px solid rgba(255, 255, 255, 0.85);
}

.fnbr-fab__btn.has-custom-icon .fnbr-fab__icon {
	width: 100%;
	height: 100%;
}

.fnbr-fab__btn.has-custom-icon .fnbr-fab__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.fnbr-fab__btn.has-custom-icon .fnbr-fab__pulse {
	border-color: rgba(var(--fnb-primary-rgb, 180, 140, 102), 0.35);
}

.fnbr-fab__label {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	border: 0;
}

.fnbr-fab__modal {
	position: fixed;
	inset: 0;
	z-index: 100060;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: max(12px, env(safe-area-inset-top, 0px)) max(12px, env(safe-area-inset-right, 0px)) max(12px, env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px));
}

.fnbr-fab__modal[hidden] {
	display: none !important;
}

.fnbr-fab__backdrop {
	position: absolute;
	inset: 0;
	border: 0;
	margin: 0;
	padding: 0;
	background: rgba(15, 23, 42, 0.48);
	backdrop-filter: blur(2px);
	cursor: pointer;
	animation: fnbr-fab-fade 180ms ease;
}

.fnbr-fab__panel {
	position: relative;
	z-index: 1;
	width: min(560px, 100%);
	max-height: min(88vh, 820px);
	display: flex;
	flex-direction: column;
	background: #fff;
	border-radius: 18px;
	border: 1px solid #eef1f5;
	box-shadow: 0 28px 64px rgba(15, 23, 42, 0.24);
	overflow: hidden;
	animation: fnbr-fab-up 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.fnbr-fab__head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
	padding: 16px 16px 12px;
	border-bottom: 1px solid #eef1f5;
	background:
		radial-gradient(600px 120px at 0% 0%, rgba(var(--fnb-primary-rgb, 180, 140, 102), 0.12), transparent 55%),
		#fff;
	flex: 0 0 auto;
}

.fnbr-fab__eyebrow {
	margin: 0 0 2px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--fnb-primary, #b48c66);
}

.fnbr-fab__title {
	margin: 0;
	font-size: clamp(1.05rem, 2.5vw, 1.25rem);
	font-weight: 750;
	line-height: 1.3;
	color: #072625;
	letter-spacing: -0.02em;
}

.fnbr-fab__x {
	border: 0;
	background: #f3f5f8;
	width: 36px;
	height: 36px;
	border-radius: 10px;
	font-size: 22px;
	line-height: 1;
	color: #64748b;
	cursor: pointer;
	flex: 0 0 auto;
	transition: background 0.15s ease, color 0.15s ease;
}

.fnbr-fab__x:hover,
.fnbr-fab__x:focus-visible {
	background: var(--fnb-primary-soft, #f7f1ea);
	color: var(--fnb-primary-hover, #9a734f);
	outline: none;
}

.fnbr-fab__body {
	overflow: auto;
	-webkit-overflow-scrolling: touch;
	padding: 6px 12px 16px;
	flex: 1 1 auto;
	overscroll-behavior: contain;
	background: #fff;
}

/* Compact widget inside FAB modal */
.fnbr-fab .fnbr-sc--fab {
	max-width: none;
	margin: 0;
}

.fnbr-fab .fnbr-sc--fab .fnbr-sc__shell {
	padding: 2px 2px 8px;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	background: transparent;
	overflow: visible;
}

.fnbr-fab .fnbr-sc--fab .fnbr-sc__form {
	position: sticky;
	top: 0;
	z-index: 6;
	/* Cover fnbr-fab__body padding so scrolled chips cannot peek above search. */
	margin: -6px -14px 0;
	padding: 6px 14px 8px;
	background: #fff;
	box-shadow: 0 12px 18px -14px rgba(15, 23, 42, 0.18);
}

.fnbr-fab .fnbr-sc--fab .fnbr-sc__form::before {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	top: -32px;
	height: 32px;
	background: #fff;
	pointer-events: none;
}

.fnbr-fab .fnbr-sc--fab .fnbr-sc__shell::before {
	display: none;
}

.fnbr-fab .fnbr-sc--fab .fnbr-sc__results {
	max-height: none;
}

body.fnbr-fab-open {
	overflow: hidden;
	touch-action: none;
}

@keyframes fnbr-fab-pulse {
	0% {
		transform: scale(1);
		opacity: 0.7;
	}
	70% {
		transform: scale(1.35);
		opacity: 0;
	}
	100% {
		transform: scale(1.35);
		opacity: 0;
	}
}

@keyframes fnbr-fab-fade {
	from { opacity: 0; }
	to { opacity: 1; }
}

@keyframes fnbr-fab-up {
	from {
		opacity: 0;
		transform: translateY(12px) scale(0.98);
	}
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

/* —— Mobile / narrow —— */
@media (max-width: 640px) {
	.fnbr-fab__modal {
		align-items: stretch;
		justify-content: stretch;
		padding: 0;
	}

	.fnbr-fab__panel {
		width: 100%;
		max-width: none;
		height: 100%;
		max-height: none;
		border-radius: 0;
		border: 0;
		animation: fnbr-fab-sheet 240ms cubic-bezier(0.2, 0.8, 0.2, 1);
	}

	.fnbr-fab__head {
		padding: max(14px, env(safe-area-inset-top, 0px)) 14px 12px;
	}

	.fnbr-fab__body {
		padding: 5px 12px max(16px, env(safe-area-inset-bottom, 0px));
	}
}

@keyframes fnbr-fab-sheet {
	from {
		opacity: 0;
		transform: translateY(8%);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@media (prefers-reduced-motion: reduce) {
	.fnbr-fab__pulse,
	.fnbr-fab__backdrop,
	.fnbr-fab__panel,
	.fnbr-fab__btn {
		animation: none !important;
		transition: none !important;
	}
}
