/* Headeren (includes/navigation.php), lik på alle sider. Lastes etter assets/site-navigation.css og overstyrer den.
   Hvit med tynn strek under. Forsiden: blå i ett med heroen øverst (.sh-top), hvit når man har rullet forbi. */
html body #siteHeader.sp-navigation.sh-v2 {
    overflow: visible; background: #fff; color: #21262e; box-shadow: 0 1px 0 #e6ebf0;   /* bare en tynn strek, ingen skygge */
    transition: background-color .2s ease, box-shadow .2s ease, color .2s ease;
}
html body #siteHeader.sh-v2 .sp-navigation-row { display: flex; align-items: center; gap: 16px; }
.sh-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Logo: mørk på hvitt, hvit på blått. Begge ligger oppå hverandre, så byttet ikke flytter noe. */
html body #siteHeader.sh-v2 .sp-nav-brand { position: relative; flex: none; margin: 0; }
html body #siteHeader.sh-v2 .sp-nav-brand img { width: 128px; height: auto; transition: opacity .2s ease; }
html body #siteHeader.sh-v2 .sp-nav-brand .sh-logo-light { position: absolute; left: 0; top: 50%; transform: translateY(-50%); opacity: 0; }

/* Lenker og ikoner */
html body #siteHeader.sh-v2 :is(.sp-nav-desktop a, .sp-nav-icon) { color: #21262e; transition: color .2s ease, background-color .2s ease; }
html body #siteHeader.sh-v2 .sp-nav-desktop { flex: none; margin: 0 !important; gap: 26px; }
html body #siteHeader.sh-v2 .sp-nav-desktop a:nth-child(4) { margin-left: 0; }
html body #siteHeader.sh-v2 .sp-nav-desktop a:is(:hover, [aria-current="page"]) { color: #075ac6; text-decoration: underline; text-decoration-color: currentColor; }
html body #siteHeader.sh-v2 .sp-nav-icon:is(:hover, [aria-current="page"]) { background: #f1f4f8; }
html body #siteHeader.sh-v2 .sp-navigation-row :focus-visible { outline: 3px solid #075ac6; outline-offset: 2px; }

/* Forsiden øverst: blå, hvit logo, hvit tekst og hvite ikoner, ingen strek eller skygge */
html body #siteHeader.sh-v2.sh-top { background: #075ac6; color: #fff; box-shadow: none; }
html body #siteHeader.sh-v2.sh-top .sp-nav-brand .sh-logo-dark { opacity: 0; }
html body #siteHeader.sh-v2.sh-top .sp-nav-brand .sh-logo-light { opacity: 1; }
html body #siteHeader.sh-v2.sh-top :is(.sp-nav-desktop a, .sp-nav-icon) { color: #fff; }
html body #siteHeader.sh-v2.sh-top .sp-nav-desktop a:is(:hover, [aria-current="page"]) { color: #fff; text-decoration-color: #d5f5ea; }
html body #siteHeader.sh-v2.sh-top .sp-nav-icon:hover { background: rgb(255 255 255 / 16%); }
/* X-en i mobilmenyen står på hvit bakgrunn: alltid mørk, også når headeren ligger over den blå heroen */
html body #siteHeader.sh-v2 .sp-nav-drawer .sp-drawer-top .sp-nav-icon { color: #1d232b; }
html body #siteHeader.sh-v2 .sp-nav-drawer .sp-drawer-top .sp-nav-icon:hover { background: #f1f4f8; }
html body #siteHeader.sh-v2.sh-top .sp-navigation-row :focus-visible { outline-color: #fff; }
/* Ingen overgang før første måling (siden kan være lastet midt på) */
html body #siteHeader.sh-v2.sh-init, html body #siteHeader.sh-v2.sh-init * { transition: none !important; }

/* ---------- Adressesøket i midten av headeren ---------- */
#siteHeader .sh-search { position: relative; flex: 1 1 auto; min-width: 0; max-width: 520px; margin: 0 auto; transition: opacity .25s ease, visibility .25s ease; }
/* Forsiden: skjult (men plassen beholdes) mens heroens eget adressefelt er synlig */
#siteHeader.sh-home:not(.sh-search-on) .sh-search { opacity: 0; visibility: hidden; }
#siteHeader .sp-addr-search--sm { height: 46px; padding: 0 5px 0 14px; gap: 8px; background: #f1f4f8; }
#siteHeader .sp-addr-search--sm .sp-addr-search-pin svg { width: 20px; height: 20px; }
html body #siteHeader .sp-addr-search--sm input { font-size: 15px; }
#siteHeader .sp-addr-search--sm .sp-addr-search-locate { width: 36px; height: 36px; background: #d6e8ff; color: #075ac6; }
#siteHeader .sp-addr-search--sm .sp-addr-search-locate svg { width: 19px; height: 19px; }
#siteHeader .sh-search .sp-addr-results { top: calc(100% + 8px); min-width: 100%; z-index: 130; }

