/**
 * DAF Marketplace — Header Main
 * Location: /wp-content/plugins/daf-marketplace/assets/css/header/header-main.css
 *
 * Purpose:
 * - Style the plugin-owned main marketplace header row.
 * - Keep logo, primary nav, search trigger, and CTA aligned in one premium row.
 * - Respect header max-width design setting through CSS variables with safe fallback.
 * - Keep menu colors and CTA states consistent across all frontend pages and themes.
 * - Keep dropdown/search widgets on the front layer without relying on theme CSS.
 */

.daf-mp-header__main {
	position: relative;
	z-index: 10000;
	width: 100%;
	background: #ffffff;
	border-bottom: 1px solid #e2e8f0;
	overflow: visible;
	isolation: isolate;
}

.daf-mp-header__main-inner,
.daf-mp-header__branding,
.daf-mp-header-branding,
.daf-mp-header__nav-primary--main,
.daf-mp-header__right,
.daf-mp-header__actions-wrap,
.daf-mp-header__search,
.daf-mp-header__search-hook,
.daf-mp-header__cta,
.daf-mp-header-cta-wrap,
.daf-mp-header-search-trigger-wrap {
	display: flex;
	align-items: center;
}

.daf-mp-header__main-inner {
	position: relative;
	z-index: 10001;
	width: min(100% - 32px, var(--daf-mp-header-max-width, var(--daf-header-max-width, var(--daf-width-header, 1400px))));
	max-width: var(--daf-mp-header-max-width, var(--daf-header-max-width, var(--daf-width-header, 1400px)));
	min-height: 82px;
	margin-inline: auto;
	padding: 0;
	justify-content: flex-start;
	gap: clamp(18px, 2vw, 34px);
	overflow: visible;
}

.daf-mp-header__branding {
	position: relative;
	z-index: 10002;
	flex: 0 0 auto;
	min-width: 0;
}

.daf-mp-header-branding {
	justify-content: flex-start;
	min-width: 0;
}

.daf-mp-header-logo {
	display: inline-flex;
	align-items: center;
	min-height: 50px;
	max-width: 100%;
	text-decoration: none;
}

.daf-mp-header-logo:hover,
.daf-mp-header-logo:focus {
	text-decoration: none;
	outline: none;
}

.daf-mp-header-logo__image {
	display: block;
	width: auto;
	max-width: 178px;
	max-height: 54px;
	object-fit: contain;
}

.daf-mp-header-logo__text {
	color: #0f172a;
	font-size: clamp(25px, 2.2vw, 32px);
	font-weight: 800;
	letter-spacing: -0.035em;
	line-height: 1;
	white-space: nowrap;
}

/*
 * Main primary nav.
 */
.daf-mp-header__nav-primary--main {
	position: relative;
	z-index: 10005;
	justify-content: flex-start;
	flex: 1 1 auto;
	min-width: 0;
	overflow: visible;
}

.daf-mp-header__nav-primary--main .daf-mp-header-nav {
	position: relative;
	z-index: 10006;
	display: flex;
	align-items: center;
	justify-content: flex-start;
	width: 100%;
	min-width: 0;
	overflow: visible;
}

.daf-mp-header__nav-primary--main .daf-mp-header-nav__menu {
	display: flex;
	align-items: center;
	justify-content: flex-start;
	gap: clamp(12px, 1.2vw, 22px);
	flex-wrap: nowrap;
	min-width: 0;
	overflow: visible;
}

.daf-mp-header__nav-primary--main .daf-mp-header-nav__link,
.daf-mp-header__nav-primary--main .daf-mp-header-nav .menu-item > a,
.daf-mp-header__nav-primary--main .daf-mp-header-nav .page_item > a {
	min-height: 82px;
	padding: 0 4px;
	color: #0f172a;
	font-size: clamp(14px, 1.02vw, 16px);
	font-weight: 650;
	letter-spacing: -0.01em;
	line-height: 1;
	text-decoration: none;
	white-space: nowrap;
}

.daf-mp-header__nav-primary--main .daf-mp-header-nav__link:hover,
.daf-mp-header__nav-primary--main .daf-mp-header-nav__link:focus,
.daf-mp-header__nav-primary--main .daf-mp-header-nav .menu-item > a:hover,
.daf-mp-header__nav-primary--main .daf-mp-header-nav .menu-item > a:focus,
.daf-mp-header__nav-primary--main .daf-mp-header-nav .page_item > a:hover,
.daf-mp-header__nav-primary--main .daf-mp-header-nav .page_item > a:focus {
	color: #0f9f49;
	text-decoration: none;
	outline: none;
}

