/* HeaderX
   Scoped entirely under #headerx-header / #headerx-drawer so it never leans on the
   active theme's own header CSS. */

#headerx-header,
#headerx-drawer {
	--headerx-primary: #4E1F91;
	--headerx-primary-dark: #37166B;
	--headerx-primary-soft: #F1ECFA;
	--headerx-cta: #B32025;
	--headerx-cta-dark: #8C1A1E;
	--headerx-text: #1A1A2E;
	--headerx-text-muted: #6B7280;
	--headerx-border: #E7E5F0;
	--headerx-bg: #FFFFFF;
	--headerx-bg-soft: #F7F6FB;
	--headerx-radius: 14px;
	--headerx-shadow: 0 8px 30px rgba(24, 10, 51, 0.08);
	box-sizing: border-box;
}
#headerx-header *,
#headerx-header *::before,
#headerx-header *::after,
#headerx-drawer *,
#headerx-drawer *::before,
#headerx-drawer *::after {
	box-sizing: border-box;
}

/* ---------- layout shell ---------- */
#headerx-header {
	background: var(--headerx-bg);
	font-family: inherit;
}
.headerx-container {
	max-width: 1280px;
	margin: 0 auto;
	padding: 0 24px;
}

/* ---------- main row ---------- */
.headerx-main {
	border-bottom: 1px solid var(--headerx-border);
	transition: box-shadow 0.2s ease;
}
.headerx-main__inner {
	display: grid;
	grid-template-columns: auto 1fr auto;
	align-items: center;
	gap: 24px;
	min-height: 88px;
}
/*
 * Grid columns are pinned explicitly (rather than left to auto-placement)
 * because .headerx-main__center is display:none on mobile — an auto-placed
 * item that's hidden is dropped from the grid entirely, which would shift
 * .headerx-main__end into the middle track and leave the last track's gap
 * reserved, pulling it in from the true right edge.
 */
.headerx-main__start {
	grid-column: 1;
	display: flex;
	align-items: center;
	gap: 14px;
	min-width: 0;
}
.headerx-main__center {
	grid-column: 2;
	display: flex;
	justify-content: center;
	min-width: 0;
}
.headerx-main__end {
	grid-column: 3;
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 10px;
}

/* centered primary menu */
.headerx-nav__list {
	all: unset;
	display: flex;
	align-items: center;
	gap: 32px;
	list-style: none;
}
.headerx-nav__list li {
	list-style: none;
}
.headerx-nav__list a {
	color: var(--headerx-text);
	font-size: 15px;
	font-weight: 500;
	text-decoration: none;
	white-space: nowrap;
	transition: color 0.15s ease;
}
.headerx-nav__list a:hover {
	color: var(--headerx-primary);
}

/* logo */
.headerx-logo {
	flex-shrink: 0;
	display: flex;
	align-items: center;
}
.headerx-logo__link {
	display: flex;
	align-items: center;
}
.headerx-logo__img {
	max-height: 58px;
	width: auto !important;
	max-width: 220px;
}
.headerx-logo__text {
	font-size: 26px;
	font-weight: 700;
	color: var(--headerx-primary);
	text-decoration: none;
}

/* round icon buttons (search) */
.headerx-icon-btn {
	all: unset;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	color: var(--headerx-text);
	flex-shrink: 0;
	transition: background 0.15s ease, color 0.15s ease;
}
.headerx-icon-btn:hover {
	background: var(--headerx-bg-soft);
	color: var(--headerx-primary);
}

/* search modal: a bare pill floating on the dimmed overlay, no card chrome */
.headerx-search-modal {
	position: fixed;
	inset: 0;
	z-index: 1000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	visibility: hidden;
	pointer-events: none;
}
.headerx-search-modal.is-open {
	visibility: visible;
	pointer-events: auto;
}
.headerx-search-modal__overlay {
	position: absolute;
	inset: 0;
	background: rgba(20, 10, 40, 0.55);
	opacity: 0;
	transition: opacity 0.2s ease;
}
.headerx-search-modal.is-open .headerx-search-modal__overlay {
	opacity: 1;
}
.headerx-search-modal__panel {
	position: relative;
	width: 100%;
	max-width: 640px;
	opacity: 0;
	transform: translateY(-12px);
	transition: opacity 0.2s ease, transform 0.2s ease;
}
.headerx-search-modal.is-open .headerx-search-modal__panel {
	opacity: 1;
	transform: translateY(0);
}
.headerx-search-modal__close {
	all: unset;
	cursor: pointer;
	position: absolute;
	top: -48px;
	right: 0;
	width: 36px;
	height: 36px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.15);
	color: #fff;
	font-size: 22px;
	line-height: 1;
	transition: background 0.15s ease;
}
.headerx-search-modal__close:hover {
	background: rgba(255, 255, 255, 0.28);
}
.headerx-search-modal__field {
	height: 64px;
	background: #fff;
	border-radius: 999px;
	box-shadow: var(--headerx-shadow);
	overflow: hidden;
}