/* ---------- Adressefeltet (felles for headeren og heroen), som Wolt ---------- */
.sp-addr-search {
    position: relative; display: flex; align-items: center; gap: 10px; height: 60px; padding: 0 8px 0 20px;
    border-radius: 999px; background: #fff; box-shadow: 0 0 0 2px transparent; transition: background .15s, box-shadow .15s; cursor: text;
}
.sp-addr-search.is-active, html body .sp-addr-search:focus-within { background: #e8f3ff; box-shadow: 0 0 0 2px #075ac6; }
.sp-addr-search-pin { flex: none; display: grid; place-items: center; }
.sp-addr-search-pin svg { width: 24px; height: 24px; fill: none; stroke: #21262e; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
html body .sp-addr-search input,
html body .sp-addr-search input:focus,
html body .sp-addr-search input:focus-visible {
    flex: 1 1 auto; min-width: 0; width: 100%; height: 100% !important; min-height: 0 !important; margin: 0; padding: 0 !important;
    border: 0 !important; border-radius: 0 !important; outline: none !important; box-shadow: none !important; background: transparent !important;
    color: #21262e; font-family: 'DM Sans', system-ui, sans-serif; font-weight: 500; line-height: 1.2; text-overflow: ellipsis;
}
html body .sp-addr-search input { font-size: 17px; }
.sp-addr-search input::placeholder { color: #65717e; }
.sp-addr-search-locate {
    flex: none; width: 44px; height: 44px; border: 0; border-radius: 50%; background: #e8f3ff; color: #075ac6;
    display: grid; place-items: center; cursor: pointer;
}
.sp-addr-search.is-active .sp-addr-search-locate { background: #fff; }
.sp-addr-search-locate svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.sp-addr-search-locate:hover { background: #d6e8ff; }
.sp-addr-search-locate:focus-visible { outline: 3px solid #075ac6; outline-offset: 2px; }

/* Forslagslisten: hvit, nålikon i lys sirkel, gate i fet skrift, sted under, tynne streker mellom */
.sp-addr-results {
    position: absolute; left: 0; right: 0; top: calc(100% + 8px); z-index: 60; max-height: min(420px, 60vh, 60dvh); overflow-y: auto;
    padding: 6px 0; border-radius: 14px; background: #fff; box-shadow: 0 0 0 1px #e6ebf0; text-align: left;
}
.sp-addr-results[hidden] { display: none; }
.sp-addr-results .sp-address-option {
    position: relative; display: block; width: 100%; min-height: 64px; margin: 0; padding: 12px 18px 12px 72px;
    border: 0; background: #fff; color: #21262e; font: inherit; text-align: left; cursor: pointer;
}
.sp-addr-results .sp-address-option::before {
    content: ""; position: absolute; left: 16px; top: 50%; width: 40px; height: 40px; margin-top: -20px; border-radius: 50%;
    background: #f1f4f8 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2321262e' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M19 10c0 5-7 11-7 11S5 15 5 10a7 7 0 1 1 14 0Z'/%3E%3Ccircle cx='12' cy='10' r='2.5'/%3E%3C/svg%3E") center / 20px no-repeat;
}
.sp-addr-results .sp-address-option + .sp-address-option::after { content: ""; position: absolute; left: 72px; right: 18px; top: 0; height: 1px; background: #e6ebf0; }
.sp-addr-results .sp-address-option:is(:hover, :focus) { background: #f4f8fd; outline: 0; }
.sp-addr-results .sp-address-option:focus-visible { box-shadow: inset 0 0 0 3px #075ac6; }
.sp-addr-results .sp-address-option strong { display: block; font-size: 16px; font-weight: 700; }
.sp-addr-results .sp-address-option span { display: block; margin-top: 3px; color: #65717e; font-size: 14px; }
.sp-addr-results .sp-address-message { padding: 14px 18px; margin: 0; color: #526c82; font-size: 14px; }

@media (min-width: 900px) {
    html body #siteHeader.sh-v2 .sp-nav-open { display: none; }
    #siteHeader .sh-search { margin: 0 24px; }
    #siteHeader .sh-search .sp-addr-results { min-width: 440px; }
}
@media (max-width: 899.98px) {
    html body #siteHeader.sh-v2 .sp-navigation-row { gap: 8px; }
    html body #siteHeader.sh-v2 .sp-nav-brand img { width: clamp(84px, 24vw, 112px); }
    html body #siteHeader.sh-v2 .sp-nav-open { order: 3; display: inline-flex; flex: none; margin-right: -10px; }
    #siteHeader .sh-search { order: 2; margin: 0; max-width: none; }
    #siteHeader .sp-addr-search--sm { height: 42px; padding-left: 12px; gap: 6px; }
    #siteHeader .sp-addr-search--sm .sp-addr-search-pin svg { width: 18px; height: 18px; }
    html body #siteHeader .sp-addr-search--sm input { font-size: 14px; }
    /* Forslagslisten får hele bredden under headeren på mobil, så den ikke blir smal eller kuttet */
    #siteHeader .sh-search .sp-addr-results { position: fixed; left: 8px; right: 8px; top: calc(var(--sp-nav-height) + 6px); min-width: 0; }
}
/* Mobil: «Bruk min nøyaktige posisjon» finnes også i headerens adressefelt, som lyseblå rund knapp */
@media (max-width: 899.98px) {
    #siteHeader .sp-addr-search--sm { padding-right: 4px; }
    #siteHeader .sp-addr-search--sm .sp-addr-search-locate { display: grid; width: 34px; height: 34px; }
    #siteHeader .sp-addr-search--sm .sp-addr-search-locate svg { width: 18px; height: 18px; }
}
@media (prefers-reduced-motion: reduce) {
    html body #siteHeader.sh-v2, html body #siteHeader.sh-v2 *, .sp-addr-search { transition: none !important; }
}
#siteHeader .sh-search .sp-addr-results { background: #fff; isolation: isolate; }
@media (min-width: 900px) {
    /* Søket i midten: fyller plassen mellom logo og lenker, og lenkene står ved høyre marg */
    #siteHeader .sh-search { margin: 0 auto; flex: 0 1 520px; }
    html body #siteHeader.sh-v2 .sp-nav-brand { margin-right: 24px; }
    html body #siteHeader.sh-v2 .sp-nav-desktop { margin-left: 24px !important; }
}
/* iPhone zoomer inn i felt med mindre enn 16 px skrift: alle adressefelt bruker 16 px */
html body #siteHeader .sp-addr-search--sm input, html body .sp-addr-search input { font-size: 16px; }
/* Hakk på iPhone i liggende modus: headeren holder seg innenfor det trygge området */
html body #siteHeader.sh-v2 .sp-navigation-row { padding-left: max(var(--sp-page-pad), env(safe-area-inset-left, 0px)); padding-right: max(var(--sp-page-pad), env(safe-area-inset-right, 0px)); }

/* ---------- 18.11: forslag med «Bruk min nøyaktige posisjon», adresser utenfor området og dialogene ---------- */
.sp-addr-results .sp-address-option { cursor: pointer; }
.sp-addr-results .sp-address-option.is-current { background: #eef4fc; }
.sp-addr-results .sp-address-option.is-locate strong { color: #075ac6; }
.sp-addr-results .sp-address-option.is-locate::before {
    background: #e8f3ff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23075ac6' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='3.2'/%3E%3Ccircle cx='12' cy='12' r='7.5'/%3E%3Cpath d='M12 2v2.5M12 19.5V22M2 12h2.5M19.5 12H22'/%3E%3C/svg%3E") center / 20px no-repeat;
}
.sp-addr-results .sp-address-option.is-outside strong { color: #4e5966; }
.sp-addr-results .sp-address-option span { color: #4e5966; }

/* Dialogene: «Er det her du befinner deg?» og «Vi henter ikke der ennå» */
html.sp-dlg-open { overflow: hidden; }
.sp-dlg {
    width: min(460px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 24px 24px calc(22px + env(safe-area-inset-bottom, 0px));
    border: 0; border-radius: 14px; background: #fff; color: #1b2129; box-shadow: 0 0 0 1px rgb(16 32 56 / 10%);
    font-family: 'DM Sans', system-ui, sans-serif; overflow: auto;
}
.sp-dlg::backdrop { background: rgb(10 20 36 / 45%); }
.sp-dlg-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.sp-dlg h2 { margin: 0; font-size: 26px; line-height: 1.15; letter-spacing: -0.02em; font-weight: 800; text-wrap: balance; }
.sp-dlg-x { flex: none; width: 44px; height: 44px; margin: -6px -8px 0 0; border: 0; border-radius: 50%; background: #f3f4f6; display: grid; place-items: center; cursor: pointer; }
.sp-dlg-x svg { width: 20px; height: 20px; stroke: #1b2129; stroke-width: 2.2; fill: none; stroke-linecap: round; }
.sp-dlg-lead { margin: 10px 0 16px; font-size: 16px; line-height: 1.5; color: #2a323c; }
.sp-loc-map { height: 220px; border-radius: 14px; overflow: hidden; background: #eef1f4; }
.sp-loc-map .leaflet-control-attribution { font-size: 11px; }
.sp-loc-addr { margin: 14px 0 4px; min-height: 46px; font-size: 16px; line-height: 1.35; }
.sp-loc-addr b { display: block; font-size: 18px; }
.sp-loc-addr span { color: #4e5966; }
.sp-loc-addr .sp-loc-msg { color: #2a323c; }
.sp-dlg-actions { display: grid; gap: 10px; margin-top: 14px; }
.sp-btn {
    display: inline-flex; align-items: center; justify-content: center; min-height: 54px; padding: 0 20px; border: 0; border-radius: 999px;
    font: 700 17px/1 'DM Sans', system-ui, sans-serif; cursor: pointer; text-decoration: none;
}
.sp-btn--main { background: #075ac6; color: #fff; }
.sp-btn--main:hover { background: #06499e; }
.sp-btn--main:disabled { background: #b9c7da; cursor: default; }
.sp-btn--soft { background: #e8f3ff; color: #06499e; }
.sp-btn--soft:hover { background: #d6e8ff; }
.sp-dlg :focus-visible { outline: 3px solid #075ac6; outline-offset: 2px; }
.sp-out-form { display: grid; gap: 8px; }
.sp-out-ask { margin: 0 0 4px; font-weight: 700; font-size: 17px; }
.sp-out-form label[for] { font-size: 15px; font-weight: 600; }
.sp-out-form input[type=email] { height: 52px; padding: 0 16px; border: 1px solid #c9d2dc; border-radius: 12px; font: 500 16px 'DM Sans', system-ui, sans-serif; }
.sp-out-form input[type=email]:focus { outline: none; border-color: #075ac6; box-shadow: 0 0 0 2px #075ac6; }
.sp-out-check { display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; line-height: 1.45; color: #2a323c; min-height: 44px; padding-top: 4px; }
.sp-out-check input { width: 22px; height: 22px; margin: 0; flex: none; accent-color: #075ac6; }
.sp-out-status { min-height: 20px; margin: 0; color: #a1281e; font-size: 14.5px; }
.sp-out-done { margin: 6px 0; font-size: 17px; line-height: 1.5; }
.sp-out-small { margin: 4px 0 0; text-align: center; font-size: 14px; }
.sp-out-small a { color: #4e5966; display: inline-flex; min-height: 44px; align-items: center; }
.sp-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; opacity: 0; }
@media (max-width: 520px) {
    .sp-dlg { margin: auto 0 0; width: 100vw; max-width: 100vw; border-radius: 14px 14px 0 0; }
    .sp-dlg h2 { font-size: 23px; }
}


/* ---------- 25.11: enklere adressefelt ---------- */
/* Tøm-knapp: vises når det står noe i feltet */
.sp-addr-search-clear { flex: none; display: grid; place-items: center; width: 36px; height: 36px; margin-right: -4px; border: 0; border-radius: 50%; background: none; color: #4e5966; cursor: pointer; }
.sp-addr-search-clear[hidden] { display: none; }
.sp-addr-search-clear:hover { background: rgb(16 32 56 / 8%); }
.sp-addr-search-clear:focus-visible { outline: 3px solid #075ac6; outline-offset: 1px; }
.sp-addr-search-clear svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
#siteHeader .sp-addr-search--sm .sp-addr-search-clear { width: 32px; height: 32px; }
/* Søker: nålen byttes ut med en liten ring som snurrer */
.sp-addr-search.is-loading .sp-addr-search-pin svg { visibility: hidden; }
.sp-addr-search.is-loading .sp-addr-search-pin { position: relative; }
.sp-addr-search.is-loading .sp-addr-search-pin::after { content: ""; position: absolute; inset: 0; margin: auto; width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid #c5d6ea; border-top-color: #075ac6; animation: sp-addr-spin .7s linear infinite; }
@keyframes sp-addr-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .sp-addr-search.is-loading .sp-addr-search-pin::after { animation: none; } }
/* Forslagene: det du har skrevet står i blått, og lagrede og tidligere brukte adresser har egne ikoner */
.sp-addr-results .sp-address-option mark { background: none; color: #075ac6; }
.sp-addr-results .sp-address-option.is-recent::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2321262e' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='8.5'/%3E%3Cpath d='M12 7.5V12l3 2'/%3E%3C/svg%3E");
}
.sp-addr-results .sp-address-option.is-saved::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2321262e' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 11.5 12 4l8 7.5V20h-5v-5h-6v5H4z'/%3E%3C/svg%3E");
}
.sp-addr-results .sp-address-heading { margin: 0; padding: 10px 18px 4px; color: #65717e; font-size: 13px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; }
/* Mobil: feltet ruller opp under headeren når du trykker i det, så forslagene får plass over tastaturet */
.sp-addr-search { scroll-margin-top: calc(var(--sp-nav-height, 72px) + 12px); }
