:root {
  /* Kleuren rechtstreeks overgenomen uit het Studio Swankie-kleurenpalet (studioswankie.be):
     Geel (primair) #FAD02C, Zwart (primair) #000000, Oker (secundair) #AB8E1E,
     Geel (secundair) #FCEAA2, en de tekstkleur #3D3D3D. --accent is een iets donkerder
     getinte oker dan het palet zelf (#AB8E1E) zodat witte knoptekst er voldoende op afsteekt
     (toegankelijkheids-contrast); --warm is wél exact het heldere geel uit je palet. */
  --bg: #fffef9;
  --surface: #ffffff;
  --text: #3d3d3d;
  --muted: #726d63;
  --line: #eae6da;
  --accent: #897218;
  --accent-dark: #786315;
  --accent-soft: #fceaa2;
  --warm: #fad02c;
  --warm-soft: #fdf3d0;
  --btn-bg: #897218;
  --btn-bg-hover: #786315;
  --danger: #b3261e;
  --ok-bg: #e7f3ec; --ok-fg: #1d5a34;
  --err-bg: #fbe9e7; --err-fg: #8c1d13;
  --info-bg: #fceaa2; --info-fg: #786315;
  --radius: 14px;
  --shadow: 0 2px 8px rgba(40, 34, 20, .06), 0 1px 2px rgba(40, 34, 20, .05);
  --shadow-lift: 0 10px 24px rgba(40, 34, 20, .12), 0 2px 6px rgba(40, 34, 20, .08);
  --font-head: 'Baloo 2', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c1a15; --surface: #262219; --text: #f1ece0; --muted: #b3ab9b; --line: #3a3426;
    --accent: #fad02c; --accent-dark: #e0b824; --accent-soft: #3a331c; --warm: #fad02c; --warm-soft: #4a4120; --danger: #f2877f;
    --btn-bg: #897218; --btn-bg-hover: #786315;
    --ok-bg: #1b3325; --ok-fg: #9fd9b4; --err-bg: #3a1f1c; --err-fg: #f4b0a9; --info-bg: #3a331c; --info-fg: #e0b824;
    --shadow: 0 2px 10px rgba(0, 0, 0, .35); --shadow-lift: 0 12px 28px rgba(0, 0, 0, .45);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
main.wrap { padding-top: 28px; padding-bottom: 56px; min-height: 60vh; }
a { color: var(--accent); }
h1, h2, h3, .brand { font-family: var(--font-head); }
h1 { font-size: 1.9rem; line-height: 1.25; margin: 0 0 14px; font-weight: 800; letter-spacing: -.2px; }
h2 { font-size: 1.2rem; margin: 0 0 8px; font-weight: 600; }
small, .muted { color: var(--muted); font-weight: 400; }
code { background: var(--line); padding: 1px 6px; border-radius: 6px; }

.site-header { background: var(--surface); box-shadow: 0 1px 0 var(--line); position: sticky; top: 0; z-index: 40; }
.site-header::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--warm));
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.25rem; text-decoration: none; color: var(--text); letter-spacing: .1px; }
.brand-logo { height: 38px; width: auto; display: block; }
/* Beheer: vaste zijbalk met gegroepeerde navigatie */
.admin-shell { display: flex; align-items: flex-start; min-height: 100vh; }
.admin-sidebar {
  width: 248px; flex: 0 0 248px; background: var(--surface); border-right: 1px solid var(--line);
  padding: 22px 16px; display: flex; flex-direction: column; gap: 20px;
  position: sticky; top: 0; align-self: flex-start; height: 100vh; overflow-y: auto;
}
.admin-brand { display: flex; align-items: center; gap: 9px; font-family: var(--font-head); font-weight: 700; font-size: 1.05rem; color: var(--text); text-decoration: none; padding: 0 8px; }
.admin-brand .brand-logo { height: 28px; }
.admin-sidebar-sub { margin: -14px 0 0; padding: 0 8px; font-size: .7rem; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.admin-nav { display: flex; flex-direction: column; gap: 20px; flex: 1; }
.admin-nav-groep { display: flex; flex-direction: column; gap: 2px; }
.admin-nav-label { margin: 0 0 4px; padding: 0 10px; font-size: .7rem; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.admin-nav-link { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; color: var(--text); text-decoration: none; font-size: .93rem; font-weight: 600; transition: background .15s ease, color .15s ease; }
.admin-nav-link:hover { background: var(--bg); }
.admin-nav-link.active { background: var(--accent-soft); color: var(--accent-dark); }
.admin-nav-icon { width: 19px; height: 19px; flex: 0 0 auto; }
.admin-logout-form { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); }
.admin-logout-form .linkbtn { display: block; width: 100%; text-align: left; padding: 9px 10px; border-radius: 10px; font-weight: 600; text-decoration: none; }
.admin-logout-form .linkbtn:hover { background: var(--bg); }
.admin-main { flex: 1; min-width: 0; }

/* Beheer-dashboard: statistiekentegels + overzichtstabel per vereniging */
.stat-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); border-top: 3px solid var(--line); }
.stat-tile.accent-1 { border-top-color: var(--accent); }
.stat-tile.accent-2 { border-top-color: var(--ok-fg); }
.stat-tile.accent-3 { border-top-color: var(--warm); }
.stat-tile .stat-label { margin: 0 0 8px; font-size: .78rem; letter-spacing: .03em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.stat-tile .stat-value { font-family: var(--font-head); font-size: 2rem; font-weight: 800; line-height: 1; }
.stat-tile .stat-sub { margin: 6px 0 0; font-size: .82rem; color: var(--muted); }

@media (max-width: 860px) {
  .admin-shell { flex-direction: column; }
  .admin-sidebar {
    position: relative; top: auto; height: auto; width: 100%; flex: none;
    flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px 18px;
    border-right: 0; border-bottom: 1px solid var(--line);
  }
  .admin-sidebar-sub { display: none; }
  .admin-nav { flex-direction: row; flex-wrap: wrap; gap: 6px 16px; }
  .admin-nav-groep { flex-direction: row; align-items: center; gap: 4px; }
  .admin-nav-label { display: none; }
  .admin-logout-form { margin: 0 0 0 auto; padding: 0; border-top: 0; }
  .admin-logout-form .linkbtn { padding: 6px 10px; }
}

.header-right { display: flex; align-items: center; gap: 14px; }
.vereniging-naam { font-weight: 600; font-size: .92rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 420px; }
.cart-icon { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; color: var(--text); text-decoration: none; transition: background .15s ease; flex: 0 0 auto; }
.cart-icon:hover { background: var(--accent-soft); }
.cart-icon svg { width: 22px; height: 22px; }
.cart-badge { position: absolute; top: -2px; right: -2px; background: var(--btn-bg); color: #fff; font-size: .68rem; font-weight: 700; line-height: 1; min-width: 17px; height: 17px; border-radius: 99px; display: flex; align-items: center; justify-content: center; padding: 0 3px; }
.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; padding: 24px 0; }
.footer-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; }
.footer-links { display: flex; align-items: center; gap: 18px; }
.footer-links a { color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--accent); text-decoration: underline; }
.footer-instagram { display: inline-flex; align-items: center; gap: 6px; }
.footer-instagram svg { width: 17px; height: 17px; flex: 0 0 auto; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin-bottom: 20px; box-shadow: var(--shadow); }
.card.narrow { max-width: 520px; margin-left: auto; margin-right: auto; }
.card.danger { border-color: var(--danger); }

