/* =============================================
   Markaniz Burada — Header v3 (stable, no jitter)
   ============================================= */

/* Reset legacy main.css header rules */
.mb-header.mb-header--v3 {
	position: sticky;
	top: 0;
	z-index: 1000;
	height: auto !important;
	min-height: 0;
	background: transparent;
	backdrop-filter: none;
	border-bottom: none;
	isolation: isolate;
}

.mb-auth-page .mb-site-bar,
.mb-auth-page .mb-header--v3 {
	display: none;
}

/* ---- Static site bar (scrolls away, NOT sticky) ---- */
.mb-site-bar {
	background: linear-gradient(90deg, #115e59, #0f766e);
	color: rgba(255, 255, 255, 0.92);
	font-size: 13px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mb-site-bar__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	height: 36px;
	gap: 16px;
}

.mb-site-bar__msg {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	font-weight: 500;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.mb-site-bar__links {
	display: flex;
	gap: 20px;
	flex-shrink: 0;
}

.mb-site-bar__links a {
	color: rgba(255, 255, 255, 0.85);
	font-weight: 500;
}

.mb-site-bar__links a:hover {
	color: #fff;
}

/* ---- Sticky shell (FIXED height — never collapses) ---- */
.mb-header__sticky {
	background: #fff;
	border-bottom: 1px solid var(--mb-border);
	box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
	transform: translateZ(0);
	backface-visibility: hidden;
	transition: box-shadow 0.25s ease;
}

.mb-header--v3.is-scrolled .mb-header__sticky {
	box-shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
}

/* Main row */
.mb-header__main {
	border-bottom: 1px solid var(--mb-border);
}

.mb-header__main-inner {
	display: flex;
	align-items: center;
	gap: 20px;
	min-height: 76px;
	padding: 12px 0;
}

.mb-logo--header {
	flex-shrink: 0;
}

.mb-logo--header .custom-logo {
	max-height: 44px;
	width: auto;
}

.mb-header__search-wrap {
	flex: 1;
	max-width: 580px;
	min-width: 0;
}

/* Search */
.mb-header-search {
	display: flex;
	align-items: stretch;
	background: #f8fafc;
	border: 2px solid var(--mb-border);
	border-radius: 14px;
	overflow: hidden;
	transition: border-color 0.2s, box-shadow 0.2s;
}

.mb-header-search:focus-within {
	border-color: var(--mb-primary);
	box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.1);
	background: #fff;
}

.mb-header-search__field {
	flex: 1;
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 0 16px;
	min-width: 0;
}

.mb-header-search__icon {
	color: var(--mb-text-light);
	flex-shrink: 0;
}

.mb-header-search__input {
	flex: 1;
	border: none;
	background: none;
	padding: 13px 0;
	font-size: 15px;
	color: var(--mb-text);
	outline: none;
	min-width: 0;
}

.mb-header-search__cat {
	border: none;
	border-left: 1px solid var(--mb-border);
	background: transparent;
	padding: 0 14px;
	font-size: 13px;
	font-weight: 600;
	color: var(--mb-text-muted);
	cursor: pointer;
	max-width: 150px;
	outline: none;
}

.mb-header-search__btn {
	display: flex;
	align-items: center;
	gap: 8px;
	background: linear-gradient(135deg, var(--mb-primary), var(--mb-primary-light));
	color: #fff;
	border: none;
	padding: 0 22px;
	font-weight: 700;
	font-size: 14px;
	cursor: pointer;
	flex-shrink: 0;
}

/* Trending searches */
.mb-header-trending {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 6px 10px;
	margin-top: 8px;
	padding-left: 4px;
	font-size: 12px;
}

.mb-header-trending > span {
	color: var(--mb-text-light);
	font-weight: 600;
}

.mb-header-trending a {
	color: var(--mb-text-muted);
	padding: 2px 10px;
	background: #f1f5f9;
	border-radius: 100px;
	font-weight: 500;
	transition: all 0.2s;
}

.mb-header-trending a:hover {
	background: rgba(15, 118, 110, 0.1);
	color: var(--mb-primary);
}

/* Trust strip */
.mb-header__trust {
	background: linear-gradient(90deg, rgba(15, 118, 110, 0.04), rgba(20, 184, 166, 0.06));
	border-top: 1px solid rgba(15, 118, 110, 0.08);
}

.mb-header__trust-inner {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 28px;
	min-height: 32px;
	font-size: 12px;
	color: var(--mb-text-muted);
	font-weight: 500;
}

.mb-header-trust-item em {
	font-style: normal;
	margin-right: 4px;
}

/* Tools */
.mb-header__tools {
	display: flex;
	align-items: center;
	gap: 4px;
	flex-shrink: 0;
}

.mb-header-tool {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2px;
	padding: 8px 12px;
	border-radius: 12px;
	color: var(--mb-text-muted);
	transition: background 0.2s, color 0.2s;
	min-width: 56px;
}

.mb-header-tool:hover {
	background: rgba(15, 118, 110, 0.06);
	color: var(--mb-primary);
}

.mb-header-tool__label {
	font-size: 11px;
	font-weight: 600;
}

.mb-header-tool__badge {
	position: absolute;
	top: 4px;
	right: 6px;
	min-width: 18px;
	height: 18px;
	padding: 0 5px;
	background: var(--mb-primary);
	color: #fff;
	font-size: 10px;
	font-weight: 700;
	border-radius: 100px;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 2px solid #fff;
}

.mb-header-tool__badge--alert {
	background: #ef4444;
}

/* User menu */
.mb-header-user {
	position: relative;
}

.mb-header-user__trigger {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 6px 12px 6px 6px;
	border: 1px solid var(--mb-border);
	border-radius: 100px;
	background: #fff;
	cursor: pointer;
	font-family: inherit;
}

.mb-header-user__trigger:hover,
.mb-header-user.is-open .mb-header-user__trigger {
	border-color: var(--mb-primary);
	box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1);
}

