:root {
	--schacht-logo-max-height: 44px;
	--schacht-logo-max-height-scrolled: 31px;
	--schacht-logo-max-height-home-desktop: 115px;
	--schacht-logo-max-height-home-scrolled: 81px;
	--schacht-logo-max-height-mobile: 82px;
	--schacht-logo-max-height-mobile-home: 90px;
	--schacht-header-icon-size: 36px;
	--schacht-header-icon-svg: 18px;
	--schacht-header-green: 0, 102, 51;
	--schacht-header-alpha: 0.35;
	--schacht-header-bg: rgba(0, 102, 51, 0.35);
}

/* Desktop: Theme-Transparenz wiederherstellen (kein erzwungenes Grün) */
@media (min-width: 1025px) {
	#masthead::after {
		content: none !important;
		display: none !important;
	}

	#masthead > .container-fluid,
	#masthead .site-header-inner,
	#masthead .row,
	#masthead .row.valign,
	#masthead .header-col,
	#masthead .site-branding,
	#masthead .header-elements,
	#masthead #mega-menu-wrap-primary {
		background: transparent !important;
		background-color: transparent !important;
		background-image: none !important;
	}
}

/* Logo: einheitliche Größe auf allen Seiten (Desktop: von Anfang an, kein Sprung beim Scrollen) */
.site-logo,
.mobile-logo-link img,
.desktop-logo-link img {
	max-height: var(--schacht-logo-max-height) !important;
	height: auto !important;
	min-height: unset !important;
	width: auto !important;
	vertical-align: middle;
	object-fit: contain;
}

@media (min-width: 1025px) {
	body:not(.home) #masthead:not(.sticky-active):not(.is-sticky) .site-logo,
	body:not(.home) #masthead:not(.sticky-active):not(.is-sticky) .desktop-logo-link img {
		max-height: var(--schacht-logo-max-height) !important;
		height: auto !important;
		width: auto !important;
	}

	body:not(.home) #masthead.sticky-active .site-logo,
	body:not(.home) #masthead.is-sticky .site-logo,
	body:not(.home) #masthead.sticky-active .desktop-logo-link img,
	body:not(.home) #masthead.is-sticky .desktop-logo-link img {
		max-height: var(--schacht-logo-max-height-scrolled) !important;
		height: auto !important;
		width: auto !important;
	}
}

/* Startseite Desktop: groß oben, beim Scrollen 30 % kleiner */
@media (min-width: 1025px) {
	body.home #masthead:not(.sticky-active):not(.is-sticky) .site-logo,
	body.home #masthead:not(.sticky-active):not(.is-sticky) .desktop-logo-link img,
	body.home.transparent-header #masthead.main-header:not(.sticky-active):not(.is-sticky) .site-logo,
	body.home.transparent-header #masthead.main-header:not(.sticky-active):not(.is-sticky) .desktop-logo-link img,
	body.home.has-hero #masthead.main-header:not(.sticky-active):not(.is-sticky) .site-logo,
	body.home.has-hero #masthead.main-header:not(.sticky-active):not(.is-sticky) .desktop-logo-link img {
		max-height: var(--schacht-logo-max-height-home-desktop) !important;
		height: auto !important;
		width: auto !important;
		transform: none !important;
	}

	body.home #masthead.sticky-active .site-logo,
	body.home #masthead.is-sticky .site-logo,
	body.home #masthead.sticky-active .desktop-logo-link img,
	body.home #masthead.is-sticky .desktop-logo-link img {
		max-height: var(--schacht-logo-max-height-home-scrolled) !important;
		height: auto !important;
		width: auto !important;
		transform: none !important;
	}

	body.home #masthead .schacht-header-tagline {
		font-size: 0.475rem;
		line-height: 1.3;
		max-width: 14rem;
	}
}

/* Startseite Mobile: Logo von Anfang an in Scroll-Größe, kein Sprung beim Scrollen */
@media (min-width: 1025px) {
	body.home #masthead-mobile .site-logo,
	body.home #masthead-mobile .desktop-logo-link img {
		max-height: var(--schacht-logo-max-height) !important;
		height: auto !important;
		width: auto !important;
	}
}

/* Kopfzeile: Zusatztext nur auf der Startseite */
#masthead .site-branding,
#masthead-mobile .site-branding {
	display: flex;
	align-items: center;
	gap: 1rem;
}

#masthead .site-branding-text,
#masthead-mobile .site-branding-text {
	display: none !important;
}

body:not(.home) .schacht-header-tagline {
	display: none !important;
}

