/* ── Emondt Materiaalapp — artikelen.css ────────────────── */

#tab-artikelen { padding-top: 0; }

/* ═══ ARTIKEL TOP ═══════════════════════════════════════════ */
.artikel-top { padding: 14px 0 0; }
.zoek-filter-rij { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }

/* ═══ ZOEKBALK ══════════════════════════════════════════════ */
.search-box {
  flex: 1; display: flex; align-items: center; gap: 10px;
  background: var(--surface2);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius); padding: 0 14px;
  transition: border-color .2s;
}
.search-box:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px rgba(174,195,54,.12), var(--elev-1); }
.search-box svg { color: var(--muted); flex-shrink: 0; width: 18px; height: 18px; }
.search-box input {
  flex: 1; border: none; background: transparent;
  font-family: 'Inter', 'DM Sans', sans-serif;
  font-size: .95rem; color: var(--text);
  padding: 13px 0; outline: none;
}
.search-box input::placeholder { color: var(--muted); }

/* ═══ FILTER KNOP ═══════════════════════════════════════════ */
.filter-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 50px; height: 50px; flex-shrink: 0;
  background: var(--surface2);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius);
  font-family: 'Inter', 'DM Sans', sans-serif;
  font-size: .85rem; font-weight: 600; color: var(--text-secondary);
  cursor: pointer; transition: all .15s;
}
.filter-btn #filter-btn-label { display: none; }
.filter-btn:active { transform: scale(.97); }
.filter-btn.actief {
  background: var(--green-dim);
  border-color: var(--green-border);
  color: var(--green);
}


/* ═══ ACTIEF FILTER LABEL ═══════════════════════════════════ */
#actief-filter-label { padding: 2px 0 6px; gap: 4px; flex-wrap: wrap; align-items: center; }

/* ═══ WEERGAVE TOGGLE ════════════════════════════════════════ */
.weergave-rij {
  display: flex; align-items: center;
  justify-content: space-between; padding: 8px 0 12px;
}
.weergave-btns { display: flex; gap: 4px; }
.weergave-btn {
  width: 34px; height: 34px;
  border: 1.5px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface2); color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all .15s;
}
.weergave-btn.active { background: var(--green); border-color: var(--green); color: #000; }
.weergave-btn:active { transform: scale(.93); }

/* ═══ CATEGORIE LABELS ═══════════════════════════════════════ */
.cat-label {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 14px; margin: 0 0 4px;
  font-size: .8rem; font-weight: 700; color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: .08em;
}
.cat-label span:last-child,
.subcat-label span:last-child,
.subsubcat-label span:last-child {
  transition: transform .22s ease;
}

.subcat-label {
  background: transparent;
  border-left: 2px solid var(--green-border);
  padding: 7px 12px 7px 16px; margin: 0 0 3px;
  font-size: .8rem; font-weight: 600; color: var(--text-secondary);
  display: flex; align-items: center; gap: 6px;
}

.subsubcat-label {
  border-left: 2px solid var(--border-strong);
  padding: 5px 12px 5px 24px; margin: 0 0 2px;
  font-size: .76rem; font-weight: 500; color: var(--muted);
  display: flex; align-items: center; gap: 6px;
}

/* ═══ FILTER SHEET RIJEN ═════════════════════════════════════ */
.filter-rij {
  display: flex; align-items: center;
  padding: 12px 18px; cursor: pointer;
  transition: background .15s; gap: 12px;
  border-bottom: 1px solid var(--border);
}
.filter-rij:last-child { border-bottom: none; }
.filter-rij:active { background: var(--surface2); }
.filter-rij.actief { background: var(--green-dim); }
.filter-rij-ico { display: none; }
.filter-rij-tekst { flex: 1; }
.filter-rij-naam { font-size: .9rem; font-weight: 600; color: var(--text); }
.filter-rij-aantal { font-size: .74rem; color: var(--muted); margin-top: 1px; }
.filter-rij-arrow { color: var(--muted); font-size: .82rem; flex-shrink: 0; }
.filter-rij.actief .filter-rij-naam { color: var(--green); }
.filter-rij.actief .filter-rij-arrow { color: var(--green); }

/* ═══ ARTIKEL GRID ══════════════════════════════════════════ */
.artikel-grid { display: flex; flex-direction: column; gap: 8px; }

.artikel-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 14px 12px;
  display: flex; flex-direction: column; gap: 10px;
  transition: border-color .2s, background .2s, box-shadow .22s ease, transform .18s ease;
  position: relative; cursor: pointer;
  box-shadow: var(--elev-2);
}
.artikel-card:active { background: var(--surface2); box-shadow: var(--elev-1); transform: scale(.99); }
.artikel-card.selected {
  border-color: var(--green-border);
  background: var(--green-light);
  box-shadow: var(--shadow-card-selected);
}
.artikel-card.selected:not(:active) { transform: translateY(-1px); }
.artikel-card.selected::before {
  content: ''; position: absolute; top: 0; left: 0; bottom: 0; width: 3px;
  background: var(--green);
  border-radius: var(--radius) 0 0 var(--radius);
}

