.mt-header {
	position: relative;
	z-index: 1000;
	background: #fff;
	border-bottom: 1px solid rgba(229, 231, 235, 0.9);
	box-shadow: 0 12px 34px rgba(17, 24, 39, 0.05);
	transition: box-shadow 0.3s ease, background 0.3s ease;
}

/* Marketplace header proportions shared by every frontend page. */
@media (min-width: 1025px) {
	.mt-header-topbar__inner { min-height: 34px; }
	.mt-header-topbar__item { font-size: 12px; }
	.mt-header-main__inner { grid-template-columns: 190px minmax(360px, 1fr) auto; min-height: 78px; gap: 22px; }
	.mt-header-logo img { max-width: 150px; max-height: 58px; }
	.mt-header-logo__tagline { display: none; }
	.mt-header-search { min-height: 44px; border-radius: 24px; }
	.mt-header-search__select,.mt-header-search input[type="search"] { min-height: 42px; font-size: 12px; }
	.mt-header-search__select { flex-basis: 190px; padding-left: 18px; }
	.mt-header-search__button { flex-basis: 48px; width: 48px; min-height: 40px; border-radius: 12px; }
	.mt-header-actions { gap: 16px; }
	.mt-header-action { gap: 7px; }
	.mt-header-action__text strong { font-size: 12px; }
	.mt-header-action__text small { font-size: 9px; }
	.mt-header-nav__inner { min-height: 42px; }
	.mt-header-categories { flex: 0 0 220px; }
	.mt-header-categories__button { min-height: 40px; border-radius: 6px 6px 0 0; font-size: 12px; }
	.mt-primary-nav .menu { justify-content:flex-start; gap:0; }
	.mt-primary-nav .menu>li>a { min-height: 42px; padding: 0 18px; font-size: 12px; }
}

body.admin-bar .mt-header {
	top: auto;
}