body.home .schacht-header-tagline {
	margin: 0;
	color: #ffffff;
	font-size: 0.95rem;
	line-height: 1.35;
	font-weight: 500;
	max-width: 22rem;
}

@media (min-width: 1025px) {
	body.home #masthead .schacht-header-tagline {
		display: block;
		font-size: 0.475rem;
		line-height: 1.3;
		max-width: 14rem;
	}
}

@media (max-width: 1024px) {
	#masthead-mobile .site-logo,
	#masthead-mobile .mobile-logo-link img,
	#masthead-mobile .desktop-logo-link img {
		max-height: var(--schacht-logo-max-height-mobile) !important;
	}

	body.home #masthead-mobile .site-logo,
	body.home #masthead-mobile .mobile-logo-link img,
	body.home #masthead-mobile .desktop-logo-link img {
		max-height: var(--schacht-logo-max-height-mobile-home) !important;
	}

	#masthead-mobile .site-branding {
		gap: 0.5rem;
	}

	body.home #masthead-mobile .schacht-header-tagline {
		display: -webkit-box !important;
		-webkit-box-orient: vertical;
		-webkit-line-clamp: 4;
		overflow: hidden;
		font-size: 0.64rem;
		line-height: 1.2;
		font-weight: 400;
		max-width: 9.5rem;
	}

	#masthead-mobile .header-elements .schacht-header-shop-link,
	#masthead-mobile .header-search-field:not(.schacht-search-open) .search-submit,
	#masthead-mobile #mega-menu-wrap-primary .mega-menu-toggle,
	#masthead-mobile #mega-menu-wrap-primary .mega-toggle-block-1 button {
		width: var(--schacht-header-icon-size) !important;
		height: var(--schacht-header-icon-size) !important;
		min-width: var(--schacht-header-icon-size) !important;
	}

	#masthead-mobile .header-search-field:not(.schacht-search-open) .search-submit svg,
	.schacht-header-shop-link svg {
		width: var(--schacht-header-icon-svg) !important;
		height: var(--schacht-header-icon-svg) !important;
		max-height: var(--schacht-header-icon-svg) !important;
	}

	#masthead-mobile #mega-menu-wrap-primary .mega-toggle-block-1 button::before {
		width: 20px;
		height: 2.5px;
		box-shadow: 0 -7px 0 #ffffff, 0 7px 0 #ffffff !important;
	}
}

/* Shop-Symbol in der Kopfzeile */
.schacht-header-shop-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: var(--schacht-header-icon-size, 36px);
	height: var(--schacht-header-icon-size, 36px);
	flex-shrink: 0;
	color: #ffffff;
	text-decoration: none;
	line-height: 1;
	position: relative;
	z-index: 3;
}

.schacht-header-shop-link svg {
	width: var(--schacht-header-icon-svg, 18px);
	height: var(--schacht-header-icon-svg, 18px);
	fill: currentColor;
}

#masthead-mobile .header-elements .schacht-header-shop-link {
	margin-right: 4px;
}

#masthead .header-elements .schacht-header-shop-link {
	margin-right: 8px;
}

/* Theme-Warenkorb ausblenden – nur Shop-Link zu /produkte/ */
#mega-menu-item-23318,
#masthead #mega-menu-primary > li.mega-menu-item:has(> a.dashicons-cart[href*="/cart"]),
#masthead-mobile #mega-menu-primary > li.mega-menu-item:has(> a.dashicons-cart[href*="/cart"]),
.header-elements .header-cart,
.header-elements .sydney-header-cart,
.header-elements a.cart-contents,
.header-elements .sidebar-cart-trigger {
	display: none !important;
	visibility: hidden !important;
}

/* Legacy-Selektoren (Abwärtskompatibilität) */
body.home #masthead .site-branding {
	display: flex;
	align-items: center;
	gap: 1rem;
}

body.home #masthead .site-branding-text {
	display: none !important;
}

body.home #masthead-mobile .site-branding-text {
	display: none !important;
}

