/* Gutenberg site header — absolute, transparent, full-bleed fluid (no Bootstrap / no global-styles) */

/*
 * Parent modal.css sets overflow:hidden on body when a modal opens.
 * That breaks position:sticky (shop stack) and can shift layout width.
 * Scroll is locked via JS (wheel/touch/keys) instead — keep overflow alone.
 * scrollbar-gutter keeps classic-scrollbar space reserved as a belt-and-suspenders.
 */
html {
	scrollbar-gutter: stable;
}

html body.tw-modal-overlay-open,
html body.tw-search-overlay-open {
	overflow: visible !important;
	padding-right: 0 !important;
}

.site-header.top-bar {
	/* Fluid logo / nav icons — icon size is the scale root; cart + labels track it. */
	--toboo-header-logo-h: clamp(2.25rem, 4.8vw, 3.125rem);
	--toboo-header-logo-animate-h: clamp(3.6rem, 7.8vw, 5.0625rem);
	/* Mobile min raised (was 1.5rem — too small); desktop cap unchanged. */
	--toboo-header-icon: clamp(1.95rem, 5vw + 0.55rem, 2.25rem);
	--toboo-header-cart-w: calc(var(--toboo-header-icon) * 1.0667);
	--toboo-header-cart-h: calc(var(--toboo-header-icon) * 1.1333);
	--toboo-header-label: calc(var(--toboo-header-icon) * 0.333);
	position: absolute;
	z-index: 100;
	/* Classic used mt-3; sit a bit lower in the viewport. */
	top: 4.5rem;
	left: 0;
	right: 0;
	width: auto;
	min-height: clamp(3.25rem, 7vw, 4.25rem);
	display: flex;
	align-items: center;
	background: transparent !important;
	background-color: transparent !important;
	pointer-events: none;
	overflow: visible;
	box-sizing: border-box;
}

body.admin-bar .site-header.top-bar {
	top: calc(32px + 4.5rem);
}

.site-header.top-bar a,
.site-header.top-bar button,
.site-header.top-bar .wp-block-button,
.site-header.top-bar .wp-block-site-logo {
	pointer-events: auto;
}

/*
 * Fluid inner shell — wider than content (1140px), capped at wideSize (1320px).
 * Side inset via width, so the max width stays fully usable.
 */
.site-header > .wp-block-group,
.site-header .toboo-header-container {
	width: min(1320px, calc(100% - 2 * var(--toboo-edge-x, 4%))) !important;
	max-width: 1320px !important;
	margin-left: auto !important;
	margin-right: auto !important;
	box-sizing: border-box;
}

.site-header .toboo-header-row.wp-block-columns,
.site-header .toboo-header-row {
	display: flex !important;
	flex-wrap: nowrap !important;
	align-items: center !important;
	justify-content: space-between !important;
	width: 100%;
	column-gap: 1rem;
	row-gap: 0;
	overflow: visible;
}

.site-header .toboo-header-logo-col,
.site-header .toboo-header-nav-col {
	display: flex;
	align-items: center;
	align-self: stretch;
	min-width: 0;
}

.site-header .toboo-header-logo-col {
	justify-content: flex-start;
	flex: 0 1 auto;
	min-width: auto;
	overflow: visible;
}

.site-header .toboo-header-nav-col {
	justify-content: flex-end;
	flex: 1 1 auto;
	overflow: visible;
	min-width: auto;
}

.site-header .toboo-site-logo,
.site-header .toboo-site-logo .custom-logo-link {
	display: flex;
	align-items: center;
	line-height: 0;
	height: 100%;
	overflow: visible;
}

.site-header .toboo-site-logo img,
.site-header .toboo-site-logo .custom-logo,
.site-header .toboo-site-logo svg.logo,
.site-header .toboo-site-logo #logo {
	display: block;
	width: auto !important;
	height: var(--toboo-header-logo-h) !important;
	max-height: var(--toboo-header-logo-h) !important;
	max-width: min(100%, 12rem);
	overflow: visible;
}

/* Padded viewBox (logo-animate): keep letter size ≈ wordmark at logo-h. */
.site-header .toboo-site-logo svg.logo.logo-animate,
.site-header .toboo-site-logo #logo.logo-animate {
	height: var(--toboo-header-logo-animate-h) !important;
	max-height: var(--toboo-header-logo-animate-h) !important;
}

.site-header .toboo-header-nav {
	display: flex !important;
	flex-wrap: nowrap !important;
	justify-content: flex-end;
	align-items: flex-start;
	gap: 1.75rem;
	width: 100%;
	height: 100%;
	overflow: visible;
}

