/* GeoNovus menüü – the yellow menu bar.
   Colours and fonts are inherited from the site: Elementor global colours where they exist,
   with the site's current values as fallbacks. */

.gn-bar {
	--gn-yellow: var(--e-global-color-accent, #FFD049);
	--gn-ink: var(--e-global-color-primary, #22222F);
	--gn-text: var(--e-global-color-secondary, #54595F);
	--gn-soft: #F6F6F4;
	--gn-line: #E4E4E4;
	--gn-tint: rgba(34, 34, 47, .08);
	--gn-tint-hover: rgba(34, 34, 47, .05);
	--gn-shadow: 0 12px 32px rgba(34, 34, 47, .12);
	--gn-max: 1140px;
	--gn-ease: cubic-bezier(0, 0, .24, 1);

	position: relative;
	z-index: 999;
	background: var(--gn-yellow);
	color: var(--gn-ink);
	font-family: inherit;
	-webkit-font-smoothing: antialiased;
}

.gn-bar *,
.gn-bar *::before,
.gn-bar *::after { box-sizing: border-box; }

.gn-bar ul { list-style: none; margin: 0; padding: 0; }
.gn-bar li { margin: 0; padding: 0; line-height: 1.4; }
.gn-bar li::before, .gn-bar li::marker { content: none; }
.gn-bar a { text-decoration: none; color: inherit; border: 0; box-shadow: none; }
.gn-bar button { font-family: inherit; letter-spacing: inherit; text-transform: none; text-align: left; white-space: nowrap; }

/* Neutralise theme button styles (Hello Elementor colours buttons pink on hover/focus). */
.gn-bar button,
.gn-bar button:hover,
.gn-bar button:focus,
.gn-bar button:active {
	background-color: transparent;
	color: var(--gn-ink);
	border-color: transparent;
	box-shadow: none;
	text-decoration: none;
}

.gn-sr {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

.gn-wrap {
	position: relative;
	width: min(var(--gn-max), 100% - 40px);
	height: 60px;
	margin: 0 auto;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
}

/* ---------- Top level ---------- */

.gn-top { display: flex; align-items: center; gap: 4px; margin-left: -16px !important; }
.gn-item { position: relative; }

.gn-top-link,
.gn-top-btn {
	display: flex;
	align-items: center;
	gap: 6px;
	height: 36px;
	padding: 0 16px;
	border: 0;
	border-radius: 100px;
	background: transparent;
	color: var(--gn-ink);
	font-size: 15px;
	font-weight: 500;
	line-height: 1;
	letter-spacing: .01em;
	cursor: pointer;
	transition: background-color .14s var(--gn-ease);
}
.gn-bar .gn-top-link:hover,
.gn-bar .gn-top-btn:hover { background: var(--gn-tint-hover); color: var(--gn-ink); }
.gn-bar .gn-item.gn-open > .gn-top-btn,
.gn-top-link[aria-current="page"] { background: var(--gn-tint); }
.gn-top-link:focus-visible,
.gn-top-btn:focus-visible { outline: 2px solid var(--gn-ink); outline-offset: 2px; }

.gn-chev { transition: transform .2s var(--gn-ease); }
.gn-item.gn-open > .gn-top-btn .gn-chev { transform: rotate(180deg); }

/* ---------- Dropdowns (desktop) ---------- */

.gn-drop {
	position: absolute;
	top: calc(100% + 24px);
	left: 0;
	background: #fff;
	border-radius: 16px;
	box-shadow: var(--gn-shadow);
	opacity: 0;
	visibility: hidden;
	transform: translateY(-4px);
	transition: opacity .16s var(--gn-ease), transform .16s var(--gn-ease), visibility 0s linear .16s;
	z-index: 1000;
}
/* Invisible bridge so the pointer can travel from the bar to the panel. */
.gn-drop::before { content: ""; position: absolute; left: 0; right: 0; top: -24px; height: 24px; }
.gn-item.gn-open > .gn-drop {
	opacity: 1;
	visibility: visible;
	transform: none;
	transition: opacity .16s var(--gn-ease), transform .16s var(--gn-ease), visibility 0s;
}

/* List panels: Teenused, Valdkonnad */
.gn-drop-list { width: 440px; padding: 12px; }
.gn-list a {
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 14px 16px;
	border-radius: 10px;
	transition: background-color .14s var(--gn-ease);
}
.gn-list a:hover,
.gn-list a:focus-visible { background: var(--gn-soft); outline: none; }
.gn-list a[aria-current="page"] { background: var(--gn-soft); }
.gn-list-title { font-size: 15px; font-weight: 600; line-height: 1.35; color: var(--gn-ink); }
.gn-list-desc { font-size: 14px; line-height: 1.45; color: var(--gn-text); }

.gn-drop-all {
	display: inline-block;
	margin: 8px 16px 6px;
	font-size: 14px;
	font-weight: 500;
	color: var(--gn-ink);
	border-bottom: 1px solid var(--gn-ink) !important;
}

/* Mega panel: Tooted. Spans the full content width. */
.gn-item.gn-is-mega { position: static; }
.gn-drop-mega { left: 0; right: 0; top: calc(100% + 12px); padding: 40px 48px 44px; }
.gn-drop-mega::before { top: -12px; height: 12px; }
.gn-mega-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 40px;
}
.gn-cat { display: flex; flex-direction: column; gap: 12px; }
.gn-cat-link { font-size: 15px; font-weight: 600; line-height: 1.35; color: var(--gn-ink); }
.gn-products { display: flex; flex-direction: column; gap: 8px; }
.gn-products a { display: block; font-size: 15px; line-height: 1.4; color: var(--gn-text); }
.gn-cat-link:hover,
.gn-products a:hover { color: var(--gn-ink); text-decoration: underline !important; text-underline-offset: 3px; }
.gn-all {
	align-self: flex-start;
	margin-top: 4px;
	font-size: 14px;
	font-weight: 500;
	color: var(--gn-ink);
	border-bottom: 1px solid var(--gn-ink) !important;
}

/* ---------- Search ---------- */

.gn-search {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 280px;
	height: 38px;
	margin: 0;
	padding: 0 16px;
	border-radius: 100px;
	background: var(--gn-tint);
	color: var(--gn-ink);
	transition: background-color .14s var(--gn-ease);
}
.gn-search:focus-within { background: rgba(34, 34, 47, .12); outline: 2px solid var(--gn-ink); outline-offset: 2px; }
.gn-search svg { flex: 0 0 auto; }
.gn-search input[type="search"] {
	flex: 1 1 auto;
	min-width: 0;
	height: 100%;
	margin: 0;
	padding: 0;
	border: 0 !important;
	border-radius: 0;
	background: transparent !important;
	box-shadow: none !important;
	color: var(--gn-ink);
	font: inherit;
	font-size: 14px;
	outline: none;
	-webkit-appearance: none;
	appearance: none;
}
.gn-search input::placeholder { color: var(--gn-ink); opacity: .65; }
.gn-search input::-webkit-search-cancel-button { -webkit-appearance: none; }

/* Mobile-only controls are hidden on desktop. */
.gn-mtoggle,
.gn-stoggle { display: none; }

/* ---------- Mobile and tablet ---------- */

@media (max-width: 1024px) {
	.gn-wrap { width: 100%; height: 52px; padding: 0 4px 0 0; gap: 0; }

	.gn-mtoggle,
	.gn-stoggle {
		display: flex;
		align-items: center;
		justify-content: center;
		gap: 10px;
		height: 44px;
		padding: 0 16px;
		border: 0;
		background: transparent;
		color: var(--gn-ink);
		font-size: 15px;
		font-weight: 600;
		cursor: pointer;
	}
	.gn-stoggle { width: 44px; padding: 0; }
	.gn-mtoggle:focus-visible,
	.gn-stoggle:focus-visible { outline: 2px solid var(--gn-ink); outline-offset: -2px; }

	.gn-burger { position: relative; width: 22px; height: 16px; }
	.gn-burger span {
		position: absolute; left: 0; width: 22px; height: 1.75px;
		background: currentColor;
		transition: transform .2s var(--gn-ease), opacity .2s var(--gn-ease);
	}
	.gn-burger span:nth-child(1) { top: 0; }
	.gn-burger span:nth-child(2) { top: 7px; }
	.gn-burger span:nth-child(3) { top: 14px; }
	.gn-bar.gn-open .gn-burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
	.gn-bar.gn-open .gn-burger span:nth-child(2) { opacity: 0; }
	.gn-bar.gn-open .gn-burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

	/* The menu panel */
	.gn-nav {
		display: none;
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		max-height: calc(100vh - 120px);
		max-height: calc(100dvh - 120px);
		overflow-y: auto;
		overscroll-behavior: contain;
		background: #fff;
		box-shadow: var(--gn-shadow);
		padding: 8px 0 16px;
	}
	.gn-bar.gn-open .gn-nav { display: block; }

	.gn-top { flex-direction: column; align-items: stretch; gap: 0; margin: 0 !important; }
	.gn-item, .gn-item.gn-is-mega { position: static; }

	.gn-bar .gn-top-link,
	.gn-bar .gn-top-btn {
		width: 100%;
		height: 56px;
		justify-content: space-between;
		padding: 0 16px;
		border-radius: 0;
		border-bottom: 1px solid var(--gn-line);
		font-size: 17px;
		font-weight: 600;
		text-align: left;
	}
	.gn-bar .gn-top-link:hover,
	.gn-bar .gn-top-btn:hover { background: transparent; }
	.gn-bar .gn-item.gn-open > .gn-top-btn { background: var(--gn-soft); }
	.gn-top-link[aria-current="page"] { background: transparent; }
	.gn-chev { width: 20px; height: 20px; }

	.gn-drop,
	.gn-drop-mega,
	.gn-drop-list {
		position: static;
		display: none;
		width: auto;
		padding: 4px 0 8px;
		border-radius: 0;
		border-bottom: 1px solid var(--gn-line);
		background: var(--gn-soft);
		box-shadow: none;
		opacity: 1;
		visibility: visible;
		transform: none;
		transition: none;
	}
	.gn-drop::before { display: none; }
	.gn-item.gn-open > .gn-drop { display: block; }

	.gn-mega-grid { display: block; }
	.gn-cat { display: block; }
	.gn-products,
	.gn-all { display: none !important; }
	.gn-cat-link,
	.gn-list a {
		display: flex;
		align-items: center;
		min-height: 46px;
		padding: 10px 16px 10px 32px;
		border-radius: 0;
		font-size: 15px;
		font-weight: 400;
		color: var(--gn-ink);
	}
	.gn-list a { flex-direction: row; justify-content: flex-start; text-align: left; }
	.gn-list-title { font-size: 15px; font-weight: 400; }
	.gn-list-desc { display: none; }
	.gn-drop-all { display: flex; min-height: 46px; align-items: center; margin: 0 16px 0 32px; border: 0 !important; font-weight: 600; text-decoration: underline !important; text-underline-offset: 3px; }

	/* Search drops down as its own row */
	.gn-search {
		display: none;
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		width: auto;
		height: 60px;
		padding: 0 16px;
		border-radius: 0;
		background: var(--gn-yellow);
		box-shadow: 0 8px 16px rgba(34, 34, 47, .08);
	}
	.gn-search:focus-within { outline: none; background: var(--gn-yellow); }
	.gn-search input[type="search"] {
		height: 44px;
		padding: 0 16px;
		border-radius: 100px;
		background: rgba(255, 255, 255, .7) !important;
		font-size: 16px; /* 16px stops iOS zooming in */
	}
	.gn-search > svg { display: none; }
	.gn-bar.gn-search-open .gn-search { display: flex; }
}

@media (prefers-reduced-motion: reduce) {
	.gn-bar * { transition: none !important; }
}
