/* Appily Eighteen — Nutrient Bench Sheet product page */

.page-nutrient-bench {
  --nb-mocha: #6b5b3e;
  --nb-mocha-dark: #4a3f2c;
  --nb-sage: #8fae7a;
  --nb-sage-soft: rgba(143, 174, 122, 0.16);
  --nb-amber: #c67d3a;
  --nb-amber-soft: rgba(198, 125, 58, 0.14);
  --nb-alu: #b8c4cc;
  --nb-alu-dark: #8a9aa6;
  --nb-tray: #eef2f0;
  --nb-tray-deep: #dce6e0;
  --nb-ink: #2c2419;
  --nb-accent: var(--nb-sage);
  --nb-accent-soft: var(--nb-sage-soft);
  --nb-glow: rgba(143, 174, 122, 0.55);
  --nb-led: #7ee8a0;
  background:
    radial-gradient(ellipse at 88% 0%, rgba(143, 174, 122, 0.1) 0%, transparent 38%),
    linear-gradient(180deg, #f4f7f5 0%, var(--white) 280px);
}

.page-nutrient-bench.tone-root {
  --nb-accent: #a67c52;
  --nb-accent-soft: rgba(166, 124, 82, 0.16);
  --nb-glow: rgba(198, 125, 58, 0.45);
  --nb-led: #e8b87e;
}
.page-nutrient-bench.tone-allium {
  --nb-accent: #8b6fa8;
  --nb-accent-soft: rgba(139, 111, 168, 0.16);
  --nb-glow: rgba(139, 111, 168, 0.4);
  --nb-led: #c9a8e8;
}
.page-nutrient-bench.tone-legume {
  --nb-accent: #5a9a62;
  --nb-accent-soft: rgba(90, 154, 98, 0.16);
  --nb-glow: rgba(90, 154, 98, 0.45);
  --nb-led: #8ee89a;
}
.page-nutrient-bench.tone-fungi {
  --nb-accent: #8d7b6a;
  --nb-accent-soft: rgba(141, 123, 106, 0.16);
  --nb-glow: rgba(141, 123, 106, 0.4);
  --nb-led: #d4c4b0;
}
.page-nutrient-bench.tone-vine {
  --nb-accent: #4a8f5c;
  --nb-accent-soft: rgba(74, 143, 92, 0.16);
  --nb-glow: rgba(74, 143, 92, 0.45);
  --nb-led: #6ee89a;
}
.page-nutrient-bench.tone-herb {
  --nb-accent: #6b9e7a;
  --nb-accent-soft: rgba(107, 158, 122, 0.16);
  --nb-glow: rgba(107, 158, 122, 0.45);
  --nb-led: #9ee8b0;
}
.page-nutrient-bench.tone-sprout {
  --nb-accent: #7cb87a;
  --nb-accent-soft: rgba(124, 184, 122, 0.18);
  --nb-glow: rgba(124, 184, 122, 0.45);
  --nb-led: #b0f0a8;
}
.page-nutrient-bench.tone-fresh {
  --nb-accent: var(--nb-sage);
  --nb-accent-soft: var(--nb-sage-soft);
  --nb-glow: rgba(143, 174, 122, 0.55);
  --nb-led: #7ee8a0;
}

/* Shared */
.nb-kicker {
  margin: 0 0 8px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--nb-mocha);
}

.nb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px 22px;
  border: none;
  border-radius: var(--radius-md);
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform var(--transition), background var(--transition), box-shadow var(--transition);
}

.nb-btn-primary {
  width: 100%;
  background: var(--nb-mocha);
  color: var(--white);
  box-shadow: 0 10px 24px rgba(107, 91, 62, 0.28);
}

.nb-btn-primary:hover {
  background: var(--nb-mocha-dark);
  transform: translateY(-1px);
}

.nb-btn-disabled {
  width: 100%;
  background: #e8e4dc;
  color: #999;
  cursor: not-allowed;
}

/* Breadcrumb pipe */
.nb-pipe-trail {
  padding: 18px 0 0;
}

.nb-pipe-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.nb-crumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--muted);
}