/* restyle WordPress's default get_search_form() markup into the pill field above */
.headerx-search-modal__field .search-form {
	display: flex;
	align-items: center;
	width: 100%;
	height: 100%;
	margin: 0;
}
.headerx-search-modal__field .search-form label {
	flex: 1 1 auto;
	min-width: 0;
	height: 100%;
	margin: 0;
	display: flex;
	align-items: center;
}
.headerx-search-modal__field .search-field {
	all: unset;
	box-sizing: border-box;
	display: block;
	width: 100%;
	height: 100%;
	padding: 0 26px;
	font-size: 17px;
	color: var(--headerx-text);
}
.headerx-search-modal__field .search-submit {
	all: unset;
	box-sizing: border-box;
	cursor: pointer;
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 48px;
	height: 48px;
	padding: 0 18px;
	margin-right: 8px;
	border-radius: 999px;
	background: var(--headerx-primary);
	color: #fff;
	font-size: 14px;
	font-weight: 600;
	white-space: nowrap;
	transition: background 0.15s ease;
}
.headerx-search-modal__field .search-submit:hover {
	background: var(--headerx-primary-dark);
}

/* ---------- right side: account cluster ---------- */
.headerx-account-cluster {
	display: flex;
	align-items: center;
	gap: 14px;
}
.headerx-account-link {
	all: unset;
	cursor: pointer;
	display: flex;
	align-items: center;
	font-size: 14px;
	font-weight: 600;
	color: var(--headerx-text);
	white-space: nowrap;
}
.headerx-account-link:hover {
	color: var(--headerx-primary);
}
.headerx-account-link--muted {
	font-weight: 400;
	color: var(--headerx-text-muted);
}
.headerx-account-link--muted:hover {
	color: var(--headerx-cta);
}
.headerx-account-link--cta {
	padding: 10px 20px;
	border-radius: 999px;
	background: var(--headerx-cta);
	color: #fff;
	font-weight: 600;
	transition: background 0.15s ease;
}
.headerx-account-link--cta:hover {
	background: var(--headerx-cta-dark);
	color: #fff;
}

/* mobile-only elements hidden on desktop; the burger opens the drawer */
.headerx-burger {
	all: unset;
	display: none;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	gap: 4px;
	width: 40px;
	height: 40px;
	flex-shrink: 0;
	cursor: pointer;
	margin-left: auto;
}
.headerx-burger span {
	display: block;
	width: 20px;
	height: 2px;
	background: var(--headerx-text);
	border-radius: 2px;
}

body.headerx-no-scroll {
	overflow: hidden;
}

/* ---------- off-canvas drawer (mobile) ---------- */
#headerx-drawer {
	position: fixed;
	inset: 0;
	z-index: 1000;
	visibility: hidden;
	pointer-events: none;
}
#headerx-drawer.is-open {
	visibility: visible;
	pointer-events: auto;
}
.headerx-drawer__overlay {
	position: absolute;
	inset: 0;
	background: rgba(20, 10, 40, 0.45);
	opacity: 0;
	transition: opacity 0.2s ease;
}
#headerx-drawer.is-open .headerx-drawer__overlay {
	opacity: 1;
}
.headerx-drawer__panel {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	width: 88%;
	max-width: 360px;
	background: #fff;
	box-shadow: var(--headerx-shadow);
	padding: 18px 20px 32px;
	overflow-y: auto;
	transform: translateX(100%);
	transition: transform 0.25s ease;
}
#headerx-drawer.is-open .headerx-drawer__panel {
	transform: translateX(0);
}
.headerx-drawer__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding-bottom: 16px;
	margin-bottom: 16px;
	border-bottom: 1px solid var(--headerx-border);
}
.headerx-drawer__close {
	all: unset;
	cursor: pointer;
	flex-shrink: 0;
	font-size: 26px;
	line-height: 1;
	color: var(--headerx-text-muted);
	padding: 4px 8px;
}
.headerx-drawer__account {
	display: flex;
	align-items: center;
	gap: 14px;
	flex-wrap: wrap;
	flex: 1 1 auto;
	min-width: 0;
}
.headerx-drawer__section {
	margin-bottom: 18px;
	padding-bottom: 18px;
}
.headerx-drawer__menu {
	all: unset;
	display: flex;
	flex-direction: column;
	list-style: none;
}
.headerx-drawer__menu li {
	list-style: none;
}
.headerx-drawer__menu a {
	display: block;
	padding: 10px 0;
	color: var(--headerx-text);
	font-size: 15px;
	font-weight: 500;
	text-decoration: none;
	border-bottom: 1px solid var(--headerx-border);
}

/* ---------- responsive ---------- */
@media (max-width: 1024px) {
	.headerx-nav__list {
		gap: 20px;
	}
}

@media (max-width: 860px) {
	.headerx-container {
		padding: 0 16px;
	}
	/* centered primary menu moves into the drawer on mobile to keep the bar clean */
	.headerx-main__center {
		display: none;
	}
	.headerx-main__inner {
		min-height: 72px;
		gap: 12px;
	}
	/* account cluster moves into the drawer on mobile to keep the bar clean */
	.headerx-main__end > .headerx-account-cluster {
		display: none;
	}
	.headerx-burger {
		display: flex;
	}
}

@media (max-width: 480px) {
	.headerx-logo__img {
		max-height: 44px;
	}
}
