/* ==========================================================================
   Dinmerkelapp — butikkens stilark
   Farger: blekk-indigo, fargestiftblå, lappegul, mint, himmel.
   Skrift: Bricolage Grotesque (titler) + Figtree (brødtekst).
   Merkelapp-designeren (public/merkelapp/css) leser --nf-*-tokenene
   nederst i :root, så den får samme farger uten egne endringer.
   ========================================================================== */

:root {
    --ink: #1E2550;
    /* Tonene under regnes ut fra grunnfargene, så Kontoret → Utseende bare trenger å sette dem */
    --ink-2: color-mix(in srgb, var(--ink) 78%, #fff);
    --ink-3: color-mix(in srgb, var(--ink) 56%, #fff);
    --blue: #2B59F0;
    --blue-dark: color-mix(in srgb, var(--blue) 76%, #000);
    --blue-soft: color-mix(in srgb, var(--blue) 17%, #fff);
    --yellow: #FFD23F;
    --mint: #2FBF97;
    --sky: #EEF5FF;
    --line: #DDE3F2;
    --white: #FFFFFF;
    --danger: #C62D2D;

    --f-display: "Bricolage Grotesque", "Figtree", system-ui, sans-serif;
    --f-body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;

    --r-s: 8px;
    --r-m: 14px;
    --r-l: 24px;
    --wrap: 1180px;

    /* Merkelapp-designeren (design-tokens.css aliaser disse) */
    --nf-primary: var(--blue);
    --nf-primary-hover: var(--blue-dark);
    --nf-primary-dark: var(--blue-dark);
    --nf-primary-soft: var(--blue-soft);
    --nf-primary-softer: var(--sky);
    --nf-primary-pill: color-mix(in srgb, var(--blue) 28%, #fff);
    --nf-primary-deep: var(--ink);
    --nf-heading: var(--ink);
    --nf-text: var(--ink-2);
    --nf-muted: var(--ink-3);
    --nf-bg: var(--white);
    --nf-bg-secondary: var(--sky);
    --nf-border: var(--line);
    --nf-border-soft: var(--line);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font: 400 1rem/1.6 var(--f-body);
    color: var(--ink);
    background: var(--white);
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--blue); text-underline-offset: 3px; }
a:hover { color: var(--blue-dark); }

:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; border-radius: 4px; }

h1, h2, h3, h4 {
    font-family: var(--f-display);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin: 0 0 .5em;
    color: var(--ink);
}
h1 { font-size: clamp(2.1rem, 6vw, 3.6rem); }
h2 { font-size: clamp(1.6rem, 3.6vw, 2.3rem); }
h3 { font-size: 1.25rem; letter-spacing: -0.01em; }

p { margin: 0 0 1em; }

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.narrow { width: min(100% - 2.5rem, 720px); margin-inline: auto; }
.muted { color: var(--ink-3); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── Knapper og skjema ─────────────────────────────────────────────── */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    min-height: 48px; padding: .7rem 1.4rem;
    font: 700 1rem/1 var(--f-body);
    border-radius: 999px; border: 2px solid transparent;
    background: var(--blue); color: var(--white);
    text-decoration: none; cursor: pointer;
    transition: background-color .15s, transform .15s;
}
.btn:hover { background: var(--blue-dark); color: var(--white); }
.btn:active { transform: translateY(1px); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { background: var(--sky); color: var(--ink); }
.btn--yellow { background: var(--yellow); color: var(--ink); }
.btn--yellow:hover { background: color-mix(in srgb, var(--yellow) 88%, #000); color: var(--ink); }
.btn--block { width: 100%; }
.btn--vipps { background: #FF5B24; }
.btn--vipps:hover { background: #E04A17; }
.btn[disabled] { opacity: .5; pointer-events: none; }

.link-btn { background: none; border: 0; padding: 0; color: var(--ink-3); font: inherit; text-decoration: underline; cursor: pointer; }

.field { display: grid; gap: .35rem; margin-bottom: 1rem; }
.field label { font-weight: 600; font-size: .95rem; }
.field small { color: var(--ink-3); }
.input, .field input[type=text], .field input[type=email], .field input[type=tel], .field textarea, .field select {
    width: 100%; min-height: 48px; padding: .7rem .9rem;
    font: inherit; color: var(--ink);
    background: var(--white); border: 2px solid var(--line); border-radius: var(--r-s);
}
.field textarea { min-height: 96px; resize: vertical; }
.input:focus, .field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--blue); }
.field.has-error input, .field.has-error textarea { border-color: var(--danger); }
.error { color: var(--danger); font-size: .9rem; font-weight: 600; }
.grid-2 { display: grid; gap: 0 1rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.check { display: flex; gap: .6rem; align-items: flex-start; margin-bottom: .8rem; }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--blue); }

.notice { padding: .9rem 1.1rem; border-radius: var(--r-s); background: var(--sky); margin-bottom: 1.2rem; }
.notice--ok { background: color-mix(in srgb, var(--mint) 14%, #fff); }
.notice--error { background: #FDE8E8; color: #8A1C1C; }

/* ── Topp ──────────────────────────────────────────────────────────── */

.strip {
    background: var(--ink); color: var(--white);
    font-size: .88rem; text-align: center; padding: .45rem 1rem;
}

.header { border-bottom: 1px solid var(--line); background: var(--white); position: sticky; top: 0; z-index: 30; }
.header__in { display: flex; align-items: center; gap: 1rem; min-height: 68px; }
.logo { display: inline-flex; align-items: center; gap: .55rem; text-decoration: none; color: var(--ink); }
.logo svg { width: 38px; height: 26px; flex: none; }
.logo img { height: var(--logo-h, 36px); width: auto; max-width: 260px; flex: none; object-fit: contain; }
.logo span { font: 800 1.35rem/1 var(--f-display); letter-spacing: -0.03em; }
.nav { display: none; gap: 1.4rem; margin-left: 1.5rem; }
.nav a { color: var(--ink); text-decoration: none; font-weight: 600; }
.nav a:hover, .nav a[aria-current=page] { color: var(--blue); }
.header__tools { margin-left: auto; display: flex; gap: .3rem; align-items: center; }
.icon-btn {
    position: relative; display: inline-grid; place-items: center;
    width: 44px; height: 44px; border-radius: 999px;
    color: var(--ink); background: none; border: 0; cursor: pointer;
}
.icon-btn:hover { background: var(--sky); color: var(--ink); }
.icon-btn svg { width: 22px; height: 22px; }
.badge {
    position: absolute; top: 3px; right: 1px;
    min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px;
    background: var(--yellow); color: var(--ink); font: 800 .75rem/20px var(--f-body); text-align: center;
}
.menu-toggle { display: inline-grid; }
@media (min-width: 900px) {
    .nav { display: flex; }
    .menu-toggle { display: none; }
}
.mobile-nav { display: none; border-top: 1px solid var(--line); padding: .5rem 0 1rem; }
.mobile-nav.open { display: block; }
.mobile-nav a { display: block; padding: .8rem 0; color: var(--ink); font-weight: 600; text-decoration: none; border-bottom: 1px solid var(--line); }

/* ── Forside: navnet først ─────────────────────────────────────────── */

.hero { background: var(--sky); overflow: hidden; }
.hero__in { display: grid; gap: 2.5rem; padding: 3rem 0 3.5rem; align-items: center; }
@media (min-width: 900px) { .hero__in { grid-template-columns: 1.05fr 1fr; padding: 4.5rem 0 5rem; } }
.hero h1 { max-width: 13ch; }
.hero__lead { font-size: 1.15rem; color: var(--ink-2); max-width: 46ch; }
.namebox { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 1.6rem; max-width: 520px; }
.namebox input {
    flex: 1 1 220px; min-height: 56px; padding: .8rem 1.1rem;
    font: 700 1.15rem var(--f-body); color: var(--ink);
    border: 2px solid var(--ink); border-radius: 999px; background: var(--white);
}
.namebox input:focus { outline: none; box-shadow: 0 0 0 4px var(--yellow); }
.namebox .btn { min-height: 56px; }
.hero__facts { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; margin: 1.4rem 0 0; padding: 0; list-style: none; color: var(--ink-2); font-size: .95rem; }
.hero__facts li::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 2px; background: var(--mint); margin-right: .5rem; vertical-align: 2px; }

/* Lappebunken: tre navnelapper med navnet kunden skriver */
.labels { position: relative; min-height: 300px; display: grid; place-items: center; }
.tag {
    --rot: 0deg;
    position: absolute;
    display: flex; align-items: center; gap: 14px;
    width: min(88%, 380px); height: 108px; padding: 0 22px;
    border-radius: 16px;
    background: var(--c, var(--white));
    color: var(--t, var(--ink));
    box-shadow: 0 1px 0 rgba(30, 37, 80, .08), 0 14px 30px -14px rgba(30, 37, 80, .35);
    transform: translate(var(--x, 0), var(--y, 0)) rotate(var(--rot));
    animation: tag-in .7s cubic-bezier(.2, .9, .25, 1.15) both;
    animation-delay: var(--d, 0s);
}
.tag img { width: 70px; height: 70px; object-fit: contain; flex: none; }
.tag__text { min-width: 0; font-family: var(--f-display); line-height: 1.12; }
.tag__name { font-size: 1.7rem; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tag__sub { font-size: .95rem; font-weight: 600; opacity: .8; }
.tag--1 { --c: var(--yellow); --rot: -6deg; --x: -18px; --y: -88px; --d: .05s; }
.tag--2 { --c: var(--blue); --t: var(--white); --rot: 3deg; --x: 22px; --y: 4px; --d: .18s; }
.tag--3 { --c: var(--white); --rot: -2deg; --x: -6px; --y: 96px; --d: .31s; }
@keyframes tag-in {
    from { opacity: 0; transform: translate(var(--x), calc(var(--y) - 40px)) rotate(calc(var(--rot) - 10deg)) scale(.92); }
    to   { opacity: 1; transform: translate(var(--x), var(--y)) rotate(var(--rot)); }
}
@media (prefers-reduced-motion: reduce) { .tag { animation: none; } }

/* ── Seksjoner ─────────────────────────────────────────────────────── */

.section { padding: 3.5rem 0; }
.section--tint { background: var(--sky); }
.section__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 1rem; margin-bottom: 1.6rem; }
.section__head p { margin: 0; color: var(--ink-2); max-width: 56ch; }

/* Velg type navnelapper: tre store valg side om side */
.types { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 760px) { .types { grid-template-columns: repeat(3, 1fr); } }
.type {
    display: grid; grid-template-rows: auto 1fr; text-decoration: none; color: var(--ink);
    border: 2px solid var(--line); border-radius: var(--r-l); overflow: hidden; background: var(--white);
    transition: border-color .15s;
}
.type:hover { border-color: var(--ink); color: var(--ink); }
.type__img { aspect-ratio: 4 / 3; background: var(--sky); }
.type__img img { width: 100%; height: 100%; object-fit: cover; }
.type__body { padding: 1.1rem 1.25rem 1.3rem; display: grid; gap: .3rem; align-content: start; }
.type__body p { margin: 0; color: var(--ink-2); font-size: .95rem; }

.price { font-weight: 800; font-size: 1.1rem; }
.price del { color: var(--ink-3); font-weight: 500; margin-right: .35rem; }
.price ins { text-decoration: none; }
.save { display: inline-block; font-size: .8rem; font-weight: 700; color: var(--ink); background: var(--yellow); padding: .1rem .5rem; border-radius: 6px; margin-left: .3rem; vertical-align: 2px; }

/* Slik bestiller du — en ekte rekkefølge, derfor nummerert */
.steps { display: grid; gap: 1.5rem; margin: 0; padding: 0; list-style: none; counter-reset: step; }
@media (min-width: 760px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.steps li { counter-increment: step; display: grid; grid-template-columns: 48px 1fr; gap: 1rem; align-items: start; }
.steps li::before {
    content: counter(step);
    width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center;
    background: var(--yellow); color: var(--ink); font: 800 1.35rem var(--f-display);
}
.steps h3 { margin-bottom: .2rem; }
.steps p { margin: 0; color: var(--ink-2); }

/* Produktrutenett (personlige produkter, kategori, søk) */
.products { display: grid; gap: 1.5rem 1rem; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 900px) { .products { grid-template-columns: repeat(4, 1fr); } }
.card { text-decoration: none; color: var(--ink); display: grid; gap: .55rem; align-content: start; }
.card:hover { color: var(--ink); }
.card__img { aspect-ratio: 1; border-radius: var(--r-m); overflow: hidden; background: var(--sky); }
.card__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.card:hover .card__img img { transform: scale(1.03); }
.card__name { font-weight: 700; line-height: 1.3; }
.card .price { font-size: 1rem; }

.durable { display: grid; gap: 1rem; grid-template-columns: repeat(2, 1fr); margin: 0; padding: 0; list-style: none; }
@media (min-width: 760px) { .durable { grid-template-columns: repeat(4, 1fr); } }
.durable li { padding: 1.1rem; border-radius: var(--r-m); background: var(--white); border: 1px solid var(--line); }
.durable strong { display: block; font: 800 1.2rem var(--f-display); margin-bottom: .15rem; }
.durable span { color: var(--ink-2); font-size: .93rem; }

/* ── Produktside ───────────────────────────────────────────────────── */

.crumbs { font-size: .9rem; color: var(--ink-3); padding: 1rem 0 0; }
.crumbs a { color: var(--ink-3); }
.pd { display: grid; gap: 2rem; padding: 1.5rem 0 3rem; }
@media (min-width: 900px) { .pd { grid-template-columns: 1.1fr 1fr; gap: 3rem; } }
.pd__gallery { display: grid; gap: .6rem; align-content: start; }
.pd__main { aspect-ratio: 1; border-radius: var(--r-l); overflow: hidden; background: var(--sky); }
.pd__main img { width: 100%; height: 100%; object-fit: cover; }
.pd__thumbs { display: flex; gap: .5rem; overflow-x: auto; }
.pd__thumbs button { flex: none; width: 72px; height: 72px; padding: 0; border: 2px solid transparent; border-radius: var(--r-s); overflow: hidden; background: var(--sky); cursor: pointer; }
.pd__thumbs button[aria-current=true] { border-color: var(--ink); }
.pd__thumbs img { width: 100%; height: 100%; object-fit: cover; }
.pd .product_title { font-size: clamp(1.8rem, 4vw, 2.6rem); }
.pd .summary .price { font-size: 1.5rem; margin-bottom: .2rem; }
.unit { color: var(--ink-3); margin-bottom: 1.2rem; }
.pd__short { color: var(--ink-2); }
.pd__delivery { display: flex; gap: .6rem; align-items: center; color: var(--ink-2); font-size: .95rem; margin: 1rem 0 0; }
.pd__delivery svg { width: 22px; height: 22px; color: var(--mint); flex: none; }

.swatches { display: flex; flex-wrap: wrap; gap: .5rem; margin: .3rem 0 1.2rem; padding: 0; border: 0; }
.swatches legend { font-weight: 600; margin-bottom: .45rem; padding: 0; }
.swatch input { position: absolute; opacity: 0; pointer-events: none; }
.swatch span {
    display: inline-flex; align-items: center; gap: .45rem; min-height: 42px; padding: .4rem .9rem;
    border: 2px solid var(--line); border-radius: 999px; cursor: pointer; font-weight: 600; font-size: .93rem;
}
.swatch i { width: 16px; height: 16px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .12); }
.swatch input:checked + span { border-color: var(--ink); background: var(--sky); }
.swatch input:focus-visible + span { outline: 3px solid var(--yellow); outline-offset: 2px; }

.buy { display: flex; gap: .6rem; align-items: stretch; margin-top: .4rem; }
.quantity { display: inline-flex; align-items: center; border: 2px solid var(--line); border-radius: 999px; overflow: hidden; }
.quantity button { width: 44px; height: 48px; border: 0; background: none; font-size: 1.25rem; cursor: pointer; color: var(--ink); }
.quantity input { width: 44px; height: 48px; border: 0; text-align: center; font: 700 1rem var(--f-body); color: var(--ink); -moz-appearance: textfield; }
.quantity input::-webkit-outer-spin-button, .quantity input::-webkit-inner-spin-button { -webkit-appearance: none; }
.buy .btn { flex: 1; }

.prose { color: var(--ink-2); max-width: 68ch; }
.prose h2, .prose h3 { color: var(--ink); margin-top: 1.6em; }
.prose img { border-radius: var(--r-m); margin: 1rem 0; }
.prose ul, .prose ol { padding-left: 1.2rem; }
.prose li { margin-bottom: .35rem; }
.prose table { width: 100%; border-collapse: collapse; }
.prose td, .prose th { border-bottom: 1px solid var(--line); padding: .5rem; text-align: left; }

.pd-designer { padding: 1rem 0 2.5rem; }
.pd-designer__intro { display: grid; gap: .25rem; margin: 1.3rem 0 1rem; }
.pd-designer__intro p { margin: 0; color: var(--ink-2); }

/* ── Kurv og kasse ─────────────────────────────────────────────────── */

.page-head { padding: 2rem 0 1rem; }
.cart { display: grid; gap: 2rem; padding-bottom: 3rem; }
@media (min-width: 900px) { .cart { grid-template-columns: 1fr 380px; align-items: start; } }
.lines { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.line { display: grid; grid-template-columns: 88px 1fr; gap: 1rem; padding: 1.1rem 0; border-bottom: 1px solid var(--line); }
.line__img { width: 88px; height: 88px; border-radius: var(--r-s); overflow: hidden; background: var(--sky); }
.line__img img { width: 100%; height: 100%; object-fit: contain; }
.line__name { font-weight: 700; }
.line__meta { color: var(--ink-3); font-size: .9rem; }
.line__row { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: center; justify-content: space-between; margin-top: .5rem; }
.line__actions { display: flex; gap: 1rem; font-size: .9rem; }
.qty-form { display: inline-flex; }

.summary-box { background: var(--sky); border-radius: var(--r-l); padding: 1.4rem; position: sticky; top: 90px; }
.summary-box h2 { font-size: 1.35rem; }
.sum { display: flex; justify-content: space-between; gap: 1rem; padding: .35rem 0; }
.sum--disc { color: var(--blue-dark); font-weight: 600; }
.sum--total { border-top: 2px solid var(--ink); margin-top: .5rem; padding-top: .8rem; font-weight: 800; font-size: 1.2rem; }
.meter { height: 8px; border-radius: 999px; background: var(--white); overflow: hidden; margin: .4rem 0 .2rem; }
.meter i { display: block; height: 100%; background: var(--mint); border-radius: inherit; }
.coupon { display: flex; gap: .4rem; margin: 1rem 0; }
.coupon input { flex: 1; min-height: 44px; padding: .5rem .8rem; border: 2px solid var(--line); border-radius: var(--r-s); font: inherit; }
.coupon .btn { min-height: 44px; padding: .5rem 1rem; }

.checkout { display: grid; gap: 2rem; padding-bottom: 3rem; }
@media (min-width: 900px) { .checkout { grid-template-columns: 1fr 400px; align-items: start; } }
.checkout fieldset { border: 0; padding: 0; margin: 0 0 1.5rem; }
.checkout legend { font: 800 1.3rem var(--f-display); margin-bottom: .8rem; }
.mini-lines { list-style: none; padding: 0; margin: 0 0 1rem; }
.mini-lines li { display: grid; grid-template-columns: 52px 1fr auto; gap: .7rem; align-items: center; padding: .45rem 0; font-size: .93rem; }
.mini-lines img { width: 52px; height: 52px; object-fit: contain; border-radius: 6px; background: var(--white); }

.empty { text-align: center; padding: 4rem 0; }
.empty p { color: var(--ink-2); }

/* ── Min side ──────────────────────────────────────────────────────── */

.account { display: grid; gap: 2rem; padding-bottom: 3rem; }
@media (min-width: 900px) { .account { grid-template-columns: 1fr 320px; align-items: start; } }
.orders { width: 100%; border-collapse: collapse; }
.orders th, .orders td { text-align: left; padding: .7rem .4rem; border-bottom: 1px solid var(--line); }
.orders th { font-size: .85rem; color: var(--ink-3); font-weight: 600; }
.status { display: inline-block; padding: .1rem .55rem; border-radius: 6px; font-size: .82rem; font-weight: 700; background: var(--blue-soft); }
.status--completed { background: color-mix(in srgb, var(--mint) 16%, #fff); }
.status--cancelled, .status--refunded { background: #FDE8E8; }

/* ── Bunn ──────────────────────────────────────────────────────────── */

.footer { background: var(--ink); color: color-mix(in srgb, var(--ink) 25%, #fff); padding: 3rem 0 2rem; margin-top: 0; }
.footer a { color: var(--white); }
.footer__grid { display: grid; gap: 2rem; }
@media (min-width: 760px) { .footer__grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.footer h3 { color: var(--white); font-size: 1.05rem; }
.footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .4rem; }
.footer .logo { color: var(--white); margin-bottom: 1rem; }
.footer form { display: flex; gap: .4rem; margin-top: .6rem; }
.footer input { flex: 1; min-height: 44px; border-radius: 999px; border: 0; padding: .5rem 1rem; font: inherit; }
.footer .btn { min-height: 44px; }
.footer__base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid rgba(255, 255, 255, .15); font-size: .88rem; }


/* WooCommerce-klasser som merkelapp-JS-en flytter rundt på */
.single_add_to_cart_button.loading { opacity: .6; }
