#site-header {
	position: sticky;
	top: 0;
	z-index: 999;
	background: var(--sziv-white);
	transition: all 0.3s ease;
}

.desktop-search-toggle {
	display: none;
}

#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;
}

#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Ő */
.fejlec-kereso-wrapper {
	display: flex;
	justify-content: center;
	width: 100%;
	margin-top: 0.5rem;

	.fejlec-kereso-form {
		width: 100%;
		max-width: 450px;
	}

	.fejlec-kereso-input-box {
		position: relative;
		display: flex;
		align-items: center;
	}

	.fejlec-kereso-icon {
		position: absolute;
		left: 18px;
		width: 18px;
		height: 18px;
		fill: var(--sziv-grey);
		pointer-events: none;
	}

	.fejlec-kereso-input {
		width: 100%;
		height: 30px;
		padding: 6px 15px 6px 45px;
		border: 1px solid #999999;
		border-radius: 20px;
		outline: none;
		font-size: 15px;
		font-style: italic;
		color: #333333;
		background-color: var(--sziv-white);
		transition: all 0.2s ease-in-out;
	}

	.fejlec-kereso-input::placeholder {
		color: var(--sziv-grey);
		font-style: italic;
	}

	.fejlec-kereso-input:focus {
		border-color: #333333;
		box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
	}
}

/* Asztali kereső gomb rejtése alapból */
.desktop-search-toggle {
	display: none !important;
}

/* ==========================================================================
   DESKTOP GÖRGETETT (SCROLLED) ÁLLAPOT STÍLUSAI (min-width: 994px)
   ========================================================================== */
@media (min-width: 994px) {
	/* ----------------------------------------------------
	   GÖRGETETT ÁLLAPOT (.is-scrolled)
	   ---------------------------------------------------- */
	#site-header.is-scrolled {
		padding: 10px 0;
		box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
	}

	#site-header.is-scrolled .header-inner {
		display: flex !important;
		flex-direction: row;
		flex-wrap: nowrap;
		align-items: center !important;
		justify-content: space-between !important;
	}

	/* Logó és menüsor egy sorba rendezése, margók felülírása */
	#site-header.is-scrolled .site-branding {
		margin: 0 !important;
	}

	#site-header.is-scrolled .site-branding .site-logo img {
		width: 250px;
		max-width: 250px;
	}

	#site-header.is-scrolled #menu-fomenu {
		margin: 0 10px !important;
	}

	/* Eredeti keresőmező elrejtése görgetéskor */
	#site-header.is-scrolled .fejlec-kereso-wrapper {
		display: none !important;
	}

	/* Kereső ikon megjelenítése a menüsor mellett görgetéskor */
	#site-header.is-scrolled .desktop-search-toggle {
		display: inline-flex !important;
		align-items: center;
		justify-content: center;
		background: transparent;
		border: none;
		cursor: pointer;
		padding: 5px;
		margin-left: 15px;
		color: var(--sziv-grey);
		transition: color 0.3s ease;
	}

	#site-header.is-scrolled .desktop-search-toggle:hover {
		color: var(--sziv-black);
	}

	/* ----------------------------------------------------
	   KERESŐ AKTÍV ÁLLAPOT GÖRGETÉSKOR (.desktop-search-active)
	   ---------------------------------------------------- */

	/* Menüsor és kereső ikon elrejtése */
	#site-header.is-scrolled.desktop-search-active .site-navigation,
	#site-header.is-scrolled.desktop-search-active .desktop-search-toggle {
		display: none !important;
	}

	/* Keresőmező megjelenítése full szélességben a menü helyén */
	#site-header.is-scrolled.desktop-search-active .fejlec-kereso-wrapper {
		display: flex !important;
		margin-top: 0 !important;
		flex: 1;
		max-width: 500px;
		margin-left: auto;
		align-items: center;
		gap: 10px;
	}

	#site-header.is-scrolled.desktop-search-active .fejlec-kereso-form {
		flex: 1;
	}

	/* Bezáró (X) gomb megjelenítése desktopon is aktív állapotban */
	#site-header.is-scrolled.desktop-search-active .search-close-btn {
		display: inline-flex !important;
		align-items: center;
		justify-content: center;
		background: transparent;
		border: 1px solid var(--sziv-grey);
		color: var(--sziv-grey);
		border-radius: 50%;
		width: 28px;
		height: 28px;
		font-size: 18px;
		cursor: pointer;
		padding: 0;
		line-height: 1;
		transition: all 0.2s ease;
	}

	#site-header.is-scrolled.desktop-search-active .search-close-btn:hover {
		background: var(--sziv-grey);
		color: var(--sziv-white);
	}
}

@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;
	}
}

@media (min-width: 992px) and (max-width: 1199px) {
	.site-header.is-scrolled .header-inner {
		max-width: 1200px !important; /* Hello theme css felülírás */

		.site-branding .site-logo img {
			width: 180px !important;
			max-width: 180px !important;
			margin: 0 10px !important;
		}
	}
}