@media (max-width: 1024px) {
	.top-bar {
		display: none !important;
	}

	.sydney-breadcrumb-trail {
		display: none !important;
		height: 0 !important;
		min-height: 0 !important;
		padding: 0 !important;
		margin: 0 !important;
		overflow: hidden !important;
		background: transparent !important;
		border: 0 !important;
	}

	#masthead.header_layout_2,
	#masthead:not(#masthead-mobile) {
		display: none !important;
		visibility: hidden !important;
		height: 0 !important;
		overflow: hidden !important;
		pointer-events: none !important;
	}

	#masthead-mobile {
		display: block !important;
		visibility: visible !important;
		opacity: 1 !important;
		position: fixed !important;
		top: 0 !important;
		left: 0 !important;
		right: 0 !important;
		width: 100% !important;
		z-index: 100010 !important;
		background-color: var(--schacht-header-bg) !important;
		box-shadow: none !important;
	}

	#masthead-mobile.is-sticky,
	#masthead-mobile.sticky-active,
	#masthead-mobile.sticky-always {
		background-color: var(--schacht-header-bg) !important;
		box-shadow: none !important;
	}

	#masthead-mobile .site-branding-text,
	#masthead .site-branding-text {
		display: none !important;
	}

	#masthead-mobile .site-description,
	#masthead-mobile a:not(.button):not(.schacht-header-shop-link) {
		color: #ffffff !important;
	}

	#masthead-mobile svg {
		fill: #ffffff !important;
	}

	#masthead-mobile .header-elements {
		display: flex !important;
		visibility: visible !important;
		opacity: 1 !important;
	}

	#masthead-mobile .header-search-field {
		display: block !important;
	}

	#masthead-mobile #mega-menu-wrap-primary .mega-menu-toggle {
		display: flex !important;
		visibility: visible !important;
		opacity: 1 !important;
	}

	body:not(.home) {
		padding-top: 0 !important;
	}

	body:not(.home) .sydney-hero-area,
	body:not(.home) .header-slider {
		margin-top: 0 !important;
		position: relative !important;
		top: 0 !important;
	}

	body:not(.home):not(.has-hero) #content.page-wrap,
	body:not(.home):not(.has-hero) .page-wrap {
		padding-top: var(--schacht-mobile-header-height, 64px) !important;
	}

	/* Suche: nur Lupe, Eingabe nach Klick */
	#masthead-mobile .header-search-field {
		position: relative;
		margin-right: 8px;
	}

	#masthead-mobile .header-search-field:not(.schacht-search-open) .search-field {
		position: absolute;
		width: 1px;
		height: 1px;
		padding: 0;
		margin: -1px;
		overflow: hidden;
		clip: rect(0, 0, 0, 0);
		white-space: nowrap;
		border: 0;
		opacity: 0;
		pointer-events: none;
	}

	#masthead-mobile .header-search-field:not(.schacht-search-open) .search-submit {
		position: relative;
		z-index: 3;
		padding: 6px;
		margin: 0;
		cursor: pointer;
		background: transparent;
		border: 0;
		line-height: 1;
		pointer-events: auto;
		width: var(--schacht-header-icon-size) !important;
		height: var(--schacht-header-icon-size) !important;
		min-width: var(--schacht-header-icon-size) !important;
	}

	#masthead-mobile .header-search-field:not(.schacht-search-open) .search-submit svg {
		fill: #ffffff !important;
		width: var(--schacht-header-icon-svg) !important;
		height: var(--schacht-header-icon-svg) !important;
		max-height: var(--schacht-header-icon-svg) !important;
	}

	#masthead-mobile .header-search-field.schacht-search-open {
		position: fixed;
		left: 12px;
		right: 12px;
		top: calc(var(--schacht-mobile-header-height, 64px) + 8px);
		z-index: 1000001;
		background: rgba(255, 255, 255, 0.98);
		border-radius: 12px;
		box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
		padding: 10px 12px;
	}

	#masthead-mobile .header-search-field.schacht-search-open form {
		display: flex;
		align-items: center;
		gap: 8px;
		width: 100%;
	}

	#masthead-mobile .header-search-field.schacht-search-open .search-field,
	#masthead-mobile .header-search-field.schacht-search-open .wc-search-field,
	#masthead-mobile .header-search-field.schacht-search-open input[type="search"],
	body.schacht-search-active #masthead-mobile .header-search-field input.search-field,
	body.schacht-search-active #masthead-mobile .header-search-field input.wc-search-field {
		position: static;
		width: 100%;
		opacity: 1;
		clip: auto;
		height: auto;
		margin: 0;
		pointer-events: auto;
		background: #f3f3f3 !important;
		border: 1px solid #d0d0d0 !important;
		border-radius: 10px !important;
		padding: 10px 14px !important;
		color: #222222 !important;
		-webkit-text-fill-color: #222222 !important;
		caret-color: #222222 !important;
	}

	#masthead-mobile .header-search-field.schacht-search-open .search-field::placeholder,
	#masthead-mobile .header-search-field.schacht-search-open .wc-search-field::placeholder,
	#masthead-mobile .header-search-field.schacht-search-open input[type="search"]::placeholder,
	body.schacht-search-active #masthead-mobile .header-search-field input.search-field::placeholder {
		color: #333333 !important;
		opacity: 1 !important;
		-webkit-text-fill-color: #333333 !important;
	}

	#masthead-mobile .header-search-field.schacht-search-open .search-submit {
		position: static;
		padding: 8px;
		flex-shrink: 0;
	}

	#masthead-mobile .header-search-field.schacht-search-open .search-submit svg {
		fill: #04852f !important;
		width: 22px;
		height: 22px;
	}

	/* Menü: Hamburger statt schwarzem Kasten */
	#masthead-mobile #mega-menu-wrap-primary .mega-menu-toggle {
		background: transparent !important;
		border: 0 !important;
		border-radius: 0 !important;
		box-shadow: none !important;
		height: var(--schacht-header-icon-size) !important;
		line-height: 1 !important;
		padding: 0 !important;
		min-width: var(--schacht-header-icon-size) !important;
		width: var(--schacht-header-icon-size) !important;
		display: flex !important;
		align-items: center;
		justify-content: center;
	}

	#masthead-mobile #mega-menu-wrap-primary .mega-menu-toggle .mega-toggle-blocks-left,
	#masthead-mobile #mega-menu-wrap-primary .mega-menu-toggle .mega-toggle-blocks-center,
	#masthead-mobile #mega-menu-wrap-primary .mega-menu-toggle .mega-toggle-blocks-right {
		flex: 0 0 auto;
		justify-content: center;
	}

	#masthead-mobile #mega-menu-wrap-primary .mega-menu-toggle {
		position: relative;
		z-index: 3;
		pointer-events: auto;
	}

	#masthead-mobile #mega-menu-wrap-primary .mega-toggle-block-1 button {
		background: transparent !important;
		border: 0 !important;
		box-shadow: none !important;
		padding: 0 !important;
		width: var(--schacht-header-icon-size) !important;
		height: var(--schacht-header-icon-size) !important;
		min-width: var(--schacht-header-icon-size) !important;
		position: relative;
		z-index: 3;
		display: flex;
		align-items: center;
		justify-content: center;
		pointer-events: auto;
		cursor: pointer;
	}

	#masthead-mobile #mega-menu-wrap-primary .mega-toggle-label-closed,
	#masthead-mobile #mega-menu-wrap-primary .mega-toggle-label-open {
		position: absolute;
		width: 1px;
		height: 1px;
		padding: 0;
		margin: -1px;
		overflow: hidden;
		clip: rect(0, 0, 0, 0);
		white-space: nowrap;
		border: 0;
	}

	#masthead-mobile #mega-menu-wrap-primary .mega-toggle-block-1::after {
		display: none !important;
		content: none !important;
	}

	#masthead-mobile #mega-menu-wrap-primary .mega-toggle-block-1 button::before {
		content: "";
		display: block;
		width: 20px;
		height: 2.5px;
		background: #ffffff !important;
		border-radius: 2px;
		box-shadow: 0 -7px 0 #ffffff, 0 7px 0 #ffffff !important;
	}

	#masthead-mobile .header-elements {
		justify-content: flex-end;
		align-items: center;
		gap: 4px;
	}
}

