.nxpv {
  --nxpv-accent: #1e3029;
  --nxpv-line: #d7dcd9;
  --nxpv-soft: #f5f7f6;
  --nxpv-muted: #68726e;
  clear: both;
  margin: 22px 0;
  color: inherit;
}

.nxpv *, .nxpv *::before, .nxpv *::after { box-sizing: border-box; }
.nxpv__heading { margin: 0 0 10px; color: inherit; font-size: .9rem; line-height: 1.3; font-weight: 650; letter-spacing: .01em; }
.nxpv__items { display: flex; flex-wrap: wrap; gap: 8px; }
.nxpv__item { position: relative; color: inherit; text-decoration: none !important; transition: border-color .16s ease, background-color .16s ease, color .16s ease; }
.nxpv__item:hover { color: var(--nxpv-accent); }
.nxpv__item:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.nxpv__volume { font-weight: 650; white-space: nowrap; }
.nxpv__current { font-size: 10px; line-height: 1; text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; }
.nxpv__item.is-oos { opacity: .55; }

/* Layout 1: compact buttons. */
.nxpv--pills .nxpv__item {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 13px;
  border: 1px solid var(--nxpv-line);
  background: #fff;
}
.nxpv--pills .nxpv__item:hover { border-color: var(--nxpv-accent); }
.nxpv--pills .nxpv__item.is-current { border-color: var(--nxpv-accent); background: var(--nxpv-accent); color: #fff; }
.nxpv--pills .nxpv__current { padding-left: 7px; border-left: 1px solid rgba(255,255,255,.35); }

/* Layout 2: informative cards. */
.nxpv--cards .nxpv__items { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); max-width: 680px; gap: 8px; }
.nxpv--cards .nxpv__item { display: flex; min-height: 96px; flex-direction: column; justify-content: center; align-items: flex-start; gap: 4px; padding: 13px; border: 1px solid var(--nxpv-line); background: #fff; }
.nxpv--cards .nxpv__item:hover { border-color: var(--nxpv-accent); background: var(--nxpv-soft); }
.nxpv--cards .nxpv__item.is-current { border: 2px solid var(--nxpv-accent); padding: 12px; }
.nxpv--cards .nxpv__volume { font-size: 1.08rem; }
.nxpv--cards .nxpv__price { color: var(--nxpv-muted); font-size: .84rem; line-height: 1.3; }
.nxpv--cards .nxpv__price del { opacity: .65; }
.nxpv--cards .nxpv__stock { font-size: .72rem; color: var(--nxpv-muted); }
.nxpv--cards .nxpv__stock.is-in { color: #257155; }
.nxpv--cards .nxpv__stock.is-out { color: #9a4343; }
.nxpv--cards .nxpv__current { position: absolute; right: 8px; top: 8px; color: var(--nxpv-muted); }

/* Layout 3: clean textual list. */
.nxpv--list .nxpv__items { display: block; max-width: 560px; border-top: 1px solid var(--nxpv-line); }
.nxpv--list .nxpv__item { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; min-height: 42px; padding: 8px 2px; border-bottom: 1px solid var(--nxpv-line); }
.nxpv--list a.nxpv__item::after { content: '→'; color: var(--nxpv-muted); transition: transform .16s ease; }
.nxpv--list a.nxpv__item:hover::after { transform: translateX(3px); color: currentColor; }
.nxpv--list .nxpv__item.is-current { color: var(--nxpv-accent); }
.nxpv--list .nxpv__current { margin-left: auto; color: var(--nxpv-muted); }

.nxpv--pills .nxpv__item.is-current .nxpv__volume,
.nxpv--pills .nxpv__item.is-current .nxpv__current,
.nxpv--cards .nxpv__item.is-current .nxpv__volume,
.nxpv--cards .nxpv__item.is-current .nxpv__current,
.nxpv--list .nxpv__item.is-current .nxpv__current,
.nxpv--list .nxpv__item.is-current .nxpv__volume {
  color: white;
}

@media (max-width: 520px) {
  .nxpv { margin: 18px 0; }
  .nxpv--cards .nxpv__items { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nxpv--pills .nxpv__item { flex: 1 0 calc(33.333% - 8px); }
  .nxpv--pills .nxpv__current { display: none; }
}

/* ============================================================
 * Consolidated badges: a single badge for several same-volume
 * variants. Clicking opens a compact popup above the badge.
 * ============================================================ */

.nxpv__item--group { position: relative; }

.nxpv__group-toggle {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  padding: 0;
  text-align: left;
  text-decoration: none !important;
  transition: border-color .16s ease, background-color .16s ease, color .16s ease;
}
.nxpv__group-toggle:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.nxpv__group-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .12);
  color: inherit;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

/* Pills layout: make the toggle look like a normal pill. */
.nxpv--pills .nxpv__item--group {
  padding: 0;
  border: 0;
  background: transparent;
  min-height: 0;
}
.nxpv--pills .nxpv__group-toggle {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 13px;
  border: 1px solid var(--nxpv-line);
  background: #fff;
}
.nxpv--pills .nxpv__item--group:hover .nxpv__group-toggle {
  border-color: var(--nxpv-accent);
  color: var(--nxpv-accent);
}
.nxpv--pills .nxpv__item--group.is-current .nxpv__group-toggle {
  border-color: var(--nxpv-accent);
  background: var(--nxpv-accent);
  color: #fff;
}
.nxpv--pills .nxpv__group-toggle .nxpv__current {
  padding-left: 7px;
  border-left: 1px solid rgba(255, 255, 255, .35);
}
.nxpv--pills .nxpv__item--group:not(.is-current) .nxpv__group-toggle .nxpv__current {
  padding-left: 7px;
  border-left: 1px solid rgba(0, 0, 0, .12);
  color: var(--nxpv-muted);
}

/* Cards layout: badge as a grid cell, popup on top. */
.nxpv--cards .nxpv__item--group {
  display: flex;
  min-height: 96px;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 4px;
  padding: 0;
  border: 0;
  background: transparent;
}
.nxpv--cards .nxpv__group-toggle {
  display: flex;
  width: 100%;
  min-height: 96px;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 4px;
  padding: 13px;
  border: 1px solid var(--nxpv-line);
  background: #fff;
}
.nxpv--cards .nxpv__item--group:hover .nxpv__group-toggle {
  border-color: var(--nxpv-accent);
  background: var(--nxpv-soft);
}
.nxpv--cards .nxpv__item--group.is-current .nxpv__group-toggle {
  border-width: 2px;
  border-color: var(--nxpv-accent);
  padding: 12px;
}
.nxpv--cards .nxpv__group-toggle .nxpv__volume {
  font-size: 1.08rem;
}
.nxpv--cards .nxpv__group-toggle .nxpv__current {
  position: static;
  margin-top: 4px;
  color: var(--nxpv-muted);
}

/* List layout: badge as a row. */
.nxpv--list .nxpv__item--group {
  display: flex;
  width: 100%;
  min-height: 42px;
  padding: 8px 2px;
  border-bottom: 1px solid var(--nxpv-line);
}
.nxpv--list .nxpv__group-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
}
.nxpv--list .nxpv__item--group.is-current {
  color: var(--nxpv-accent);
}
.nxpv--list .nxpv__group-toggle .nxpv__current {
  margin-left: auto;
  color: var(--nxpv-muted);
}

/* The popup balloon itself: above the badge by default,
   flips below when there is not enough room above. */
.nxpv__popup {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  z-index: 60;
  min-width: 240px;
  max-width: 340px;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--nxpv-line);
  border-radius: 6px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, .12), 0 2px 6px rgba(0, 0, 0, .05);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nxpv__popup.is-below {
  bottom: auto;
  top: calc(100% + 8px);
}
.nxpv__popup[hidden] {
  display: none;
}

.nxpv__popup-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 9px;
  text-decoration: none !important;
  border-radius: 4px;
  color: inherit;
  background: transparent;
  transition: background-color .14s ease, color .14s ease;
}
.nxpv__popup-item:hover {
  background: var(--nxpv-soft);
}
.nxpv__popup-item.is-current {
  background: var(--nxpv-accent);
  color: #fff;
  cursor: default;
}
.nxpv__popup-item.is-oos {
  opacity: .55;
}

