/* ============================================
   Header — top-bar, навігація, пошук,
   shop buttons, language switcher
   ============================================ */

/* Header Top - Start */
header { 
	position: fixed;
	top: 0;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	background: var(--white);
	width: 100%;
	height: var(--header-height);
	margin: 0;
	padding: 0;
	z-index: 1000;
	border-bottom: 1px solid var(--border);
}
header::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: var(--top-bar-height);
	background: var(--black);
}
.header-top {
	height: var(--top-bar-height);
	align-items: center;
}
.top-bar-adress {
	display: flex;
	align-items: center;
	gap: 11px;
}
.top-bar-adress span {
	margin-top: 1px;
	color: var(--white);
}
.top-bar-menu {
	margin-left: 80px;
	padding-left: 15px;
	border-left: 1px solid var(--primary);
}
#top-bar-menu {
	color: var(--white);
}
#top-bar-menu a:hover {
	color: var(--primary);
}
.top-bar-phone {
	display: flex;
	gap: 5px;
	align-items: center;
	justify-content: center;
	margin-left: auto;
}
.top-bar-phone a {
	padding-top: 3px;
	color: var(--white);
}
.top-bar-call-back {
	margin-top: 1px;
}
.top-bar-call-back a {
	color: var(--gray);
}
@media (max-width: 1279px) {
	.header-top {
		display: none;
	}
	header::before {
		display: none;
	}
}
/* Header Top - End */

/* Header Main - Start */
.header-main {
	height: calc(var(--header-height) - var(--top-bar-height));
}
.logo-header {
	display: flex;
	align-items: center;
}
.btn-catalog picture {
	transition: all 0.3s ease-in-out;
}
.btn-catalog .close-menu {
	opacity: 0;
	visibility: hidden;
	position: absolute;
	transition: all 0.3s ease-in-out;
}
.btn-circle.user-account {
	margin-left: 14px;
}

@media (max-width: 1279px) {
	.side-menu-call {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		gap: 6px;
		width: 33px;
		height: 35px;
		cursor: pointer;
		background: var(--primary);
		border-radius: var(--radius-small);
	}
	.side-menu-call > .menu-line {
		display: flex;
		width: 20px;
		height: 2px;
		background: var(--white);
		border-radius: var(--radius-mid);
	}
	.logo-header {
		margin-right: auto;
	}
	.logo-header img {
		width: 64px;
	}
	.btn-sale {
		display: none;
	}
	.btn.btn-catalog {
		order: -1;
		--btn-height: 30px;
		--btn-pad: 5px;
		width: 30px;
	}
	header .btn-catalog span {
		display: none;
	}
	header .chating,
	header .change-lang {
		display: none;
	}
	header .user-account {
		display: none;
	}
}
/* Header Main - End */

/* Lanuage Switcher - Start */
.language-wrapper {
	position: relative;
}
.language-wrapper .language-box {
	position: absolute;
	left: 0;
	right: 0;
	bottom: calc(-84px - 8px);
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	transition: all 0.3s ease;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
}
.language-wrapper.active .language-box {
	opacity: 1;
	visibility: visible;
	pointer-events: all;
}
.language-wrapper .language-box a {
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	background: var(--white);
	width: 38px;
	height: 38px;
	padding: 9px;
	border: 1px solid var(--border);
	border-radius: var(--radius-max);
	transition: all 0.3s ease;
}
.language-wrapper .language-box a:hover,
.language-wrapper .language-box a.active {
	background: var(--border);
}
.language-wrapper .language-box a.active {
	pointer-events: none;
	cursor: default;
}
/* Lanuage Switcher - End */

/* Search - Start */
.search-wrapper {
	display: flex;
	flex-grow: 1;
}
.search-background {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: var(--overlay);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	z-index: 1;
}
.search-wrapper.in-search .search-background {
	visibility: visible;
	pointer-events: all;
}
.search-wrapper .search-box .icon {
	content: "";
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	/* Left - Right */
	left: initial;
	right: 14px;
	/* Left - Right */
	width: 17px;
	height: 17px;
	background: url(/wp-content/themes/shop/img/icons/search.svg) no-repeat center center;
	background-size: contain;
	transition: all 0.3s ease;
	cursor: pointer;
	z-index: 2;
}
.search-wrapper.in-search .search-box .icon {
	background: url(/wp-content/themes/shop/img/icons/close.svg) no-repeat center center;
	background-size: contain;
}
.search-wrapper .search-box .input {
	font-family: var(--font-family-1);
	font-size: 14px;
	line-height: 14px;
	font-weight: 400;
	background: var(--light-gray);
	color: var(--dark-gray);
	padding: 14px 14px 14px 14px;
	transform: translateY(0px);
}
.search-inline-pc {
	display: none;
}
.search-popup-mob {
	display: none;
}
.search-call-mob {
	display: none;
}
/* Search Result - Start */
#search-results {
	position: fixed;
	top: var(--header-height);
	display: flex;
	flex-direction: column;
	width: 628px;
	height: fit-content;
	min-height: 250px;
	max-height: 50vh;
	padding: 0 15px;
	background: var(--white);
	border-bottom-right-radius: 5px;
	border-bottom-left-radius: 5px;
	box-shadow: 0px 2px 5px rgb(0 0 0 / 10%);
	z-index: 2;
}
#search-results .no-result {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 250px;
}
#search-results .search-loading {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 250px;
}
#search-results .search-loading span {
	width: 30px;
	height: 30px;
	border: 3px solid var(--border);
	border-top-color: var(--primary);
	border-radius: var(--radius-max);
	animation: search-spin 0.6s linear infinite;
}
@keyframes search-spin {
	to { transform: rotate(360deg); }
}
#search-results .category-tabs {
	position: sticky;
	top: 0;
	list-style: none;
	display: flex;
	align-items: center;
	gap: 15px;
	width: 100%;
	min-height: calc(30px + 16px);
	padding: 15px 0;
	margin: 0 0 15px 0;
	background: var(--white);
	overflow-x: auto;
	overflow-y: hidden;
	z-index: 1;
}
#search-results .category-tabs::-webkit-scrollbar {
	height: 6px;
}
#search-results .category-tabs a {
	display: flex;
	color: var(--gray);
	min-width: max-content;
	font-size: 16px;
	line-height: 16px;
}
#search-results .category-tabs a.active,
#search-results .category-tabs a:hover {
	color: var(--primary);
}
#search-results .view-all-results {
	position: sticky;
	bottom: -1px;
	display: flex;
	padding: 15px 0;
	margin-top: auto;
	background: var(--white);
}
#search-results .tab-content {
	display: flex;
	overflow-y: auto;
	overflow-x: hidden;
	padding-right: 5px;
}
#search-results .tab-pane {
	display: none;
	flex-direction: column;
	width: 100%;
}
#search-results .tab-pane.active {
	display: flex;
}

