/* ---------- Farger og grunnoppsett ---------- */
:root {
  --black: #070707;
  --blue: #1479e6;
  --blue-d: #0b5cc0;
  --text: #0f1720;
  --muted: #5d6774;
  --line: #e3e7ee;
  --bg: #f3f5f8;
  --card: #ffffff;
  --green: #14913a;
  --red: #c0392b;
  --vipps: #ff5b24;
  --radius: 14px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.45;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select { font: inherit; }
button { cursor: pointer; }
h1, h2, h3 { margin: 0 0 0.4em; line-height: 1.15; font-weight: 800; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.section { margin-top: 28px; }

/* ---------- Topbar ---------- */
.topbar { background: var(--black); color: #fff; position: sticky; top: 0; z-index: 20; }
.topbar-inner {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  grid-template-areas:
    "menu logo cart"
    "search search search";
  align-items: center;
  gap: 10px 12px;
  padding: 10px 16px 12px;
  max-width: 1200px;
  margin: 0 auto;
}
.menu-btn { grid-area: menu; }
.logo { grid-area: logo; justify-self: center; }
.logo img { height: 52px; width: auto; }
.cart-btn { grid-area: cart; justify-self: end; }
.search { grid-area: search; position: relative; width: 100%; }

.icon-btn {
  background: none; border: 0; color: #fff;
  width: 42px; height: 42px; border-radius: 10px; padding: 0;
  display: grid; place-items: center; position: relative;
}
.icon-btn:hover { background: #1c1c1c; }

.menu-btn span { position: relative; display: block; width: 22px; height: 2px; background: #fff; border-radius: 2px; }
.menu-btn span::before,
.menu-btn span::after { content: ""; position: absolute; left: 0; width: 22px; height: 2px; background: #fff; border-radius: 2px; }
.menu-btn span::before { top: -7px; }
.menu-btn span::after { top: 7px; }

.badge {
  position: absolute; top: 2px; right: 0;
  background: var(--blue); color: #fff;
  font-size: 0.7rem; font-weight: 800;
  min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px;
  display: grid; place-items: center;
}
.badge:empty { display: none; }

.search input {
  /* 1px + min-width:100% hindrer at input-ens standardbredde sprenger topbaren */
  width: 1px; min-width: 100%; padding: 11px 14px 11px 40px;
  border: 0; border-radius: 10px;
  background: #fff; color: var(--text);
}
.search input:focus { outline: 2px solid var(--blue); }
.search-ico {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; color: #6b7280; pointer-events: none;
}

/* Desktop-faner */
.tabs { display: none; background: #fff; border-bottom: 1px solid var(--line); }
.tabs-inner {
  display: flex; gap: 4px; max-width: 1200px; margin: 0 auto; padding: 0 16px;
  overflow-x: auto;
}
.tabs a {
  padding: 14px 16px; font-weight: 700; white-space: nowrap; color: var(--text);
  border-bottom: 3px solid transparent;
}
.tabs a:hover { color: var(--blue); }
.tabs a.active { color: var(--blue); border-color: var(--blue); }

/* Mobil-meny */
.drawer {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: min(300px, 85vw); background: #fff; padding: 20px;
  transform: translateX(-100%); transition: transform 0.25s ease;
  z-index: 40; overflow-y: auto;
}
.drawer.open { transform: none; }
.drawer a { display: block; padding: 14px 4px; border-bottom: 1px solid var(--line); font-weight: 700; }
.drawer a.active { color: var(--blue); }
.backdrop {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.5);
  opacity: 0; pointer-events: none; transition: opacity 0.25s; z-index: 30;
}
.backdrop.open { opacity: 1; pointer-events: auto; }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(120deg, #05080d 0%, #0b2a4f 55%, #1479e6 140%);
  color: #fff; padding: 36px 0 60px; position: relative; overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; right: -10%; bottom: -40%;
  width: 70%; height: 120%;
  background: radial-gradient(closest-side, rgba(20, 121, 230, 0.45), transparent);
}
.hero-inner { position: relative; }
.hero h1 { font-size: 1.9rem; max-width: 14ch; }
.hero p { opacity: 0.9; max-width: 40ch; margin: 0; }
.hero .btn { margin-top: 18px; }

/* ---------- Knapper ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 18px; border-radius: 10px; border: 2px solid transparent;
  font-weight: 700; text-decoration: none; transition: background 0.15s, transform 0.05s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-d); }
.btn-outline { background: #fff; color: var(--blue); border-color: var(--blue); }
.btn-outline:hover { background: #eef5fe; }
.btn-vipps { background: var(--vipps); color: #fff; }
.btn-block { width: 100%; margin-top: 10px; }

/* ---------- Kategoriflis ---------- */
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: -30px; position: relative; }
.tile {
  height: 120px; border-radius: var(--radius); padding: 12px; color: #fff; font-weight: 700;
  display: flex; align-items: flex-end; position: relative; overflow: hidden;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}
.tile::before { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 30%, rgba(0, 0, 0, 0.75)); }
.tile span { position: relative; }
/* Flis-rad uten heltebilde over seg (f.eks. Butikk-siden): ingen negativ margin */
.tiles.tiles-flat { margin-top: 18px; }
.tile-termisk-optikk { background: linear-gradient(135deg, #2a3440, #0b0f14); }
.tile-elsykler { background: linear-gradient(135deg, #1479e6, #0a2c57); }
.tile-jaktutstyr { background: linear-gradient(135deg, #4a3b26, #1d1a14); }
.tile-friluftsliv { background: linear-gradient(135deg, #4e6b3a, #1d2a16); }

.section-head { display: flex; align-items: baseline; justify-content: space-between; }
.section-head a { color: var(--blue); font-weight: 700; font-size: 0.95rem; }

.page-head { margin-top: 18px; }
.page-head p { color: var(--muted); margin: 0; }
.crumbs { font-size: 0.85rem; color: var(--muted); margin: 14px 0 6px; }
.crumbs a { color: var(--blue); }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; }
.count { color: var(--muted); font-size: 0.9rem; }
.sort { font-size: 0.9rem; display: flex; align-items: center; gap: 8px; }
select { padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: #fff; }

/* ---------- Filter på listesider ---------- */
.shop-layout { margin-top: 4px; }
.filters { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); margin-top: 12px; }
.filters-toggle { padding: 12px 14px; font-weight: 700; cursor: pointer; list-style: none; }
.filters-toggle::-webkit-details-marker { display: none; }
.filters[open] .filters-toggle { border-bottom: 1px solid var(--line); }
.filters-body { padding: 10px 14px 14px; }
.filter-head { display: flex; justify-content: space-between; align-items: center; }
.link-btn { background: none; border: 0; color: var(--blue); font-weight: 700; padding: 4px; }
.filter-group { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 10px; }
.filter-group h3 { font-size: 0.95rem; margin-bottom: 4px; }
.filter-list { max-height: 220px; overflow-y: auto; padding-right: 8px; scrollbar-width: thin; scrollbar-gutter: stable; }
.fcheck { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 0.9rem; cursor: pointer; }
.fcheck input { width: 16px; height: 16px; accent-color: var(--blue); flex: 0 0 auto; margin: 0; }
.fcheck span { flex: 1; min-width: 0; }
.fcheck em { font-style: normal; color: var(--muted); font-size: 0.8rem; }
.results { min-width: 0; }
.results .toolbar { margin-top: 12px; }

/* ---------- Produktkort ---------- */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.card {
  background: var(--card); border-radius: var(--radius); border: 1px solid var(--line);
  position: relative; display: flex; flex-direction: column; overflow: hidden;
  transition: box-shadow 0.15s;
}
.card:hover { box-shadow: 0 8px 22px rgba(15, 23, 32, 0.09); }
.card-img { display: block; }
/* Ekte produktbilder: hele produktet vises, hvit bakgrunn */
.card-img img, .main-img { width: 100%; aspect-ratio: 1 / 1; object-fit: contain; background: #fff; display: block; }
.card-img img { border-bottom: 1px solid var(--line); }
.main-img { border-radius: var(--radius); border: 1px solid var(--line); }
.thumbs { display: flex; gap: 8px; overflow-x: auto; margin-top: 10px; }
.thumb { flex: 0 0 64px; height: 64px; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.thumb img { width: 100%; height: 100%; object-fit: contain; }
.cart-item img { width: 100%; aspect-ratio: 1 / 1; object-fit: contain; background: #fff; border-radius: 10px; }
.card .ph { border-radius: 0; }
.card-body { padding: 10px 12px 12px; display: flex; flex-direction: column; flex: 1; }
.card-title { font-weight: 700; font-size: 0.95rem; line-height: 1.25; min-height: 2.5em; }
.card-cat { font-size: 0.8rem; color: var(--muted); margin-top: 2px; }
.card-foot { display: flex; align-items: flex-end; justify-content: space-between; margin-top: auto; padding-top: 8px; }

.fav {
  position: absolute; top: 8px; right: 8px; z-index: 1;
  width: 34px; height: 34px; border-radius: 50%; border: 0;
  background: #fff; color: #111; font-size: 1.1rem; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}
.add-btn {
  width: 40px; height: 40px; border-radius: 10px; border: 0;
  background: var(--blue); color: #fff; display: grid; place-items: center; flex: 0 0 auto;
}
.add-btn:hover { background: var(--blue-d); }
.add-btn:disabled { background: #b8c2cf; cursor: not-allowed; }

.price { font-weight: 800; color: var(--blue); font-size: 1.05rem; }
.price-lg { font-size: 1.8rem; margin: 6px 0; }
.stock { font-size: 0.8rem; color: var(--green); font-weight: 600; }
.stock.out { color: var(--red); }

/* Plassholder for bilder (byttes ut med ekte produktbilder) */
.ph {
  aspect-ratio: 1 / 1;
  display: grid; place-items: center; position: relative;
  background:
    radial-gradient(circle at 70% 20%, rgba(20, 121, 230, 0.45), transparent 55%),
    linear-gradient(160deg, #1f2a38, #0a0d12);
  color: #fff; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; font-size: 0.85rem;
}
.ph span { opacity: 0.85; border: 1px dashed rgba(255, 255, 255, 0.35); padding: 6px 10px; border-radius: 8px; }

/* ---------- Produktside ---------- */
.pdp { display: grid; gap: 20px; margin-top: 12px; margin-bottom: 40px; }
.pdp .ph { border-radius: var(--radius); aspect-ratio: 4 / 3; }
.gallery { position: relative; }
.gallery .fav { top: 12px; right: 12px; width: 42px; height: 42px; font-size: 1.3rem; }
.pdp-info h1 { font-size: 1.5rem; }
.desc { color: var(--muted); white-space: pre-line; }
.checks { list-style: none; padding: 0; margin: 14px 0; }
.checks li { padding: 4px 0 4px 26px; position: relative; }
.checks li::before { content: "✓"; position: absolute; left: 0; color: var(--blue); font-weight: 800; }
.qty { display: flex; align-items: center; justify-content: space-between; margin: 18px 0 4px; font-weight: 600; }
.qty-ctrl { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.qty-ctrl button { width: 40px; height: 40px; border: 0; background: #fff; font-size: 1.1rem; }
.qty-ctrl span { width: 44px; text-align: center; font-weight: 700; }
.qty-ctrl.sm button { width: 32px; height: 30px; }
.qty-ctrl.sm span { width: 34px; }

/* ---------- Handlekurv ---------- */
.cart-layout { display: grid; gap: 20px; margin-top: 12px; margin-bottom: 40px; }
.cart-list {
  list-style: none; padding: 0; margin: 12px 0 0;
  background: #fff; border-radius: var(--radius); border: 1px solid var(--line);
}
.cart-item {
  display: grid; grid-template-columns: 84px 1fr auto; gap: 12px;
  padding: 14px; border-bottom: 1px solid var(--line);
}
.cart-item:last-child { border-bottom: 0; }
.cart-item .ph { border-radius: 10px; font-size: 0.6rem; }
.cart-item .ph span { padding: 3px 5px; }
.ci-info a { font-weight: 700; display: block; }
.ci-info .stock { margin-top: 2px; }
.ci-info .qty-ctrl { margin-top: 8px; }
.ci-right { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; }
.trash { background: none; border: 0; color: var(--muted); font-size: 1rem; padding: 4px; }
.summary {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; align-self: start;
}
.summary .row { display: flex; justify-content: space-between; padding: 6px 0; }
.summary .total { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 12px; font-weight: 800; font-size: 1.1rem; }
.summary .total small { font-weight: 400; color: var(--muted); }
.green { color: var(--green); font-weight: 700; }
.perks {
  list-style: none; padding: 12px 0 0; margin: 14px 0 0; border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  font-size: 0.78rem; color: var(--muted); text-align: center;
}
.empty { text-align: center; padding: 60px 0; }
.container.empty { padding-top: 60px; padding-bottom: 60px; } /* .container-padding overstyrer ellers .empty på desktop */
.empty p { color: var(--muted); }
.empty .btn { margin-top: 10px; }
.no-results { color: var(--muted); padding: 20px 0; }

/* ---------- Meny: mega-meny (desktop) og grupper i skuffen (mobil) ---------- */
.tabs-inner { flex-wrap: wrap; overflow: visible; row-gap: 0; }
.tab-group { position: relative; display: block; }
.tab-group > a { display: block; padding: 14px 14px; font-weight: 700; white-space: nowrap; color: var(--text); border-bottom: 3px solid transparent; }
.tab-group > a:hover { color: var(--blue); }
.tab-group > a.active { color: var(--blue); border-color: var(--blue); }
.mega {
  display: none; position: absolute; left: 0; top: 100%; z-index: 25;
  background: #fff; border: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: 0 10px 24px rgba(15, 23, 32, 0.12); padding: 10px 16px; min-width: 240px;
}
.tab-group:hover .mega,
.tab-group:has(> a:focus-visible) .mega { display: block; }
.tab-group.closed .mega { display: none !important; }
.mega ul { list-style: none; margin: 0; padding: 0; }
.tabs .mega a { display: block; padding: 7px 0; border: 0; font-weight: 600; color: var(--text); white-space: normal; }
.tabs .mega a:hover { color: var(--blue); }
.mega em, .chip em, .drawer em { font-style: normal; color: var(--muted); font-size: 0.8rem; margin-left: 4px; }
.soon { color: var(--muted); }
.mega .soon { display: block; padding: 7px 0; font-weight: 600; }

.drawer-group { border-bottom: 1px solid var(--line); }
.drawer-group summary { list-style: none; padding: 14px 4px; font-weight: 800; cursor: pointer; }
.drawer-group summary::-webkit-details-marker { display: none; }
.drawer-group summary::after { content: "+"; float: right; color: var(--muted); }
.drawer-group[open] summary::after { content: "−"; }
.drawer-group > a { border-bottom: 0; color: var(--blue); padding-top: 4px; }
.drawer-group a.sub, .drawer-group span.sub { padding-left: 18px; font-weight: 600; font-size: 0.95rem; border-bottom: 0; }
.drawer-group span.sub { display: block; padding: 8px 4px 8px 18px; }

/* Underkategori-chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.chip {
  background: #fff; border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 12px; font-weight: 600; font-size: 0.9rem; color: var(--text);
}
.chip:hover { border-color: var(--blue); color: var(--blue); }
.chip.soon { background: #eef1f5; color: var(--muted); }
.coming { background: #fff; border: 1px dashed var(--line); border-radius: var(--radius); padding: 28px 18px; margin-top: 16px; text-align: center; }
.coming p { color: var(--muted); margin: 0; }

/* ---------- Pris på forespørsel og sidetall ---------- */
.price-ask { font-weight: 800; color: var(--muted); font-size: 0.95rem; white-space: nowrap; }
.min-antall { font-size: 0.8rem; color: var(--muted); font-weight: 600; white-space: nowrap; }
.card-fsp { font-size: 0.85rem; padding: 10px 8px; white-space: nowrap; margin-top: 8px; width: 100%; }
.fsp-btn { display: inline-block; border: 1px solid var(--blue); color: var(--blue); border-radius: 10px; padding: 8px 10px; font-weight: 700; font-size: 0.8rem; white-space: nowrap; background: #fff; }
.fsp-btn:hover { background: #eef5fe; }
.pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 22px 0 8px; flex-wrap: wrap; }
.pg { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 9px 14px; font: inherit; font-weight: 700; color: var(--text); cursor: pointer; }
.pg:hover:not(:disabled) { border-color: var(--blue); color: var(--blue); }
.pg:disabled { opacity: 0.4; cursor: default; }
.pg-info { color: var(--muted); font-size: 0.9rem; }

/* ---------- Bestillingsskjema ---------- */
.checkout { display: grid; gap: 4px; margin-top: 12px; }
.checkout label { display: grid; gap: 4px; font-size: 0.9rem; font-weight: 600; color: var(--text); margin-top: 8px; }
.checkout input { font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; width: 100%; }
.checkout input:focus { outline: 2px solid var(--blue); }
.checkout .two { display: grid; grid-template-columns: 1fr; gap: 0 12px; }
.checkout .btn { margin-top: 14px; }
.form-msg { color: var(--red); min-height: 1.2em; margin: 6px 0 0; font-size: 0.9rem; }
.checkout textarea { font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; width: 100%; resize: vertical; }
.fsp-produkt { background: #f3f7fc; border-radius: 10px; padding: 10px 12px; display: grid; gap: 2px; font-size: 0.9rem; }
.fsp-produkt span { color: var(--muted); }
.checkout { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
@media (min-width: 560px) { .checkout .two { grid-template-columns: 1fr 2fr; } }

/* ---------- Footer og toast ---------- */
.footer {
  background: var(--black); color: #bbb; padding: 28px 0;
  margin-top: 40px; font-size: 0.9rem; text-align: center;
}
.footer strong { color: #fff; }
.footer { text-align: left; }
.footer-grid { display: grid; grid-template-columns: 1fr; gap: 22px; }
.footer-grid > div > p { margin: 4px 0 0; }
.footer h4 { color: #fff; margin: 0 0 8px; font-size: 0.95rem; }
.footer a { display: block; padding: 3px 0; color: #bbb; }
.footer a:hover { color: #fff; }
@media (min-width: 768px) {
  .footer-grid { grid-template-columns: 1.2fr 1fr 1fr 1.4fr; gap: 28px; }
}
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px);
  background: #0f1720; color: #fff; padding: 12px 18px; border-radius: 10px;
  opacity: 0; pointer-events: none; transition: opacity 0.25s, transform 0.25s;
  z-index: 50; max-width: 90vw; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Tablet (768px+) ---------- */
@media (min-width: 768px) {
  .topbar-inner {
    grid-template-columns: auto 1fr auto;
    grid-template-areas: "logo search cart";
    gap: 24px;
    padding: 12px 24px;
  }
  .menu-btn { display: none; }
  .logo img { height: 56px; }
  .search { justify-self: center; max-width: 560px; }
  .tabs { display: block; }
  .drawer, .backdrop { display: none; }

  .hero { padding: 56px 0 80px; }
  .hero h1 { font-size: 2.6rem; max-width: 18ch; }
  .hero p { font-size: 1.1rem; }

  .tiles { grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: -40px; }
  .tiles.tiles-flat { margin-top: 18px; grid-template-columns: repeat(3, 1fr); }
  .tile { height: 160px; font-size: 1.05rem; }

  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .cart-item { grid-template-columns: 110px 1fr auto; }
  .perks { font-size: 0.85rem; }
}

/* ---------- PC (1024px+) ---------- */
@media (min-width: 1024px) {
  .container { padding: 0 24px; }
  .hero h1 { font-size: 3rem; }
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
  .pdp { grid-template-columns: 1.1fr 1fr; gap: 48px; }
  .pdp .ph { aspect-ratio: 1 / 1; }
  .pdp-info h1 { font-size: 1.9rem; }
  .cart-layout { grid-template-columns: 1.6fr 1fr; }
  .shop-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 24px; align-items: start; }
  .filters { position: sticky; top: 16px; margin-top: 12px; }
  .filters-toggle { display: none; }
}

/* ---------- Vedlegg i forespørselsskjema ---------- */
.fsp-note { font-size: 0.9rem; background: #fff7e6; border: 1px solid #f0d9a8; border-radius: 10px; padding: 10px 12px; margin: 12px 0; color: var(--text); }
.fsp-vedlegg { display: grid; gap: 4px; margin-top: 10px; }
.fsp-vedlegg input[type=file] { padding: 8px; background: #fff; }
.checkout label.samtykke { display: flex; align-items: flex-start; gap: 8px; font-weight: 400; margin-top: 12px; }
.checkout label.samtykke input { width: auto; margin-top: 3px; }

/* ---------- Undertittel og varenummer ---------- */
.undertittel { font-size: 1.05rem; font-weight: 600; color: var(--text); margin: -4px 0 2px; }
.varenr { font-size: 0.8rem; color: var(--muted); margin-bottom: 6px; }

/* ---------- Spesifikasjoner ---------- */
.specs { margin: 12px 0; display: grid; gap: 4px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }
.specs div { display: grid; grid-template-columns: 140px 1fr; gap: 8px; font-size: 0.9rem; padding: 3px 0; border-bottom: 1px solid #f0f2f5; }
.specs div:last-child { border-bottom: 0; }
.specs dt { color: var(--muted); }
.specs dd { margin: 0; font-weight: 600; }

.bilde-notis { font-size: 0.82rem; color: var(--muted); margin: 6px 0 0; }

/* ---------- Lange navn i kortene: maks 3 linjer ---------- */
.card-title { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; text-overflow: ellipsis; }

/* Undertittel på produktkort (f.eks. variant som skiller like navn) */
.card-sub { font-size: .8rem; color: #6b7280; margin-top: 2px; line-height: 1.3; overflow-wrap: anywhere; }
/* Ekte variant er litt tydeligere enn varenummeret under */
.card-variant { font-size: .8rem; color: #374151; font-weight: 600; margin-top: 2px; line-height: 1.3; overflow-wrap: anywhere; }
.card-varenr { font-size: .75rem; color: #6b7280; margin-top: 1px; line-height: 1.3; overflow-wrap: anywhere; }

/* Lange nedtrekk (over 10 underkategorier) vises i to kolonner på desktop */
@media (min-width: 900px) {
  .mega.mega-2col { min-width: 460px; }
  .mega.mega-2col ul { column-count: 2; column-gap: 28px; }
  .mega.mega-2col li { break-inside: avoid; }
}

/* Tre nivåer i desktop-menyen: kategorier i venstre kolonne, underkategorier i flyout til høyre */
.tabs .mega.mega-tree { min-width: 250px; padding: 6px 0; }
.tabs .mega.mega-tree ul { list-style: none; margin: 0; padding: 0; }
.tabs .mega.mega-tree > ul > li { position: relative; }
.tabs .mega.mega-tree > ul > li > a { display: flex; justify-content: space-between; gap: 12px; padding: 8px 16px; border: 0; font-weight: 600; color: var(--text); white-space: normal; }
.tabs .mega.mega-tree > ul > li > a:hover,
.tabs .mega.mega-tree > ul > li:hover > a,
.tabs .mega.mega-tree > ul > li:focus-within > a { background: #f3f5f8; color: var(--blue); }
.tabs .mega.mega-tree .flyout { display: none; position: absolute; left: 100%; top: -1px; min-width: 240px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 10px 24px rgba(15, 23, 32, 0.12); padding: 6px 0; }
.tabs .mega.mega-tree li.has-sub:hover > .flyout,
.tabs .mega.mega-tree li.has-sub:focus-within > .flyout { display: block; }
.tabs .mega.mega-tree .flyout a { display: flex; justify-content: space-between; gap: 12px; padding: 7px 16px; border: 0; font-weight: 500; color: var(--text); white-space: normal; }
.tabs .mega.mega-tree .flyout a:hover, .tabs .mega.mega-tree .flyout a:focus-visible { background: #f3f5f8; color: var(--blue); }
.tabs .mega.mega-tree em { font-style: normal; color: var(--muted); font-size: 0.8rem; }
/* Mobilskuff: kategorier og underkategorier (sammenleggbart) */
.drawer-kat { margin-left: 4px; }
.drawer-kat > summary { list-style: none; cursor: pointer; }
.drawer-kat > summary::-webkit-details-marker { display: none; }
.drawer-kat > summary::after { content: '+'; float: right; color: var(--muted); }
.drawer-kat[open] > summary::after { content: '–'; }
.drawer .sub2 { padding-left: 28px; }

/* Liten hjelpetekst (f.eks. om lagerstatus og leveringssted) */
.fine { font-size: 0.8rem; color: var(--muted); margin-top: 4px; }

/* ---------- Forside: hero med utvalgt produkt ---------- */
.hero-grid { display: grid; gap: 24px; align-items: center; }
.hero-feat { position: relative; width: 100%; max-width: 380px; aspect-ratio: 4 / 4.2; justify-self: center; }
.hf-item {
  position: absolute; inset: 0; display: flex; flex-direction: column; gap: 6px;
  background: #fff; color: var(--text); border-radius: 16px; padding: 14px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35); text-decoration: none;
  opacity: 0; transition: opacity 1.2s ease; pointer-events: none;
}
.hf-item.on { opacity: 1; pointer-events: auto; }
.hf-bilde { flex: 1; min-height: 0; background: #f5f6f8; border-radius: 10px; overflow: hidden; }
.hf-bilde img { width: 100%; height: 100%; object-fit: contain; }
.hf-item strong { font-size: 0.95rem; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hf-item span { color: var(--blue); font-weight: 800; font-size: 1.1rem; }
@media (min-width: 900px) { .hero-grid { grid-template-columns: 1.15fr 0.85fr; } }

/* ---------- Forside: kategoriflis med roterende produktbilder ---------- */
.kat-flis {
  position: relative; display: block; height: 200px; border-radius: var(--radius); overflow: hidden;
  background: #f5f6f8; color: #fff; text-decoration: none; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
@media (hover: hover) {
  .kat-flis:hover { transform: translateY(-4px); box-shadow: 0 14px 28px rgba(0, 0, 0, 0.22); }
}
.kf-scene { position: absolute; top: 0; left: 0; right: 0; bottom: 44px; background: #f5f6f8; }
.kf-bilde { position: absolute; inset: 0; opacity: 0; transition: opacity 1.2s ease; }
.kf-bilde.on { opacity: 1; }
.kf-bilde img { width: 100%; height: 100%; object-fit: contain; padding: 10px; transform-origin: center; }
.kf-bilde.on img { animation: kf-zoom 5s ease-out forwards; }
@keyframes kf-zoom { from { transform: scale(1); } to { transform: scale(1.06); } }
.kf-band {
  position: absolute; left: 0; right: 0; bottom: 0; height: 44px; padding: 0 12px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px; font-weight: 700;
}
.kf-band em { font-style: normal; font-size: 0.8rem; opacity: 0.92; white-space: nowrap; }
.tiles .kat-flis { height: 190px; }
@media (max-width: 559px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kat-flis, .tiles .kat-flis { height: 170px; }
  .kf-band { font-size: 0.9rem; }
  .kf-band em { font-size: 0.7rem; }
  .hero-feat { max-width: 300px; }
}
@media (prefers-reduced-motion: reduce) {
  .kf-bilde.on img { animation: none; }
  .kf-bilde, .hf-item, .kat-flis { transition: none; }
}

/* ---------- Forside: logo i heltebildet ---------- */
.hero-logo {
  width: 100%; max-width: 460px; height: auto; justify-self: center;
  mix-blend-mode: screen; /* svart bakgrunn i logoen forsvinner mot den mørkeblå heltebakgrunnen */
  animation: logo-inn 1.2s ease-out both;
}
@keyframes logo-inn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (max-width: 899px) {
  .hero-grid { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .hero-logo { order: -1; width: 260px; }
  .hero-tekst { display: flex; flex-direction: column; align-items: center; }
  .hero-tekst p { margin: 0 auto; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-logo { animation: none; }
}

/* ---------- Kategoriflis: navn på én linje, antall på egen linje ---------- */
.kf-band { flex-direction: column; align-items: flex-start; justify-content: center; gap: 0; height: 56px; padding: 0 12px; }
.kf-band span { white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; font-size: 1rem; }
.kf-band em { font-size: 0.75rem; }
.kf-scene { bottom: 56px; }
@media (max-width: 559px) {
  .kf-band span { font-size: 0.9rem; }
  .kf-band { height: 52px; }
  .kf-scene { bottom: 52px; }
}

/* ---------- Forside: luft mellom heltebilde, kategorier og populære produkter ---------- */
.hero { padding-bottom: 64px; }
.kat-seksjon { margin-top: 40px; }
.kat-seksjon .section-head { margin-bottom: 14px; }
.tiles { margin-top: 0; margin-bottom: 48px; gap: 20px; position: relative; }
@media (max-width: 559px) {
  .hero { padding-bottom: 40px; }
  .kat-seksjon { margin-top: 24px; }
  .tiles { gap: 12px; margin-bottom: 48px; }
}

/* ---------- Forside: faste bilder per kategori (admin) ---------- */
.kat-flis.har-bilde { background: #0b0f14; }
.kf-foto { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.har-bilde .kf-band { background: linear-gradient(to top, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0)); height: 84px; justify-content: flex-end; padding-bottom: 10px; }
.uten-bilde .kf-band { background: none; }
