/* Hardwarebixen — eco-friendly, accessible UI */

:root{
  /* Dark (default) */
  --bg:#0b0f12;
  --panel:#12171d;
  --border:#202833;
  --text:#eef3f7;
  --muted:#b6c2ce;
  --accent:#22c55e;           /* eco green */
  --accent-contrast:#08130b;
  --shadow:0 4px 18px rgba(0,0,0,.25);
}

@media (prefers-color-scheme: light){
  :root{
    --bg:#f7fafb;
    --panel:#ffffff;
    --border:#dbe2ea;
    --text:#0e141b;
    --muted:#5a6a7a;
    --accent:#199a4b;
    --accent-contrast:#ffffff;
    --shadow:0 4px 14px rgba(0,0,0,.08);
  }
}

*{box-sizing:border-box}
html{scroll-behavior:smooth;-webkit-text-size-adjust:100%}
body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  background:var(--bg);
  color:var(--text);
  line-height:1.45;
}

/* Header */
header{
  position:sticky; top:0; z-index:10;
  display:flex; gap:16px; align-items:center;
  padding:14px 18px; background:rgba(0,0,0,.35);
  backdrop-filter: saturate(120%) blur(6px);
  border-bottom:1px solid var(--border);
}
header h1{margin:0; font-size:18px; letter-spacing:.2px}
header form{margin-left:auto; display:flex; gap:8px}
input,button,select{
  font:inherit; padding:10px 12px; border-radius:12px;
  border:1px solid var(--border); background:rgba(255,255,255,.03); color:var(--text)
}
input::placeholder{color:var(--muted)}
button{background:var(--accent); border-color:transparent; color:var(--accent-contrast); cursor:pointer}
button:focus-visible, a:focus-visible{outline:2px solid var(--accent); outline-offset:2px}

.wrap{max-width:1100px; margin:0 auto; padding:20px}

/* Categories */
nav.cats{margin:12px 0; display:flex; gap:8px; flex-wrap:wrap}
.badge{
  display:inline-block; font-size:12px; padding:4px 8px;
  border:1px solid var(--border); border-radius:999px; color:var(--muted)
}

/* Cards / grid */
.grid{display:grid; grid-template-columns:repeat(auto-fill,minmax(260px,1fr)); gap:16px}
.card{
  background:var(--panel); border:1px solid var(--border); border-radius:16px;
  padding:14px; display:flex; flex-direction:column; gap:10px; box-shadow:var(--shadow)
}
.card .price{font-weight:700; font-size:20px; margin:4px 0 8px}
img{max-width:100%; height:auto; border-radius:12px; display:block; background:#0f1318}

/* CTA */
.cta{
  display:inline-block; padding:10px 14px; border-radius:12px;
  background:var(--accent); color:var(--accent-contrast); text-decoration:none; border:none
}

/* Product page */
.prod-top{display:grid; gap:16px; grid-template-columns:minmax(0,1.1fr) minmax(0,1fr)}
@media (max-width:900px){ .prod-top{grid-template-columns:1fr} }

.thumbs{display:flex; gap:8px; flex-wrap:wrap; margin-top:8px}
.thumbs button{
  background:transparent; border:1px solid var(--border);
  border-radius:10px; padding:0; cursor:pointer
}
.thumbs button.active{ border-color: var(--accent); box-shadow:0 0 0 2px color-mix(in oklab, var(--accent) 30%, transparent) }
.thumbs button img{ display:block; width:96px; height:auto; border-radius:10px }

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce){
  *{scroll-behavior:auto}
}

/* --- Topmenu: store, solide grønne knapper --- */
header nav.cats a.badge{
  background: var(--accent);
  color: var(--accent-contrast);
  border-color: transparent;
  font-weight: 800;
  letter-spacing: .2px;
  padding: 12px 18px;
  border-radius: 999px;
  box-shadow: var(--shadow);
  text-decoration: none;
  transition: transform .06s ease, filter .12s ease;
  font-size: 15px;
}
header nav.cats a.badge:hover{ filter: brightness(.95); transform: translateY(-1px); }
header nav.cats a.badge.active{ box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 50%, transparent) inset; }