/* Keep wrappers in the flex flow without breaking hover. */
.site-header .toboo-header-nav > .wp-block-buttons,
.site-header .toboo-header-nav > .wp-block-twtheme-meta-conditions,
.site-header .toboo-header-nav > .tw-meta-conditions {
	display: flex;
	align-items: flex-start;
	margin: 0;
}

.site-header .toboo-header-nav .wp-block-twtheme-meta-conditions-branch,
.site-header .toboo-header-nav .wp-block-twtheme-meta-conditions-branch__inner,
.site-header .toboo-header-nav .wp-block-buttons {
	display: flex;
	align-items: flex-start;
	margin: 0;
}

.site-header .toboo-header-nav .wp-block-button {
	margin: 0;
}

.site-header .toboo-header-nav .wp-block-button__link {
	position: relative;
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	justify-content: flex-start;
	gap: 0;
	font-size: var(--toboo-header-label) !important;
	font-weight: 500 !important;
	line-height: 1.1;
	text-decoration: none;
	box-shadow: none !important;
	border: 0 !important;
	cursor: pointer;
	color: rgba(255, 255, 255, 0.42) !important;
	background: transparent !important;
	transition: color 0.15s ease;
	overflow: visible;
	max-width: 5.5rem;
}

.site-header .toboo-header-nav .wp-block-button__link:hover,
.site-header .toboo-header-nav .wp-block-button__link:focus-visible {
	color: rgba(255, 255, 255, 0.82) !important;
}

/* Labels: icon-only by default, reveal under icon on hover/focus. */
.site-header .toboo-header-nav-label {
	position: absolute;
	top: 100%;
	left: 50%;
	margin-top: calc(var(--toboo-header-icon) * 0.2);
	transform: translateX(-50%) translateY(0.2rem);
	opacity: 0;
	visibility: hidden;
	white-space: nowrap;
	pointer-events: none;
	transition:
		opacity 0.18s ease,
		transform 0.18s ease,
		visibility 0.18s ease;
}

.site-header .toboo-header-nav .wp-block-button__link:hover .toboo-header-nav-label,
.site-header .toboo-header-nav .wp-block-button__link:focus-visible .toboo-header-nav-label {
	opacity: 1;
	visibility: visible;
	transform: translateX(-50%) translateY(0);
	color: rgba(255, 255, 255, 0.82);
}

/*
 * Cart pin: spacer keeps the topbar slot while JS FLIP-animates the real button
 * from its exact start position (no opacity).
 */
.site-header .toboo-header-cart-spacer {
	display: block;
	flex: 0 0 auto;
	visibility: hidden;
	pointer-events: none;
}

.site-header .toboo-header-nav > .wp-block-buttons.toboo-header-cart-pinned {
	pointer-events: auto;
}

@media (prefers-reduced-motion: reduce) {
	.site-header .toboo-header-nav-label {
		transition: none;
		transform: none;
	}
}

/* Fluid icon slot so Spiele / Konto / Korb share one baseline (capped via --toboo-header-icon). */
.site-header .toboo-header-nav .tw-button-icon-outer,
.site-header .toboo-header-nav .toboo-cart-icons {
	display: flex;
	align-items: center;
	justify-content: center;
	width: var(--toboo-header-icon);
	height: var(--toboo-header-icon);
	max-width: var(--toboo-header-icon);
	max-height: var(--toboo-header-icon);
	flex: 0 0 var(--toboo-header-icon);
	line-height: 0;
	color: #fff;
	opacity: 1;
	overflow: visible;
}

/* Transforms need non-inline boxes for Toboo hover animations */
.site-header .tw-button-icon-slot,
.site-header .icon-svg,
.site-header .toboo-cart-icon {
	display: inline-block;
	line-height: 0;
	transform-box: fill-box;
	overflow: visible;
}

.site-header .toboo-header-nav .wp-block-button__link svg,
.site-header .toboo-header-nav .icon-svg {
	width: var(--toboo-header-icon);
	height: var(--toboo-header-icon);
	max-width: var(--toboo-header-icon);
	max-height: var(--toboo-header-icon);
	font-size: var(--toboo-header-icon);
	color: #fff !important;
	fill: currentColor;
	opacity: 1;
	overflow: visible;
}

.site-header .toboo-nav-prefix {
	display: none;
}

@media (min-width: 768px) {
	.site-header .toboo-nav-prefix {
		display: inline;
	}
}

.site-header .toboo-header-account-user .tw-button-icon-slot,
.site-header .toboo-header-account-user .icon-svg.swirl,
.site-header .toboo-header-account-user .tw-button-icon-outer {
	position: relative;
}

