html, body {
    font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
}

a {
    color: #0a1a52;
}

a:hover {
    color: #1a3a82;
}

.content {
    padding-top: 0;
}

h1:focus {
    outline: none;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "En feil har oppstått."
    }

/* ===================================================
   HEADER — User dropdown menu
   =================================================== */
.nav_container_third li {
    position: relative;
}

.nav_container_third li .sub-menu-wrap {
    width: auto;
    background-color: #fff;
    position: absolute;
    right: 0;
    top: 34px;
    padding: 10px 0 10px 20px;
    z-index: 0;
    opacity: 0;
    border: 2px solid #0a1a52;
    display: none;
}

.nav_container_third li .sub-menu-wrap.active {
    display: block;
    z-index: 10;
    animation-name: slideDown;
    animation-duration: .4s;
    animation-fill-mode: forwards;
    animation-timing-function: ease;
}

.nav_container_third li .sub-menu-wrap ul.sub-menu {
    width: 100%;
    min-width: 180px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.nav_container_third li .sub-menu-wrap ul.sub-menu li {
    width: 100%;
    padding: 0 20px 0 0;
}

.nav_container_third li .sub-menu-wrap ul.sub-menu li a {
    text-align: left;
    width: 100%;
    padding: 8px 0;
    font-size: 11px;
    font-weight: 400;
    background: none;
    color: #000;
    white-space: nowrap;
    text-decoration: none;
    display: block;
}

.nav_container_third li .sub-menu-wrap ul.sub-menu li a:hover {
    background: none;
    color: #706f6f;
}

.user-menu-trigger {
    cursor: pointer;
}

.user-display-name {
    font-size: 11px;
    margin-left: 5px;
    font-weight: 400;
    vertical-align: middle;
    max-width: 140px;
    display: inline-block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sub-menu-button {
    text-align: left;
    width: 100%;
    padding: 8px 0;
    font-size: 11px;
    font-weight: 400;
    background: none;
    color: #000;
    white-space: nowrap;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.sub-menu-button:hover {
    color: #706f6f;
}

/* ===================================================
   HOME PAGE — Carousel
   =================================================== */
.home-carousel {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 0 0;
    overflow: hidden;
}

.carousel-container {
    position: relative;
    width: 100%;
    height: 400px;
    background: #E5E5E5;
    border-radius: 4px;
    overflow: hidden;
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
    pointer-events: none;
}

.carousel-slide--active {
    opacity: 1;
    pointer-events: auto;
}

.carousel-slide-link {
    display: block;
    position: relative;
    width: 100%;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

.carousel-slide-link img {
    height: 100%;
    display: block;
    object-fit: contain;
    object-position: left center;
}

.carousel-slide-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10, 26, 82, 0.35);
}

.carousel-slide-text h2 {
    color: #fff;
    font-weight: 500;
    margin: 0;
    font-family: 'Open Sans', sans-serif;
    text-shadow: 0 0 12px #000;
    font-size: 3rem;
    line-height: 1.3;
    text-transform: uppercase;
    letter-spacing: 10px;
    text-align: center;
}

.carousel-dots {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 2;
}

.carousel-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid #fff;
    background: transparent;
    cursor: pointer;
    padding: 0;
    transition: background 0.3s;
}

.carousel-dot--active {
    background: #fff;
}

.carousel-dot:hover {
    background: rgba(255, 255, 255, 0.6);
}

/* ===================================================
   HOME PAGE — Shortcuts (Se våre produkter / Logg inn / UPS Guide)
   =================================================== */
.home-shortcuts {
    padding: 30px 0;
    max-width: 1200px;
    margin: 0 auto;
}

.home-shortcuts-grid {
    display: flex;
    gap: 20px;
}

.home-shortcut {
    flex: 1;
}

.home-shortcut-link {
    display: block;
    overflow: hidden;
    border-radius: 4px;
}

.home-shortcut-img {
    width: 100%;
    display: block;
    transition: transform 0.3s ease;
}

.home-shortcut-link:hover .home-shortcut-img {
    transform: scale(1.03);
}

.home-shortcut-card {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 16 / 7;
    background-color: #666;
    border-radius: 4px;
    transition: background-color 0.3s ease;
    text-decoration: none;
}

.home-shortcut-link:hover .home-shortcut-card {
    background-color: #555;
}

.home-shortcut-card-text {
    text-align: center;
    color: #fff;
    letter-spacing: 4px;
    text-transform: uppercase;
    line-height: 1.5;
    user-select: none;
}

.home-shortcut-card-text span {
    display: block;
    font-size: 0.78rem;
    font-weight: 400;
    letter-spacing: 5px;
    opacity: 0.85;
}

.home-shortcut-card-text strong {
    display: block;
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: 6px;
}

/* Login / Register popup panel on home shortcut */
.home-shortcut-login-wrapper {
    position: relative;
}

.home-shortcut-login-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    width: 100%;
    text-align: left;
}

