:root {
	--navbar-height: 64px; /* juster ved behov */
}

/* ==================================================================
   TOPPNAV — fullbredde container (nøytral bakgrunn)
   ================================================================== */
.navbar {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	background-color: #f3f4f6; /* samme som body i default.cshtml */
	z-index: 1000;
	border-bottom: 1px solid rgba(0,0,0,0.06);
	box-shadow: 0 1px 3px rgba(0,0,0,0.10);
}

/* ==================================================================
   INNER WRAPPER — følger samme bredde som .main-column (900px)
   ================================================================== */
.navbar-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;

	max-width: 1200px;    /* matcher hovedinnholdet */
	margin: 0 auto;

	padding: 0.5rem 15px; /* samme side-padding som .main-column */
	background-color: #0099BC;
	color: #ffffff;

	border-bottom-left-radius: 6px;
	border-bottom-right-radius: 6px;
	position: relative;
}

/* ==================================================================
   LOGO
   ================================================================== */
.logo {
	display: flex;
	align-items: center;
	margin-right: auto;
}

.logo-link {
	display: flex;
	align-items: center;
	line-height: 0;
	text-decoration: none;
	color: #ffffff;
}

.logo-img {
	display: block;
	height: auto;
	max-height: 40px;
	width: auto;
}

/* ==================================================================
   DESKTOP-MENY
   ================================================================== */
.nav-links-desktop {
	display: inline-flex;
	gap: 1.2rem;
	list-style: none;
	margin: 0;
	padding: 0;
	margin-right: 0.5rem;
}

.nav-links-desktop li {
	display: inline-flex;
}

.nav-links-desktop a {
	text-decoration: none;
	color: #f9f9f9;
	font-weight: 500;
	padding: 0.2rem 0.1rem;
	transition: opacity 0.2s ease, transform 0.2s ease;
}

.nav-links-desktop a:hover {
	color: #ffffff;
	opacity: 1;
	transform: none;
	text-decoration: underline;
}

/* Aktiv side (ikke-lenke) */
.nav-links-desktop li:not(:has(a)) {
	color: #e0e9f0;
	font-weight: 600;
	cursor: default;
	display: flex;
	align-items: center;
	padding: 0.2rem 0.1rem;
	line-height: 1.4em;
}

.nav-links-desktop li:not(:has(a)):hover {
	opacity: 1;
	transform: none;
}

/* ==================================================================
   HAMBURGER
   ================================================================== */
.menu-toggle {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 5px;

	width: 40px;
	height: 40px;
	border: none;
	background: transparent;
	cursor: pointer;
	padding: 0;
	margin: 0;

	margin-left: 12px;
}

.menu-toggle .bar {
	display: block;
	width: 24px;
	height: 3px;
	background: #ffffff;
	border-radius: 2px;
	transition: transform 0.25s ease, opacity 0.25s ease;
}

.menu-toggle.active .bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.menu-toggle.active .bar:nth-child(2) { opacity: 0; }
.menu-toggle.active .bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* ==================================================================
   MOBILMENY (dropdown)
   ================================================================== */
.nav-links-mobile {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;

	background-color: #0099BC;
	display: none;

	flex-direction: column;
	align-items: stretch;
	gap: 0;

	border-top: 1px solid rgba(255,255,255,0.2);

	max-height: calc(100vh - var(--navbar-height));
	overflow-y: auto;
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;

	margin: 0;
	padding-top: 0;
}

.nav-links-mobile.open {
	display: flex;
	animation: fadeIn 0.25s ease;
}

.nav-links-mobile li {
	list-style: none;
	border-bottom: 1px solid rgba(255,255,255,0.15);
}

.nav-links-mobile li:not(:has(a)) {
	border-bottom: none;
	padding: 5px 0;
}

.nav-links-mobile a {
	display: block;
	padding: 8px 18px;
	text-decoration: none;
	color: #ffffff;
	font-size: 16px;
}

.nav-links-mobile a:hover {
	background: rgba(255,255,255,0.12);
}

@keyframes fadeIn {
	from { opacity: 0; transform: translateY(-8px); }
	to   { opacity: 1; transform: translateY(0); }
}

/* ==================================================================
   RESPONSIVITET
   ================================================================== */
@media (max-width: 699px) {
	.nav-links-desktop { display: none; }
}

@media (min-width: 700px) {
	.nav-links-desktop { display: inline-flex; }

	/* PC: mobilmeny skal ikke dekke hele bredden */
	.nav-links-mobile {
		left: auto;
		right: 0;
		width: 50%;
		max-width: 520px;
		border-left: 1px solid rgba(255,255,255,0.2);
		border-top-left-radius: 6px;
		box-shadow: 0 2px 8px rgba(0,0,0,0.15);
	}
}

/* ==================================================================
   GLOBALT: hindre scrolling når meny er åpen
   ================================================================== */
.no-scroll {
	overflow: hidden;
}

/* ==================================================================
   LOADING OVERLAY (spinner)
   ================================================================== */
body.is-loading::before {
	content: "";
	position: fixed;
	inset: 0;
	background: rgba(255,255,255,0.6);
	z-index: 2000;
}

body.is-loading::after {
	content: "";
	position: fixed;
	top: 50%;
	left: 50%;
	width: 48px;
	height: 48px;
	margin-left: -24px;
	margin-top: -24px;
	border: 4px solid rgba(0,0,0,0.2);
	border-top-color: rgba(0,0,0,0.6);
	border-radius: 50%;
	animation: agriloggSpin 0.8s linear infinite;
	z-index: 2001;
}

@keyframes agriloggSpin {
	to { transform: rotate(360deg); }
}

/* GI PLASS UNDER FIXED TOPPMENY PÅ MOBIL */
@media (max-width: 700px) {
	body {
		padding-top: 70px; /* juster 60–90px etter hvor høy menyen er */
	}
}

@media (min-width: 701px) {
	body {
		padding-top: 70px; /* juster 60–90px etter hvor høy menyen er */
	}
}

/* --- MOBIL: Topplinje full bredde --- */
@media (max-width: 700px) {

    .navbar {
        border-radius: 0 !important; /* fjern avrunding */
        padding-left: 0;
        padding-right: 0;
        width: 100%;
    }

    .navbar > .main-column {
        padding-left: 0 !important;
        padding-right: 0 !important;
        max-width: none !important;
        width: 100% !important;
    }
}