.artikel-top-rij { display: flex; align-items: flex-start; gap: 12px; }

.artikel-img {
  width: 50px; height: 50px; border-radius: 10px;
  background: var(--surface2); border: 1px solid var(--border-strong);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; overflow: hidden;
}
.artikel-img img { width: 100%; height: 100%; object-fit: cover; border-radius: 9px; }
.artikel-card.selected .artikel-img { border-color: var(--green-border); }

.artikel-body { flex: 1; min-width: 0; }
.artikel-naam {
  font-size: .95rem; font-weight: 700;
  color: var(--text); line-height: 1.35; word-break: break-word;
}
.artikel-link-btn {
  display: inline-flex; align-items: center; justify-content: center;
  margin-left: 6px; font-size: .75rem; font-weight: 700;
  color: #000; background: var(--green);
  border-radius: 4px; padding: 2px 6px; text-decoration: none;
  vertical-align: middle; line-height: 1.4; transition: opacity .15s;
}
.artikel-link-btn:hover { opacity: .85; }

.artikel-details { margin-top: 6px; display: flex; flex-direction: column; gap: 3px; }
.artikel-detail-rij { font-size: .75rem; color: var(--muted); display: flex; gap: 4px; }
.artikel-detail-label { min-width: 72px; font-weight: 600; color: var(--muted); opacity: .8; }
.artikel-detail-val { font-family: 'DM Mono', monospace; color: var(--text-secondary); font-size: .74rem; }
.artikel-meta { font-size: .76rem; color: var(--muted); font-family: 'DM Mono', monospace; }

.artikel-warning-tag {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--warning-bg); border: 1px solid rgba(245,158,11,.3);
  border-radius: 6px; padding: 4px 10px; margin-top: 4px;
  font-size: .75rem; font-weight: 600; color: var(--warning);
}

