:root {
    --paper: #F2F1ED;
    --ink: #20211D;
    --accent-orange: #E8622C; /* Signaturfarge: CTA, pris, lenker */
    --accent-orange-soft: rgba(232, 98, 44, 0.10);
    --accent-orange-dark: #C94F1F;
    --blueprint-blue: #1B4B66; /* Kun til teknisk motiv: hjørnemerker, eyebrows, måltegning */
    --blueprint-blue-soft: rgba(27, 75, 102, 0.08);
    --surface: #FFFFFF;
    --white-color: #FFFFFF; /* Alias: tekst på mørk bunn (knapper, footer, lysboks) */
    --border-color: #DDD8CC;
    --dark-bg: #1A1912;
    --shadow-light: rgba(32, 33, 29, 0.08);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --space-1: 8px;
    --space-2: 16px;
    --space-3: 24px;
    --space-4: 40px;
    --space-5: 64px;
}

body {
    font-family: 'IBM Plex Sans', sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--paper);
    color: var(--ink);
    line-height: 1.6;
}

/* Knapper */
.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: var(--radius-md);
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.2s ease;
}
.btn:hover {
    transform: translateY(-2px);
    text-decoration: none;
}
.btn.btn-primary {
    background: var(--accent-orange);
    color: var(--white-color);
}
.btn.btn-primary:hover {
    background: var(--accent-orange-dark);
    color: var(--white-color);
}
.btn.btn-secondary {
    background: transparent;
    color: var(--ink);
    border: 2px solid var(--border-color);
}
.btn.btn-secondary:hover {
    border-color: var(--accent-orange);
    color: var(--accent-orange);
}

/* Header / Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--paper) 0%, var(--surface) 60%);
    padding: var(--space-5) 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-5);
}
.hero-content {
    max-width: 560px;
    text-align: left;
}
.hero-content h1 {
    margin: 0 0 var(--space-2);
    font-family: 'Space Grotesk', sans-serif;
    font-size: 3rem;
    font-weight: 700;
    color: var(--ink);
    line-height: 1.2;
}
.hero-content .hero-tagline {
    font-size: 1.15rem;
    color: var(--ink);
    margin: 0 0 var(--space-3);
}
.hero-media {
    position: relative;
    flex-shrink: 0;
}
.hero-media img {
    max-width: 480px;
    width: 100%;
    display: block;
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 24px var(--shadow-light);
}

/* Navigasjon */
nav {
    background: var(--white-color);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    box-shadow: 0 2px 4px var(--shadow-light);
    position: sticky; /* Sticky nav */
    top: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-left: 20px;
    padding-right: 20px;
}
.nav-brand img {
    height: 32px;
    width: auto;
    filter: invert(1); /* logo_black.png er hvit på transparent bunn */
    display: block;
}
.nav-links {
    display: flex;
    align-items: center;
}
.nav-links a,
.nav-links label {
    color: var(--ink);
    text-decoration: none;
    padding: 0 20px;
    font-weight: 600;
    transition: color 0.3s ease;
}
.nav-links a:hover,
.nav-links label:hover {
    color: var(--accent-orange);
    text-decoration: none;
}

/* Nedtrekksmeny for Produkter */
.nav-dropdown {
    position: relative;
}
.nav-dropdown-checkbox {
    /* Skjult, men fortsatt tilgjengelig via <label for="..."> (ren CSS-toggle for touch) */
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.nav-dropdown-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}
.dropdown-caret {
    font-size: 0.7em;
    transition: transform 0.2s ease;
}
.nav-dropdown:hover .dropdown-caret,
.nav-dropdown:focus-within .dropdown-caret,
.nav-dropdown-checkbox:checked ~ .nav-dropdown-toggle .dropdown-caret {
    transform: rotate(180deg);
}
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--white-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 24px var(--shadow-light);
    padding: 8px;
    display: flex;
    flex-direction: column;
    min-width: 240px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    z-index: 1001;
}
.nav-dropdown:hover .dropdown-menu,
.nav-dropdown:focus-within .dropdown-menu,
.nav-dropdown-checkbox:checked ~ .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.dropdown-menu a {
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    white-space: nowrap;
}
.dropdown-menu a:hover {
    background: var(--accent-orange-soft);
}

/* Container */
.container {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
    overflow: hidden;
}

/* Kategorinavigasjon over produktene */
.category-nav {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    justify-content: center;
    background: var(--white-color);
    padding: var(--space-3);
    border-radius: var(--radius-md);
    box-shadow: 0 2px 10px var(--shadow-light);
    margin-bottom: 30px;
}
.category-nav a {
    padding: 8px 20px;
    border-radius: var(--radius-md);
    background: var(--accent-orange-soft);
    color: var(--accent-orange);
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.3s ease, color 0.3s ease;
}
.category-nav a:hover {
    background: var(--accent-orange);
    color: var(--white-color);
}