.mb-header-user__avatar {
	width: 34px;
	height: 34px;
	border-radius: 50%;
	object-fit: cover;
}

.mb-header-user__name {
	font-size: 14px;
	font-weight: 600;
	max-width: 100px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.mb-header-user__caret {
	color: var(--mb-text-light);
	transition: transform 0.2s;
}

.mb-header-user.is-open .mb-header-user__caret {
	transform: rotate(180deg);
}

.mb-header-user__menu {
	position: absolute;
	top: calc(100% + 8px);
	right: 0;
	width: 260px;
	background: #fff;
	border: 1px solid var(--mb-border);
	border-radius: 16px;
	box-shadow: 0 20px 50px rgba(15, 23, 42, 0.15);
	padding: 8px;
	z-index: 1100;
}

.mb-header-user__menu-head {
	display: flex;
	gap: 12px;
	padding: 12px;
	border-bottom: 1px solid var(--mb-border);
	margin-bottom: 4px;
}

.mb-header-user__menu-head img {
	width: 44px;
	height: 44px;
	border-radius: 12px;
	object-fit: cover;
}

.mb-header-user__menu-head strong {
	display: block;
	font-size: 14px;
}

.mb-header-user__menu-head span {
	font-size: 12px;
	color: var(--mb-text-muted);
	word-break: break-all;
}

.mb-header-user__links a {
	display: block;
	padding: 10px 12px;
	border-radius: 10px;
	font-size: 14px;
	font-weight: 500;
	color: var(--mb-text);
}

.mb-header-user__links a:hover {
	background: rgba(15, 118, 110, 0.06);
	color: var(--mb-primary);
}

.mb-header-user__logout {
	margin-top: 4px;
	padding-top: 4px;
	border-top: 1px solid var(--mb-border);
}

.mb-header-user__logout button {
	width: 100%;
	padding: 10px 12px;
	background: none;
	border: none;
	text-align: left;
	font-size: 14px;
	color: #ef4444;
	cursor: pointer;
	border-radius: 10px;
	font-family: inherit;
}

.mb-header-user__logout button:hover {
	background: #fef2f2;
}

/* CTA */
.mb-header-cta {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 12px 20px;
	background: linear-gradient(135deg, #f97316, #ea580c);
	color: #fff !important;
	border-radius: 12px;
	font-weight: 700;
	font-size: 14px;
	box-shadow: 0 4px 14px rgba(249, 115, 22, 0.35);
	margin-left: 8px;
	white-space: nowrap;
}

.mb-header-cta:hover {
	opacity: 0.95;
	transform: translateY(-1px);
}

/* Nav row */
.mb-header__nav-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	min-height: 48px;
}

.mb-nav--bar {
	flex: 1;
	min-width: 0;
	overflow: hidden;
}

.mb-nav__list--bar {
	display: flex;
	align-items: center;
	gap: 2px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.mb-nav__list--bar > .mb-nav__item > .mb-nav__link {
	display: flex;
	align-items: center;
	gap: 4px;
	padding: 12px 16px;
	font-size: 14px;
	font-weight: 600;
	color: var(--mb-text-muted);
	border-radius: 10px;
	white-space: nowrap;
}

.mb-nav__list--bar > .mb-nav__item > .mb-nav__link:hover,
.mb-nav__list--bar > .mb-nav__item.is-active > .mb-nav__link {
	color: var(--mb-primary);
	background: rgba(15, 118, 110, 0.06);
}

.mb-nav__list--bar > .mb-nav__item.is-active > .mb-nav__link {
	box-shadow: inset 0 -2px 0 var(--mb-primary);
	border-radius: 10px 10px 0 0;
	background: transparent;
}

/* Category pills */
.mb-header__pills {
	display: flex;
	align-items: center;
	gap: 6px;
	flex-shrink: 0;
	overflow-x: auto;
	max-width: 42%;
	scrollbar-width: none;
	padding: 4px 0;
}

.mb-header__pills::-webkit-scrollbar {
	display: none;
}

.mb-header-pill {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 6px 12px;
	background: #f1f5f9;
	border-radius: 100px;
	font-size: 12px;
	font-weight: 600;
	color: var(--mb-text-muted);
	white-space: nowrap;
	transition: all 0.2s;
}

.mb-header-pill:hover {
	background: rgba(15, 118, 110, 0.1);
	color: var(--mb-primary);
}

.mb-header-pill span {
	font-size: 14px;
	line-height: 1;
}

/* Mega menu — GPU, no layout shift */
.mb-header__nav {
	position: relative;
}

.mb-nav__item--mega {
	position: static;
}

.mb-mega-menu {
	position: absolute;
	left: 0;
	right: 0;
	top: 100%;
	background: #fff;
	border-top: 1px solid var(--mb-border);
	box-shadow: 0 24px 48px rgba(15, 23, 42, 0.12);
	opacity: 0;
	visibility: hidden;
	transform: translate3d(0, 6px, 0);
	transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
	z-index: 900;
	pointer-events: none;
}

.mb-nav__item--mega:hover .mb-mega-menu {
	opacity: 1;
	visibility: visible;
	transform: translate3d(0, 0, 0);
	pointer-events: auto;
}

.mb-mega-menu__inner {
	max-width: var(--mb-container, 1280px);
	margin: 0 auto;
	padding: 24px;
}

.mb-mega-menu__grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 8px;
}

.mb-mega-menu__item {
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 16px;
	border-radius: 14px;
	border: 1px solid transparent;
}

.mb-mega-menu__item:hover {
	background: rgba(15, 118, 110, 0.05);
	border-color: rgba(15, 118, 110, 0.12);
}

.mb-mega-menu__icon {
	font-size: 1.75rem;
}

.mb-mega-menu__label {
	font-weight: 700;
	font-size: 14px;
}

.mb-mega-menu__count {
	font-size: 12px;
	color: var(--mb-text-muted);
}

.mb-mega-menu__all {
	display: inline-flex;
	margin-top: 16px;
	font-size: 14px;
	font-weight: 700;
	color: var(--mb-primary);
}

/* Dropdown */
.mb-nav__item--dropdown {
	position: relative;
}

.mb-nav__item--dropdown > .mb-nav__dropdown {
	position: absolute;
	top: calc(100% + 4px);
	left: 0;
	min-width: 200px;
	background: #fff;
	border: 1px solid var(--mb-border);
	border-radius: 12px;
	box-shadow: 0 12px 40px rgba(15, 23, 42, 0.12);
	padding: 6px;
	list-style: none;
	margin: 0;
	opacity: 0;
	visibility: hidden;
	transform: translate3d(0, 6px, 0);
	transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
	z-index: 200;
}

.mb-nav__item--dropdown:hover > .mb-nav__dropdown {
	opacity: 1;
	visibility: visible;
	transform: translate3d(0, 0, 0);
}

.mb-nav__dropdown a {
	display: block;
	padding: 10px 14px;
	border-radius: 8px;
	font-size: 13px;
	font-weight: 500;
	color: var(--mb-text-muted);
}

.mb-nav__dropdown a:hover {
	background: rgba(15, 118, 110, 0.08);
	color: var(--mb-primary);
}

.mb-nav__caret {
	opacity: 0.5;
}

/* Mobile */
.mb-header__mobile-actions {
	display: none;
	align-items: center;
	gap: 4px;
	margin-left: auto;
}

.mb-header-mobile-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border: none;
	background: none;
	border-radius: 12px;
	cursor: pointer;
	color: var(--mb-text);
}

