:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --text: #1c2330;
  --muted: #5e6a7d;
  --line: #e3e7ee;
  --accent: #1d3a5f;
  --accent-dark: #12263f;
  --accent-soft: #e4eef7;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(20, 30, 50, .08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}
img { max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 30;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; align-items: center; gap: 20px;
  max-width: 1280px; margin: 0 auto; padding: 14px 20px;
}
.logo { display: flex; align-items: center; white-space: nowrap; }
.logo svg { display: block; }
.search-wrap { flex: 1; }
#searchInput {
  width: 100%; max-width: 560px;
  padding: 10px 16px;
  border: 1px solid var(--line); border-radius: 24px;
  background: var(--bg); font-size: 15px;
}
#searchInput:focus { outline: 2px solid var(--accent); border-color: transparent; }
.cart-btn {
  position: relative; border: 1px solid var(--line);
  border-radius: 24px; padding: 9px 16px; background: var(--surface);
  display: flex; align-items: center; gap: 2px; color: var(--accent-dark);
}
.cart-btn:hover { background: var(--accent-soft); border-color: var(--accent); }
.cart-btn svg { display: block; }
.cart-count {
  position: absolute; top: -6px; right: -4px;
  font-size: 12px; font-weight: 700; color: #fff;
  background: var(--accent); border-radius: 10px; padding: 1px 6.5px;
  border: 2px solid var(--surface);
}
.icon-btn { text-decoration: none; gap: 7px; }
.icon-label { font-size: 13.5px; font-weight: 600; color: var(--accent-dark); }
@media (max-width: 1000px) { .icon-label { display: none; } }