/* Hovedinnhold */
.main-content {
    background: var(--white-color);
    padding: var(--space-4);
    margin-bottom: 30px;
    border-radius: var(--radius-md);
    box-shadow: 0 2px 10px var(--shadow-light);
}
.main-content h2 {
    color: var(--ink);
    font-family: 'Space Grotesk', sans-serif;
    border-bottom: 2px solid var(--accent-orange);
    padding-bottom: 15px;
    margin-bottom: 25px;
    font-size: 2rem;
    font-weight: 700;
}
.main-content h3 {
    color: var(--ink);
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
}
.main-content p {
    margin-bottom: 15px;
}
.main-content a {
    color: var(--accent-orange);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}
.main-content a:hover {
    color: var(--accent-orange-dark);
    text-decoration: underline;
}
.main-content .category-eyebrow {
    display: block;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 500;
    font-size: 0.8rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--blueprint-blue);
    margin-bottom: 8px;
}

/* Kontaktseksjon */
.contact-links {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
}

/* Produktgalleri */
.product-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* Litt større min-størrelse */
    gap: var(--space-3);
    margin-top: 30px;
}
.product-item {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 15px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
    display: flex; /* For bedre vertikal justering */
    flex-direction: column;
    justify-content: space-between;
}
.product-item::before,
.product-item::after {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    pointer-events: none;
    transition: width 0.25s ease, height 0.25s ease, top 0.25s ease, left 0.25s ease, right 0.25s ease, bottom 0.25s ease;
}
.product-item::before {
    top: 6px;
    left: 6px;
    border-top: 2px solid var(--blueprint-blue);
    border-left: 2px solid var(--blueprint-blue);
}
.product-item::after {
    bottom: 6px;
    right: 6px;
    border-bottom: 2px solid var(--blueprint-blue);
    border-right: 2px solid var(--blueprint-blue);
}
.product-item:hover {
    box-shadow: 0 5px 15px var(--shadow-light);
    border-color: var(--blueprint-blue);
}
.product-item:hover::before {
    top: -6px;
    left: -6px;
    width: 22px;
    height: 22px;
}
.product-item:hover::after {
    bottom: -6px;
    right: -6px;
    width: 22px;
    height: 22px;
}
.product-item img {
    max-width: 100%;
    height: 200px; /* Fast høyde for bilder */
    object-fit: contain; /* Sikrer at bildet passer uten å bli strukket */
    margin-bottom: 15px;
    border-radius: var(--radius-sm);
    background-color: var(--paper);
}
.product-item h3 {
    color: var(--ink);
    font-family: 'Space Grotesk', sans-serif;
    margin-bottom: 8px;
    font-size: 1.3rem;
    font-weight: 500;
}
.product-item p {
    color: var(--ink);
    font-size: 0.95rem;
    flex-grow: 1; /* Lar paragrafen fylle tilgjengelig plass */
}
a.product-item,
a.product-item:hover {
    text-decoration: none;
    color: inherit;
}

/* Produktdetaljside */
.breadcrumb {
    margin: 0 0 var(--space-2);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.85rem;
}
.breadcrumb a {
    color: var(--accent-orange);
    text-decoration: none;
    font-weight: 500;
}
.breadcrumb a:hover {
    text-decoration: underline;
}
.product-detail {
    display: flex;
    gap: var(--space-4);
    align-items: flex-start;
}
.product-detail-media {
    flex: 1 1 380px;
    max-width: 480px;
}
.product-detail-media img {
    width: 100%;
    display: block;
    border-radius: var(--radius-md);
    background-color: var(--paper);
    border: 1px solid var(--border-color);
}

/* Hjørnemerker (måltegning-motiv) — brukes på .hero-media og .lightbox-trigger,
   som begge er wrapper-elementer (::before/::after rendres ikke på <img>) */
.bracket-frame {
    position: relative;
}
.bracket-frame::before,
.bracket-frame::after {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    pointer-events: none;
    transition: width 0.25s ease, height 0.25s ease, top 0.25s ease, left 0.25s ease, right 0.25s ease, bottom 0.25s ease;
}
.bracket-frame::before {
    top: -6px;
    left: -6px;
    border-top: 2px solid var(--blueprint-blue);
    border-left: 2px solid var(--blueprint-blue);
}
.bracket-frame::after {
    bottom: -6px;
    right: -6px;
    border-bottom: 2px solid var(--blueprint-blue);
    border-right: 2px solid var(--blueprint-blue);
}
.lightbox-trigger {
    display: block;
    cursor: zoom-in;
}
.lightbox-trigger + .lightbox-trigger {
    margin-top: var(--space-2);
}
.lightbox-trigger.dimension-trigger {
    border: 2px solid var(--blueprint-blue);
    border-radius: var(--radius-md);
    padding: 4px;
    background: var(--blueprint-blue-soft);
}
.lightbox-trigger.dimension-trigger img {
    border: none;
}
.dimension-label {
    display: block;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 500;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--blueprint-blue);
    text-align: center;
    margin-top: 6px;
}