.daf-mp-header__nav-primary--main .daf-mp-header-nav__item.current-menu-item > .daf-mp-header-nav__link,
.daf-mp-header__nav-primary--main .daf-mp-header-nav__item.current-menu-ancestor > .daf-mp-header-nav__link,
.daf-mp-header__nav-primary--main .daf-mp-header-nav__item.current_page_item > .daf-mp-header-nav__link,
.daf-mp-header__nav-primary--main .daf-mp-header-nav__item.current_page_parent > .daf-mp-header-nav__link,
.daf-mp-header__nav-primary--main .daf-mp-header-nav .menu-item.current-menu-item > a,
.daf-mp-header__nav-primary--main .daf-mp-header-nav .menu-item.current-menu-ancestor > a,
.daf-mp-header__nav-primary--main .daf-mp-header-nav .page_item.current_page_item > a,
.daf-mp-header__nav-primary--main .daf-mp-header-nav .page_item.current_page_parent > a {
	color: #0f9f49;
}

.daf-mp-header__nav-primary--main .daf-mp-header-nav__link:after,
.daf-mp-header__nav-primary--main .daf-mp-header-nav .menu-item > a:after,
.daf-mp-header__nav-primary--main .daf-mp-header-nav .page_item > a:after {
	bottom: 18px;
	height: 2px;
	background: #0f9f49;
	border-radius: 999px;
}

/*
 * Parent dropdown menu spacing in the main header row.
 */
.daf-mp-header__nav-primary--main .daf-mp-header-nav .menu-item-has-children > .daf-mp-header-nav__link,
.daf-mp-header__nav-primary--main .daf-mp-header-nav .page_item_has_children > .daf-mp-header-nav__link,
.daf-mp-header__nav-primary--main .daf-mp-header-nav .menu-item-has-children > a,
.daf-mp-header__nav-primary--main .daf-mp-header-nav .page_item_has_children > a {
	padding-right: 17px;
}

/*
 * Right side: search + CTA inline.
 */
.daf-mp-header__right {
	position: relative;
	z-index: 10008;
	display: flex;
	align-items: center;
	justify-content: flex-end;
	flex: 0 0 auto;
	margin-left: auto;
	min-width: 0;
	overflow: visible;
}

.daf-mp-header__actions-wrap {
	position: relative;
	z-index: 10009;
	display: flex !important;
	align-items: center !important;
	justify-content: flex-end;
	flex-direction: row !important;
	flex-wrap: nowrap !important;
	gap: clamp(12px, 1.2vw, 20px);
	min-width: 0;
	width: auto;
	overflow: visible;
}

.daf-mp-header__search,
.daf-mp-header__search-hook {
	position: relative;
	z-index: 10010;
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: auto;
	max-width: none;
	min-width: auto;
	overflow: visible;
}

.daf-mp-header-search-trigger-wrap {
	position: relative;
	z-index: 10011;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: auto;
}

.daf-mp-header-search-trigger {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	min-width: 44px;
	min-height: 44px;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: transparent;
	color: #475569;
	box-shadow: none;
	cursor: pointer;
	transition:
		color 180ms ease,
		background-color 180ms ease,
		transform 180ms ease;
}

.daf-mp-header-search-trigger:hover,
.daf-mp-header-search-trigger:focus {
	background: #f4f8f5;
	color: #0f9f49;
	outline: none;
	transform: translateY(-1px);
}

.daf-mp-header-search-trigger__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 20px;
	height: 20px;
	line-height: 1;
}

.daf-mp-header-search-trigger__icon svg {
	display: block;
	width: 100%;
	height: 100%;
}

/*
 * Search/dropdown widgets must stay above header and hero.
 */
.daf-mp-header__search-hook .daf-mp-search-modal,
.daf-mp-header__search-hook .daf-mp-search-dropdown,
.daf-mp-header__search-hook .daf-live-results-dropdown,
.daf-mp-header__search-hook [class*="dropdown"],
.daf-mp-header__search-hook [class*="modal"],
.daf-mp-header-search-trigger-wrap .daf-mp-search-modal,
.daf-mp-header-search-trigger-wrap .daf-mp-search-dropdown,
.daf-mp-header-search-trigger-wrap .daf-live-results-dropdown,
.daf-mp-header-search-trigger-wrap [class*="dropdown"],
.daf-mp-header-search-trigger-wrap [class*="modal"] {
	z-index: 10050;
}

/*
 * CTA button.
 * Text is forced white across all page states because theme/global anchor
 * styles can otherwise override it.
 */
.daf-mp-header__cta {
	position: relative;
	z-index: 10010;
	display: flex;
	align-items: center;
	justify-content: flex-end;
	flex: 0 0 auto;
	width: auto;
	min-width: 0;
	overflow: visible;
}

.daf-mp-header-cta-wrap {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: auto;
}