/* ---------- favorieten-hartjes ---------- */
.fav-btn {
  position: absolute; top: 8px; right: 8px; z-index: 3;
  width: 34px; height: 34px; border-radius: 50%;
  background: #fff; border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); box-shadow: 0 1px 4px rgba(20,30,50,.12);
}
.fav-btn:hover { color: #d9465e; border-color: #d9465e; }
.fav-btn.active { color: #d9465e; border-color: #d9465e; }
.fav-btn.active svg path { fill: #d9465e; }
.fav-btn.fav-inline { position: static; width: 46px; height: 46px; flex-shrink: 0; }
.buy-actions { display: flex; align-items: center; gap: 12px; }
/* ---------- categorieën-dropdown ---------- */
.cats-btn {
  background: var(--accent); color: #fff; border: none;
  padding: 10px 18px; border-radius: 10px; font-weight: 600; font-size: 14.5px;
  white-space: nowrap;
}
.cats-btn:hover, .cats-btn.active { background: var(--accent-dark); }
.cats-panel {
  display: none; position: absolute; left: 0; right: 0; top: 100%;
  background: var(--surface); border-bottom: 1px solid var(--line);
  box-shadow: 0 16px 32px rgba(15, 25, 45, .18); z-index: 40;
  max-height: 70vh; overflow-y: auto;
}
.cats-panel.open { display: block; }
.site-header { position: sticky; }
.cp-inner {
  max-width: 1280px; margin: 0 auto; padding: 24px 20px 28px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 24px;
}
.cp-main { display: block; font-weight: 700; color: var(--accent-dark); margin-bottom: 8px; font-size: 14.5px; }
.cp-main:hover { text-decoration: underline; }
.cp-sub { display: block; font-size: 13.5px; color: var(--muted); padding: 3px 0; }
.cp-sub:hover { color: var(--accent-dark); }

/* ---------- usp-balk ---------- */
.usp-bar {
  background: var(--accent-soft); color: var(--accent-dark);
  display: flex; justify-content: center; gap: 36px; flex-wrap: wrap;
  padding: 8px 20px; font-size: 13px; font-weight: 600;
}

.cat-nav {
  display: flex; gap: 4px; overflow-x: auto;
  max-width: 1280px; margin: 0 auto; padding: 0 20px 10px;
}
.cat-nav a {
  white-space: nowrap; padding: 6px 14px; border-radius: 18px;
  font-size: 14px; color: var(--muted); border: 1px solid transparent;
}
.cat-nav a:hover { background: var(--bg); }
.cat-nav a.active { background: var(--accent-soft); color: var(--accent-dark); font-weight: 600; }

/* ---------- layout ---------- */
#app { max-width: 1280px; margin: 0 auto; padding: 24px 20px 60px; min-height: 60vh; }
.loading { text-align: center; padding: 80px 0; color: var(--muted); }

.toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 18px;
}
.toolbar h1 { font-size: 20px; margin: 0; flex: 1; }
.toolbar .count { color: var(--muted); font-size: 14px; }
.toolbar select {
  padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface);
}
.filter-toggle { display: none; }
.subcat-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.subcat-row a {
  font-size: 13px; padding: 5px 12px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--line); color: var(--muted);
}
.subcat-row a.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ---------- startpagina ---------- */
.hero {
  background: linear-gradient(118deg, #2a4e7d 0%, #1d3a5f 100%);
  border-radius: 14px; color: #fff; padding: 20px 28px;
  display: flex; align-items: center; gap: 24px; margin-bottom: 30px;
}
.hero-text { flex: 1; display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.hero-text > div { flex: 1; min-width: 260px; }
.hero h1 { font-size: 21px; margin: 0 0 4px; line-height: 1.25; color: #fff; }
.hero p { font-size: 13.5px; color: #bcd0e4; max-width: 560px; margin: 0; }
.hero-cta { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-btn { text-align: center; padding: 10px 18px; font-size: 14px; }
.hero .btn { background: #fff; color: var(--accent-dark); }
.hero .btn:hover { background: #e4eef7; }
.hero .btn.secondary { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.55); }
.hero .btn.secondary:hover { background: rgba(255,255,255,.12); }
.hero-badge { flex-shrink: 0; }
@media (max-width: 760px) { .hero-badge { display: none; } .hero { padding: 18px 20px; } }

.home-section { margin-bottom: 38px; }
.home-section h2 { font-size: 20px; margin: 0 0 16px; }
.home-cats {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}
.home-cat {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform .12s ease, box-shadow .12s ease;
}
.home-cat:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(20,30,50,.12); }
.home-cat .hc-img {
  height: 130px; background: #fff; padding: 14px; box-sizing: border-box;
  display: flex; align-items: center; justify-content: center;
}
.home-cat .hc-img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.home-cat .hc-img.all-icon {
  background: var(--accent); color: #fff; font-size: 44px; font-weight: 700;
}
.home-cat .hc-body { padding: 12px 14px 14px; }
.home-cat h3 { font-size: 15px; margin: 0 0 2px; }
.home-cat span { font-size: 12.5px; color: var(--muted); }

/* ---------- categorie-rijen (shelves) ---------- */
.shelf-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; }
.shelf-head h2 { margin: 0; }
.shelf-all { font-size: 14px; font-weight: 600; color: var(--accent); white-space: nowrap; }
.shelf-all:hover { color: var(--accent-dark); text-decoration: underline; }
.shelf-wrap { position: relative; }
.shelf-row {
  display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding-bottom: 6px; scrollbar-width: thin;
}
.shelf-row .card { flex: 0 0 210px; scroll-snap-align: start; }
.shelf-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--line);
  box-shadow: 0 2px 8px rgba(20,30,50,.18);
  font-size: 22px; line-height: 1; color: var(--accent-dark); z-index: 5;
  display: flex; align-items: center; justify-content: center;
}
.shelf-arrow:hover { background: var(--accent-soft); }
.shelf-arrow.left { left: -14px; }
.shelf-arrow.right { right: -14px; }
@media (max-width: 760px) { .shelf-arrow { display: none; } }

/* ---------- product grid ---------- */
.grid {
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.card {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform .12s ease, box-shadow .12s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(20,30,50,.12); }
.card .img {
  height: 210px; background: #fff; padding: 12px; box-sizing: border-box; flex-shrink: 0;
  position: relative;
}
.card .img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.card .body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card h3 { font-size: 15px; margin: 0; font-weight: 600; line-height: 1.35; }
.card .meta { font-size: 12.5px; color: var(--muted); }
.card .price-row { margin-top: auto; display: flex; align-items: center; justify-content: space-between; }
.price { font-weight: 700; color: var(--accent-dark); }
.price.on-request { font-weight: 600; font-size: 13.5px; color: var(--muted); }
.badge {
  font-size: 11.5px; background: var(--accent-soft); color: var(--accent-dark);
  padding: 2px 8px; border-radius: 10px;
}

/* ---------- product detail ---------- */
.back-link { display: inline-block; margin-bottom: 16px; color: var(--muted); font-size: 14px; }
.back-link:hover { color: var(--accent-dark); }
.detail { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 36px; }
@media (max-width: 860px) { .detail { grid-template-columns: 1fr; } }
.gallery .main-img {
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
  aspect-ratio: 1; padding: 20px; box-sizing: border-box;
}
.gallery .main-img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.thumbs { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.thumbs img {
  width: 64px; height: 64px; object-fit: contain; background: #fff;
  border: 2px solid var(--line); border-radius: 8px; padding: 4px; cursor: pointer;
}
.thumbs img.active { border-color: var(--accent); }

.pinfo h1 { font-size: 26px; margin: 0 0 6px; }
.pinfo .crumb { font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.desc-section {
  margin-top: 36px; background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px 24px;
}
.desc-section h2 { font-size: 18px; margin: 0 0 10px; }
.desc-section .desc { color: var(--text); margin: 0 0 14px; max-width: 900px; }
.desc-section ul.bullets { margin: 0; padding-left: 20px; color: var(--text); }
.desc-section ul.bullets li { margin-bottom: 4px; }

.buy-box {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px; margin-top: 8px;
}
.buy-box .row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.buy-box label { font-size: 13.5px; color: var(--muted); min-width: 90px; }
.buy-box select, .buy-box input[type=number] {
  padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 15px;
}
.buy-box input[type=number] { width: 84px; }
.buy-box .price-line { font-size: 20px; margin-bottom: 14px; }
.btn {
  display: inline-block; background: var(--accent); color: #fff; border: none;
  padding: 12px 22px; border-radius: 10px; font-weight: 600; font-size: 15px;
}
.btn:hover { background: var(--accent-dark); }
.btn.secondary { background: var(--surface); color: var(--accent-dark); border: 1px solid var(--accent); }
.btn.secondary:hover { background: var(--accent-soft); }
.btn:disabled { opacity: .55; cursor: default; }

.variant-label { font-size: 13.5px; color: var(--muted); margin-bottom: 8px; }
.variant-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.variant-opt {
  display: flex; align-items: center; gap: 12px;
  border: 2px solid var(--line); border-radius: 10px;
  padding: 10px 14px; cursor: pointer; background: #fff;
  transition: border-color .12s, background .12s;
}
.variant-opt:hover { border-color: var(--accent); }
.variant-opt.selected { border-color: var(--accent); background: var(--accent-soft); }
.variant-opt input { accent-color: var(--accent); flex-shrink: 0; }
.variant-opt .vo-body { flex: 1; min-width: 0; }
.variant-opt .vo-ref { display: block; font-weight: 700; font-size: 14.5px; }
.variant-opt .vo-diff { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.variant-opt .vo-price { font-weight: 600; font-size: 13.5px; color: var(--accent-dark); white-space: nowrap; }
.specs-link { display: inline-block; font-size: 13px; color: var(--accent-dark); margin-bottom: 14px; text-decoration: underline; }
table.specs tr.highlight td { background: var(--accent-soft); font-weight: 600; }

.spec-section { margin-top: 36px; }
.spec-section h2 { font-size: 18px; margin-bottom: 10px; }
.spec-table-wrap { overflow-x: auto; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
table.specs { border-collapse: collapse; width: 100%; font-size: 13.5px; }
table.specs th, table.specs td { padding: 9px 14px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.specs th { background: var(--accent-soft); color: var(--accent-dark); font-weight: 600; }
table.specs tr:last-child td { border-bottom: none; }

/* ---------- cart drawer ---------- */
.overlay {
  position: fixed; inset: 0; background: rgba(15,20,30,.4);
  opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 40;
}
.overlay.show { opacity: 1; pointer-events: auto; }
.cart-drawer {
  position: fixed; top: 0; right: -420px; width: min(400px, 92vw); height: 100vh;
  background: var(--surface); z-index: 50; box-shadow: -4px 0 24px rgba(0,0,0,.15);
  display: flex; flex-direction: column; transition: right .25s ease;
}
.cart-drawer.open { right: 0; }
.cart-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.cart-head h2 { margin: 0; font-size: 18px; }
.close-btn { background: none; border: none; font-size: 18px; color: var(--muted); }
.cart-items { flex: 1; overflow-y: auto; padding: 12px 20px; }
.cart-item { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.cart-item img { width: 56px; height: 56px; object-fit: contain; background: #fff; border-radius: 8px; border: 1px solid var(--line); }
.cart-item .ci-body { flex: 1; font-size: 14px; }
.cart-item .ci-name { font-weight: 600; }
.cart-item .ci-ref { color: var(--muted); font-size: 12.5px; }
.cart-item .ci-qty { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.cart-item .ci-qty button {
  width: 26px; height: 26px; border-radius: 6px; border: 1px solid var(--line); background: var(--bg);
}
.cart-item .remove { background: none; border: none; color: #b0392e; font-size: 13px; padding: 0; }
.cart-foot { padding: 16px 20px; border-top: 1px solid var(--line); }
.cart-foot .total-line { display: flex; justify-content: space-between; font-weight: 700; margin-bottom: 12px; }
.cart-empty { color: var(--muted); text-align: center; padding: 40px 0; }

/* ---------- checkout ---------- */
.checkout { max-width: 680px; }
.checkout h1 { font-size: 24px; }
.checkout .order-summary {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px 20px; margin-bottom: 24px; font-size: 14px;
}
.checkout .order-summary div { display: flex; justify-content: space-between; padding: 4px 0; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 18px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid label { display: block; font-size: 13.5px; color: var(--muted); margin-bottom: 4px; }
.form-grid input, .form-grid textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; font: inherit; background: #fff;
}
.notice {
  background: var(--accent-soft); color: var(--accent-dark);
  padding: 12px 16px; border-radius: 10px; font-size: 14px; margin: 18px 0;
}
.order-text {
  width: 100%; height: 220px; font-family: Consolas, monospace; font-size: 12.5px;
  border: 1px solid var(--line); border-radius: 8px; padding: 12px; background: #fff;
}

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); }
.site-footer p { max-width: 1280px; margin: 0 auto; padding: 18px 20px; color: var(--muted); font-size: 13.5px; }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--text); color: #fff; padding: 12px 22px; border-radius: 10px;
  opacity: 0; transition: all .25s; z-index: 60; font-size: 14.5px; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- mobiel & tablet ---------- */
@media (max-width: 760px) {
  .header-inner {
    flex-wrap: wrap; gap: 8px; padding: 12px 14px 10px; row-gap: 10px;
    justify-content: space-between;
  }
  /* rij 1: enkel het logo, gecentreerd */
  .logo { order: 1; flex-basis: 100%; justify-content: center; }
  .logo svg { height: 26px; }
  /* rij 2: Categorieën en iconen gelijkmatig verdeeld */
  .cats-btn { order: 2; padding: 9px 14px; font-size: 14px; }
  #accountBtn { order: 3; }
  #favBtn { order: 4; }
  #cartBtn { order: 5; }
  .cart-btn { padding: 8px 14px; }
  /* rij 3: zoekbalk over de volle breedte */
  .search-wrap { order: 6; flex-basis: 100%; }
  #searchInput { max-width: none; padding: 10px 14px; }
  /* 16px voorkomt dat smartphones automatisch inzoomen bij het typen */
  input, select, textarea { font-size: 16px; }
  /* categorieënstrook vervalt op mobiel: het uitklapmenu neemt dit over */
  .cat-nav { display: none; }
  .usp-bar { gap: 6px 18px; padding: 7px 12px; font-size: 11.5px; justify-content: center; }
  .usp-bar span:nth-child(2) { display: none; }
  #app { padding: 16px 14px 40px; }

  /* productgrid: 2 kolommen met compactere kaarten */
  .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .card .img { height: 150px; padding: 8px; }
  .card .body { padding: 10px 11px 12px; gap: 4px; }
  .card h3 { font-size: 13.5px; }
  .card .meta { font-size: 11.5px; }
  .price { font-size: 13.5px; }
  .price.on-request { font-size: 12px; }
  .badge { font-size: 10.5px; padding: 2px 6px; }
  .fav-btn { width: 30px; height: 30px; top: 6px; right: 6px; }

  /* homepage-rijen */
  .shelf-row .card { flex: 0 0 160px; }
  .home-cats { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .home-cat .hc-img { height: 96px; padding: 10px; }
  .home-cat h3 { font-size: 13.5px; }
  .hero-text > div { min-width: 0; }
  .hero h1 { font-size: 17px; }
  .hero p { font-size: 12.5px; }
  .hero-btn { padding: 9px 14px; font-size: 13px; }

  /* detailpagina */
  .pinfo h1 { font-size: 21px; }
  .buy-box { padding: 14px; }
  .variant-opt { padding: 9px 11px; }
  .vo-diff { font-size: 11.5px; }
  .form-grid { grid-template-columns: 1fr; }

  /* subcategorieën achter een Filter-knop */
  .filter-toggle {
    display: flex; align-items: center; gap: 8px;
    width: 100%; margin-bottom: 12px;
    background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
    padding: 11px 14px; font-size: 14px; color: var(--text);
  }
  .filter-toggle strong { color: var(--accent-dark); }
  .filter-toggle .ft-caret { margin-left: auto; color: var(--muted); transition: transform .15s; }
  .filter-toggle.open { border-color: var(--accent); }
  .filter-toggle.open .ft-caret { transform: rotate(180deg); }
  .subcat-row { display: none; }
  .subcat-row.open {
    display: flex; background: var(--surface); border: 1px solid var(--line);
    border-radius: 10px; padding: 12px; margin-top: -6px;
  }
}
