/* -----------------------------------------------------------------------------
   telix.pl dark slim sticky header (golem.de-style)
   Loaded site-wide by functions.php. Targets stable GeneratePress selectors so
   it survives the 2.4.1 -> 3.6.1 update and works in both float & flexbox structures.
-------------------------------------------------------------------------------- */

:root {
	--telix-header-bg: #14181f;
	--telix-header-bg-sub: #1f242e;
	--telix-header-accent: #ffcc00;
	--telix-header-ink: #ffffff;
	--telix-header-muted: #c2c7d0;
	--telix-header-h: 58px;
}

/* ----- The bar: dark, slim, sticky ---------------------------------------- */
.site-header,
#masthead {
	background-color: var(--telix-header-bg);
	position: -webkit-sticky;
	position: sticky;
	top: 0;
	z-index: 200;
	box-shadow: 0 1px 0 rgba(255, 255, 255, .06), 0 2px 12px rgba(0, 0, 0, .25);
}

#masthead .inside-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: nowrap;
	gap: 24px;
	padding-top: 0;
	padding-bottom: 0;
	min-height: var(--telix-header-h);
}

/* ----- Logo (left) --------------------------------------------------------- */
#masthead .site-logo {
	margin: 0;
	display: flex;
	align-items: center;
}
#masthead .site-logo img,
#masthead .header-image {
	max-height: 34px;
	width: auto;
	height: auto;
	display: block;
}

/* Logo only — hide the text site title + tagline block entirely.
   The logo lives in its own .site-logo div, so removing .site-branding from the
   flex row also lets the logo sit hard-left (logo + nav only). */
#masthead .site-branding,
#masthead .main-title,
#masthead .site-title,
#masthead .site-description {
	display: none !important;
}

/* ----- Primary navigation (right) ----------------------------------------- */
.main-navigation,
#site-navigation,
.main-navigation .inside-navigation {
	background-color: transparent;
}

.main-navigation {
	box-shadow: none;
}

.main-navigation .main-nav > ul > li > a,
.main-navigation .menu-toggle {
	color: var(--telix-header-ink);
	line-height: var(--telix-header-h);
	padding: 0 14px;
	font-size: .9rem;
	font-weight: 600;
	letter-spacing: .01em;
	text-transform: uppercase;
}

.main-navigation .main-nav > ul > li > a:hover,
.main-navigation .main-nav > ul > li[class*="current-menu"] > a {
	color: var(--telix-header-accent);
	background-color: transparent;
}

/* Thin accent underline on hover/active — golem touch */
.main-navigation .main-nav > ul > li > a {
	position: relative;
}
.main-navigation .main-nav > ul > li > a::after {
	content: "";
	position: absolute;
	left: 14px;
	right: 14px;
	bottom: 0;
	height: 3px;
	background: var(--telix-header-accent);
	transform: scaleX(0);
	transition: transform .15s ease;
}
.main-navigation .main-nav > ul > li > a:hover::after,
.main-navigation .main-nav > ul > li[class*="current-menu"] > a::after {
	transform: scaleX(1);
}

/* ----- Dropdowns (sub-menus) ---------------------------------------------- */
.main-navigation ul ul {
	background-color: var(--telix-header-bg-sub);
	box-shadow: 0 8px 24px rgba(0, 0, 0, .3);
	/* Rounded card on all corners; the yellow accent is drawn inset via ::before
	   so it clears the rounded top corners instead of curving around them. */
	border-radius: 12px;
	overflow: hidden;
}
.main-navigation ul ul::before {
	content: "";
	position: absolute;
	top: 0;
	left: 12px;          /* inset by ~the corner radius */
	right: 12px;
	height: 2px;         /* a touch thinner than the old 3px edge */
	background: var(--telix-header-accent);
	border-radius: 0 0 2px 2px;
	pointer-events: none;
	z-index: 2;
}
.main-navigation ul ul li a {
	color: var(--telix-header-muted);
	text-transform: none;
	font-weight: 500;
	line-height: 1.4;
	padding: 10px 18px;
	border-radius: 8px;  /* rounded hover/active highlight */
}
.main-navigation ul ul li a:hover,
.main-navigation ul ul li[class*="current-menu"] > a {
	color: var(--telix-header-ink);
	background-color: rgba(255, 255, 255, .05);
}

/* ----- Category icons in sub-menus ---------------------------------------- */
.main-navigation .main-nav ul ul li a { display: flex; align-items: center; gap: 9px; }
.telix-mi {
	width: 17px;
	height: 17px;
	flex: none;
	color: var(--telix-header-muted);
	transition: color .15s ease;
}
.main-navigation .main-nav ul ul li:hover > a .telix-mi,
.main-navigation .main-nav ul ul li a:hover .telix-mi {
	color: var(--telix-header-accent);
}

