/**
 * Header inline search — compact expand at icon position.
 */

.b2bmg-header__search-wrap {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: flex-end;
}

.b2bmg-header__search-form {
	display: flex;
	align-items: center;
	max-width: 0;
	opacity: 0;
	overflow: hidden;
	margin-right: 0;
	pointer-events: none;
	transition:
		max-width 0.35s cubic-bezier(0.4, 0, 0.2, 1),
		opacity 0.25s ease,
		margin-right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.b2bmg-header__search-form.is-open {
	max-width: 220px;
	opacity: 1;
	margin-right: 6px;
	pointer-events: auto;
}

.b2bmg-header__search-input {
	width: 220px;
	height: 36px;
	padding: 0 14px;
	font-family: var(--b2bmg-font);
	font-size: 0.875rem;
	color: var(--b2bmg-text);
	background-color: var(--b2bmg-white);
	border: 1px solid var(--b2bmg-border-strong);
	border-radius: 999px;
	outline: none;
	transition: border-color var(--b2bmg-transition), box-shadow var(--b2bmg-transition);
}

.b2bmg-header__search-input::placeholder {
	color: var(--b2bmg-muted);
}

.b2bmg-header__search-input:focus {
	border-color: var(--b2bmg-primary);
	box-shadow: 0 0 0 2px rgba(74, 78, 215, 0.12);
}

.b2bmg-header__search-wrap .b2bmg-header__search {
	flex-shrink: 0;
	border: none;
	background: transparent;
	cursor: pointer;
}

.b2bmg-header__search-wrap .b2bmg-header__search[aria-expanded="true"] {
	color: var(--b2bmg-primary);
	background-color: var(--b2bmg-bg-light);
}

@media (max-width: 767px) {
	.b2bmg-header__search-form.is-open {
		max-width: 160px;
	}

	.b2bmg-header__search-input {
		width: 160px;
		font-size: 0.8125rem;
	}
}