.home-login-panel {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 6px 24px rgba(0,0,0,.12);
    z-index: 100;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.home-login-panel-option {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    text-decoration: none;
    color: #333;
    transition: background-color 0.2s ease;
}

.home-login-panel-option:hover {
    background-color: #f5f5f5;
}

.home-login-panel-option + .home-login-panel-option {
    border-top: 1px solid #eee;
}

.home-login-panel-option .fa {
    font-size: 1.5rem;
    color: #666;
    width: 28px;
    text-align: center;
    flex-shrink: 0;
}

.home-login-panel-option strong {
    display: block;
    font-size: 1rem;
    margin-bottom: 2px;
}

.home-login-panel-option small {
    display: block;
    font-size: 0.85rem;
    color: #888;
}

/* ===================================================
   UPS GUIDE PAGE
   =================================================== */
.ups-guide-page {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px 60px;
}

.ups-guide-page h1 {
    letter-spacing: 6px;
    text-transform: uppercase;
    margin-bottom: 30px;
}

.ups-guide-thumbnail-link {
    display: block;
    width: 100%;
    max-width: 700px;
    margin-bottom: 24px;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0,0,0,0.13);
    transition: box-shadow 0.2s ease;
    text-decoration: none;
}

.ups-guide-thumbnail-link:hover {
    box-shadow: 0 6px 24px rgba(0,0,0,0.2);
}

.ups-guide-thumbnail-link img {
    width: 100%;
    display: block;
}

.ups-guide-pdf-link {
    display: inline-block;
    margin-top: 8px;
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 1px;
}

/* ===================================================
   HOME PAGE — Favourites section
   =================================================== */
.home-favourites {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 0 40px;
    clear: both;
}

/* Product card grid — mirrors structure.css rules that are scoped
   to #productarea_holder .content_holder, so the same markup works
   on the home page outside that wrapper. */
.home-favourites #page-single-product-holder {
    float: left;
    width: 100%;
    margin: 0;
}

.home-favourites ul#categoryPostList,
.home-favourites ul#directSearchPost {
    margin: 0;
    padding: 0;
    float: left;
    width: 100%;
    list-style: none;
}

.home-favourites .product_rows {
    float: left;
    width: 100%;
    margin: 0 0 15px;
    display: flex;
    transition: opacity 0.3s;
}

.home-favourites .product_rows li {
    background-color: #fff;
    list-style: none;
    float: left;
    width: 31%;
    border: 1px solid #7c7c7b;
    padding: 15px;
    margin: 0 10px;
    text-align: center;
    position: relative;
}

.home-favourites .product_rows li .postInfo .image {
    float: left;
    width: 100%;
    min-height: 160px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.home-favourites .product_rows li .postInfo .image img {
    max-height: 160px;
}

.home-favourites .product_rows li .postInfo .info {
    float: left;
    width: 100%;
}

.home-favourites .product_rows li .postInfo .info h3 {
    color: #0a1a52;
    font-size: 17px;
    margin: 0;
    line-height: 22px;
}

.home-favourites .product_rows li .postInfo .info span {
    float: left;
    width: 100%;
    line-height: 1;
    font-size: 15px;
}

.home-favourites .product_rows li .postInfo .mainValues {
    margin: 15px 0;
    float: left;
    width: 100%;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-content: center;
}

.home-favourites .product_rows li .postInfo .mainValues .valueBox {
    float: left;
    width: 33.3333333333%;
    padding: 10px 0 20px;
    position: relative;
    min-height: 55px;
}

.home-favourites .product_rows li .postInfo .mainValues .valueBox:nth-child(2n) {
    padding: 10px 5px;
    border-right: 1px solid #ccc;
    border-left: 1px solid #ccc;
}

.home-favourites .product_rows li .postInfo .mainValues .valueBox span {
    line-height: 1;
    float: left;
    width: 100%;
}

.home-favourites .product_rows li .postInfo .mainValues .valueBox span.name {
    font-size: 10px;
    font-weight: 700;
    line-height: 13px;
    color: #aaa;
    margin: 0 0 5px;
}

.home-favourites .product_rows li .postInfo .mainValues .valueBox span.value {
    position: absolute;
    bottom: 0;
    left: 0;
    font-size: 14px;
    font-weight: 700;
}

.home-favourites .product_rows li .postInfo .readmore {
    float: left;
    width: 100%;
    margin: 0;
}

.home-favourites .product_rows li .postInfo .readmore a {
    margin: auto;
    display: inline-block;
    padding: 10px 25px;
    line-height: 1;
    background: #0a1a52;
    border: none;
    color: #fff;
    width: auto;
    text-transform: uppercase;
    text-decoration: none;
}

.home-favourites .product_rows li .postInfo .readmore a:hover {
    background: #0d2169;
}

/* ===================================================
   HOME PAGE — Section header
   =================================================== */
.home-section-header {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #0a1a52;
}

.home-section-header h2 {
    font-size: 1.6em;
    color: #0a1a52;
    margin: 0;
}

/* ===================================================
   HOME PAGE — Trending / Aktuelt
   =================================================== */
.home-trending {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 0 40px;
}

.trending-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.trending-card {
    position: relative;
}

.trending-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.trending-card-image-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: 4px;
}