body.schacht-search-active::before {
	content: "";
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.25);
	z-index: 1000000;
	pointer-events: none;
}

/* Shop /produkte/: Kategorien vor Intro-Text */
body.post-type-archive-product #content.page-wrap {
	display: flex;
	flex-direction: column;
}

body.post-type-archive-product .woocommerce-page-header,
body.post-type-archive-product .woocommerce-page-header .container {
	display: contents;
}

body.post-type-archive-product .woocommerce-page-header .woocommerce-products-header__title,
body.post-type-archive-product .woocommerce-page-header h1.page-title {
	order: 1;
	width: 100%;
}

body.post-type-archive-product #content.page-wrap > .content-wrapper {
	order: 2;
	width: 100%;
}

body.post-type-archive-product .woocommerce-page-header .page-description {
	order: 3;
	width: 100%;
	max-width: 100%;
	padding: 2rem 15px;
	box-sizing: border-box;
}

/* Kategorie-Karten: Bild über Titel */
body.post-type-archive-product .product-category-item-layout1 ul.products li.product-category > a {
	display: flex;
	flex-direction: column;
	align-items: center;
}

body.post-type-archive-product .product-category-item-layout1 ul.products li.product-category > a img {
	order: 1;
}

body.post-type-archive-product .product-category-item-layout1 ul.products li.product-category .woocommerce-loop-category__title {
	order: 2;
	margin-top: 15px;
}