.nb-crumb a:hover {
  color: var(--nb-accent);
}

.nb-crumb-current {
  color: var(--nb-ink);
  font-weight: 600;
}

.nb-row-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--nb-accent-soft);
  color: var(--nb-accent);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.nb-row-chip::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--nb-accent);
}

/* Main bench */
.nb-bench {
  padding: 28px 0 52px;
}

.nb-bench-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
  gap: clamp(24px, 4vw, 44px);
  align-items: start;
}

/* Grow tray visual */
.nb-tray-stage {
  position: relative;
  padding: 0 0 8px;
}

.nb-led-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 0;
  padding: 10px 16px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: linear-gradient(180deg, #2a332e 0%, #1e2622 100%);
  color: #c8e6d0;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.nb-led-bar span:first-child {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--nb-led);
  box-shadow: 0 0 10px var(--nb-glow);
  animation: nb-led-pulse 2.2s ease-in-out infinite;
}

@keyframes nb-led-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

.nb-tray-body {
  position: relative;
  padding: 36px 28px 28px;
  border: 3px solid var(--nb-alu-dark);
  border-top: none;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  background:
    repeating-linear-gradient(
      90deg,
      var(--nb-tray) 0,
      var(--nb-tray) 48px,
      var(--nb-tray-deep) 48px,
      var(--nb-tray-deep) 49px
    );
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.6),
    0 18px 40px rgba(44, 36, 25, 0.1);
  overflow: hidden;
}

.nb-tray-body::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 80%, rgba(143, 174, 122, 0.12) 0%, transparent 55%),
    linear-gradient(180deg, transparent 60%, rgba(0, 0, 0, 0.03) 100%);
  pointer-events: none;
}

.nb-drain-channel {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 12px;
  background: repeating-linear-gradient(
    90deg,
    var(--nb-alu) 0,
    var(--nb-alu) 8px,
    var(--nb-alu-dark) 8px,
    var(--nb-alu-dark) 16px
  );
  opacity: 0.7;
}

.nb-cell {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  min-height: 380px;
  padding: 24px;
}

.nb-cell-ring {
  position: absolute;
  top: 20px;
  right: clamp(12px, 3vw, 28px);
  width: 96px;
  height: 96px;
  z-index: 2;
}

.nb-cell-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.nb-ring-track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.7);
  stroke-width: 7;
}

.nb-ring-fill {
  fill: none;
  stroke: var(--nb-accent);
  stroke-width: 7;
  stroke-linecap: round;
  stroke-dasharray: 327;
  stroke-dashoffset: calc(327 - (327 * var(--nb-score, 90) / 100));
  transition: stroke-dashoffset 0.8s ease;
}

.nb-ring-label {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 0.66rem;
  font-weight: 800;
  color: var(--nb-accent);
  text-align: center;
  line-height: 1.15;
}

.nb-hero-img {
  position: relative;
  z-index: 1;
  margin: 0;
  width: min(100%, 360px);
  filter: drop-shadow(0 24px 36px rgba(44, 36, 25, 0.14));
}

.nb-hero-img img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
}

.nb-flag {
  position: absolute;
  top: 16px;
  left: 0;
  z-index: 3;
  padding: 8px 16px 8px 12px;
  background: var(--nb-accent);
  color: var(--white);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  clip-path: polygon(0 0, 100% 0, calc(100% - 10px) 50%, 100% 100%, 0 100%);
}

.nb-flag-sold {
  background: #888;
}