/* Lysboks (CSS-only, via :target) for forstørrede produktbilder */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2000;
    align-items: center;
    justify-content: center;
}
.lightbox:target {
    display: flex;
}
.lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
}
.lightbox-image {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: block;
    border-radius: var(--radius-md);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}
.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: var(--white-color);
    font-size: 2.5rem;
    line-height: 1;
    font-weight: 300;
    text-decoration: none;
}
.lightbox-close:hover {
    color: var(--accent-orange);
}
.product-detail-info {
    flex: 1 1 320px;
}
.product-detail-info h1 {
    margin: 0 0 var(--space-1);
    font-family: 'Space Grotesk', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--ink);
}
.feature-list {
    list-style: none;
    margin: 0 0 15px;
    padding: 0;
}
.feature-list li {
    margin-bottom: 6px;
}
.product-item p.product-price,
.product-detail-info .product-price {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 1.2rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: var(--accent-orange);
    margin: 0 0 var(--space-2);
}

/* Prisliste — for produkter med flere varianter/tillegg */
.price-list {
    list-style: none;
    margin: 0 0 var(--space-3);
    padding: 0;
    border-top: 1px solid var(--border-color);
}
.price-list li {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: var(--space-2);
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}
.price-list li small {
    display: block;
    color: var(--ink);
    opacity: 0.65;
    font-size: 0.78rem;
    font-weight: 400;
}
.price-list-amount {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 500;
    color: var(--accent-orange);
    white-space: nowrap;
}

/* Footer */
footer {
    background: var(--dark-bg);
    color: var(--white-color);
    text-align: center;
    padding: 1.5rem 0;
    margin-top: 40px;
    font-size: 0.9rem;
}

/* Responsivitet */
@media (max-width: 768px) {
    .hero-section {
        flex-direction: column;
        text-align: center;
        padding: var(--space-4) 20px;
        gap: var(--space-3);
    }
    .hero-content {
        text-align: center;
    }
    .hero-media img {
        max-width: 100%;
    }
    .hero-content h1 {
        font-size: 2.5rem;
    }
    .hero-content .hero-tagline {
        font-size: 1rem;
    }
    nav {
        flex-direction: column;
        gap: 10px;
    }
    .nav-links a,
    .nav-links label {
        padding: 0 10px;
        font-size: 0.9rem;
    }
    .container {
        width: 95%;
        padding: 0 10px;
    }
    .main-content h2 {
        font-size: 1.8rem;
    }
    .product-gallery {
        grid-template-columns: 1fr; /* Ett produkt per rad på små skjermer */
    }
    .product-item img {
        height: 180px;
    }
    .product-detail {
        flex-direction: column;
    }
}
@media (max-width: 480px) {
    .hero-section {
        padding: var(--space-3) 10px;
    }
    .hero-content h1 {
        font-size: 2rem;
    }
    nav {
        padding: 0.8rem 0;
    }
    .nav-links {
        display: flex;
        flex-direction: column;
        width: 100%;
    }
    .nav-links a,
    .nav-links label {
        display: block;
        padding: 8px 0;
        border-bottom: 1px solid var(--border-color);
        text-align: center;
    }
    .nav-links a:last-child {
        border-bottom: none;
    }
    .nav-dropdown {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    .dropdown-menu {
        position: static;
        transform: none;
        box-shadow: none;
        border: none;
        border-radius: 0;
        padding: 0;
        min-width: 0;
        width: 100%;
        align-items: center;
        transition: none;
        max-height: 0;
        overflow: hidden;
    }
    .nav-dropdown-checkbox:checked ~ .dropdown-menu {
        max-height: 300px;
        padding: 4px 0 8px;
    }
    .dropdown-menu a {
        padding: 8px 0;
        text-align: center;
    }
    .main-content {
        padding: 20px;
    }
    .main-content h2 {
        font-size: 1.5rem;
    }
    .category-nav {
        padding: var(--space-2);
    }
}

@media (prefers-reduced-motion: reduce) {
    .product-item,
    .product-item::before,
    .product-item::after,
    .bracket-frame::before,
    .bracket-frame::after,
    .btn,
    .dropdown-caret,
    .dropdown-menu,
    .nav-links a,
    .nav-links label {
        transition: none !important;
    }
}
