#site-header {
	position: sticky;
	top: 0;
	z-index: 999;
	background: var(--sziv-white);
}

#menu-fomenu {
	margin-top: 10px;

	/* Főmenü elemek középre igazítása */
	& > .menu-item {
		display: inline-flex;
		align-items: center;
	}

	/* A főmenü linkek */
	& .menu-item a {
		color: var(--sziv-grey);
		font-family: inherit;
		font-size: 16px;
		font-weight: 400;
		text-decoration: none;
		padding: 1px 0;
		margin: 0 15px;
		border-bottom: 2px solid transparent;
		transition: color 0.3s ease, border-bottom-color 0.3s ease;
	}

	/* Hover effekt */
	& > .menu-item a:hover {
		color: var(--sziv-black);
		border-bottom-color: var(--sziv-burgundy);
	}
}

/* A perjel ( / ) elválasztó beszúrása a menüpontok közé */
#menu-fomenu > .menu-item:not(:last-child)::after {
	content: "/";
	color: #b5b5b5;
	font-size: 16px;
	font-weight: 300;
	margin-left: 5px;
	pointer-events: none;
}

/* A perjel ( / ) elválasztó beszúrása a menüpontok közé */
#menu-fomenu > .menu-item:last-child::after {
	content: none;
}

/* Almenü */
#menu-fomenu > .menu-item > ul.sub-menu {
	background: var(--sziv-white);
	border: 1px solid var(--sziv-cyan);
	border-top: none;
	top: 0;
	left: -3px;
	width: calc(100% + 60px);
}

/* Almenü elemek*/
#menu-fomenu > .menu-item > ul.sub-menu > .menu-item {
	display: flex;
	align-items: center;
	border: 1px solid transparent;
	margin: 10px 0;
	transition: all 0.3s ease;
	text-align: start;
}
#menu-fomenu > .menu-item > ul.sub-menu > .menu-item:first-child {
	margin-top: 0;
	& > a {
		border-bottom: 2px solid var(--sziv-burgundy);
	}
}

/* Almenü elemek hover effekt */
#menu-fomenu > .menu-item > ul.sub-menu > .menu-item:not(:first-child):hover {
	color: var(--sziv-black);
	&::before {
		content: "";
		display: flex;
		width: 5px;
		height: 15px;
		background: var(--sziv-cyan);
		margin-left: 15px;
	}
	 a {
		border-bottom: 2px solid var(--sziv-cyan);
		margin-left: 10px;
	 }
}

/* KERESŐ */

/* Fejléc kereső mező csomagoló */
.fejlec-kereso-wrapper {
	display: flex;
	justify-content: center;
	width: 100%;
	margin-top: 0.5rem;

	.fejlec-kereso-form {
		width: 100%;
		max-width: 450px; /* A kereső sáv maximális szélessége */
	}

	/* Kereső beviteli doboz */
	.fejlec-kereso-input-box {
		position: relative;
		display: flex;
		align-items: center;
	}

	/* Nagyító ikon beállítása */
	.fejlec-kereso-icon {
		position: absolute;
		left: 18px;
		width: 18px;
		height: 18px;
		fill: var(--sziv-grey);
		pointer-events: none;
	}

	/* A beviteli mező (pill/kapszula forma) */
	.fejlec-kereso-input {
		width: 100%;
		height: 30px;
		padding: 6px 15px 6px 45px; /* Hely hagyása a bal oldali ikonnak */
		border: 1px solid #999999;
		border-radius: 20px; /* Lekerekített élek */
		outline: none;
		font-size: 15px;
		font-style: italic;
		color: #333333;
		background-color: var(--sziv-white);
		transition: all 0.2s ease-in-out;
	}

	/* Placeholder (Súgó szöveg) dőlt betűtípusa */
	.fejlec-kereso-input::placeholder {
		color: var(--sziv-grey);
		font-style: italic;
	}

	/* Focus állapot (amikor belelép a felhasználó) */
	.fejlec-kereso-input:focus {
		border-color: #333333;
		box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
	}
}