/* ----- Mega-menu "layer" (golem.de-style) — desktop only -------------------
   Turn a top-level item's sub-menu into a full-width panel that drops below the
   bar with its children laid out in columns. We only override GeneratePress's
   *shown* (hover/focus) state; the hidden state keeps GP's off-screen default.
   Header.css loads after the parent main.css, so these win on the cascade. */
@media (min-width: 769px) {
	/* The bar (its centered .inside-header) is the positioning context. */
	#masthead .inside-header { position: relative; }

	/* Static top-level items so the panel resolves against .inside-header, not the li. */
	.main-navigation .main-nav > ul > li.menu-item-has-children { position: static; }

	.main-navigation:not(.toggled) .main-nav > ul > li.menu-item-has-children:hover > ul,
	.main-navigation:not(.toggled) .main-nav > ul > li.menu-item-has-children.sfHover > ul,
	.main-navigation .main-nav > ul > li.menu-item-has-children:focus-within > ul {
		left: 0;
		right: 0;
		width: auto;
		top: 100%;
		display: grid;
		grid-template-columns: repeat(4, minmax(0, 1fr));
		gap: 2px 32px;
		padding: 22px clamp(20px, 4vw, 48px) 26px;
		box-shadow: 0 14px 30px rgba(0, 0, 0, .32);
	}

	/* Direct children become grid cells (column entries). */
	.main-navigation .main-nav > ul > li.menu-item-has-children > ul > li { width: auto; }
	.main-navigation .main-nav > ul > li.menu-item-has-children > ul > li > a {
		padding: 9px 12px;
		margin: 0 -12px;   /* keep text aligned to the column; pill extends into the gap */
		font-size: .92rem;
	}

	.main-navigation .main-nav > ul > li.menu-item-has-children > ul > li > a {
		font-weight: 600;
		color: var(--telix-header-ink);
	}

	/* Show only the top item's DIRECT children in the layer. Hide deeper levels
	   (e.g. the phone-database manufacturers Samsung/Apple/… under Telefony) and
	   their now-pointless dropdown carets. */
	.main-navigation .main-nav > ul > li.menu-item-has-children > ul ul {
		display: none !important;
	}
	.main-navigation .main-nav > ul > li.menu-item-has-children > ul .dropdown-menu-toggle {
		display: none !important;
	}
}

/* ----- Navigation search --------------------------------------------------- */
.navigation-search input[type="search"],
.navigation-search input[type="search"]:focus {
	background-color: var(--telix-header-bg-sub);
	color: var(--telix-header-ink);
}
.main-navigation .main-nav ul li.search-item > a,
.main-navigation a.search-item,
.main-navigation .search-item > a {
	color: var(--telix-header-ink);
}
.main-navigation .main-nav ul li.search-item > a:hover {
	color: var(--telix-header-accent);
}

/* ----- "Zaloguj" as an inline icon (desktop) ------------------------------ */
.telix-menu-auth__icon { width: 22px; height: 22px; flex: none; }

@media (min-width: 769px) {
	.main-navigation .main-nav > ul > li.telix-menu-auth--login {
		display: flex;
		align-items: center;
	}
	.main-navigation .main-nav > ul > li.telix-menu-auth--login > a {
		display: flex;
		align-items: center;
		height: var(--telix-header-h);
		line-height: 1;
	}
	/* icon only on desktop — hide the text label (kept for the mobile overlay + a11y) */
	.main-navigation .telix-menu-auth--login .telix-menu-auth__label {
		position: absolute !important;
		width: 1px; height: 1px;
		margin: -1px; padding: 0;
		overflow: hidden;
		clip: rect(0, 0, 0, 0);
		white-space: nowrap;
		border: 0;
	}
	/* no sliding underline bar under the icon */
	.main-navigation .main-nav > ul > li.telix-menu-auth--login > a::after { display: none !important; }
}

/* Mobile overlay: show the "Zaloguj" text, hide the icon (plain menu item). */
.telix-mmenu .telix-menu-auth__icon { display: none; }

/* ===== Mobile header bar + overlay (golem.de-style) ======================= */
.telix-mbar,
.telix-moverlay { display: none; }