.nxpv__popup-thumb {
  width: 32px;
  height: 32px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
  background: var(--nxpv-soft);
}

.nxpv__popup-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.nxpv__popup-name {
  font-weight: 700;
  font-size: .85rem;
  line-height: 1.25;
  color: inherit;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.nxpv__popup-item:not(.is-current) .nxpv__popup-name {
  color: var(--nxpv-muted);
} 
.nxpv__popup-item.is-current .nxpv__popup-name{
  color: white;
}
.nxpv__popup-price {
  font-size: .78rem;
  color: var(--nxpv-muted);
}
.nxpv__popup-item.is-current .nxpv__popup-price {
  color: rgba(255, 255, 255, .9);
}

.nxpv__popup-stock {
  font-size: .7rem;
  color: var(--nxpv-muted);
}
.nxpv__popup-item.is-current .nxpv__popup-stock {
  color: rgba(255, 255, 255, .9);
}

.nxpv--list .nxpv__popup,
.nxpv--pills .nxpv__popup {
  left: 0;
  right: auto;
}

@media (max-width: 520px) {
  .nxpv__popup {
    left: 0;
    right: auto;
    max-width: 280px;
  }
  .nxpv--pills .nxpv__group-toggle {
    flex: 1 0 calc(33.333% - 8px);
  }
}