@media (max-width: 993px) {

	/* Body helybiztosítás, hogy a header ne takarja el az oldal alját */
	body {
		padding-bottom: 90px !important;
	}

	/* 1. Sötét háttér, teljes szélesség ÉS LAP ALJÁRA RÖGZÍTÉS */
	#site-header {
		background-color: var(--sziv-mobile-header) !important;
		width: 100% !important;
		position: fixed !important;
		bottom: 0 !important;
		left: 0 !important;
		right: 0 !important;
		top: auto !important;
		z-index: 99999 !important;
	}

	#site-header .header-inner {
		display: flex !important;
		justify-content: space-between !important;
		align-items: center !important;
		position: relative !important;
		width: 100% !important;
		max-width: 100% !important;
		padding: 0 20px !important;
		box-sizing: border-box !important;
		height: 60px;
	}

	/* 2. Asztali kereső és navigáció elrejtése */
	#site-header .fejlec-kereso-wrapper,
	#site-header .site-navigation {
		display: none !important;
	}

	/* 3. LOGÓ: Középre pozicionálás */
	#site-header .site-branding {
		position: absolute !important;
		left: 50% !important;
		top: 50% !important;
		transform: translate(-50%, -50%) !important;
		margin: 0 !important;
		padding: 0 !important;
		z-index: 1;
	}

	#site-header .site-branding img,
	#site-header .site-logo img {
		max-height: 60px !important;
		height: 100% !important;
		width: auto !important;
		display: block !important;
	}

	/* 4. BAL OLDAL: A HTML Kereső gomb stílusa */
	button.header-search-toggle {
		display: flex !important;
		align-items: center;
		justify-content: center;
		background: transparent;
		border: none;
		border-radius: 0;
		padding: 5px;
		margin-right: auto; /* Bal szélre tolja */
		color: var(--sziv-white);
		cursor: pointer;
		z-index: 2;
		height: 100%;

		&:hover, &:active, &:focus {
			background: none;
			color: var(--sziv-grey);
		}
	}

	.header-search-toggle svg {
		fill: var(--sziv-white);
		height: 30px;
		width: 30px;
	}

	/* 5. JOBB OLDAL: Hamburger gomb */
	#site-header .site-navigation-toggle-holder {
		margin-left: auto !important;
		z-index: 2;
		height: 100%;
		padding-right: 10px;

		button.site-navigation-toggle {
			span.site-navigation-toggle-icon {
				display: inline-block;
				transform: scale(1.3) !important;
				transform-origin: center center;
				&:before, &:after {
					color: var(--sziv-white);
				}
			}
		}
	}

	/* ==========================================================================
	   KERESŐ MÓD
	   ========================================================================== */

	/* Nyitott állapotban elrejtjük a Logót, a bal gombot és a Hamburger gombot */
	#site-header.search-is-active .site-branding,
	#site-header.search-is-active .header-search-toggle,
	#site-header.search-is-active .site-navigation-toggle-holder {
		display: none !important;
	}

	/* Megjelenítjük a teljes szélességű keresőt */
	#site-header.search-is-active .fejlec-kereso-wrapper {
		display: flex !important;
		width: 100% !important;
		max-width: 100% !important;
		margin: 0 !important;
		align-items: center;
		gap: 10px;
		height: 100%;
	}

	#site-header.search-is-active .fejlec-kereso-form {
		flex: 1 !important;
		max-width: 100% !important;
	}

	/* Bezáró (X) gomb a kereső mellett */
	.search-close-btn {
		display: none;
		background: transparent !important;
		border-color: var(--sziv-grey) !important;
		color: var(--sziv-white) !important;
		line-height: 1;
		&:hover, &:active, &:focus {
			background: var(--sziv-grey) !important;
		}
	}

	#site-header.search-is-active .search-close-btn {
		display: block !important;
	}

	/* ==========================================================================
       DROPDOWN MOBIL MENÜ FORMÁZÁSA (FELFELÉ NYÍLÓ, ALULRÓL)
       ========================================================================== */

	/* A fő menü konténer pozicionálása a fejléc fölé */
	#site-header .site-navigation-dropdown {
		position: fixed !important;
		bottom: 90px !important;
		top: auto !important;    /* Letiltjuk a felső igazítást */
		right: 0 !important;
		left: auto !important;
		width: auto !important;
		max-height: calc(100vh - 70px) !important;
		overflow-y: auto !important;
		z-index: 99998 !important;
		background: transparent !important;
		/* Animációs beállítások alulról felfelé */
		transform-origin: bottom right !important;
		transition: transform 0.25s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.2s ease-in-out, visibility 0.2s !important;
	}

	/* A fekete menü doboz (ul.menu) igazítása */
	#site-header .site-navigation-dropdown ul.menu {
		font-size: 18px;
		position: relative !important;
		top: auto !important;
		bottom: 0 !important;
		right: 0 !important;
		left: auto !important;
		width: 320px !important;
		margin: 0 !important;
		padding: 15px 10px !important;
		background-color: var(--sziv-mobile-header) !important;
		color: var(--sziv-grey) !important;
		box-shadow: -2px -4px 15px rgba(0, 0, 0, 0.4) !important;
	}

	#site-header .site-navigation-dropdown ul.menu li.menu-item {
		> a {
			padding: 8px 12px !important;
			background: none !important;
			box-shadow: none !important;
			text-align: start !important;
			display: block !important;

			&:hover, &:focus, &:active {
				color: var(--sziv-white) !important;
				text-decoration: underline !important;
				text-decoration-color: var(--sziv-burgundy) !important;
				text-underline-offset: 5px !important;
				cursor: pointer !important;
			}
		}

		.sub-menu {
			margin-left: 15px !important;

			li.menu-item {
				> a {
					display: flex !important;
					align-items: center !important;
					padding: 4px 10px !important;
					margin-bottom: 3px !important;

					&:hover, &:focus, &:active {
						color: var(--sziv-white) !important;
						text-decoration: underline !important;
						text-decoration-color: var(--sziv-cyan) !important;
						text-underline-offset: 5px !important;

						&::before {
							content: "" !important;
							display: flex !important;
							width: 5px !important;
							height: 15px !important;
							background: var(--sziv-cyan) !important;
							margin-right: 10px !important;
						}
					}
				}
			}
		}

		&.hide-on-mobile {
			display: none !important;
		}
	}

	#site-header .fejlec-kereso-wrapper {
		.fejlec-kereso-input {
			font-size: 16px;
		}
	}
}

/* Mobilon kívül (Desktopon) a gomb és a bezáró gomb rejtve marad */
@media (min-width: 994px) {
	.header-search-toggle,
	.search-close-btn {
		display: none !important;
	}
}