/* ============================================================
   Lizenzpoint Header
   Conversion-optimized, mobile-first, zero bloat
   ============================================================ */

:root {
	--lp-primary: #0a66c2;
	--lp-primary-dark: #084d91;
	--lp-accent: #16a34a;
	--lp-text: #0f1b2d;
	--lp-text-muted: #5a6b7f;
	--lp-border: #e5e9ef;
	--lp-bg: #ffffff;
	--lp-bg-soft: #f6f8fb;
	--lp-topbar-bg: #0f1b2d;
	--lp-topbar-text: #cfd8e3;
	--lp-nav-bg: #ffffff;
	--lp-nav-border: #e5e9ef;
	--lp-shadow: 0 1px 3px rgba(15, 27, 45, 0.06), 0 1px 2px rgba(15, 27, 45, 0.04);
	--lp-shadow-hover: 0 4px 12px rgba(15, 27, 45, 0.08);
	--lp-radius: 8px;
	--lp-header-height: 72px;
	--lp-container: 1280px;
	--lp-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ============================================================
   HARD HIDE everything Kadence used to render in the header.
   With our header.php override, Kadence's header markup is never
   emitted — but if any stray template outputs it, kill it on sight.
   ============================================================ */
header#masthead:not(.lizenzpoint-header),
#main-header:not(.lp-header-main),
#mobile-header,
#search-drawer,
.search-toggle-open,
.drawer-overlay[data-drawer-target-string="#search-drawer"] {
	display: none !important;
}

/* ====== Header shell ====== */
.lizenzpoint-header {
	background: var(--lp-bg);
	border-bottom: 1px solid var(--lp-border);
	font-family: var(--lp-font);
	color: var(--lp-text);
	position: relative;
	z-index: 100;
}

.lp-header-inner,
.lp-topbar-inner,
.lp-nav-inner {
	max-width: var(--lp-container);
	margin: 0 auto;
	padding: 0 20px;
}

/* ====== Top utility bar ====== */
.lp-topbar {
	background: var(--lp-topbar-bg);
	color: var(--lp-topbar-text);
	font-size: 13px;
	line-height: 1.4;
}

.lp-topbar-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	min-height: 36px;
	gap: 16px;
}