/* --- Kurv: pænere tabel, vandret qty, tydelig fjern-knap --- */
.cart-card{ max-width: 1100px; margin: 0 auto; }
.table { width:100%; border-collapse: collapse; background:var(--panel); border:1px solid var(--border); border-radius:16px; overflow:hidden; box-shadow:var(--shadow) }
.table th, .table td { padding:16px; border-bottom:1px solid var(--border); vertical-align: middle; }
.table th { text-align:left; color:var(--muted); font-weight:700 }
.table td:nth-child(2), .table th:nth-child(2),
.table td:nth-child(4), .table th:nth-child(4),
.table td:nth-child(5), .table th:nth-child(5){
  text-align: right;
}

.qty{
  display: inline-flex;
  flex-direction: row;            /* vandret */
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,.05);
  border-radius: 999px;
  padding: 4px 8px;
  border:1px solid var(--border);
}
.qty button{
  width: 34px; height: 34px; line-height: 34px;
  border-radius: 999px;
  border: none;
  background: var(--accent);
  color: var(--accent-contrast);
  font-weight: 900;
  cursor: pointer;
}
.qty span{ min-width: 28px; text-align: center; font-weight: 800; }

.row-actions button{
  padding: 10px 14px;
  border-radius: 12px;
  border:1px solid var(--border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.row-actions .danger{
  background: #b91c1c;            /* rød */
  border-color: transparent;
  color: #fff;
}

.summary{
  margin-top:16px;
  display:flex;
  justify-content: space-between;
  align-items:center;
}
.summary .cta{ font-size: 16px; padding: 12px 18px; }
.empty { padding:18px; border:1px dashed var(--border); border-radius:12px; color:var(--muted); background:rgba(255,255,255,.02) }

/* Header: centrer topmenu */
header.hb { display:flex; align-items:center; gap:12px; }
header.hb .nav-wrap { flex:1; display:flex; justify-content:center; }
header.hb nav.cats { margin-left:0 !important; }

/* Produktside layout (stabil boks til billeder) */
.prod-top { display:grid; grid-template-columns: minmax(260px, 620px) 1fr; gap:16px; align-items:start; }
@media (max-width: 860px) { .prod-top { grid-template-columns: 1fr; } }

/* Fast billedboks (stop layout-hop) */
.media-box {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;      /* vælg 4/3 for computertasker; brug 1/1 eller 16/9 hvis det passer bedre */
  background: #0f1318;       /* matcher img baggrund i dark */
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.media-box > img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: contain;       /* vis hele produktet uden beskæring */
  display: block;
}

/* Thumbnails */
.thumbs { display:flex; flex-wrap:wrap; gap:8px; margin-top:8px; }
.thumb { border:0; background:transparent; cursor:pointer; padding:0; opacity:.9; }
.thumb.active { outline:2px solid var(--accent); outline-offset:2px; opacity:1; }
.thumb img { width:72px; height:72px; object-fit:cover; border-radius:10px; display:block; background:#0f1318 }

/* Pris/info under billedkolonne */
.prod-under { margin-top:12px; display:grid; gap:8px; }

/* Lightbox */
.lightbox-backdrop { position:fixed; inset:0; background:rgba(0,0,0,.9); display:none; z-index:9999; }
.lightbox-backdrop.open { display:flex; align-items:center; justify-content:center; }
.lightbox-backdrop img { max-width:95vw; max-height:95vh; }

/* Webshop-kort: klikbar titel + fast billedhøjde */
.card .prod-link { text-decoration:none; color:inherit; }
.card .prod-link:focus { outline:2px solid var(--accent); outline-offset:2px; }

/* Ens billedhøjde i kort */
/* Ens billedhøjde i kort */
.card .card-img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3; /* samme som på produktsider for roligt grid */
  background: var(--bg); /* matcher sidens baggrund i stedet for sort */
  border: 1px solid #eee;
  border-radius: 8px;
  overflow: hidden;
}

.card .card-img > img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* --- HOTFIX: Billedbokse skal matche sidens baggrund ---
   Indsæt dette NEDERST i /assets/styles.css for at override tidligere regler. */

/* Globalt: gør <img> gennemsigtig i stedet for sort baggrund */
img { background: transparent !important; }

/* Webshop-kort og produktside: brug sidens baggrund i boksen */
.card .card-img,
.media-box {
  background: var(--bg) !important;   /* følger dark/light automagisk */
  border-color: var(--border) !important;
}

/* Selve billedet skal også være gennemsigtigt */
.card .card-img > img,
.media-box > img { background: transparent !important; }

/* (valgfrit) fjern sort baggrund fra thumbnails også */
.thumb img { background: transparent !important; }