.site-header .ghost-mouth {
	position: absolute;
	width: 4px;
	height: 4px;
	background: #000;
	left: 50%;
	transform: translateX(-2px);
	top: 54%;
	border-radius: 50%;
	pointer-events: none;
	z-index: 1;
}

.site-header #cart-btn {
	position: relative;
	overflow: visible;
}

.site-header #cart-btn .toboo-cart-icons {
	position: relative;
	/* Jelly bag handles paint above the viewBox — give them room. */
	width: var(--toboo-header-cart-w);
	height: var(--toboo-header-cart-h);
	max-width: var(--toboo-header-cart-w);
	max-height: var(--toboo-header-cart-h);
	flex-basis: var(--toboo-header-cart-w);
	overflow: visible;
}

.site-header #cart-btn .toboo-cart-icons > .tw-button-icon-outer,
.site-header #cart-btn .toboo-cart-icons > .toboo-cart-icon,
.site-header #cart-btn .toboo-cart-icons > .icon-svg {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0;
	overflow: visible;
}

.site-header #cart-btn .toboo-cart-icons .icon-svg,
.site-header #cart-btn .toboo-cart-icons .tw-button-icon-slot {
	color: #fff !important;
	overflow: visible;
}

.site-header #cart-btn .toboo-cart-icons svg {
	display: block;
	width: var(--toboo-header-icon);
	height: var(--toboo-header-cart-h);
	max-width: var(--toboo-header-icon);
	max-height: var(--toboo-header-cart-h);
	color: #fff !important;
	fill: currentColor;
	overflow: visible;
}

/* Empty cart: bag only. Filled cart: bag + quantity. */
.site-header #cart-btn.cart-empty .cart-quantity {
	display: none !important;
}

/*
 * Classic product-count: centered on the package face, inside `.box`
 * so the hover animation moves icon + number as one piece.
 */
.site-header #cart-btn .toboo-cart-icons.box {
	transform-origin: bottom center;
}

/* Plain count centered on the package face — no badge. */
.site-header #cart-btn .cart-quantity,
.site-header #cart-btn .product-count {
	position: absolute;
	top: auto;
	right: auto;
	bottom: calc(var(--toboo-header-cart-h) * 0.275);
	left: 50%;
	transform: translateX(-50%);
	display: block;
	min-width: 0;
	height: auto;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	color: #1e1e21 !important;
	font-size: calc(var(--toboo-header-icon) * 0.378);
	font-weight: 700;
	line-height: 1;
	white-space: nowrap;
	text-align: center;
	text-shadow: none;
	box-sizing: border-box;
	z-index: 2;
	pointer-events: none;
}

/* Barrierefreiheits-Trigger im Header — wie Ezzy (weißes Icon, Hover Primary). */
.site-header .wp-block-twtheme-accessibility-trigger,
.site-header .tw-a11y-trigger--header-block {
	display: inline-flex;
	align-items: center;
	flex: 0 0 auto;
}

.site-header .tw-search-block__toggle.tw-a11y-trigger,
.site-header .tw-a11y-trigger--header-block {
	width: var(--toboo-header-icon, 2.25rem);
	height: var(--toboo-header-icon, 2.25rem);
	min-width: var(--toboo-header-icon, 2.25rem);
	min-height: var(--toboo-header-icon, 2.25rem);
	padding: 0;
	border: 0;
	color: #fff !important;
	background: transparent;
	transition: color 0.2s ease;
}

.site-header .tw-search-block__toggle.tw-a11y-trigger .tw-a11y-trigger__icon svg,
.site-header .tw-a11y-trigger--header-block .tw-a11y-trigger__icon svg,
.site-header .tw-a11y-trigger--header-block .icon-svg svg {
	display: block;
	width: var(--toboo-header-icon, 2.25rem);
	height: var(--toboo-header-icon, 2.25rem);
	color: inherit !important;
	fill: currentColor;
}

.site-header .tw-search-block__toggle.tw-a11y-trigger:hover,
.site-header .tw-search-block__toggle.tw-a11y-trigger:focus-visible,
.site-header .tw-a11y-trigger--header-block:hover,
.site-header .tw-a11y-trigger--header-block:focus-visible {
	color: var(--wp--preset--color--hell, #b5d91f) !important;
}

/* Skip-Link-Sprungziel: kein zusätzlicher Abstand wie in Ezzy gutenberg-compat. */
#main.tw-a11y-anchor,
main#tw-a11y-anchor {
	margin-top: 0 !important;
	margin-block-start: 0 !important;
}