.lp-trust-list {
	display: flex;
	flex-wrap: wrap;
	gap: 20px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.lp-trust-item {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.lp-trust-item .lp-icon {
	width: 14px;
	height: 14px;
	color: var(--lp-accent);
	flex-shrink: 0;
}

.lp-topbar-phone {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: var(--lp-topbar-text);
	text-decoration: none;
	font-weight: 600;
	transition: color 0.15s ease;
}

.lp-topbar-phone:hover {
	color: #fff;
}

.lp-topbar-phone .lp-icon {
	width: 14px;
	height: 14px;
}

/* ====== Main header row ====== */
.lp-header-main {
	background: var(--lp-bg);
}

.lp-header-inner {
	display: grid;
	grid-template-columns: auto 1fr auto;
	align-items: center;
	gap: 32px;
	min-height: var(--lp-header-height);
}

/* Logo */
.lp-header-logo .custom-logo-link {
	display: inline-block;
	line-height: 0;
}

.lp-header-logo img,
.lp-header-logo .custom-logo {
	max-height: 44px;
	width: auto;
	height: auto;
}

.lp-logo-text {
	font-size: 22px;
	font-weight: 800;
	color: var(--lp-text);
	text-decoration: none;
	letter-spacing: -0.02em;
}

.lp-logo-text:hover {
	color: var(--lp-primary);
}

/* ====== Search ====== */
.lp-header-search {
	position: relative;
	width: 100%;
	max-width: 640px;
	justify-self: center;
}

.lp-search-form {
	position: relative;
	width: 100%;
}

.lp-search-label {
	display: flex;
	align-items: center;
	width: 100%;
	height: 44px;
	padding: 0 12px 0 16px;
	background: var(--lp-bg-soft);
	border: 1.5px solid var(--lp-border);
	border-radius: var(--lp-radius);
	transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.lp-search-label:focus-within {
	border-color: var(--lp-primary);
	background: #fff;
	box-shadow: 0 0 0 3px rgba(10, 102, 194, 0.12);
}

.lp-search-label > .lp-icon {
	width: 18px;
	height: 18px;
	color: var(--lp-text-muted);
	flex-shrink: 0;
	margin-right: 10px;
}

.lp-search-input {
	flex: 1;
	border: 0;
	background: transparent;
	font: inherit;
	font-size: 15px;
	color: var(--lp-text);
	outline: 0;
	padding: 0;
	min-width: 0;
}

.lp-search-input::placeholder {
	color: var(--lp-text-muted);
}

.lp-search-input::-webkit-search-cancel-button,
.lp-search-input::-webkit-search-decoration {
	-webkit-appearance: none;
	appearance: none;
}

.lp-search-clear {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border: 0;
	background: transparent;
	color: var(--lp-text-muted);
	cursor: pointer;
	border-radius: 6px;
	padding: 0;
}

.lp-search-clear:hover {
	background: var(--lp-border);
	color: var(--lp-text);
}

.lp-search-clear .lp-icon {
	width: 16px;
	height: 16px;
}

/* Search results dropdown */
.lp-search-results {
	position: absolute;
	top: calc(100% + 8px);
	left: 0;
	right: 0;
	background: #fff;
	border: 1px solid var(--lp-border);
	border-radius: var(--lp-radius);
	box-shadow: 0 12px 32px rgba(15, 27, 45, 0.12);
	max-height: 480px;
	overflow-y: auto;
	z-index: 50;
}

.lp-search-results[hidden] {
	display: none;
}

.lp-search-list {
	list-style: none;
	margin: 0;
	padding: 6px;
}

.lp-search-item {
	margin: 0;
}

.lp-search-link {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 12px;
	border-radius: 6px;
	text-decoration: none;
	color: var(--lp-text);
	transition: background 0.1s ease;
}

.lp-search-link:hover,
.lp-search-link:focus {
	background: var(--lp-bg-soft);
	outline: 0;
}

.lp-search-link img {
	width: 40px;
	height: 40px;
	object-fit: contain;
	border-radius: 4px;
	background: var(--lp-bg-soft);
	flex-shrink: 0;
}

.lp-search-meta {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
	flex: 1;
}

.lp-search-title {
	font-size: 14px;
	font-weight: 500;
	line-height: 1.35;
	overflow: hidden;
	text-overflow: ellipsis;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

.lp-search-price {
	font-size: 13px;
	font-weight: 600;
	color: var(--lp-primary);
}

.lp-search-price del {
	color: var(--lp-text-muted);
	font-weight: 400;
	margin-right: 6px;
}

.lp-search-empty {
	padding: 20px;
	text-align: center;
	color: var(--lp-text-muted);
	font-size: 14px;
}

.lp-search-viewall {
	display: block;
	padding: 12px 16px;
	border-top: 1px solid var(--lp-border);
	background: var(--lp-bg-soft);
	font-size: 13px;
	font-weight: 600;
	color: var(--lp-primary);
	text-align: center;
	text-decoration: none;
}

.lp-search-viewall:hover {
	background: var(--lp-border);
}

.lp-search-loading {
	padding: 16px;
	text-align: center;
	color: var(--lp-text-muted);
	font-size: 13px;
}

/* ====== Right actions ====== */
.lp-header-actions {
	display: flex;
	align-items: center;
	gap: 4px;
}

.lp-action {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 8px 12px;
	border-radius: var(--lp-radius);
	text-decoration: none;
	color: var(--lp-text);
	font-size: 14px;
	font-weight: 500;
	transition: background 0.15s ease;
	line-height: 1;
}

.lp-action:hover,
.lp-action:focus {
	background: var(--lp-bg-soft);
	color: var(--lp-text);
}

.lp-action .lp-icon {
	width: 22px;
	height: 22px;
	flex-shrink: 0;
}

.lp-action-label {
	white-space: nowrap;
}

.lp-cart-icon-wrap {
	position: relative;
	display: inline-flex;
}

.lp-cart-count {
	position: absolute;
	top: -6px;
	right: -8px;
	min-width: 18px;
	height: 18px;
	padding: 0 5px;
	background: var(--lp-accent);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	line-height: 18px;
	text-align: center;
	border-radius: 9px;
	box-shadow: 0 0 0 2px #fff;
}

.lp-cart-total {
	font-weight: 600;
	white-space: nowrap;
}

.lp-cart-total .woocommerce-Price-amount {
	color: var(--lp-text);
}

/* Mobile toggle — hidden on desktop */
.lp-mobile-toggle {
	display: none;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--lp-text);
	cursor: pointer;
	border-radius: var(--lp-radius);
}

.lp-mobile-toggle:hover {
	background: var(--lp-bg-soft);
}

.lp-mobile-toggle .lp-icon {
	width: 24px;
	height: 24px;
}

/* ============================================================
   Primary Navigation
   ============================================================ */
.lp-nav {
	background: var(--lp-nav-bg);
	border-top: 1px solid var(--lp-nav-border);
}

.lp-nav-inner {
	display: flex;
	align-items: center;
}

.lp-menu {
	display: flex;
	flex-wrap: wrap;
	margin: 0;
	padding: 0;
	list-style: none;
	gap: 4px;
}

.lp-menu > li {
	position: relative;
	margin: 0;
}

.lp-menu > li > a {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 14px 16px;
	color: var(--lp-text);
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
	transition: color 0.15s ease;
	border-bottom: 2px solid transparent;
}

.lp-menu > li > a:hover,
.lp-menu > li:focus-within > a,
.lp-menu > li.current-menu-item > a,
.lp-menu > li.current-menu-ancestor > a {
	color: var(--lp-primary);
	border-bottom-color: var(--lp-primary);
}

/* Dropdown caret */
.lp-menu .menu-item-has-children > a::after {
	content: "";
	width: 8px;
	height: 8px;
	margin-left: 4px;
	border-right: 1.5px solid currentColor;
	border-bottom: 1.5px solid currentColor;
	transform: rotate(45deg) translateY(-2px);
}

/* Submenus */
.lp-menu .sub-menu {
	position: absolute;
	top: 100%;
	left: 0;
	min-width: 220px;
	margin: 0;
	padding: 6px;
	list-style: none;
	background: #fff;
	border: 1px solid var(--lp-border);
	border-radius: var(--lp-radius);
	box-shadow: 0 12px 32px rgba(15, 27, 45, 0.12);
	opacity: 0;
	visibility: hidden;
	transform: translateY(4px);
	transition: opacity 0.15s ease, visibility 0.15s ease, transform 0.15s ease;
	z-index: 60;
}

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

.lp-menu .sub-menu .sub-menu {
	top: 0;
	left: 100%;
	margin-left: 4px;
}

.lp-menu .sub-menu li {
	margin: 0;
}

.lp-menu .sub-menu a {
	display: block;
	padding: 8px 12px;
	color: var(--lp-text);
	font-size: 14px;
	font-weight: 500;
	text-decoration: none;
	border-radius: 6px;
	white-space: nowrap;
}

.lp-menu .sub-menu a:hover,
.lp-menu .sub-menu li.current-menu-item > a {
	background: var(--lp-bg-soft);
	color: var(--lp-primary);
}

.lp-menu .sub-menu .menu-item-has-children > a {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.lp-menu .sub-menu .menu-item-has-children > a::after {
	content: "›";
	font-weight: 700;
	color: var(--lp-text-muted);
	margin: 0;
	border: 0;
	transform: none;
}

/* ====== Sticky behavior ====== */
.lizenzpoint-header.is-sticky {
	position: sticky;
	top: 0;
	box-shadow: var(--lp-shadow);
}

.lizenzpoint-header.is-sticky .lp-topbar {
	display: none;
}

.lizenzpoint-header.is-sticky .lp-header-inner {
	min-height: 60px;
}

/* ====== Responsive ====== */
@media (max-width: 960px) {
	.lp-topbar {
		display: none;
	}

	.lp-header-inner {
		grid-template-columns: auto 1fr auto;
		grid-template-rows: auto auto;
		gap: 12px 8px;
		padding-top: 12px;
		padding-bottom: 12px;
		min-height: 0;
	}

	.lp-header-logo {
		grid-column: 1;
		grid-row: 1;
	}

	.lp-header-actions {
		grid-column: 3;
		grid-row: 1;
		justify-self: end;
	}

	.lp-header-search {
		grid-column: 1 / -1;
		grid-row: 2;
		max-width: 100%;
	}

	.lp-action-account,
	.lp-cart-total {
		display: none;
	}

	.lp-action {
		padding: 8px;
	}

	.lp-mobile-toggle {
		display: inline-flex;
	}

	/* Nav becomes a slide-down drawer */
	.lp-nav {
		display: none;
		border-top: 1px solid var(--lp-border);
	}

	.lp-nav.is-open {
		display: block;
	}

	.lp-nav-inner {
		padding-top: 8px;
		padding-bottom: 8px;
	}

	.lp-menu {
		flex-direction: column;
		width: 100%;
		gap: 0;
	}

	.lp-menu > li,
	.lp-menu .sub-menu li {
		width: 100%;
	}

	.lp-menu > li > a {
		padding: 12px 4px;
		border-bottom: 1px solid var(--lp-border);
	}

	.lp-menu > li:last-child > a {
		border-bottom: 0;
	}

	/* Mobile: submenus become inline, always visible */
	.lp-menu .sub-menu {
		position: static;
		opacity: 1;
		visibility: visible;
		transform: none;
		box-shadow: none;
		border: 0;
		padding: 0 0 8px 16px;
		background: transparent;
		min-width: 0;
	}

	.lp-menu .sub-menu .sub-menu {
		margin-left: 0;
		padding-left: 16px;
	}

	.lp-menu .menu-item-has-children > a::after {
		display: none;
	}
}

@media (max-width: 480px) {
	.lp-header-inner,
	.lp-topbar-inner,
	.lp-nav-inner {
		padding-left: 14px;
		padding-right: 14px;
	}

	.lp-search-input {
		font-size: 16px; /* prevent iOS zoom on focus */
	}

	.lp-header-logo img,
	.lp-header-logo .custom-logo {
		max-height: 36px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.lp-search-label,
	.lp-action,
	.lp-topbar-phone,
	.lp-menu .sub-menu {
		transition: none;
	}
}