.stack { display: flex; flex-direction: column; gap: 16px; }
label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: .95rem; }
label small { font-weight: 400; }
label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=datetime-local], input[type=tel], input[type=search], input[type=url], select, textarea {
  width: 100%; padding: 10px 12px; font: inherit; color: var(--text);
  background: var(--bg); border: 1px solid var(--line); border-radius: 9px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin: 0; display: flex; flex-direction: column; gap: 14px; }
legend { font-weight: 700; padding: 0 6px; font-family: var(--font-head); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.btn {
  display: inline-block; background: var(--btn-bg); color: #fff; border: 0; border-radius: 10px;
  padding: 11px 22px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; text-align: center;
  box-shadow: 0 2px 6px rgba(137, 114, 24, .3); transition: background .15s ease, transform .15s ease, box-shadow .15s ease;
}
.btn:hover { background: var(--btn-bg-hover); transform: translateY(-1px); box-shadow: 0 6px 14px rgba(137, 114, 24, .35); }
.btn-light { background: transparent; color: var(--accent); border: 1px solid var(--accent); box-shadow: none; }
.btn-light:hover { background: var(--accent-soft); transform: none; box-shadow: none; }
.btn-danger { background: var(--danger); box-shadow: 0 2px 6px rgba(179, 38, 30, .25); }
.btn-danger:hover { filter: brightness(.92); background: var(--danger); }
.btn-sm { padding: 6px 14px; font-size: .9rem; border-radius: 8px; }

/* Icoon-knoppen voor rij-acties in tabellen (bv. Producten/Bewerken bij een vereniging) */
.icon-btn-set { display: flex; gap: 8px; align-items: center; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 8px; flex: 0 0 auto;
  background: transparent; color: var(--accent); border: 1px solid var(--accent);
  text-decoration: none; cursor: pointer; transition: background .15s ease, color .15s ease;
}
.icon-btn:hover { background: var(--accent-soft); }
.icon-btn-danger { color: var(--danger); border-color: var(--danger); }
.icon-btn-danger:hover { background: var(--err-bg); }
.icon-btn-svg { width: 16px; height: 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; cursor: pointer; text-decoration: underline; }
form.inline { display: inline; margin: 0; }

.flash { padding: 12px 14px; border-radius: 10px; margin: 0 0 14px; }
.flash.ok { background: var(--ok-bg); color: var(--ok-fg); }
.flash.err { background: var(--err-bg); color: var(--err-fg); }
.flash.info { background: var(--info-bg); color: var(--info-fg); }

.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.row-between h1 { margin: 0; }

/* Publieke catalogus */
.intro { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 28px 24px; margin-bottom: 28px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.intro::after { content: ""; position: absolute; left: 28px; bottom: 20px; width: 56px; height: 4px; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--warm)); }
.intro h1 { margin-bottom: 10px; }
.intro .lead { font-size: 1.08rem; color: var(--muted); max-width: 70ch; margin: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 22px; margin-top: 8px; }
.product { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow); transition: transform .18s ease, box-shadow .18s ease; }
.product:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); }
.product .mainimg, .product .noimg { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; display: block; background: var(--surface); }
.product .noimg { display: grid; place-items: center; color: var(--muted); background: var(--bg); }
.gallery { display: flex; flex-direction: column; background: var(--bg); }
.thumbs { display: flex; gap: 6px; padding: 8px 8px 0; flex-wrap: wrap; background: var(--surface); }
.thumbbtn { padding: 0; border: 2px solid transparent; border-radius: 8px; background: none; cursor: pointer; line-height: 0; transition: border-color .15s ease; }
.thumbbtn img { width: 42px; height: 42px; object-fit: contain; background: var(--bg); border-radius: 6px; display: block; }
.thumbbtn.active, .thumbbtn:hover { border-color: var(--accent); }
.pbody { padding: 18px; display: flex; flex-direction: column; gap: 7px; flex: 1; }
.pbody p { margin: 0; }
.pbody .tile-desc { font-size: .92rem; color: var(--muted); max-width: none; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.pbody .opt { font-size: .92rem; color: var(--muted); }
.pbody .tag { align-self: flex-start; }
.pbody h2 a { color: inherit; text-decoration: none; }
.pbody h2 a:hover { color: var(--accent); text-decoration: underline; }
.meerinfo { font-size: .92rem; font-weight: 600; }
.price { display: inline-block; align-self: flex-start; font-size: 1.05rem; font-weight: 700; color: var(--accent-dark); background: var(--accent-soft); padding: 4px 11px; border-radius: 99px; }
.mainimg-link, .noimg-link { display: block; text-decoration: none; color: inherit; }
.note { color: var(--muted); margin-top: 24px; text-align: center; }
.cartbar { margin: 4px 0 0; }

/* Productpagina (detail) */
.productlayout { display: grid; grid-template-columns: 3fr 2fr; gap: 32px; align-items: start; }
.productgallery .mainimg-big, .productgallery .noimg-big {
  width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); display: block; cursor: zoom-in;
}
.productgallery .noimg-big { display: grid; place-items: center; color: var(--muted); background: var(--bg); cursor: default; }
.productgallery .thumbs-row { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.productinfo .tag { margin-bottom: 4px; }
.productinfo .price { font-size: 1.3rem; margin: 6px 0 14px; }
.productinfo .section { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); }
.productinfo .section h3 { font-family: var(--font-head); font-size: 1.05rem; margin: 0 0 10px; }
.maattabel-trigger { margin-top: 26px; }