/* ═══ QTY CONTROL ════════════════════════════════════════════ */
.qty-wrap { display: flex; align-items: center; gap: 8px; width: 100%; }
.qty-btn {
  width: 44px; height: 44px;
  background: var(--surface2);
  border: 1.5px solid var(--border-strong);
  color: var(--text); font-size: 1.3rem; font-weight: 700;
  cursor: pointer; transition: all .15s;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm); flex-shrink: 0;
}
.qty-btn:active { background: var(--green); color: #000; border-color: var(--green); transform: scale(.92); box-shadow: var(--glow-green-sm); }
.artikel-card.selected .qty-btn { border-color: var(--green-border); }

.qty-val {
  flex: none; height: 44px; text-align: center; padding: 0 6px;
  border: 1.5px solid var(--border-strong); border-radius: var(--radius-sm);
  font-family: 'Inter', 'DM Sans', sans-serif;
  font-size: 1.1rem; font-weight: 700;
  color: var(--text); background: var(--surface2); outline: none;
  cursor: text; min-width: 44px; width: 3ch;
  -moz-appearance: textfield; transition: border-color .15s;
}
.qty-val::-webkit-inner-spin-button, .qty-val::-webkit-outer-spin-button { -webkit-appearance: none; }
.qty-val:focus { border-color: var(--green); background: var(--surface3); box-shadow: 0 0 0 2px rgba(174,195,54,.16); }
.artikel-card.selected .qty-val { border-color: var(--green-border); }

/* ═══ INFO KNOP + VERPAKKING POPUP ══════════════════════════ */
.artikel-info-btn {
  width: 28px; height: 28px; border-radius: 50%;
  border: 1.5px solid var(--border-strong); background: var(--surface2);
  color: var(--muted); font-size: .75rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0; transition: all .15s;
  font-family: 'Inter', 'DM Sans', sans-serif; line-height: 1;
}
.artikel-info-btn:active { background: var(--green); color: #000; border-color: var(--green); }

.verpakking-popup {
  position: absolute; bottom: calc(100% + 8px); left: 0; right: 0;
  background: var(--surface3);
  border: 1px solid var(--border-strong);
  color: var(--text);
  font-size: .84rem; padding: 12px 14px;
  border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
  z-index: 50; line-height: 1.6;
}
.verpakking-popup::after {
  content: ''; position: absolute; top: 100%; left: 24px;
  border: 6px solid transparent;
  border-top-color: var(--surface3);
}
.verpakking-link {
  display: inline-flex; align-items: center; gap: 5px;
  margin-top: 8px; color: var(--green);
  font-size: .8rem; font-weight: 600; text-decoration: none;
}

/* ═══ MODUS A — compacte rij ═════════════════════════════════ */
.artikel-card.card-a {
  flex-direction: row; align-items: center;
  padding: 9px 12px; gap: 10px; min-height: 0;
}
.card-a-body { flex: 1; min-width: 0; }
.card-a-body .artikel-naam { font-size: .88rem; }
.card-a-meta {
  display: flex; flex-wrap: wrap; gap: 0 5px; margin-top: 1px;
  font-size: .69rem; color: var(--muted);
}
.card-a-meta span { white-space: nowrap; }

/* ═══ MODUS B — rijke kaart ══════════════════════════════════ */
.artikel-card.card-b { padding: 0; flex-direction: column; }
.card-b-header {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px 10px;
}
.card-b-meta { font-size: .71rem; color: var(--muted); margin-top: 3px; }
.card-b-details {
  font-size: .78rem; color: var(--text-secondary);
  margin-top: 6px; line-height: 1.5;
}
.card-b-fav {
  flex-shrink: 0; width: 30px; height: 30px;
  background: none; border: 1.5px solid var(--border-strong);
  border-radius: 8px; cursor: pointer; font-size: 1rem;
  color: var(--muted); display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.card-b-fav.actief { color: #f59e0b; border-color: rgba(245,158,11,.4); background: rgba(245,158,11,.08); }
.card-b-link {
  display: flex; align-items: center; gap: 6px;
  margin: 0 14px 10px;
  background: var(--surface2); border: 1px solid var(--border-strong);
  border-radius: 8px; padding: 6px 10px;
  text-decoration: none; color: var(--text-secondary);
  font-size: .74rem; font-weight: 600; transition: border-color .12s;
  width: fit-content;
}
.card-b-link:active { border-color: var(--green); color: var(--green); }
.card-b-footer {
  display: flex; align-items: center; justify-content: space-between;
  border-top: 1px solid var(--border);
  padding: 8px 14px;
  background: var(--surface2);
  border-radius: 0 0 var(--radius) var(--radius);
}
.artikel-card.card-b.selected .card-b-footer { background: var(--green-light); border-color: var(--green-border); }

/* ═══ MODUS C — compact raster ═══════════════════════════════ */
.artikel-grid.modus-c .artikel-blok,
.modus-c.artikel-blok {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.artikel-card.card-c { padding: 0; flex-direction: column; min-height: 86px; }
.card-c-body { flex: 1; min-width: 0; padding: 10px 10px 6px; }
.card-c-naam { font-size: .82rem !important; line-height: 1.3; }
.card-c-meta { font-size: .65rem; color: var(--muted); margin-top: 2px; }
.card-c-footer {
  display: flex; align-items: center; gap: 3px;
  padding: 5px 8px 8px;
  border-top: 1px solid var(--border);
}
.artikel-card.card-c.selected .card-c-footer { border-color: var(--green-border); }

/* ═══ WARN BADGE ═════════════════════════════════════════════ */
.warn-badge { font-size: .66rem; color: #f59e0b; font-weight: 700; }

/* ═══ K1 KNOPPEN (compact artikel controls) ══════════════════ */
.k1-qty {
  display: flex; align-items: center; gap: 4px;
  flex-shrink: 0;
}
.k1-btn {
  width: 32px; height: 32px;
  background: var(--surface2);
  border: 1.5px solid var(--border-strong);
  border-radius: 8px;
  color: var(--text); font-size: 1.1rem; font-weight: 700;
  cursor: pointer; transition: all .2s cubic-bezier(0.34,1.56,0.64,1);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; line-height: 1;
}
.k1-btn:active { background: var(--green); color: #000; border-color: var(--green); transform: scale(.82); box-shadow: var(--glow-green-sm); }
.artikel-card.selected .k1-btn { border-color: var(--green-border); }
.k1-info {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--surface2); border: 1.5px solid var(--border-strong);
  color: var(--muted); font-size: .76rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0; transition: all .12s;
  line-height: 1; font-style: italic;
}
.k1-info:active { background: var(--green); color: #000; border-color: var(--green); }

/* ═══ CART ITEMS ═════════════════════════════════════════════ */
.cart-items-wrap { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.cart-item {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}
.cart-badge {
  min-width: 28px; height: 28px; border-radius: 8px;
  background: var(--green-dim); border: 1px solid var(--green-border);
  color: var(--green); font-size: .8rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.cart-info { flex: 1; min-width: 0; }
.cart-naam { font-size: .88rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart-code { font-size: .72rem; color: var(--muted); font-family: 'DM Mono', monospace; margin-top: 1px; }
.cart-qty-btn {
  width: 30px; height: 30px;
  border: 1.5px solid var(--border-strong); border-radius: 7px;
  background: var(--surface2); color: var(--text);
  font-size: 1rem; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .12s; flex-shrink: 0;
}
.cart-qty-btn:active { background: var(--green); color: #000; border-color: var(--green); }
.cart-qty-input {
  height: 30px; text-align: center;
  border: 1.5px solid var(--border-strong); border-radius: 7px;
  font-family: 'Inter', 'DM Sans', sans-serif; font-size: .85rem; font-weight: 700;
  color: var(--text); background: var(--surface2); outline: none;
  -moz-appearance: textfield; min-width: 34px; padding: 0 4px;
}
.cart-qty-input::-webkit-inner-spin-button,
.cart-qty-input::-webkit-outer-spin-button { -webkit-appearance: none; }
.del-btn {
  width: 30px; height: 30px; border-radius: 7px; flex-shrink: 0;
  background: none; border: 1.5px solid transparent;
  color: var(--muted); cursor: pointer; display: flex;
  align-items: center; justify-content: center; transition: all .12s;
}
.del-btn:active { background: var(--danger-light); color: var(--danger); border-color: rgba(252,104,104,.3); }

/* ═══ CART SAMENVATTING ══════════════════════════════════════ */
.s-row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 6px 0; border-bottom: 1px solid var(--border);
  font-size: .84rem;
}
.s-row:last-child { border-bottom: none; }
.s-row span:first-child { color: var(--muted); }
.s-row span:last-child { color: var(--text); font-weight: 600; text-align: right; max-width: 60%; }
.s-row.total { padding-top: 10px; margin-top: 2px; }
.s-row.total span:first-child { color: var(--text); font-weight: 700; }
.s-row.total span:last-child { color: var(--green); font-size: .95rem; font-weight: 700; }

/* ═══ LEVERDATUM KNOPPEN ═════════════════════════════════════ */
#lev-zsm-btn, #lev-datum-btn {
  transition: background .15s, color .15s, border-color .15s;
}
#lev-zsm-btn.actief, #lev-datum-btn.actief {
  background: var(--green-dim) !important;
  color: var(--green) !important;
  border-color: var(--green-border) !important;
}

/* ═══ ARTIKEL LIJST STAGGER ══════════════════════════════════ */
@keyframes artikelIn {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}
.artikel-blok .artikel-card,
.artikel-grid > .artikel-card {
  animation: artikelIn .28s cubic-bezier(0.32,0.72,0,1) both;
}
.artikel-blok .artikel-card:nth-child(1),  .artikel-grid > .artikel-card:nth-child(1)  { animation-delay: 0ms; }
.artikel-blok .artikel-card:nth-child(2),  .artikel-grid > .artikel-card:nth-child(2)  { animation-delay: 25ms; }
.artikel-blok .artikel-card:nth-child(3),  .artikel-grid > .artikel-card:nth-child(3)  { animation-delay: 50ms; }
.artikel-blok .artikel-card:nth-child(4),  .artikel-grid > .artikel-card:nth-child(4)  { animation-delay: 75ms; }
.artikel-blok .artikel-card:nth-child(5),  .artikel-grid > .artikel-card:nth-child(5)  { animation-delay: 100ms; }
.artikel-blok .artikel-card:nth-child(6),  .artikel-grid > .artikel-card:nth-child(6)  { animation-delay: 125ms; }
.artikel-blok .artikel-card:nth-child(7),  .artikel-grid > .artikel-card:nth-child(7)  { animation-delay: 150ms; }
.artikel-blok .artikel-card:nth-child(8),  .artikel-grid > .artikel-card:nth-child(8)  { animation-delay: 175ms; }
.artikel-blok .artikel-card:nth-child(9),  .artikel-grid > .artikel-card:nth-child(9)  { animation-delay: 200ms; }
.artikel-blok .artikel-card:nth-child(n+10), .artikel-grid > .artikel-card:nth-child(n+10) { animation-delay: 225ms; }
