.header-desktop-wrapper {
	position: sticky;
	top: -1px;
	display: flex;
	flex-flow: column;
	background-color: $color-white;
	transition: padding 0.3s ease;
	z-index: 1001;

	&.fixed {
		padding: calc(8px + 1px) 0 8px 0;

		.header-desktop-container {
			margin-top: 0;
		}
	}

	@include mobile {
		display: none;
	}
}

.header-desktop-container {
	display: flex;
	flex-flow: row nowrap;
	align-items: center;
	gap: 20px;
	align-self: center;
	width: 100%;
	max-width: calc($width-desktop + 16px * 2);
	margin-top: 16px;
	padding: 0 16px;
	transition: margin-top 0.3s ease;
	box-sizing: border-box;
}

.header-desktop-logo {
	display: block;
	width: 100%;
	max-width: 190px;
}

.header-desktop-logo__img {
	display: block;
	width: 100%;
	pointer-events: none;
}

.header-desktop-catalog-btn {
	display: flex;
	flex-flow: row nowrap;
	align-items: center;
	gap: 10px;
	height: 54px;
	padding: 0 20px;
	color: $color-white;
	border-radius: 16px;
	background-color: $color-green;
	box-sizing: border-box;
	transition: background-color 0.3s ease;

	&[aria-expanded='true'] {
		background-color: $color-orange;

		.header-desktop-catalog-btn__icon > svg:nth-child(1) {
			opacity: 0;
			transform: rotate(45deg);
		}

		.header-desktop-catalog-btn__icon > svg:nth-child(2) {
			opacity: 1;
			transform: rotate(0);
		}
	}
}

.header-desktop-catalog-btn__icon {
	position: relative;
	width: 24px;
	height: 24px;

	svg {
		position: absolute;
		inset: 0;
		width: 100%;
		height: 100%;
		opacity: 0;
		transform: rotate(-45deg);
		transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);

		&:nth-child(1) {
			opacity: 1;
			transform: rotate(0);
		}
	}
}

.header-desktop-catalog-btn__label {
	font-weight: 500;
}

.header-desktop-search-wrapper {
	flex: 1;
	position: relative;
}

.header-desktop-search-input {
	width: 100%;
	height: 54px;
	padding: 0 calc(16px + 24px + 12px) 0 16px;
	border-radius: 16px;
	background-color: $color-surface;
	background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M17.5 17.5L22 22' stroke='%23737373' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M20 11C20 6.02944 15.9706 2 11 2C6.02944 2 2 6.02944 2 11C2 15.9706 6.02944 20 11 20C15.9706 20 20 15.9706 20 11Z' stroke='%23737373' stroke-width='1.5' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: center right 16px;
	background-size: 24px 24px;
	box-sizing: border-box;
	transition: padding 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);

	&::placeholder {
		color: $color-gray-md;
	}

	&:not(:placeholder-shown) {
		padding: 0 calc(16px + 24px + 12px);
		background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M17.5 17.5L22 22' stroke='%23737373' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M20 11C20 6.02944 15.9706 2 11 2C6.02944 2 2 6.02944 2 11C2 15.9706 6.02944 20 11 20C15.9706 20 20 15.9706 20 11Z' stroke='%23737373' stroke-width='1.5' stroke-linejoin='round'/%3E%3C/svg%3E");
		background-repeat: no-repeat;
		background-position: center left 16px;
		background-size: 24px 24px;
	}

	&:not(:placeholder-shown) {
		& ~ .header-desktop-search-reset-btn {
			opacity: 1;
			visibility: visible;
			transform: none;
		}
	}

	&:placeholder-shown {
		padding: 0 calc(16px + 24px + 12px) 0 16px;
		background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M17.5 17.5L22 22' stroke='%23737373' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M20 11C20 6.02944 15.9706 2 11 2C6.02944 2 2 6.02944 2 11C2 15.9706 6.02944 20 11 20C15.9706 20 20 15.9706 20 11Z' stroke='%23737373' stroke-width='1.5' stroke-linejoin='round'/%3E%3C/svg%3E");
		background-repeat: no-repeat;
		background-position: center right 16px;

		& ~ .header-desktop-search-reset-btn {
			opacity: 0;
			visibility: hidden;
			transform: none;
		}
	}

	&:focus {
		padding: 0 calc(16px + 24px + 12px);
		background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M17.5 17.5L22 22' stroke='%23737373' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M20 11C20 6.02944 15.9706 2 11 2C6.02944 2 2 6.02944 2 11C2 15.9706 6.02944 20 11 20C15.9706 20 20 15.9706 20 11Z' stroke='%23737373' stroke-width='1.5' stroke-linejoin='round'/%3E%3C/svg%3E");
		background-repeat: no-repeat;
		background-position: center left 16px;
		background-size: 24px 24px;
	}
}

.header-desktop-search-reset-btn {
	position: absolute;
	top: calc((54px - 24px) / 2);
	right: 16px;
	width: 24px;
	height: 24px;
	color: $color-gray-md;
	opacity: 0;
	visibility: hidden;
	transform: scale(0);
	transition:
		opacity 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275),
		visibility 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275),
		transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);

	@include desktop {
		&:hover {
			color: $color-green;
		}
	}
}

.header-desktop-search-reset-btn__icon {
	width: 100%;
	height: 100%;
}

.header-desktop-search-controls {
	display: grid;
	grid-template-columns: repeat(3, 54px);
	gap: 10px;
}

.header-desktop-search-control-btn {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 54px;
	height: 54px;
	border-radius: 16px;
	background-color: $color-surface;
	color: $color-green;
}

.header-desktop-search-control-btn__icon {
	width: 24px;
	height: 24px;
}

.header-desktop-search-control-btn__counter {
	position: absolute;
	top: -7px;
	right: -9px;
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 24px;
	height: 24px;
	padding: 0 4px;
	border-radius: calc(24px / 2);
	background-color: $color-green;
	color: $color-white;
	font-weight: 500;
	text-align: center;
	pointer-events: none;
	box-sizing: border-box;
}