/* Search Responsive - Start */
@media (min-width: 1280px) {
	.search-inline-pc {
		position: relative;
		display: flex;
		gap: 10px;
		width: 100%;
		z-index: 2;
	}
	/* Іконка в правому краї інпута: right = кнопка «Шукати» 98px + gap 10px + 14px */
	.search-box.search-inline-pc .icon {
		right: calc(98px + 10px + 14px);
	}
	.search-box.search-inline-pc .input {
		padding-right: 40px;
	}
}
@media (max-width: 1279px) {
	.search-call-mob {
		display: flex;
		margin-left: auto;
		cursor: pointer;
		width: 26px;
		min-width: 26px;
	}
	.search-wrapper {
		position: fixed;
		display: flex;
		justify-content: center;
		width: 100%;
		z-index: 10;
	}
	.search-background {
		background: transparent;
		-webkit-backdrop-filter: blur(2px);
		backdrop-filter: blur(2px);
	}
	.search-background.active {
		opacity: 1;
		visibility: visible;
		pointer-events: all;
	}
	.search-popup-mob {
		position: fixed;
		top: calc(var(--header-height) / 2);
		left: 0;
		right: 0;
		margin: 0 auto;
		width: 60%;
		max-width: 800px;
		padding: 10px;
		border-radius: var(--radius-medium);
		background: var(--light-gray);
		z-index: 2;
		display: flex;
		justify-content: center;
		opacity: 0;
		visibility: hidden;
		pointer-events: none;
	}
	.search-popup-mob.active {
		opacity: 1;
		visibility: visible;
		pointer-events: all;
	}
	.search-popup-mob input {
		background: var(--white);
	}
	.search-wrapper .search-box .icon {
		right: calc(14px + 10px);
	}
	#search-results {
		top: calc(var(--header-height) / 2 + 61px);
		left: 0;
		right: 0;
		margin: 0 auto;
	}
}
@media (max-width: 768px) {
	.search-background {
		background: rgb(0 0 0 / 5%);
		backdrop-filter: blur(0px);
	}
	.search-popup-mob {
		top: var(--header-height);
		width: 100%;
		border-radius: 0px;
	}
	#search-results {
		top: calc(var(--header-height) + 61px);
		width: 100%!important;
		max-height: 70vh;
	}
}
/* Search - End */

/* Shop Functions Group - Start */
.shop-functions-group {
	display: flex;
	align-items: center;
	gap: 10px;
}
.header-shop-button {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	width: 54px;
	height: 54px;
	background: var(--light-gray);
	border-radius: var(--radius-medium);
}
.header-shop-button img {
	width: 20px;
	height: 20px;
	object-fit: contain;
}
.compare-counter, 
.cart-counter, 
.wishlist-counter {
	position: absolute;
	top: 2px;
	right: 2px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 20px;
	background: var(--primary);
	color: var(--primary-match);
	border-radius: var(--radius-max);
	font-size: 11px;
	font-weight: 500;
}
.compare-label, 
.cart-label, 
.wishlist-label {
	font-size: 12px;
	margin-top: 4px;
	color: var(--black);
}
.compare-counter:empty, 
.cart-counter:empty, 
.wishlist-counter:empty {
	display: none;
}
.user-account {
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
}
.account-dropdown {
	top: 100%;
	right: 0;
	left: auto;
	min-width: 150px;
	z-index: 10;
}

@media (max-width: 1279px) {
	.shop-functions-group {
		gap: 5px;
	}
	.compare-label, .cart-label, .wishlist-label {
		display: none;
	}
	.header-shop-button {
		width: 40px;
		height: 40px;
		border-radius: var(--radius-mid);
	}
	.header-shop-button img {
		width: 16px;
		height: 16px;
	}
	.compare-counter, .cart-counter, .wishlist-counter {
		top: 0px;
		right: 1px;
		width: 15px;
		font-size: 10px;
	}
}
/* Shop Functions Group - End */