.daf-mp-header-cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 0;
	min-height: 46px;
	padding: 0 22px;
	border: 1px solid #8bbe38;
	border-radius: 10px;
	background: #8bbe38;
	color: #ffffff !important;
	font-size: 16px;
	font-weight: 750;
	line-height: 1;
	letter-spacing: -0.01em;
	text-align: center;
	text-decoration: none;
	white-space: nowrap;
	box-shadow: 0 10px 24px rgba(139, 190, 56, 0.18);
	transition:
		background-color 180ms ease,
		border-color 180ms ease,
		color 180ms ease,
		box-shadow 180ms ease,
		transform 180ms ease;
}

.daf-mp-header-cta:visited,
.daf-mp-header-cta:hover,
.daf-mp-header-cta:focus,
.daf-mp-header-cta:active {
	color: #ffffff !important;
	text-decoration: none;
	outline: none;
}

.daf-mp-header-cta:hover,
.daf-mp-header-cta:focus {
	background: #7fb02f;
	border-color: #7fb02f;
	box-shadow: 0 12px 28px rgba(127, 176, 47, 0.25);
	transform: translateY(-1px);
}

.daf-mp-header-cta__text {
	color: inherit !important;
	white-space: nowrap;
}

/*
 * Hide only deprecated action wrappers in this compact header.
 * Do not hide right-side search/CTA/widgets globally.
 */
.daf-mp-header__actions,
.daf-mp-header-actions,
.daf-mp-header-action__text,
.daf-mp-header__nav {
	display: none;
}

/*
 * Force compact submenu links inside desktop header.
 */
.daf-mp-header__nav-primary--main .daf-mp-header-nav .sub-menu .menu-item > a,
.daf-mp-header__nav-primary--main .daf-mp-header-nav .children .page_item > a {
	min-height: 30px !important;
	padding: 2px 8px !important;
	font-size: 13.5px !important;
	line-height: 1.15 !important;
}

.daf-mp-header__nav-primary--main .daf-mp-header-nav .sub-menu a::before,
.daf-mp-header__nav-primary--main .daf-mp-header-nav .children a::before {
	width: 22px !important;
	height: 22px !important;
	background-size: 14px 14px, auto !important;
}

.daf-mp-header__nav-primary--main .daf-mp-header-nav .sub-menu,
.daf-mp-header__nav-primary--main .daf-mp-header-nav .children {
	padding: 3px !important;
	width: 232px !important;
}

/*
 * Large desktop and laptop.
 */
@media (max-width: 1280px) {
	.daf-mp-header__main-inner {
		width: min(100% - 28px, var(--daf-mp-header-max-width, var(--daf-header-max-width, var(--daf-width-header, 1400px))));
		gap: 22px;
		min-height: 78px;
	}

	.daf-mp-header-logo__image {
		max-width: 164px;
		max-height: 50px;
	}

	.daf-mp-header__nav-primary--main .daf-mp-header-nav__menu {
		gap: 16px;
	}

	.daf-mp-header__nav-primary--main .daf-mp-header-nav__link,
	.daf-mp-header__nav-primary--main .daf-mp-header-nav .menu-item > a,
	.daf-mp-header__nav-primary--main .daf-mp-header-nav .page_item > a {
		min-height: 78px;
		font-size: 15px;
	}

	.daf-mp-header__actions-wrap {
		gap: 14px;
	}

	.daf-mp-header-cta {
		min-height: 42px;
		padding: 0 18px;
		font-size: 15px;
	}
}

/*
 * Small laptop / landscape tablet.
 */
@media (max-width: 1100px) {
	.daf-mp-header__main-inner {
		width: min(100% - 24px, var(--daf-mp-header-max-width, var(--daf-header-max-width, var(--daf-width-header, 1400px))));
		gap: 14px;
		min-height: 72px;
	}

	.daf-mp-header-logo__image {
		max-width: 148px;
		max-height: 46px;
	}

	.daf-mp-header__nav-primary--main .daf-mp-header-nav__menu {
		gap: 10px;
	}

	.daf-mp-header__nav-primary--main .daf-mp-header-nav__link,
	.daf-mp-header__nav-primary--main .daf-mp-header-nav .menu-item > a,
	.daf-mp-header__nav-primary--main .daf-mp-header-nav .page_item > a {
		min-height: 72px;
		font-size: 14px;
		padding-inline: 3px;
	}

	.daf-mp-header-search-trigger {
		width: 40px;
		height: 40px;
		min-width: 40px;
		min-height: 40px;
	}

	.daf-mp-header-cta {
		min-height: 40px;
		padding: 0 16px;
		font-size: 14px;
		border-radius: 9px;
	}
}

/*
 * Tablet/mobile layout is owned by header-mobile/offcanvas files.
 */
@media (max-width: 1024px) {
	.daf-mp-header__main {
		display: none;
	}
}