.nb-sensors {
  position: relative;
  z-index: 2;
  list-style: none;
  margin: 24px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.nb-sensors li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(0, 0, 0, 0.06);
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--ink-soft);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* Spec sheet panel */
.nb-spec {
  position: relative;
  background: var(--white);
  border: 2px solid var(--nb-mocha);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.nb-spec-tab {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 18px;
  background: linear-gradient(90deg, var(--nb-mocha) 0%, var(--nb-mocha-dark) 100%);
  color: var(--white);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nb-spec-code {
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.15);
  font-family: ui-monospace, monospace;
}

.nb-spec-body {
  padding: 22px 24px 26px;
}

.nb-spec-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.nb-spec-head h1 {
  margin: 0;
  font-size: clamp(1.65rem, 3vw, 2.1rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--nb-ink);
}

.nb-variant {
  margin: 8px 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.nb-rating {
  display: flex;
  align-items: center;
  gap: 1px;
  flex-shrink: 0;
  padding-top: 4px;
}

.nb-star {
  color: #ddd;
  font-size: 0.95rem;
}

.nb-star.is-on {
  color: var(--nb-amber);
}

.nb-reviews {
  font-size: 0.76rem;
  color: var(--muted);
  margin-left: 4px;
}

/* Nutrient readout bars */
.nb-readout {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--nb-tray);
  border: 1px solid var(--line);
}

.nb-readout-row {
  display: grid;
  grid-template-columns: 52px 1fr 36px;
  gap: 10px;
  align-items: center;
}

.nb-readout-label {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--nb-mocha);
}

.nb-readout-bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.06);
  overflow: hidden;
}

.nb-readout-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--nb-accent), var(--nb-amber));
}

.nb-readout-val {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--nb-accent);
  text-align: right;
}

.nb-price-strip {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--nb-accent-soft);
  border: 1px dashed var(--nb-accent);
}

.nb-price-was {
  font-size: 0.92rem;
  color: var(--muted);
  text-decoration: line-through;
}

.nb-price {
  font-size: clamp(1.75rem, 4vw, 2.3rem);
  font-weight: 800;
  color: var(--nb-ink);
  letter-spacing: -0.03em;
}

.nb-price.is-sale {
  color: var(--sale);
}

.nb-price-unit {
  font-size: 0.86rem;
  color: var(--muted);
  font-weight: 500;
}

.nb-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

.nb-meta-tile {
  display: grid;
  gap: 2px;
  padding: 11px 13px;
  border-radius: var(--radius-md);
  background: #faf8f4;
  border: 1px solid var(--line);
}

.nb-meta-key {
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--nb-mocha);
}

.nb-meta-tile strong {
  font-size: 0.9rem;
  color: var(--nb-ink);
}

.nb-desc {
  margin: 0 0 18px;
  color: var(--ink-soft);
  font-size: 0.92rem;
  line-height: 1.65;
}

.nb-divider {
  height: 2px;
  margin: 0 0 20px;
  background: repeating-linear-gradient(
    90deg,
    var(--nb-alu) 0,
    var(--nb-alu) 6px,
    transparent 6px,
    transparent 12px
  );
}

/* Valve qty stepper */
.nb-buy-form {
  display: grid;
  gap: 14px;
}

.nb-qty-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.nb-qty-label {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--ink-soft);
}

.nb-valve {
  display: inline-flex;
  align-items: center;
  border: 2px solid var(--nb-alu-dark);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--nb-tray);
}

.nb-valve-btn {
  width: 42px;
  height: 42px;
  border: 0;
  background: var(--white);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--nb-mocha);
  cursor: pointer;
  transition: background var(--transition);
}

.nb-valve-btn:hover {
  background: var(--nb-accent-soft);
}

.nb-valve input {
  width: 46px;
  border: 0;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  text-align: center;
  font: inherit;
  font-weight: 700;
  background: transparent;
  -moz-appearance: textfield;
}

.nb-valve input::-webkit-outer-spin-button,
.nb-valve input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.nb-footnote {
  margin: 14px 0 0;
  font-size: 0.74rem;
  color: var(--muted);
  line-height: 1.5;
}

/* Bench drawers — details */
.nb-drawers {
  padding: 0 0 48px;
}

.nb-drawers-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.nb-drawer {
  border: 2px solid var(--nb-alu-dark);
  border-radius: var(--radius-md);
  background: var(--nb-tray);
  overflow: hidden;
}

.nb-drawer summary {
  padding: 15px 16px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(180deg, var(--white) 0%, var(--nb-tray) 100%);
}

.nb-drawer summary::-webkit-details-marker {
  display: none;
}

.nb-drawer summary::before {
  content: "▸";
  margin-right: 8px;
  color: var(--nb-accent);
  font-size: 0.85rem;
}

