/*
 * Warido – mega menu nagłówka ([warido_mega_menu]).
 * Kolory i fonty z globalnych zmiennych Elementor Kit (post-9) z fallbackiem.
 *
 * Kiedy hamburger? Decyduje SZEROKOŚĆ KOLUMNY z menu (container query na .wmm-wrap), nie sam ekran:
 * 9 zakładek przy paddingu 20px potrzebuje ~1142px; poniżej padding maleje płynnie do 11px,
 * a gdy kolumna ma < 1020px – menu przechodzi w hamburger. Na ekranach <= 1024px kolumna jest
 * zawsze węższa, więc próg Elementora (tablet) jest zachowany.
 * Zmiana etykiet poziomu 0 → zmierz na nowo i popraw --wmm-fit-base oraz 1020px poniżej.
 */

.wmm-wrap {
	container-type: inline-size;
	container-name: wmm;
}

.wmm {
	--wmm-primary: var(--e-global-color-primary, #930336);
	--wmm-accent: var(--e-global-color-accent, #930336);
	--wmm-secondary: var(--e-global-color-secondary, #54595F);
	--wmm-text: var(--e-global-color-text, #7A7A7A);
	--wmm-light: var(--e-global-color-24661cb, #F9F9F9);
	--wmm-white: var(--e-global-color-dce8904, #FFFFFF);
	--wmm-black: var(--e-global-color-5c09682, #000000);
	--wmm-line: #eee;
	--wmm-font: var(--e-global-typography-primary-font-family, "Roboto"), Sans-serif;
	/* szerokość paska przy zerowym paddingu (16 boków zakładek) – zmierzone dla Roboto 14/600 */
	--wmm-fit-base: 840px;
	--wmm-item-px: clamp(11px, calc((100cqw - var(--wmm-fit-base)) / 16), 20px);
	--wmm-item-py: 13px;
	--wmm-caret-gap: 8px;
	--wmm-shadow: 0 5px 10px -3px rgba(0, 0, 0, .25);
	--wmm-ease: cubic-bezier(.58, .3, .005, 1); /* jak wskaźnik e--pointer-underline */
	--wmm-fade: .18s;
	--wmm-hover-delay: .1s;
	--wmm-justify: center; /* jak elementor-nav-menu__align-center */

	font-family: var(--wmm-font);
	font-size: 14px;
	line-height: 20px;
	text-align: left;
}

/* ---------- reset (XStore / normalize) ---------- */
.wmm ul,
.wmm li {
	list-style: none;
	margin: 0;
	padding: 0;
}
.wmm a {
	text-decoration: none;
	transition: color .3s;
}
.wmm button {
	-webkit-appearance: none;
	appearance: none;
	background: none;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	margin: 0;
	padding: 0;
	min-height: 0;
	height: auto;
	width: auto;
	font: inherit;
	line-height: inherit;
	letter-spacing: inherit;
	text-transform: none;
	text-align: inherit;
	color: inherit;
	cursor: pointer;
}
.wmm button:hover,
.wmm button:focus {
	background: none;
	color: inherit;
}
.wmm p {
	margin: 0;
}
.wmm a:focus,
.wmm button:focus {
	outline: 0;
}
.wmm a:focus-visible,
.wmm button:focus-visible {
	outline: 2px solid var(--wmm-primary);
	outline-offset: -2px;
	border-radius: 3px;
}

.wmm__label {
	display: block;
}
.wmm__caret {
	display: inline-block;
	flex: none;
	width: 0;
	height: 0;
	border-left: 4px solid transparent;
	border-right: 4px solid transparent;
	border-top: 5px solid currentColor;
	transition: transform var(--wmm-fade);
}

/* ---------- pozycjonowanie: panel = szerokość kontenera nagłówka (1140px albo to, co ustawiono w sekcji) ----------
 * Kolumna/widżet nie mogą być punktem odniesienia – zostaje .elementor-container (position:relative w Elementorze),
 * więc panel ma dokładnie szerokość i krawędzie kontenera, a top:100% = dół nagłówka. */
.elementor-location-header .elementor-top-section > .elementor-container *:has(.wmm),
.elementor-location-header .e-con-inner *:has(.wmm) {
	position: static;
}
.elementor-location-header .elementor-top-section > .elementor-container:has(.wmm),
.elementor-location-header .e-con-inner:has(.wmm) {
	position: relative;
}
.elementor-location-header .elementor-top-section:has(.wmm),
.elementor-location-header > .e-con:has(.wmm) {
	position: relative;
	z-index: 9990; /* panel nad treścią strony (sekcje z position:relative) */
}

/* ---------- CTA "Umów spotkanie" (styl przycisków strony) ---------- */
.wmm .wmm__cta {
	display: inline-flex;
	align-items: center;
	padding: 10px 20px;
	border-radius: 3px;
	background-color: var(--wmm-primary);
	color: #fff;
	font-weight: 500;
	white-space: nowrap;
	transition: background-color .3s, color .3s;
}
/* wyższa specyficzność niż stany zakładek (hover/focus-within kolorują .wmm__head > *) */
.wmm .wmm__menu .wmm__item--cta > .wmm__head > .wmm__top.wmm__cta {
	color: #fff;
}
.wmm .wmm__menu .wmm__item--cta > .wmm__head > .wmm__top.wmm__cta:hover,
.wmm .wmm__menu .wmm__item--cta > .wmm__head > .wmm__top.wmm__cta:focus-visible {
	background-color: var(--wmm-black);
	color: #fff;
}
.wmm .wmm__cta:focus-visible {
	outline-offset: 2px;
}

/* ---------- hamburger (wygląd jak .elementor-menu-toggle) ---------- */
.wmm .wmm__burger {
	display: none;
	align-items: center;
	justify-content: center;
	/* do prawej krawędzi kolumny – logo i hamburger obok siebie (zmień na "0 auto", by wyśrodkować) */
	margin: var(--wmm-burger-margin, 0 0 0 auto);
	padding: .25em;
	font-size: var(--nav-menu-icon-size, 22px);
	line-height: 1;
	border-radius: 3px;
	background-color: rgba(0, 0, 0, .05);
	color: #33373d;
}
.wmm .wmm__burger:hover,
.wmm .wmm__burger:focus {
	background-color: rgba(0, 0, 0, .05);
	color: #33373d;
}
.wmm__burger-icon {
	position: relative;
	display: block;
	width: 1em;
	height: 1em;
}
/* trzy kreski – eicon-menu-bar */
.wmm__burger-icon--open::before,
.wmm__burger-icon--open::after,
.wmm__burger-icon--open > span {
	content: "";
	position: absolute;
	left: .045em;
	right: .045em;
	height: .09em;
	background: currentColor;
}
.wmm__burger-icon--open::before { top: .2em; }
.wmm__burger-icon--open > span  { top: .455em; }
.wmm__burger-icon--open::after  { top: .71em; }
/* X – eicon-close */
.wmm__burger-icon--close::before,
.wmm__burger-icon--close::after {
	content: "";
	position: absolute;
	top: .455em;
	left: .06em;
	right: .06em;
	height: .09em;
	background: currentColor;
	transform: rotate(45deg);
}
.wmm__burger-icon--close::after {
	transform: rotate(-45deg);
}
.wmm__burger-icon--close,
.wmm.is-mobile-open .wmm__burger-icon--open {
	display: none;
}
.wmm.is-mobile-open .wmm__burger-icon--close {
	display: block;
}

/* =====================================================================
 * DESKTOP – kolumna menu >= 1020px
 * =================================================================== */
@container wmm (min-width: 1020px) {

	.wmm__menu {
		display: flex;
		flex-wrap: nowrap;
		align-items: center;
		justify-content: var(--wmm-justify);
	}

	/* li statyczne – panel liczy pozycję od sekcji nagłówka (dół nagłówka) */
	.wmm__item {
		position: static;
	}

	.wmm__head {
		position: relative;
		display: flex;
		align-items: stretch;
	}
	/* podkreślenie jak e--pointer-underline (3px, kolor akcentu) */
	.wmm__head::after {
		content: "";
		position: absolute;
		left: 0;
		bottom: 0;
		z-index: 2;
		width: 100%;
		height: 3px;
		background-color: var(--wmm-accent);
		opacity: 0;
		pointer-events: none;
		transition: opacity .3s var(--wmm-ease);
	}
	.wmm__item--cta .wmm__head::after {
		display: none;
	}

	.wmm .wmm__top {
		display: flex;
		align-items: center;
		padding: var(--wmm-item-py) var(--wmm-item-px);
		color: var(--wmm-secondary);
		font-weight: 600;
		white-space: nowrap;
	}
	.wmm button.wmm__top .wmm__caret {
		margin-left: var(--wmm-caret-gap);
	}
	/* link huba + osobny przycisk z daszkiem */
	.wmm .wmm__head > a.wmm__top:not(:only-child) {
		padding-right: 0;
	}
	.wmm .wmm__trigger--caret {
		display: flex;
		align-items: center;
		padding: var(--wmm-item-py) var(--wmm-item-px) var(--wmm-item-py) var(--wmm-caret-gap);
		color: var(--wmm-secondary);
		transition: color .3s;
	}
	.wmm .wmm__item--cta {
		margin-left: 10px;
	}
	.wmm .wmm__item--cta .wmm__cta {
		padding: 10px 20px;
	}

	/* stany: aktywna podstrona / rodzic bieżącej podstrony / otwarty panel */
	.wmm__item.is-current > .wmm__head::after,
	.wmm__item.is-current-parent > .wmm__head::after,
	.wmm__item.is-open > .wmm__head::after,
	.wmm__item:not(.is-closed):focus-within > .wmm__head::after {
		opacity: 1;
	}
	.wmm .wmm__item.is-current > .wmm__head > .wmm__top,
	.wmm .wmm__item.is-current-parent > .wmm__head > .wmm__top,
	.wmm .wmm__item.is-current-parent > .wmm__head > .wmm__trigger,
	.wmm .wmm__item.is-open > .wmm__head > *,
	.wmm .wmm__item:not(.is-closed):focus-within > .wmm__head > * {
		color: var(--wmm-accent);
	}
	.wmm__item.is-open .wmm__caret,
	.wmm__item:not(.is-closed):focus-within .wmm__caret {
		transform: rotate(180deg);
	}

	/* ---------- panele ---------- */
	.wmm__panel {
		position: absolute;
		top: 100%;
		z-index: 9997;
		visibility: hidden;
		opacity: 0;
		transform: translateY(4px);
		background-color: var(--wmm-white);
		border-radius: 0 0 3px 3px;
		box-shadow: var(--wmm-shadow);
		/* zamykanie: krótka zwłoka, żeby nie gubić panelu przy ruchu myszy po skosie */
		transition: opacity var(--wmm-fade) ease .12s, transform var(--wmm-fade) ease .12s, visibility 0s linear calc(var(--wmm-fade) + .12s);
	}
	/* mostek nad panelem – kursor nie "spada" między zakładką a panelem */
	.wmm__panel::before {
		content: "";
		position: absolute;
		left: 0;
		right: 0;
		bottom: 100%;
		height: 16px;
	}
	.wmm__item.is-open > .wmm__panel,
	.wmm__item:not(.is-closed):focus-within > .wmm__panel {
		visibility: visible;
		opacity: 1;
		transform: none;
		transition: opacity var(--wmm-fade) ease, transform var(--wmm-fade) ease, visibility 0s;
	}

	.wmm__panel--mega {
		left: 0;
		right: 0;
	}
	/* dropdown: left:auto → pozycja pozioma = pod zakładką, pionowa = dół nagłówka */
	.wmm__panel--dropdown {
		left: auto;
		min-width: 240px;
	}

	.wmm__cols {
		display: grid;
		grid-template-columns: repeat(var(--wmm-cols, 3), minmax(0, 1fr));
		gap: 24px 40px;
		max-width: calc(var(--wmm-cols, 3) * 360px);
		padding: 30px;
	}
	.wmm__group + .wmm__group {
		margin-top: 24px;
	}

	.wmm__panel--dropdown .wmm__list {
		padding: 14px 20px;
	}
}

/* hover tylko tam, gdzie jest prawdziwy kursor */
@container wmm (min-width: 1020px) {
@media (hover: hover) {
	.wmm__item:not(.is-closed):hover > .wmm__head::after {
		opacity: 1;
	}
	.wmm .wmm__item:not(.is-closed):hover > .wmm__head > *,
	.wmm .wmm__head > .wmm__top:hover,
	.wmm .wmm__head > .wmm__trigger:hover {
		color: var(--wmm-accent);
	}
	.wmm__item:not(.is-closed):hover > .wmm__panel {
		visibility: visible;
		opacity: 1;
		transform: none;
		transition: opacity var(--wmm-fade) ease var(--wmm-hover-delay), transform var(--wmm-fade) ease var(--wmm-hover-delay), visibility 0s linear var(--wmm-hover-delay);
	}
	.wmm__item:not(.is-closed):hover .wmm__caret {
		transform: rotate(180deg);
	}
}
}

/* ---------- zawartość paneli (wspólne desktop + mobile) ---------- */
.wmm .wmm__heading {
	display: block;
	margin: 0 0 8px;
	color: var(--wmm-primary);
	font-weight: 600;
	font-size: 14px;
	line-height: 20px;
}
.wmm a.wmm__heading:hover,
.wmm a.wmm__heading:focus-visible {
	color: var(--wmm-primary);
	text-decoration: underline;
	text-underline-offset: 3px;
}
.wmm .wmm__link {
	display: block;
	padding: 4px 0;
	color: var(--wmm-secondary);
	font-weight: 400;
}
.wmm .wmm__link:hover,
.wmm .wmm__link:focus-visible,
.wmm .wmm__link[aria-current="page"] {
	color: var(--wmm-primary);
}
.wmm__footer {
	border-top: 1px solid var(--wmm-line);
	padding: 14px 30px;
}
.wmm__panel--dropdown .wmm__footer {
	padding: 12px 20px;
}
.wmm .wmm__all {
	color: var(--wmm-primary);
	font-weight: 600;
}
.wmm .wmm__all:hover,
.wmm .wmm__all:focus-visible {
	color: var(--wmm-primary);
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* =====================================================================
 * HAMBURGER – kolumna menu < 1020px (zawsze na tablecie/telefonie)
 * =================================================================== */
@container wmm (max-width: 1019.98px) {

	.wmm .wmm__burger {
		display: flex;
	}

	.wmm__menu {
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		z-index: 9997;
		max-height: var(--wmm-menu-max, calc(100vh - 80px));
		overflow-x: hidden;
		overflow-y: auto;
		overscroll-behavior: contain;
		background-color: var(--wmm-white);
		box-shadow: var(--wmm-shadow);
		visibility: hidden;
		opacity: 0;
		transform: translateY(-4px);
		transition: opacity var(--wmm-fade) ease, transform var(--wmm-fade) ease, visibility 0s linear var(--wmm-fade);
	}
	.wmm.is-mobile-open .wmm__menu {
		visibility: visible;
		opacity: 1;
		transform: none;
		transition: opacity var(--wmm-fade) ease, transform var(--wmm-fade) ease, visibility 0s;
	}

	.wmm__item {
		border-bottom: 1px solid var(--wmm-line);
	}
	.wmm__head {
		position: relative;
		display: flex;
		align-items: center;
	}
	.wmm .wmm__top {
		display: flex;
		flex: 1 1 auto;
		align-items: center;
		justify-content: space-between;
		gap: 10px;
		width: 100%;
		padding: var(--wmm-item-py) 20px;
		color: var(--wmm-secondary);
		font-weight: 600;
	}
	/* link huba: kliknięcie w wiersz tylko rozwija (przycisk przykrywa wiersz);
	   do huba prowadzi "Zobacz wszystkie" w panelu */
	.wmm .wmm__trigger--caret {
		position: absolute;
		inset: 0;
		display: flex;
		align-items: center;
		justify-content: flex-end;
		padding: 0 20px;
		color: var(--wmm-secondary);
	}
	.wmm .wmm__item.is-current > .wmm__head > .wmm__top,
	.wmm .wmm__item.is-current-parent > .wmm__head > *,
	.wmm .wmm__item.is-open > .wmm__head > * {
		color: var(--wmm-accent);
	}
	.wmm__item.is-open .wmm__caret {
		transform: rotate(180deg);
	}

	.wmm__panel {
		display: none;
		background-color: var(--wmm-light);
		padding: 6px 20px 14px 30px;
	}
	.wmm__item.is-open > .wmm__panel {
		display: block;
	}
	.wmm__group {
		margin-top: 12px;
	}
	.wmm .wmm__heading {
		margin-bottom: 2px;
	}
	.wmm .wmm__link {
		padding: 7px 0;
	}
	.wmm__panel--dropdown .wmm__group:first-child,
	.wmm__panel--dropdown .wmm__list {
		margin-top: 6px;
	}
	.wmm__footer {
		margin-top: 12px;
		padding: 12px 0 0;
	}
	.wmm__panel--dropdown .wmm__footer {
		padding: 12px 0 0;
	}
	.wmm .wmm__all {
		display: block;
		padding: 4px 0;
	}

	.wmm .wmm__item--cta {
		border-bottom: 0;
		padding: 14px 20px 18px;
	}
	.wmm__item--cta .wmm__head {
		display: block;
	}
	.wmm .wmm__item--cta .wmm__cta {
		display: inline-flex;
		width: auto;
		padding: 10px 20px;
		justify-content: center;
	}
}

/* bez JS na mobile: menu rozwinięte w całości (żadne linki nie są ukryte) */
@container wmm (max-width: 1019.98px) {
@media (scripting: none) {
	.wmm .wmm__burger {
		display: none;
	}
	.wmm__menu {
		position: static;
		max-height: none;
		visibility: visible;
		opacity: 1;
		transform: none;
		box-shadow: none;
	}
	.wmm__panel {
		display: block;
	}
}
}

@media (prefers-reduced-motion: reduce) {
	.wmm *,
	.wmm *::before,
	.wmm *::after {
		transition-duration: 0s !important;
		transition-delay: 0s !important;
	}
}