.mt-header svg {
	width: 1.35rem;
	height: 1.35rem;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.mt-header,
.mt-header__inner,
.mt-header-mobile,
.mt-header-mobile__inner,
.mt-header-search,
.mt-header-actions,
.mt-mobile-panel {
	min-width: 0;
	max-width: 100%;
}

.mt-header-topbar {
	background: linear-gradient(90deg, var(--mt-green-dark), var(--mt-green));
	color: #fff;
	font-weight: 700;
}

.mt-header-topbar__inner {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	min-height: 46px;
	gap: 1rem;
}

.mt-header-topbar__item,
.mt-header-topbar__right,
.mt-header-socials {
	display: inline-flex;
	align-items: center;
	gap: 0.7rem;
}

.mt-header-topbar__item {
	color: #fff;
	font-size: 0.95rem;
}

.mt-header-topbar__item svg {
	color: var(--mt-yellow);
}

.mt-header-topbar__right {
	justify-content: flex-end;
}

.mt-header-socials {
	padding-left: 1rem;
	border-left: 1px solid rgba(255, 255, 255, 0.2);
}

.mt-header-socials a {
	display: inline-flex;
	color: #fff;
}

.mt-header-main {
	background: #fff;
}

.mt-header-main__inner {
	display: grid;
	grid-template-columns: 250px minmax(280px, 1fr) auto;
	align-items: center;
	gap: 2rem;
	min-height: 154px;
}

.mt-header-logo {
	display: inline-flex;
	align-items: flex-start;
	flex-direction: column;
	gap: 0.25rem;
}

.mt-header-logo .custom-logo-link {
	display: inline-flex;
}

.mt-header-logo img {
	display: block;
	width: auto;
	max-width: var(--mt-logo-width, 210px);
	max-height: 86px;
	object-fit: contain;
	transition: max-width 0.2s ease, max-height 0.2s ease;
}

.mt-header-logo__name {
	color: var(--mt-green-dark);
	font-family: var(--mt-font-heading);
	font-size: 2rem;
	font-weight: 800;
	line-height: 1;
}

.mt-header-logo__tagline {
	color: var(--mt-muted);
	font-size: 0.95rem;
}

.mt-header-search {
	position: relative;
	display: flex;
	align-items: center;
	width: 100%;
	min-height: 64px;
	overflow: hidden;
	border: 1px solid rgba(11, 77, 60, 0.14);
	border-radius: 999px;
	background: linear-gradient(180deg, #fff, #fbfdfb);
	box-shadow: 0 10px 28px rgba(17, 24, 39, 0.07), inset 0 0 0 1px rgba(255, 255, 255, 0.88);
	transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.mt-header-search:focus-within {
	border-color: rgba(11, 77, 60, 0.36);
	background: #fff;
	box-shadow: 0 14px 34px rgba(17, 24, 39, 0.1), 0 0 0 4px rgba(11, 77, 60, 0.08);
}

.mt-header-search__select,
.mt-header-search input[type="search"] {
	height: 100%;
	min-height: 62px;
	border: 0;
	background: transparent;
	color: var(--mt-text);
	font-size: 1rem;
	font-weight: 700;
	outline: 0;
}

.mt-header-search__select {
	flex: 0 0 250px;
	padding: 0 3rem 0 1.65rem;
	border-right: 1px solid rgba(11, 77, 60, 0.14);
	background-image: linear-gradient(45deg, transparent 50%, #6b7280 50%), linear-gradient(135deg, #6b7280 50%, transparent 50%);
	background-position: calc(100% - 1.45rem) 50%, calc(100% - 1.05rem) 50%;
	background-size: 6px 6px, 6px 6px;
	background-repeat: no-repeat;
	color: #0f172a;
	cursor: pointer;
	appearance: none;
}

.mt-header-search input[type="search"] {
	flex: 1;
	min-width: 0;
	padding: 0 1.45rem;
	color: #111827;
	font-weight: 600;
}

.mt-header-search input[type="search"]::placeholder {
	color: #6b7280;
	font-weight: 500;
}

.mt-header-search__button {
	flex: 0 0 52px;
	width: 52px;
	min-height: 52px;
	margin-right: 6px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: linear-gradient(135deg, #ff7a12, #ff5f12);
	color: #fff;
	box-shadow: 0 10px 20px rgba(255, 95, 18, 0.25);
	transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.mt-header-search__button:hover,
.mt-header-search__button:focus-visible {
	background: linear-gradient(135deg, var(--mt-green), var(--mt-green-dark));
	box-shadow: 0 12px 24px rgba(11, 77, 60, 0.2);
	transform: translateY(-1px);
}

.mt-header-search__button svg {
	width: 1.45rem;
	height: 1.45rem;
}

.mt-header-actions {
	display: flex;
	align-items: center;
	gap: 1.35rem;
	white-space: nowrap;
}

.mt-header-action {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 0.7rem;
	color: var(--mt-text);
}

.mt-header-action:hover {
	color: var(--mt-green);
}

.mt-header-action__icon {
	position: relative;
	display: inline-flex;
	color: var(--mt-green-dark);
	transition: color var(--mt-ease), transform var(--mt-ease);
}

.mt-header-action:hover .mt-header-action__icon {
	color: var(--mt-orange);
	transform: translateY(-1px);
}

.mt-header-action__icon svg {
	width: 2rem;
	height: 2rem;
	stroke-width: 1.8;
}

.mt-header-action__text {
	display: inline-flex;
	flex-direction: column;
	gap: 0.15rem;
	line-height: 1.2;
}

.mt-header-action__text strong {
	font-size: 0.95rem;
}

.mt-header-action__text small {
	color: var(--mt-muted);
	font-size: 0.8rem;
}

.mt-header-cart .mt-cart-total {
	color: var(--mt-orange);
	font-weight: 800;
}

.mt-header-badge {
	position: absolute;
	top: -0.8rem;
	right: -0.85rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 1.45rem;
	height: 1.45rem;
	padding: 0 0.35rem;
	border-radius: 999px;
	background: var(--mt-orange);
	color: #fff;
	font-size: 0.78rem;
	font-weight: 800;
	line-height: 1;
}

.mt-header-nav {
	background: #fff;
	border-top: 1px solid var(--mt-border);
}

.mt-header-nav__inner {
	position: relative;
	display: grid;
	grid-template-columns: 292px minmax(0, 1fr);
	align-items: center;
	gap: 3rem;
	min-height: 78px;
}

.mt-header-categories {
	position: relative;
}

.mt-header-categories__button {
	display: inline-flex;
	align-items: center;
	justify-content: flex-start;
	gap: 1rem;
	width: 100%;
	min-height: 78px;
	padding: 0 1.55rem;
	border-radius: var(--mt-radius-sm);
	background: linear-gradient(135deg, var(--mt-green), var(--mt-green-dark));
	color: #fff;
	box-shadow: var(--mt-shadow-sm);
}

.mt-primary-nav ul,
.mt-primary-nav li {
	padding: 0;
	margin: 0;
	list-style: none;
}

.mt-primary-nav > ul {
	display: flex;
	align-items: center;
	gap: 1.8rem;
}

.mt-primary-nav li {
	position: relative;
}

.mt-primary-nav a {
	position: relative;
	display: inline-flex;
	align-items: center;
	min-height: 78px;
	color: var(--mt-text);
	font-weight: 700;
}

.mt-primary-nav .current-menu-item > a,
.mt-primary-nav .current-menu-ancestor > a,
.mt-primary-nav a:hover {
	color: var(--mt-green);
}

.mt-primary-nav .current-menu-item > a::after,
.mt-primary-nav .current-menu-ancestor > a::after {
	position: absolute;
	right: 0;
	bottom: 0;
	left: 0;
	height: 4px;
	border-radius: 999px 999px 0 0;
	background: var(--mt-green);
	content: "";
}

.mt-primary-nav .sub-menu {
	position: absolute;
	top: 100%;
	left: 0;
	z-index: 20;
	min-width: 220px;
	padding: 0.65rem;
	border: 1px solid var(--mt-border);
	border-radius: var(--mt-radius-md);
	background: #fff;
	box-shadow: var(--mt-shadow-md);
	opacity: 0;
	visibility: hidden;
	transform: translateY(8px);
	transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

.mt-primary-nav li:hover > .sub-menu,
.mt-primary-nav li:focus-within > .sub-menu {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.mt-primary-nav .sub-menu a {
	display: flex;
	min-height: auto;
	padding: 0.7rem 0.85rem;
	border-radius: var(--mt-radius-sm);
}

.mt-primary-nav .sub-menu a:hover {
	background: var(--mt-bg-soft);
}

.mt-mega-menu {
	position: absolute;
	top: calc(100% + 0.7rem);
	left: 0;
	z-index: 30;
	width: min(92vw, var(--mt-container));
	padding: 2rem;
	border: 1px solid rgba(229, 231, 235, 0.8);
	border-radius: var(--mt-radius-lg);
	background: rgba(255, 255, 255, 0.98);
	box-shadow: 0 20px 55px rgba(17, 24, 39, 0.14);
	opacity: 0;
	visibility: hidden;
	transform: translateY(12px);
	transition: opacity var(--mt-ease), transform var(--mt-ease), visibility var(--mt-ease);
}

.mt-header-categories:hover .mt-mega-menu,
.mt-header-categories:focus-within .mt-mega-menu,
.mt-mega-menu.is-open {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.mt-mega-menu__grid {
	display: grid;
	grid-template-columns: repeat(6, minmax(120px, 1fr)) 220px;
	gap: 1.4rem;
}

.mt-mega-menu__column {
	min-height: 220px;
	padding-right: 1.2rem;
	border-right: 1px solid var(--mt-border);
}

.mt-mega-menu__title {
	display: flex;
	align-items: center;
	gap: 0.65rem;
	margin-bottom: 1rem;
	color: var(--mt-text);
	font-weight: 800;
}

.mt-mega-menu__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2rem;
	height: 2rem;
	border-radius: 50%;
	background: var(--mt-bg-soft);
	color: var(--mt-green);
	font-weight: 900;
	text-transform: uppercase;
}

.mt-mega-menu ul {
	padding: 0;
	margin: 0;
	list-style: none;
}

.mt-mega-menu li + li {
	margin-top: 0.55rem;
}

.mt-mega-menu a {
	color: var(--mt-text);
}

.mt-mega-menu a:hover,
.mt-mega-menu__all {
	color: var(--mt-green);
}

.mt-mega-menu p {
	margin-bottom: 1rem;
	font-size: 0.92rem;
}

.mt-mega-menu__all {
	display: inline-flex;
	margin-top: 1rem;
	font-weight: 700;
}

.mt-mega-menu__promo,
.mt-mega-menu__fallback {
	padding: 1.5rem;
	border-radius: var(--mt-radius-md);
	background: linear-gradient(135deg, #fff7e6, #fff1d1);
}

.mt-mega-menu__promo h2,
.mt-mega-menu__fallback h2 {
	margin-bottom: 0.6rem;
	font-size: 1.35rem;
}

.mt-mega-menu__promo h2 {
	color: var(--mt-orange);
}

.mt-mega-menu__cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 42px;
	padding: 0.75rem 1rem;
	border-radius: var(--mt-radius-sm);
	background: var(--mt-orange);
	color: #fff;
	font-weight: 800;
}

.mt-header-mobile,
.mt-mobile-overlay,
.mt-mobile-panel {
	display: none;
}

.mt-header-sticky {
	position: fixed;
	top: 0;
	right: 0;
	left: 0;
	z-index: 1000;
	display: block;
	padding-block: 0.75rem;
	background: rgba(255, 255, 255, 0.97);
	box-shadow: 0 16px 38px rgba(17, 24, 39, 0.1);
	backdrop-filter: blur(14px);
	opacity: 0;
	pointer-events: none;
	transform: translateY(-110%);
	visibility: hidden;
	transition: opacity 0.28s ease, transform 0.28s ease, visibility 0.28s ease, box-shadow 0.28s ease;
	will-change: transform, opacity;
}

body.admin-bar .mt-header-sticky {
	top: 32px;
}

.mt-header.is-sticky .mt-header-sticky {
	opacity: 1;
	pointer-events: auto;
	transform: translateY(0);
	visibility: visible;
}

.mt-header-sticky__inner {
	display: grid;
	grid-template-columns: 170px 230px minmax(280px, 1fr) auto;
	align-items: center;
	gap: 1.5rem;
	min-height: 88px;
}

.mt-header-sticky .mt-header-logo img {
	max-width: min(var(--mt-logo-width, 210px), 132px);
	max-height: 58px;
}

.mt-header-sticky .mt-header-logo__tagline {
	display: none;
}

.mt-header-categories--sticky .mt-header-categories__button {
	min-height: 56px;
	border-radius: var(--mt-radius-md);
}

.mt-header-categories--sticky .mt-mega-menu {
	top: calc(100% + 1rem);
	left: -170px;
}

.mt-header-sticky .mt-header-search {
	min-height: 56px;
}

.mt-header-sticky .mt-header-search input[type="search"],
.mt-header-sticky .mt-header-search__button {
	min-height: 54px;
}

.mt-header-sticky .mt-header-search__button {
	width: 54px;
	flex-basis: 54px;
}

.mt-header-actions--compact .mt-header-action__text small:not(.mt-cart-total) {
	display: none;
}

body.mt-mobile-menu-open {
	overflow: hidden;
}

@media (max-width: 1180px) {
	.mt-header-main__inner {
		grid-template-columns: 210px minmax(260px, 1fr) auto;
		gap: 1.2rem;
	}

	.mt-header-actions {
		gap: 0.9rem;
	}

	.mt-header-action__text small {
		display: none;
	}

	.mt-header-nav__inner {
		grid-template-columns: 260px minmax(0, 1fr);
		gap: 1.5rem;
	}

	.mt-primary-nav > ul {
		gap: 1.1rem;
	}

	.mt-mega-menu__grid {
		grid-template-columns: repeat(3, minmax(150px, 1fr));
	}

	.mt-mega-menu__promo {
		grid-column: 1 / -1;
	}

	.mt-header-sticky__inner {
		grid-template-columns: 130px 210px minmax(240px, 1fr) auto;
	}
}

@media (max-width: 1024px) {
	.mt-header-topbar,
	.mt-header-main,
	.mt-header-nav,
	.mt-header-sticky,
	.mt-header.is-sticky .mt-header-sticky {
		display: none;
	}

	.mt-header {
		position: relative;
		top: auto;
		z-index: 2147483000;
		isolation: auto;
	}

	body.mt-mobile-menu-open .mt-header {
		z-index: 2147483000;
	}

	.mt-header-mobile {
		position: relative;
		z-index: 2147483000;
		display: block;
		padding: 0.75rem 0 0.9rem;
		background: #fff;
	}

	.mt-header-mobile__inner {
		display: grid;
		grid-template-columns: 44px minmax(90px, 1fr) auto;
		align-items: center;
		gap: 0.8rem;
	}

	.mt-mobile-toggle,
	.mt-mobile-close {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 44px;
		min-height: 44px;
		padding: 0;
		border-radius: var(--mt-radius-sm);
		background: #fff;
		color: var(--mt-text);
		box-shadow: none;
	}

	.mt-mobile-toggle:hover,
	.mt-mobile-close:hover {
		background: var(--mt-bg-soft);
		color: var(--mt-green);
		transform: none;
	}

	.mt-header-mobile .mt-header-logo {
		align-items: center;
	}

	.mt-header-mobile .mt-header-logo img {
		max-width: var(--mt-logo-mobile-width, 128px);
		max-height: 56px;
	}

	.mt-header-mobile .mt-header-logo__tagline,
	.mt-header-mobile .mt-header-action__text {
		display: none;
	}

	.mt-header-mobile .mt-header-actions {
		justify-content: flex-end;
		gap: 0.8rem;
		min-width: 0;
	}

	.mt-header-mobile .mt-header-action__icon svg {
		width: 1.7rem;
		height: 1.7rem;
	}

	.mt-header-mobile__search {
		margin-top: 0.75rem;
	}

	.mt-header-mobile .mt-header-search,
	.mt-header-mobile__search .mt-header-search {
		min-height: 54px;
	}

	.mt-header-mobile .mt-header-search input[type="search"],
	.mt-header-mobile .mt-header-search__button,
	.mt-header-mobile__search .mt-header-search input[type="search"],
	.mt-header-mobile__search .mt-header-search__button {
		min-height: 52px;
	}

	.mt-header-mobile .mt-header-search__button,
	.mt-header-mobile__search .mt-header-search__button {
		width: 52px;
		flex-basis: 52px;
	}

	.mt-mobile-overlay {
		position: fixed;
		inset: 0;
		z-index: 2147483001;
		display: block;
		background: rgba(17, 24, 39, 0.42);
		opacity: 0;
		pointer-events: none;
		visibility: hidden;
		transition: opacity 0.24s ease, visibility 0.24s ease;
	}

	.mt-mobile-panel {
		position: fixed;
		inset: 0 auto 0 0;
		z-index: 2147483002;
		display: flex;
		flex-direction: column;
		width: min(88vw, 380px);
		max-width: 100vw;
		height: 100vh;
		height: 100dvh;
		padding: 1.2rem;
		background: #fff;
		box-shadow: 20px 0 45px rgba(17, 24, 39, 0.18);
		overflow-y: auto;
		transform: translateX(-100%);
		transition: transform 0.28s ease;
	}

	body.mt-mobile-menu-open .mt-mobile-overlay {
		opacity: 1;
		pointer-events: auto;
		visibility: visible;
	}

	body.mt-mobile-menu-open .mt-mobile-panel {
		transform: translateX(0);
	}

	.mt-mobile-panel__head {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 1rem;
		margin-bottom: 1.5rem;
	}

	.mt-mobile-panel ul {
		padding: 0;
		margin: 0;
		list-style: none;
	}

	.mt-mobile-panel li {
		position: relative;
		border-bottom: 1px solid var(--mt-border);
	}

	.mt-mobile-panel a {
		display: flex;
		align-items: center;
		min-height: 48px;
		color: var(--mt-text);
		font-weight: 700;
	}

	.mt-mobile-submenu-toggle {
		position: absolute;
		top: 0.25rem;
		right: 0;
		width: 40px;
		min-height: 40px;
		padding: 0;
		background: transparent;
		color: var(--mt-text);
		box-shadow: none;
	}

	.mt-mobile-submenu-toggle:hover {
		background: var(--mt-bg-soft);
		color: var(--mt-green);
		transform: none;
	}

	.mt-mobile-panel .sub-menu {
		display: none;
		padding-left: 0.9rem;
	}

	.mt-mobile-panel .is-submenu-open > .sub-menu {
		display: block;
	}

	.mt-mobile-panel__categories {
		margin-top: 1.5rem;
		padding-top: 1.5rem;
		border-top: 2px solid var(--mt-bg-soft);
	}

	.mt-mobile-panel__categories h2 {
		margin-bottom: 0.75rem;
		font-size: 1rem;
		color: var(--mt-green-dark);
	}
}

@media (max-width: 782px) {
	body.admin-bar .mt-header {
		top: 46px;
	}

	body.admin-bar .mt-header-sticky {
		top: 46px;
	}
}

@media (max-width: 520px) {
	.mt-header-mobile__inner {
		grid-template-columns: 42px minmax(78px, 1fr) auto;
		gap: 0.6rem;
	}

	.mt-header-mobile .mt-header-logo img {
		max-width: 106px;
	}

	.mt-header-mobile .mt-header-actions {
		gap: 0.6rem;
	}

	.mt-header-mobile .mt-header-search__select {
		display: none;
	}

	.mt-header-mobile .mt-header-search input[type="search"] {
		padding-inline: 0.9rem;
	}

	.mt-header-mobile .mt-header-action:first-child {
		display: none;
	}

	.mt-header-mobile .mt-header-wishlist,
	.mt-header-mobile .mt-header-cart {
		display: inline-flex;
	}

	.mt-header-mobile .mt-header-action__icon {
		align-items: center;
		justify-content: center;
		width: 2.15rem;
		height: 2.15rem;
	}

	.mt-header-mobile .mt-header-action__icon svg {
		width: 1.45rem;
		height: 1.45rem;
	}

	.mt-header-badge {
		min-width: 1.2rem;
		height: 1.2rem;
		font-size: 0.7rem;
	}
}

.mt-header-wishlist .mt-wishlist-count {
	transition: transform 0.2s ease, background 0.2s ease;
}

.mt-header-wishlist .mt-wishlist-count:not(:empty) {
	background: var(--mt-orange);
}