@media (max-width: 768px) {
	/* Replace GeneratePress's header with the custom mobile bar. */
	#masthead.site-header { display: none !important; }

	.telix-mbar {
		display: grid;
		grid-template-columns: 46px 1fr 46px;
		align-items: center;
		position: -webkit-sticky;
		position: sticky;
		top: 0;
		z-index: 200;
		min-height: var(--telix-header-h);
		padding: 0 10px;
		background: var(--telix-header-bg);
		box-shadow: 0 2px 12px rgba(0, 0, 0, .28);
	}
	.telix-mbar__btn {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 44px;
		height: 44px;
		padding: 0;
		border: 0;
		background: none;
		color: var(--telix-header-ink);
		cursor: pointer;
	}
	.telix-mbar__btn:hover,
	.telix-mbar__btn:active { color: var(--telix-header-accent); }
	.telix-mbar__menu { justify-self: start; }
	.telix-mbar__search { justify-self: end; }
	.telix-mbar__search svg { width: 22px; height: 22px; }

	/* Hamburger icon */
	.telix-mbar__bars { position: relative; display: block; width: 22px; height: 2px; }
	.telix-mbar__bars,
	.telix-mbar__bars::before,
	.telix-mbar__bars::after { background: currentColor; border-radius: 2px; }
	.telix-mbar__bars::before,
	.telix-mbar__bars::after { content: ""; position: absolute; left: 0; width: 22px; height: 2px; }
	.telix-mbar__bars::before { top: -7px; }
	.telix-mbar__bars::after { top: 7px; }

	.telix-mbar__logo { justify-self: center; display: inline-flex; align-items: center; }
	.telix-mbar__logo img { max-height: 30px; width: auto; display: block; }
	.telix-mbar__logo-text { color: #fff; font-weight: 800; font-size: 1.05rem; }

	/* ----- Overlay ----- */
	.telix-moverlay {
		display: block;
		position: fixed;
		inset: 0;
		z-index: 9999;
		background: var(--telix-header-bg);
		color: var(--telix-header-ink);
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
		opacity: 0;
		visibility: hidden;
		transform: translateY(-8px);
		transition: opacity .2s ease, transform .2s ease, visibility .2s ease;
	}
	.telix-moverlay.is-open { opacity: 1; visibility: visible; transform: none; }
	body.telix-moverlay-open { overflow: hidden; }

	.telix-moverlay__head {
		display: flex;
		align-items: center;
		justify-content: space-between;
		min-height: var(--telix-header-h);
		padding: 8px 12px;
		border-bottom: 1px solid rgba(255, 255, 255, .08);
	}
	.telix-moverlay__logo img { max-height: 30px; width: auto; display: block; }
	.telix-moverlay__close {
		width: 44px; height: 44px;
		border: 0; background: none;
		color: var(--telix-header-ink);
		cursor: pointer;
	}
	.telix-moverlay__close svg { width: 24px; height: 24px; }

	.telix-moverlay__search { display: flex; gap: 8px; padding: 14px 14px 8px; }
	.telix-moverlay__search input {
		flex: 1 1 auto; min-width: 0;
		padding: 12px 14px;
		border: 0; border-radius: 8px;
		background: var(--telix-header-bg-sub);
		color: var(--telix-header-ink);
		font-size: 1rem;
	}
	.telix-moverlay__search input::placeholder { color: var(--telix-header-muted); }
	.telix-moverlay__search button {
		flex: 0 0 auto; width: 48px;
		border: 0; border-radius: 8px;
		background: var(--telix-header-accent);
		color: var(--telix-header-bg);
		cursor: pointer;
	}
	.telix-moverlay__search button svg { width: 20px; height: 20px; }

	/* ----- Menu (big golem-style; main items kept compact) ----- */
	.telix-mmenu { list-style: none; margin: 0; padding: 6px 0 48px; }
	.telix-mmenu li { position: relative; }
	.telix-mmenu > li { border-bottom: 1px solid rgba(255, 255, 255, .06); }
	/* The overlay has its own search field — drop GP's lone search-icon menu item. */
	.telix-mmenu .search-item { display: none; }
	.telix-mmenu a { display: block; text-decoration: none; color: var(--telix-header-ink); }
	.telix-mmenu > li > a {
		padding: 14px 18px;
		font-size: .92rem;
		font-weight: 700;
		text-transform: uppercase;
		letter-spacing: .03em;
	}
	.telix-mmenu a:hover,
	.telix-mmenu a:active { color: var(--telix-header-accent); }

	.telix-mmenu__toggle {
		position: absolute;
		top: 0; right: 0;
		width: 56px; height: 50px;
		border: 0; background: none;
		color: var(--telix-header-muted);
		cursor: pointer;
		display: flex; align-items: center; justify-content: center;
	}
	.telix-mmenu__toggle svg { width: 20px; height: 20px; transition: transform .2s ease; }
	.telix-mmenu .menu-item-has-children.is-expanded > .telix-mmenu__toggle svg { transform: rotate(180deg); }

	.telix-mmenu .sub-menu {
		list-style: none;
		margin: 0;
		padding: 4px 0 8px;
		display: none;
		background: var(--telix-header-bg-sub);
	}
	.telix-mmenu .menu-item-has-children.is-expanded > .sub-menu { display: block; }
	.telix-mmenu .sub-menu a {
		display: flex;
		align-items: center;
		gap: 11px;
		padding: 11px 18px 11px 22px;
		font-size: .9rem;
		font-weight: 500;
		color: var(--telix-header-muted);
	}
	.telix-mmenu .sub-menu a:hover { color: var(--telix-header-ink); }
	.telix-mmenu .sub-menu .telix-mi { width: 18px; height: 18px; flex: none; color: var(--telix-header-accent); }
}

/* ===== Search modal (golem.de-style) ====================================== */
/* Hide GeneratePress's inline nav search — the icon opens our modal instead. */
.navigation-search { display: none !important; }

.telix-smodal { display: none; position: fixed; inset: 0; z-index: 9998; }
.telix-smodal.is-open { display: block; }
body.telix-smodal-open { overflow: hidden; }

/* Self-contained box model + layout (don't inherit theme form/box-sizing rules). */
.telix-smodal *,
.telix-smodal *::before,
.telix-smodal *::after { box-sizing: border-box; }
.telix-smodal .telix-smodal__form { display: block; } /* beats form[role="search"] */
/* Fill the panel — GP clamps search forms to max-width:460px; override it. */
.telix-smodal .telix-smodal__form,
.telix-smodal .telix-smodal__field,
.telix-smodal .telix-smodal__controls { width: 100%; max-width: none; }

.telix-smodal__backdrop { position: absolute; inset: 0; background: rgba(10, 12, 16, .6); }

.telix-smodal__panel {
	position: relative;
	width: calc(100% - 36px);
	max-width: 720px;
	margin: 104px auto 0;          /* dropped down below the header */
	background: #fff;
	color: #14181f;
	border-radius: 14px;
	box-shadow: 0 30px 80px rgba(0, 0, 0, .42);
	padding: 26px 28px 30px;
	animation: telix-smodal-in .2s ease;
}
@keyframes telix-smodal-in {
	from { opacity: 0; transform: translateY(-14px); }
	to   { opacity: 1; transform: none; }
}

.telix-smodal .telix-smodal__close {
	position: absolute;
	top: 14px; right: 14px;
	width: 36px; height: 36px;
	min-width: 0;
	padding: 0;
	border: 0; border-radius: 50%;
	background: #f1f3f5;
	color: #14181f;
	cursor: pointer;
	display: inline-flex; align-items: center; justify-content: center;
	transition: background .15s ease, color .15s ease;
}
.telix-smodal .telix-smodal__close:hover { background: var(--telix-header-accent, #ffcc00); color: #14181f; }
.telix-smodal .telix-smodal__close-x {
	display: block;
	font-size: 28px;
	line-height: 1;
	font-weight: 300;
	margin-top: -3px;        /* optical centering of the × glyph */
}

.telix-smodal__field {
	display: flex;
	align-items: center;
	gap: 12px;
	border-bottom: 2px solid #14181f;
	padding: 4px 0 12px;
	margin-top: 26px;          /* clear the absolutely-positioned close button */
}
.telix-smodal__icon { display: inline-flex; color: #6b7280; }
.telix-smodal__icon svg { width: 26px; height: 26px; }
.telix-smodal__input {
	flex: 1 1 auto;
	min-width: 0;
	border: 0;
	outline: 0;
	background: none;
	font-family: inherit;
	font-size: 1.5rem;
	font-weight: 600;
	color: #14181f;
	padding: 4px 0;
}
.telix-smodal__input::placeholder { color: #9aa1ad; font-weight: 500; }

.telix-smodal__controls {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px 18px;
	margin-top: 18px;
	flex-wrap: wrap;
}
.telix-smodal__catlabel {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: .9rem;
	color: #6b7280;
}
.telix-smodal__cat {
	border: 1px solid #e4e7ec;
	border-radius: 8px;
	padding: 9px 12px;
	font-family: inherit;
	font-size: .95rem;
	color: #14181f;
	background: #fff;
	cursor: pointer;
	max-width: 220px;
}
.telix-smodal__cat:focus { outline: 2px solid var(--telix-header-accent); outline-offset: 1px; }
/* Scoped under .telix-smodal to beat the desktop nav-button override. */
.telix-smodal .telix-smodal__submit {
	border: 0;
	border-radius: 8px;
	background: var(--telix-header-accent, #ffcc00);
	color: #14181f;
	font-family: inherit;
	font-weight: 800;
	font-size: .95rem;
	padding: 12px 30px;
	cursor: pointer;
	transition: background .15s ease;
}
.telix-smodal .telix-smodal__submit:hover { background: #e6b800; }

@media (max-width: 600px) {
	.telix-smodal__panel { margin-top: 70px; width: calc(100% - 24px); padding: 22px 18px 24px; }
	.telix-smodal__input { font-size: 1.25rem; }
	.telix-smodal__catlabel { flex: 1 1 100%; }
	.telix-smodal__cat { flex: 1 1 auto; max-width: none; }
	.telix-smodal__submit { flex: 1 1 100%; }
}