.trending-card-image-wrapper img {
    width: 100%;
    display: block;
    aspect-ratio: 4/3;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.trending-card-link:hover .trending-card-image-wrapper img {
    transform: scale(1.05);
}

.trending-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(10, 26, 82, 0.75));
    padding: 30px 12px 12px;
    text-align: center;
}

.trending-card-title {
    color: #fff;
    font-family: 'Open Sans', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 2rem;
    text-transform: uppercase;
    margin: 0;
    position: relative;
    top: -10px;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
    text-align: center;
}

.trending-card-date {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.trending-date-day {
    font-size: 1.4em;
    font-weight: bold;
    color: #0a1a52;
    line-height: 1;
}

.trending-date-month {
    font-size: 0.85em;
    color: #666;
    text-transform: uppercase;
}

/* ===================================================
   HOME PAGE — Responsive
   =================================================== */
@media (max-width: 1024px) {
    .trending-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .home-shortcuts-grid {
        flex-direction: column;
    }

    .trending-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .carousel-slide-text h2 {
        font-size: 1.5rem;
        letter-spacing: 4px;
    }

    .carousel-container {
        height: 250px;
    }
}

@media (max-width: 480px) {
    .trending-grid {
        grid-template-columns: 1fr;
    }
}

/* ===================================================
   HEADER — Two-mode responsive (wide ↔ narrow at 768px)
   =================================================== */

/* Wide (default): mobile elements hidden */
.mobile-only {
    display: none;
}

/* Force desktop header elements visible above 768px,
   overriding structure.css breakpoints at 1161px/1024px */
@media (min-width: 769px) {
    #siteGlobalBox {
        display: flex !important;
        flex-direction: row !important;
        width: 90% !important;
        justify-content: space-between !important;
    }

    #header #topHeaderContent #siteGlobalBox #optionsBox {
        display: flex !important;
        align-items: center !important;
        width: auto !important;
    }

    #main_navigation {
        display: block !important;
        float: none !important;
        width: auto !important;
        margin: 0 !important;
        border-top: none !important;
        border-bottom: none !important;
    }

    #header nav:before,
    #header nav:after {
        display: none !important;
    }
}

/* Narrow (≤ 768px): hide desktop, show mobile */
@media (max-width: 768px) {
    #siteGlobalBox,
    #main_navigation {
        display: none !important;
    }

    .mobile-only {
        display: block !important;
    }

    .mobile-header-row {
        display: flex !important;
    }
}

/* ── Selgerportal layout (sidebar + content) ── */
/* These rules style elements rendered by Selgerportal pages, not by the
   sidebar component itself, so they live in global CSS rather than scoped CSS. */
.selgerportal-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.selgerportal-layout > .selgerportal-content {
    flex: 1 1 auto;
    min-width: 0;
}

/* Reserve a fixed column for the sidebar regardless of the component class hash. */
.selgerportal-layout > aside {
    flex: 0 0 220px;
}

@media (max-width: 768px) {
    .selgerportal-layout {
        flex-direction: column;
    }

    .selgerportal-layout > aside {
        flex: 1 1 auto;
        width: 100%;
    }
}

/* ── Category Side Menu ── */
.category-side-menu {
    padding: 0;
    margin: 0;
}

.category-side-menu-title {
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #0a1a52;
    margin: 0 0 0.5rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #0a1a52;
}

.category-side-menu-list {
    list-style: none;
    margin: 0 0 0 17px;
    padding: 0;
}

.category-side-menu-item {
    margin-bottom: 0.15rem;
}

.category-side-menu-link {
    display: block;
    padding: 0.35rem 0;
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #0a1a52;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.15s;
}

.category-side-menu-link:hover,
.category-side-menu-link.active {
    color: #e5485b;
}

.category-side-menu-sublist {
    list-style: none;
    margin: 0 0 0.25rem 17px;
    padding: 0;
}

.category-side-menu-subitem {
    margin-bottom: 0;
}

.category-side-menu-sublink {
    display: block;
    padding: 0.2rem 0;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #e5485b;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.15s;
}

.category-side-menu-sublink:hover,
.category-side-menu-sublink.active {
    text-decoration: underline;
}

/* ── Home page with sidebar layout ── */
.home-with-sidebar {
    display: flex;
    gap: 32px;
    align-items: flex-start;
}

.home-with-sidebar > aside {
    flex: 0 0 220px;
    padding-top: 1rem;
}

.home-with-sidebar > .home-main-content {
    flex: 1 1 auto;
    min-width: 0;
}

@media (max-width: 768px) {
    #productarea_holder.single-product {
        display: block;
    }

    #productarea_holder.single-product .sidebar_holder {
        float: none;
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #7c7c7b;
    }

    #productarea_holder.single-product .content_holder {
        float: none;
        width: 100%;
    }

    .home-with-sidebar {
        flex-direction: column;
    }

    .home-with-sidebar > aside {
        flex: 1 1 auto;
        width: 100%;
    }
}
