/**
 * The header: a “Log in” button + an account menu (it replaces the Blocksy CTA).
 * Self-sufficient (it does not depend on dashboard.css): the variables are
 * redefined here because this module is loaded across the whole front end,
 * outside the portals.
 */
.np-hdr-cta {
	--np-green: var(--cd-primary, #117c87);
	--np-green-d: var(--cd-primary-dark, #0e6470);
	--np-ink: var(--cd-ink, #1f2733);
	--np-muted: var(--cd-muted, #5f6a74);
	--np-line: var(--cd-line, #e7eaee);
	display: inline-flex;
	align-items: center;
}

/* ---------------------------------------------------------------- *
 * Logged-out state: a “Log in” button
 * ---------------------------------------------------------------- */
.np-hdr-login {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 11px 22px;
	background: var(--np-green);
	color: #fff !important;
	font-weight: 600;
	line-height: 1;
	text-decoration: none !important;
	border-radius: 0;
	box-shadow: none;
	transition: background .15s ease;
}
.np-hdr-login:hover,
.np-hdr-login:focus {
	background: var(--np-green-d);
	color: #fff !important;
}
.np-hdr-login .dashicons {
	font-size: 18px;
	width: 18px;
	height: 18px;
	line-height: 18px;
}

/* ---------------------------------------------------------------- *
 * Logged-in state: a trigger + a panel
 * ---------------------------------------------------------------- */
.np-hdr-dd {
	position: relative;
	display: inline-block;
}

.np-hdr-trigger {
	display: inline-flex;
	align-items: center;
	gap: 9px;
	padding: 5px 10px 5px 5px;
	background: transparent;
	box-shadow: inset 0 0 0 1px var(--np-green);
	border-radius: 0;
	color: inherit;
	font: inherit;
	line-height: 1;
	cursor: pointer;
	transition: box-shadow .15s ease;
}
.np-hdr-trigger:hover,
.np-hdr-dd.is-open .np-hdr-trigger {
	box-shadow: inset 0 0 0 1px var(--np-green-d);
}
.np-hdr-trigger .np-hdr-avatar,
.np-hdr-trigger img {
	width: 30px;
	height: 30px;
	border-radius: 0;
	display: block;
	object-fit: cover;
}
.np-hdr-name {
	font-weight: 600;
	max-width: 130px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	color: inherit;
}
.np-hdr-caret {
	font-size: 16px;
	width: 16px;
	height: 16px;
	line-height: 16px;
	opacity: .7;
	transition: transform .15s ease;
}
.np-hdr-dd.is-open .np-hdr-caret {
	transform: rotate(180deg);
}

.np-hdr-panel {
	position: absolute;
	top: calc(100% + 10px);
	right: 0;
	min-width: 260px;
	background: #fff;
	box-shadow: 0 12px 34px rgba(var(--cd-navy-rgb),.13);
	border-radius: 0;
	padding: 8px;
	display: none;
	z-index: 99999;
	text-align: left;
}
.np-hdr-dd.is-open .np-hdr-panel {
	display: block;
}

.np-hdr-id {
	display: flex;
	align-items: center;
	gap: 11px;
	padding: 8px 10px 12px;
	box-shadow: inset 0 -1px 0 var(--np-line);
	margin-bottom: 8px;
}
.np-hdr-id .np-hdr-avatar,
.np-hdr-id img {
	width: 40px;
	height: 40px;
	border-radius: 0;
	display: block;
	object-fit: cover;
}
.np-hdr-id-txt {
	display: flex;
	flex-direction: column;
	min-width: 0;
	line-height: 1.3;
}
.np-hdr-id-txt strong {
	color: var(--np-ink);
	font-size: 14px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.np-hdr-id-txt small {
	color: var(--np-muted);
	font-size: 12px;
}

.np-hdr-panel a {
	display: flex;
	align-items: center;
	gap: 11px;
	padding: 9px 10px;
	color: var(--np-ink) !important;
	font-size: 14px;
	line-height: 1.2;
	text-decoration: none !important;
	border-radius: 0;
	box-shadow: none;
}
.np-hdr-panel a .dashicons {
	font-size: 18px;
	width: 18px;
	height: 18px;
	line-height: 18px;
	color: var(--np-muted);
	flex: 0 0 auto;
}
.np-hdr-panel a:hover,
.np-hdr-panel a:focus {
	background: var(--np-bg);
	color: var(--np-green) !important;
}
.np-hdr-panel a:hover .dashicons,
.np-hdr-panel a:focus .dashicons {
	color: var(--np-green);
}

/* Main button “Go to my area” */
.np-hdr-go {
	background: var(--np-green);
	color: #fff !important;
	font-weight: 600;
	margin-bottom: 6px;
}
.np-hdr-go:hover,
.np-hdr-go:focus {
	background: var(--np-green-d) !important;
	color: #fff !important;
}
.np-hdr-go .dashicons {
	color: #fff !important;
}

.np-hdr-links {
	display: block;
}

.np-hdr-logout {
	box-shadow: inset 0 1px 0 var(--np-line);
	margin-top: 6px;
	padding-top: 12px !important;
}

/* The panel aligned to the left if the CTA item is close to the right-hand edge on mobile. */
@media (max-width: 500px) {
	.np-hdr-panel {
		right: auto;
		left: 0;
	}
}

/* ---------------------------------------------------------------- *
 * Header adjustments requested:
 *  - Basket: remove the white background + the border (the icon alone).
 *    The counter (the ::after pill) is kept.
 *  - CTA button: remove the border, the text in white.
 * Qualified selectors + !important so as to beat Blocksy's inline CSS.
 * ---------------------------------------------------------------- */
.ct-header-cart a.ct-cart-item,
.ct-header-cart a.ct-cart-item:hover,
.ct-header-cart a.ct-cart-item:focus {
	background: transparent !important;
	border: 0 !important;
	box-shadow: none !important;
}

/* The “Log in” button (logged out): already white text — we remove any border. */
.np-hdr-login {
	border: 0 !important;
}

/* Account menu (logged in): with no border, white text. */
.np-hdr-trigger {
	box-shadow: none !important;
	color: #fff !important;
}
.np-hdr-trigger .np-hdr-name,
.np-hdr-trigger .np-hdr-caret {
	color: #fff !important;
}