.mb-mobile-toggle {
	flex-direction: column;
	gap: 5px;
	padding: 10px;
}

.mb-mobile-toggle span {
	display: block;
	width: 22px;
	height: 2px;
	background: var(--mb-text);
	border-radius: 2px;
	transition: transform 0.3s, opacity 0.3s;
}

.mb-header.is-open .mb-mobile-toggle span:nth-child(1) {
	transform: translateY(7px) rotate(45deg);
}

.mb-header.is-open .mb-mobile-toggle span:nth-child(2) {
	opacity: 0;
}

.mb-header.is-open .mb-mobile-toggle span:nth-child(3) {
	transform: translateY(-7px) rotate(-45deg);
}

/* Mobile search — fixed overlay, NO header height change */
.mb-header__search-mobile {
	position: fixed;
	left: 0;
	right: 0;
	top: 0;
	z-index: 1050;
	background: #fff;
	border-bottom: 1px solid var(--mb-border);
	padding: 72px 0 16px;
	box-shadow: 0 8px 24px rgba(15, 23, 42, 0.1);
	animation: mbSearchSlide 0.2s ease;
}

@keyframes mbSearchSlide {
	from { opacity: 0; transform: translateY(-8px); }
	to { opacity: 1; transform: translateY(0); }
}

.mb-header-search--mobile {
	display: flex;
	gap: 8px;
	max-width: none;
	border-radius: 12px;
}