.nb-drawer[open] summary::before {
  content: "▾";
}

.nb-drawer p {
  margin: 0;
  padding: 0 16px 16px;
  font-size: 0.86rem;
  color: var(--ink-soft);
  line-height: 1.6;
}

/* Neighbor cells — related */
.nb-neighbors {
  padding: 12px 0 64px;
  background: linear-gradient(180deg, var(--white) 0%, #f2f6f3 100%);
  border-top: 3px solid var(--nb-tray-deep);
}

.nb-neighbors-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.nb-neighbors-head h2 {
  margin: 0;
  font-size: clamp(1.25rem, 2.5vw, 1.55rem);
}

.nb-neighbors-all {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--nb-mocha);
  white-space: nowrap;
}

.nb-neighbors-all:hover {
  color: var(--nb-accent);
}

.nb-cell-row {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding: 4px 2px 16px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.nb-cell-row::-webkit-scrollbar {
  height: 6px;
}

.nb-cell-row::-webkit-scrollbar-thumb {
  background: var(--nb-alu);
  border-radius: 999px;
}

.nb-neighbor {
  flex: 0 0 172px;
  scroll-snap-align: start;
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: var(--radius-md);
  background: var(--white);
  border: 2px solid var(--nb-alu);
  transition: transform var(--transition), box-shadow var(--transition);
}

.nb-neighbor:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--nb-accent);
}

.nb-neighbor-thumb {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  background: var(--nb-accent-soft);
  padding: 10px;
}

.nb-neighbor.tone-root .nb-neighbor-thumb { background: rgba(166, 124, 82, 0.16); }
.nb-neighbor.tone-allium .nb-neighbor-thumb { background: rgba(139, 111, 168, 0.16); }
.nb-neighbor.tone-legume .nb-neighbor-thumb { background: rgba(90, 154, 98, 0.16); }
.nb-neighbor.tone-fungi .nb-neighbor-thumb { background: rgba(141, 123, 106, 0.16); }
.nb-neighbor.tone-vine .nb-neighbor-thumb { background: rgba(74, 143, 92, 0.16); }
.nb-neighbor.tone-herb .nb-neighbor-thumb { background: rgba(107, 158, 122, 0.16); }
.nb-neighbor.tone-sprout .nb-neighbor-thumb { background: rgba(124, 184, 122, 0.18); }

.nb-neighbor-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.nb-neighbor-body {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.nb-neighbor-name {
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.nb-neighbor-price {
  font-size: 0.86rem;
  font-weight: 800;
  color: var(--nb-accent);
}

/* 404 — empty bench cell */
.page-nb-miss {
  background: #f2f6f3;
}

.nb-miss {
  padding: 80px 0 100px;
  text-align: center;
}

.nb-miss-tray {
  position: relative;
  width: 140px;
  height: 100px;
  margin: 0 auto 28px;
  border: 3px solid var(--nb-alu-dark);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  background: var(--nb-tray);
  box-shadow: inset 0 4px 12px rgba(0, 0, 0, 0.06);
}

.nb-miss-tray::before {
  content: "";
  position: absolute;
  top: -14px;
  left: -3px;
  right: -3px;
  height: 14px;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  background: linear-gradient(180deg, #2a332e 0%, #1e2622 100%);
}

.nb-miss-icon {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 2rem;
  opacity: 0.5;
}

.nb-miss h1 {
  margin: 0 0 12px;
  font-size: clamp(1.5rem, 3vw, 2rem);
}

.nb-miss p {
  max-width: 460px;
  margin: 0 auto 24px;
  color: var(--muted);
}

/* Responsive */
@media (max-width: 960px) {
  .nb-bench-grid {
    grid-template-columns: 1fr;
  }

  .nb-cell {
    min-height: 300px;
  }

  .nb-drawers-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .nb-pipe-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .nb-spec-head {
    flex-direction: column;
  }

  .nb-meta-grid {
    grid-template-columns: 1fr 1fr;
  }

  .nb-cell-ring {
    width: 76px;
    height: 76px;
    top: 12px;
    right: 12px;
  }

  .nb-sensors {
    justify-content: flex-start;
  }
}