/* Opgemaakte tekst (korte/productbeschrijving, technische info) — sanitized HTML, zie app/htmlopmaak.php */
.opmaaktekst { line-height: 1.65; max-width: 68ch; }
.opmaaktekst p { margin: 0 0 .8em; }
.opmaaktekst p:last-child { margin-bottom: 0; }
.opmaaktekst ul, .opmaaktekst ol { margin: 0 0 .8em; padding-left: 1.4em; }
.opmaaktekst h2, .opmaaktekst h3 { font-family: var(--font-head); margin: .9em 0 .4em; }
.opmaaktekst blockquote { margin: 0 0 .8em; padding-left: 14px; border-left: 3px solid var(--line); color: var(--muted); font-style: italic; }
.opmaaktekst a { text-decoration: underline; }

/* Lightbox (volledige foto) en maattabel-popup */
.lightbox-overlay, .modal-overlay { position: fixed; inset: 0; background: rgba(20, 16, 6, .82); display: none; align-items: center; justify-content: center; z-index: 100; padding: 24px; }
.modal-overlay { background: rgba(20, 16, 6, .55); }
.lightbox-overlay.open, .modal-overlay.open { display: flex; }
.lightbox-overlay img { max-width: 92vw; max-height: 88vh; object-fit: contain; border-radius: 8px; background: #fff; }
.lightbox-close { position: absolute; top: 18px; right: 22px; background: rgba(255, 255, 255, .15); color: #fff; border: 0; width: 40px; height: 40px; border-radius: 50%; font-size: 1.4rem; line-height: 1; cursor: pointer; }
.lightbox-close:hover { background: rgba(255, 255, 255, .3); }
.modal-card { position: relative; background: var(--surface); border-radius: var(--radius); padding: 26px; max-width: 580px; width: 100%; max-height: 85vh; overflow: auto; box-shadow: var(--shadow-lift); }
.modal-card h2 { margin-top: 0; }
.modal-close { position: absolute; top: 12px; right: 12px; background: var(--line); color: var(--text); border: 0; width: 32px; height: 32px; border-radius: 50%; font-size: 1.1rem; line-height: 1; cursor: pointer; }
.modal-close:hover { background: var(--accent-soft); }
.maattabel-modal table { width: 100%; border-collapse: collapse; margin-top: 6px; }
.maattabel-modal th, .maattabel-modal td { padding: 8px 10px; text-align: center; border-bottom: 1px solid var(--line); }
.maattabel-modal th:first-child, .maattabel-modal td:first-child { text-align: left; }
.maattabel-modal .notities { margin-top: 16px; font-size: .85rem; color: var(--muted); white-space: pre-line; }

/* Winkelmandje / bestelformulier */
.addform { margin-top: auto; padding-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.opt-input { display: flex; flex-direction: column; gap: 4px; font-size: .9rem; font-weight: 600; }
.opt-input select, .opt-input input { padding: 8px 10px; }
.addrow { display: flex; gap: 10px; align-items: center; }
.addrow .btn { flex: 1; }
input.qty, td input[type=number] { width: 68px; flex: 0 0 auto; padding: 8px; }
.summary { padding-left: 20px; margin: 10px 0; }
.summary li { margin-bottom: 4px; }

/* Beheer */
.tablewrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; table-layout: auto; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
td.nowrap, th.nowrap { white-space: nowrap; }
th { font-size: .85rem; color: var(--muted); font-weight: 600; }
tr:last-child td { border-bottom: 0; }
tr:hover td { background: var(--bg); }
td.actions { white-space: nowrap; display: flex; gap: 14px; align-items: center; }
td.thumb img { width: 48px; height: 48px; object-fit: cover; border-radius: 8px; display: block; }
.tag { display: inline-block; font-size: .78rem; padding: 2px 8px; border-radius: 99px; background: var(--line); color: var(--muted); }
.tag.ok { background: var(--ok-bg); color: var(--ok-fg); }
.tag.off { background: var(--err-bg); color: var(--err-fg); }
img.preview { max-width: 220px; border-radius: 10px; border: 1px solid var(--line); }

/* Opmaakveld (rich text) in het beheer */
.richtext { border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.richtoolbar { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px; background: var(--bg); border-bottom: 1px solid var(--line); }
.richtoolbar button { font: inherit; font-size: .82rem; font-weight: 600; padding: 5px 9px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--text); cursor: pointer; }
.richtoolbar button:hover { background: var(--accent-soft); border-color: var(--accent); }
.richeditor { min-height: 90px; padding: 10px 12px; background: var(--surface); outline: none; line-height: 1.55; }
.richeditor:focus { box-shadow: inset 0 0 0 2px var(--accent-soft); }
.richeditor p { margin: 0 0 .6em; }
.richeditor p:last-child { margin-bottom: 0; }
.richeditor ul, .richeditor ol { margin: 0 0 .6em; padding-left: 1.4em; }
textarea.richsource { display: none; }

.optrow { display: grid; grid-template-columns: 1.2fr 1fr 1.6fr auto auto; gap: 10px; align-items: center; margin-bottom: 10px; }
.maatrij { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 10px; align-items: center; margin-bottom: 10px; }

.imgrow, .imgrow-new { display: grid; grid-template-columns: auto 1fr auto auto; gap: 10px; align-items: center; margin-bottom: 10px; }
.imgrow-new { grid-template-columns: 1fr 1fr auto; }
.preview-sm { width: 48px; height: 48px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); display: block; }

.filterbar { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.filterbar label { flex: 1 1 160px; min-width: 140px; }
.filterbar label.zoekveld { flex: 2 1 220px; }
.filterbar .filteractions { display: flex; gap: 10px; flex: 0 0 auto; }

@media (max-width: 720px) {
  .two { grid-template-columns: 1fr; }
  .optrow, .imgrow, .imgrow-new, .maatrij { grid-template-columns: 1fr; padding: 12px; border: 1px solid var(--line); border-radius: 10px; }
  h1 { font-size: 1.5rem; }
  .intro { padding: 22px 20px 20px; }
  .vereniging-naam { max-width: 150px; font-size: .82rem; }
  .productlayout { grid-template-columns: 1fr !important; }
}