.mb-header-search--mobile input {
	flex: 1;
	padding: 12px 16px;
	border: 1px solid var(--mb-border);
	border-radius: 10px;
	font-size: 15px;
}

/* Drawer */
.mb-header__overlay {
	position: fixed;
	inset: 0;
	background: rgba(15, 23, 42, 0.5);
	z-index: 1100;
	backdrop-filter: blur(4px);
}

.mb-header__drawer {
	position: fixed;
	top: 0;
	right: 0;
	width: min(360px, 92vw);
	height: 100vh;
	height: 100dvh;
	background: #fff;
	z-index: 1200;
	display: flex;
	flex-direction: column;
	transform: translate3d(100%, 0, 0);
	transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	box-shadow: -8px 0 40px rgba(15, 23, 42, 0.15);
}

.mb-header.is-open .mb-header__drawer {
	transform: translate3d(0, 0, 0);
}

.mb-header__drawer-head {
	padding: 20px;
	border-bottom: 1px solid var(--mb-border);
	position: relative;
}

.mb-header__drawer-close {
	position: absolute;
	top: 16px;
	right: 16px;
	width: 36px;
	height: 36px;
	border: none;
	background: var(--mb-bg);
	border-radius: 10px;
	cursor: pointer;
	font-size: 16px;
}

.mb-header__drawer-user {
	display: flex;
	gap: 14px;
	align-items: center;
	padding-right: 40px;
}

.mb-header__drawer-user img {
	width: 52px;
	height: 52px;
	border-radius: 14px;
	object-fit: cover;
}

.mb-header__drawer-auth {
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding-right: 40px;
}

.mb-header__drawer-nav {
	flex: 1;
	overflow-y: auto;
	padding: 12px 16px;
}

.mb-drawer-nav {
	list-style: none;
	margin: 0;
	padding: 0;
}

.mb-drawer-nav__link {
	display: block;
	padding: 14px 16px;
	font-size: 16px;
	font-weight: 600;
	color: var(--mb-text);
	border-radius: 12px;
}

.mb-drawer-nav__sub {
	list-style: none;
	margin: 0 0 8px;
	padding: 0 0 0 16px;
}

.mb-drawer-nav__sub a {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px 16px;
	font-size: 14px;
	color: var(--mb-text-muted);
	border-radius: 10px;
}

.mb-header__drawer-foot {
	padding: 16px 20px 24px;
	border-top: 1px solid var(--mb-border);
}

/* Responsive */
@media (max-width: 1100px) {
	.mb-header-search__cat { display: none; }
	.mb-header-tool__label { display: none; }
	.mb-header-tool { min-width: auto; padding: 8px; }
	.mb-header-user__name { display: none; }
	.mb-header-cta span { display: none; }
	.mb-header-cta { padding: 12px; margin-left: 4px; }
	.mb-header__pills { max-width: 36%; }
	.mb-mega-menu__grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 900px) {
	.mb-site-bar__links { display: none; }
	.mb-header-trending { display: none; }
	.mb-header__trust { display: none; }
	.mb-header__pills { display: none; }
	.mb-header-search__btn span { display: none; }
}

@media (max-width: 768px) {
	.mb-site-bar { display: none; }

	.mb-header__main-inner {
		min-height: 64px;
		padding: 8px 0;
	}

	.mb-header-search,
	.mb-header__tools,
	.mb-header__search-wrap {
		display: none;
	}

	.mb-header__mobile-actions {
		display: flex;
	}

	.mb-header__nav {
		display: none;
	}

	.mb-header-cta {
		display: none;
	}
}

@media (max-width: 480px) {
	.mb-logo__text small { display: none; }
}

/* Kill old v2 jitter rules if any remain */
.mb-header--v2 .mb-header__top,
.mb-header--v3 .mb-header__top {
	display: none !important;
}

.mb-header--v3.is-scrolled .mb-header__sticky {
	max-height: none;
}

.mb-header--v3.is-scrolled .mb-site-bar {
	max-height: none;
	opacity: 1;
}
