/* NetzwerkBOX MODAL — clean rewrite. Matches the .liquid intent:
   header (mode + close), centered 3D box, search row with cycling-color
   filter, slot sidebar, results carousel below, AGB + Fertige-Boxen links
   anchored at the bottom. */

.nbm {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: stretch; justify-content: center;
  animation: nbmFade .25s ease both;
}
@keyframes nbmFade { from { opacity: 0; } to { opacity: 1; } }

.nbm__bg {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  cursor: pointer;
}

.nbm__dialog {
  position: relative;
  width: 100%;
  height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 0;
  padding: 18px 28px 14px;
  background:
    radial-gradient(1100px 700px at 50% 0%, rgba(249,230,59,0.04), transparent 60%),
    radial-gradient(900px 600px at 90% 80%, rgba(59,192,249,0.04), transparent 60%),
    radial-gradient(800px 500px at 10% 80%, rgba(188,65,147,0.04), transparent 60%),
    #0a0a08;
  color: #f3f3ec;
  animation: nbmSlide .35s cubic-bezier(.2,.7,.3,1) both;
}
@keyframes nbmSlide { from { transform: translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }

.nbm--bright .nbm__dialog {
  background:
    radial-gradient(1100px 700px at 50% 0%, rgba(249,230,59,0.18), transparent 60%),
    radial-gradient(900px 600px at 90% 80%, rgba(59,192,249,0.12), transparent 60%),
    #f3f3ee;
  color: #131310;
}

/* HEADER ROW */
.nbm__header {
  display: flex; justify-content: space-between; align-items: center;
  padding-bottom: 12px;
}
.nbm__brand { display: flex; align-items: center; gap: 12px; }
.nbm__brand-pill {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.nbm--bright .nbm__brand-pill {
  background: rgba(0,0,0,0.06); border-color: rgba(0,0,0,0.1); color: #131310;
}
.nbm__icon-btn {
  width: 40px; height: 40px;
  border: 0; background: transparent;
  color: rgba(255,255,255,0.55);
  cursor: pointer; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  position: relative;
  transition: background .15s ease, color .15s ease;
}
.nbm__icon-btn:hover { background: rgba(255,255,255,0.08); color: white; }
.nbm--bright .nbm__icon-btn { color: rgba(0,0,0,0.5); }
.nbm--bright .nbm__icon-btn:hover { background: rgba(0,0,0,0.06); color: #131310; }
.nbm__tooltip {
  position: absolute; top: 100%; left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: #131310; color: white;
  font-size: 11px; padding: 4px 8px; border-radius: 4px;
  pointer-events: none; opacity: 0;
  transition: opacity .2s ease;
  white-space: nowrap;
}
.nbm__icon-btn:hover .nbm__tooltip { opacity: 1; }

/* CONTENT — split into 3D box + sidebar */
.nbm__content {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) 380px;
  gap: 24px;
  min-height: 0;
}
.nbm__left {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto auto;
  gap: 16px;
  min-width: 0; min-height: 0;
}

/* 3D BOX */
.nbm__box {
  display: flex; align-items: center; justify-content: center;
  min-height: 0;
  position: relative;
}
.nbm__box > div { width: 100%; height: 100%; max-height: 640px; }
.nbm__box canvas {
  filter: drop-shadow(0 30px 80px rgba(0,0,0,0.6));
}

/* SEARCH ROW — input + cycling-color filter button */
.nbm__searchrow {
  position: relative;
  display: flex;
  max-width: 580px;
  width: 100%;
  margin: 0 auto;
  align-items: stretch;
}
.nbm__search {
  flex: 1;
  height: 52px;
  border: 0;
  border-radius: 4px 0 0 4px;
  background: rgba(255,255,255,0.06);
  color: white;
  padding: 0 18px;
  font-size: 14px;
  outline: none;
}
.nbm--bright .nbm__search { background: white; color: #131310; }
.nbm__search::placeholder { color: rgba(255,255,255,0.4); }
.nbm--bright .nbm__search::placeholder { color: rgba(0,0,0,0.4); }

.nbm__filter {
  height: 52px;
  padding: 0 22px;
  background: #131310;
  color: white;
  border: 0;
  border-radius: 0 56px 56px 0;
  display: inline-flex; align-items: center; gap: 10px;
  cursor: pointer;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 500;
  position: relative;
  z-index: 2;
  animation: nbmCycle 8s linear infinite;
  transition: opacity .15s ease;
}
.nbm__filter:hover { opacity: 0.85; }
@keyframes nbmCycle {
  0%   { box-shadow: inset 0 0 0 2px #F9E63B; }
  33%  { box-shadow: inset 0 0 0 2px #BC4193; }
  66%  { box-shadow: inset 0 0 0 2px #3BC0F9; }
  100% { box-shadow: inset 0 0 0 2px #F9E63B; }
}

/* DROPDOWN — opens beneath the search row */
.nbm__drop {
  position: absolute;
  left: 0; right: 0; top: 60px;
  margin: 0 auto;
  max-width: 580px;
  background: rgba(20,20,18,0.96);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 4px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  padding: 0;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: max-height .35s ease, opacity .25s ease, transform .2s ease;
  z-index: 5;
}
.nbm__drop.is-open {
  max-height: 380px;
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
.nbm--bright .nbm__drop { background: white; border-color: rgba(0,0,0,0.08); }

.nbm__drop-section { padding: 14px 18px; border-bottom: 1px solid rgba(255,255,255,0.06); }
.nbm--bright .nbm__drop-section { border-color: rgba(0,0,0,0.06); }
.nbm__drop-section:last-child { border-bottom: 0; }

.nbm__drop-h {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 10px;
  font-size: 12px;
  color: rgba(255,255,255,0.6);
}
.nbm--bright .nbm__drop-h { color: rgba(0,0,0,0.55); }
.nbm__drop-rs {
  background: transparent; border: 0; cursor: pointer;
  color: rgba(255,255,255,0.4); font-size: 14px;
  padding: 4px;
}
.nbm__drop-rs:hover { color: white; }
.nbm--bright .nbm__drop-rs { color: rgba(0,0,0,0.4); }
.nbm--bright .nbm__drop-rs:hover { color: #131310; }

.nbm__lens {
  display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px;
}
.nbm__len {
  height: 44px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.02);
  color: rgba(255,255,255,0.8);
  border-radius: 6px;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.nbm__len:hover { background: rgba(255,255,255,0.08); }
.nbm__len.is-active { background: #DB0000; border-color: #DB0000; color: white; }
.nbm__len .mono small { font-size: 10px; opacity: 0.7; }
.nbm--bright .nbm__len { background: rgba(0,0,0,0.04); border-color: rgba(0,0,0,0.08); color: #131310; }
.nbm--bright .nbm__len:hover { background: rgba(0,0,0,0.08); }
.nbm--bright .nbm__len.is-active { background: #DB0000; color: white; border-color: #DB0000; }

.nbm__cols { display: flex; gap: 8px; flex-wrap: wrap; }
.nbm__col {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.2);
  cursor: pointer;
  padding: 0;
  transition: transform .15s, box-shadow .15s;
}
.nbm__col:hover { transform: scale(1.08); }
.nbm__col.is-active { border-color: white; box-shadow: 0 0 0 3px #DB0000; }
.nbm--bright .nbm__col { border-color: rgba(0,0,0,0.15); }
.nbm--bright .nbm__col.is-active { border-color: #131310; }

/* RESULTS CAROUSEL */
.nbm__results {
  display: flex; gap: 12px;
  overflow-x: auto; overflow-y: hidden;
  padding: 0 4px 8px;
  scroll-behavior: smooth;
}
.nbm__results::-webkit-scrollbar { height: 6px; }
.nbm__results::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 999px; }

.nbm__card {
  flex: 0 0 220px;
  display: flex; flex-direction: column;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 6px;
  overflow: hidden;
  transition: transform .18s ease, border-color .18s ease;
}
.nbm__card:hover { transform: translateY(-2px); border-color: rgba(255,255,255,0.18); }
.nbm--bright .nbm__card { background: white; border-color: rgba(0,0,0,0.08); }

.nbm__card-img { height: 88px; }
.nbm__card-name { padding: 10px 12px 2px; font-size: 14px; font-weight: 500; text-align: center; }
.nbm__card-sku { padding: 0 12px 8px; font-size: 10px; color: rgba(255,255,255,0.4); text-align: center; }
.nbm--bright .nbm__card-sku { color: rgba(0,0,0,0.4); }

.nbm__card-actions {
  display: flex; align-items: center;
  padding: 0;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.nbm--bright .nbm__card-actions { border-color: rgba(0,0,0,0.06); }
.nbm__card-sheet {
  width: 40px; height: 40px;
  background: transparent; border: 0; cursor: pointer;
  color: rgba(255,255,255,0.5);
  display: inline-flex; align-items: center; justify-content: center;
}
.nbm--bright .nbm__card-sheet { color: rgba(0,0,0,0.5); }
.nbm__card-sheet:hover { color: #DB0000; }
.nbm__card-price { flex: 1; padding: 0 8px; font-size: 13px; font-weight: 600; text-align: center; }
.nbm__card-add {
  width: 48px; height: 40px;
  background: #DB0000; color: white;
  border: 0; cursor: pointer;
  border-radius: 0 0 48px 0;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s ease;
}
.nbm__card-add:hover { background: #b80000; }

/* SIDEBAR */
.nbm__sidebar {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 6px;
  padding: 24px;
  display: flex; flex-direction: column;
  min-height: 0;
}
.nbm--bright .nbm__sidebar { background: rgba(255,255,255,0.7); border-color: rgba(0,0,0,0.06); }
.nbm__sidebar-h {
  text-align: center;
  font-size: 22px;
  font-weight: 500;
  margin: 0 0 16px;
  letter-spacing: -0.02em;
}

.nbm__slots { list-style: none; margin: 0; padding: 0; flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.nbm__slot {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto auto 22px;
  gap: 10px; align-items: center;
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  position: relative;
  transition: background .15s, border-color .15s;
}
.nbm__slot:hover { background: rgba(255,255,255,0.04); }
.nbm--bright .nbm__slot:hover { background: rgba(0,0,0,0.04); }
.nbm__slot.is-active { background: rgba(219,0,0,0.12); border-color: rgba(219,0,0,0.4); }
.nbm__slot.is-empty { opacity: 0.5; }
.nbm__slot.is-empty.is-active { opacity: 1; }
.nbm__slot-n { font-size: 10px; color: rgba(255,255,255,0.4); font-weight: 600; }
.nbm--bright .nbm__slot-n { color: rgba(0,0,0,0.4); }
.nbm__slot-pill {
  height: 24px; padding: 0 10px;
  border-radius: 999px;
  font-size: 11px; font-weight: 700;
  color: #0d0d0b;
  display: inline-flex; align-items: center; justify-content: center;
}
.nbm__slot-name { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nbm__slot-q { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 600; color: var(--ks-red, #DB0000); }
.nbm__qn { min-width: 18px; text-align: right; }
.nbm__qarrows { display: inline-flex; flex-direction: column; line-height: 1; }
.nbm__qarrows button { background: none; border: 0; padding: 0; cursor: pointer; font-size: 8px; line-height: 9px; color: rgba(255,255,255,0.45); }
.nbm__qarrows button:hover { color: var(--ks-red, #DB0000); }
.nbm--bright .nbm__qarrows button { color: rgba(0,0,0,0.4); }
.nbm__slot-p { font-size: 13px; font-weight: 600; text-align: right; }
.nbm__slot-empty {
  grid-column: 2 / -1;
  font-size: 12px; color: rgba(255,255,255,0.4);
}
.nbm--bright .nbm__slot-empty, .nbm--bright .nbm__slot-q { color: rgba(0,0,0,0.4); }
.nbm__slot-x {
  background: transparent; border: 0; cursor: pointer;
  color: rgba(255,255,255,0.35);
  width: 20px; height: 20px;
  display: inline-flex; align-items: center; justify-content: center;
}
.nbm__slot-x:hover { color: #DB0000; }

.nbm__total {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 0;
  margin: 0 4px;
  border-top: 1px solid rgba(255,255,255,0.08);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.nbm--bright .nbm__total { border-color: rgba(0,0,0,0.08); }
.nbm__total .mono { font-size: 14px; font-weight: 600; }
.nbm__total-v { font-size: 22px; color: #F9E63B; }
.nbm--bright .nbm__total-v { color: #DB0000; }

.nbm__checkout {
  display: flex; align-items: center; justify-content: center;
  gap: 8px;
  height: 48px;
  margin-top: 12px;
  background: #DB0000;
  color: white;
  border: 0;
  border-radius: 4px;
  font-weight: 500;
  cursor: pointer;
  transition: background .18s ease;
}
.nbm__checkout:hover:not(:disabled) { background: #b80000; }
.nbm__checkout:disabled { background: rgba(255,255,255,0.1); color: rgba(255,255,255,0.4); cursor: not-allowed; }
.nbm--bright .nbm__checkout:disabled { background: rgba(0,0,0,0.06); color: rgba(0,0,0,0.4); }

.nbm__fill {
  margin-top: 8px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.7);
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  transition: background .15s, color .15s;
}
.nbm__fill:hover:not(:disabled) { background: rgba(255,255,255,0.06); color: white; }
.nbm__fill:disabled { opacity: 0.3; cursor: not-allowed; }
.nbm--bright .nbm__fill { border-color: rgba(0,0,0,0.12); color: rgba(0,0,0,0.65); }

/* FOOT */
.nbm__foot {
  display: flex; justify-content: space-between;
  padding-top: 12px;
  font-size: 11px;
  opacity: 0.55;
}
.nbm__foot a { color: inherit; }
.nbm__foot a:hover { opacity: 1; }

/* Mobile */
@media (max-width: 1100px) {
  .nbm__dialog { padding: 14px 16px; }
  .nbm__content { grid-template-columns: 1fr; gap: 12px; }
  .nbm__sidebar { max-height: 40vh; }
}
