/* Nova Hold — cart-only visual language
   Pearl + cobalt + chartreuse. Container-query plates + floating ledger.
   Independent of Tally Loom (tl-*), prior Appily carts, Inkforge. */

.page-cart {
  --nh-ink: #0f172a;
  --nh-mute: #64748b;
  --nh-pearl: #f8fafc;
  --nh-sheet: #ffffff;
  --nh-line: rgba(15, 23, 42, 0.1);
  --nh-cobalt: #1d4ed8;
  --nh-cobalt-soft: rgba(29, 78, 216, 0.12);
  --nh-volt: #bbe034;
  --nh-volt-deep: #8fb31a;
  --nh-display: "Kanit", system-ui, sans-serif;
  --nh-sans: "Work Sans", "Segoe UI", sans-serif;
  --nh-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --nh-spring: cubic-bezier(0.34, 1.4, 0.64, 1);
  --nh-h1: clamp(2.2rem, 1.5rem + 3vw, 3.6rem);
  --nh-row: clamp(0.95rem, 0.88rem + 0.35vw, 1.1rem);
}

.page-cart .a61-stage,
.page-cart .page-main {
  background: transparent !important;
  color: var(--nh-ink) !important;
  font-family: var(--nh-sans);
}

.page-cart .page-main {
  max-width: none;
  padding: 0;
}

.page-cart .a61-aisle-rail,
.page-cart .a61-mob-bar {
  display: none !important;
}

.page-cart .visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.nh-root {
  position: relative;
  isolation: isolate;
  width: min(1120px, calc(100% - 1.5rem));
  margin: 0 auto;
  padding: clamp(1.25rem, 3vw, 2.25rem) 0 3.5rem;
  overflow-x: clip;
}

.nh-sky {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 55% 40% at 100% 0%, var(--nh-cobalt-soft), transparent 55%),
    radial-gradient(ellipse 40% 30% at 0% 40%, rgba(187, 224, 52, 0.18), transparent 50%),
    var(--nh-pearl);
}

.nh-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.45;
  animation: nh-drift 18s ease-in-out infinite alternate;
}

.nh-orb-a {
  width: 36vw;
  height: 36vw;
  top: -8%;
  right: -6%;
  background: rgba(29, 78, 216, 0.28);
}

.nh-orb-b {
  width: 28vw;
  height: 28vw;
  bottom: 10%;
  left: -8%;
  background: rgba(187, 224, 52, 0.25);
  animation-delay: -5s;
}

@keyframes nh-drift {
  from { transform: translate(0, 0); }
  to { transform: translate(-3%, 4%); }
}

.nh-eyebrow {
  margin: 0 0 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--nh-cobalt);
}

/* Empty */
.nh-empty {
  position: relative;
  max-width: 36rem;
  margin: 2rem auto 0;
  padding: clamp(2.5rem, 6vw, 4rem) 1.5rem;
  text-align: center;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 2rem;
  box-shadow: 0 24px 50px rgba(15, 23, 42, 0.08);
  overflow: hidden;
}

.nh-empty-halo {
  position: absolute;
  inset: -40% -20% auto;
  height: 80%;
  background: radial-gradient(circle, rgba(187, 224, 52, 0.35), transparent 65%);
  pointer-events: none;
}

.nh-empty h1,
.nh-banner h1 {
  margin: 0 0 0.65rem;
  font-family: var(--nh-display);
  font-size: var(--nh-h1);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
}

.nh-empty h1 em,
.nh-banner h1 em {
  font-style: normal;
  color: var(--nh-cobalt);
  background: linear-gradient(180deg, transparent 60%, rgba(187, 224, 52, 0.45) 60%);
}

.nh-empty-dek,
.nh-dek {
  margin: 0 0 1.25rem;
  color: var(--nh-mute);
  font-size: 1.05rem;
  line-height: 1.55;
}

/* Banner */
.nh-banner {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.nh-count {
  display: grid;
  place-items: center;
  min-width: 5.5rem;
  padding: 0.85rem 1rem;
  background: var(--nh-ink);
  color: #fff;
  border-radius: 1.35rem;
  text-align: center;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.2);
  transition: transform 0.35s var(--nh-spring);
}

.nh-count.is-pulse {
  animation: nh-pulse 0.45s var(--nh-spring);
}

.nh-count strong {
  font-family: var(--nh-display);
  font-size: 1.75rem;
  font-weight: 750;
  line-height: 1;
  color: var(--nh-volt);
}

.nh-count span {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.75;
}

@keyframes nh-pulse {
  50% { transform: scale(1.06); }
}

/* Orbit route — overlapping circles, not numbered path bars */
.nh-orbit {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 1.5rem;
  padding: 0.35rem;
  width: fit-content;
  max-width: 100%;
  overflow-x: auto;
}

.nh-orbit-node {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 1rem 0.55rem 0.55rem;
  background: var(--nh-sheet);
  border: 1px solid var(--nh-line);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--nh-mute);
  white-space: nowrap;
}

.nh-orbit-node i {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.15);
}

.nh-orbit-node.is-now {
  background: var(--nh-volt);
  border-color: transparent;
  color: var(--nh-ink);
  box-shadow: 0 10px 24px rgba(187, 224, 52, 0.35);
}

.nh-orbit-node.is-now i {
  background: var(--nh-ink);
  box-shadow: 0 0 0 4px rgba(15, 23, 42, 0.12);
}

.nh-orbit-arc {
  width: 1.75rem;
  height: 2px;
  background: linear-gradient(90deg, rgba(15, 23, 42, 0.2), rgba(15, 23, 42, 0.05));
  flex-shrink: 0;
}

/* Deck grid */
.nh-deck {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(16rem, 20rem);
  gap: 1.25rem;
  align-items: start;
}

.nh-plates {
  display: grid;
  gap: 0.85rem;
}

/* Container-query plate rows */
.nh-plate {
  container-type: inline-size;
  container-name: plate;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 1.5rem;
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.06);
  overflow: hidden;
  opacity: 1;
  transform: none;
  animation: nh-rise 0.5s var(--nh-ease) backwards;
  animation-delay: calc(var(--pi, 0) * 60ms);
  transition: transform 0.35s var(--nh-spring), box-shadow 0.35s, opacity 0.3s, filter 0.3s;
}

.nh-plate.is-bump {
  animation: nh-bump 0.4s var(--nh-spring);
}

.nh-plate.is-zero {
  opacity: 0.45;
  filter: grayscale(0.35);
}

.nh-plate:hover {
  box-shadow: 0 20px 44px rgba(29, 78, 216, 0.12);
  transform: translateY(-2px);
}

.nh-plate.is-zero:hover {
  transform: none;
}

@keyframes nh-rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

@keyframes nh-bump {
  40% { transform: scale(1.015); }
}

.nh-plate-inner {
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 1fr);
  grid-template-areas:
    "thumb copy"
    "ops ops";
  gap: 0.85rem 1rem;
  padding: 1rem;
}

@container plate (min-width: 34rem) {
  .nh-plate-inner {
    grid-template-columns: 6.5rem minmax(0, 1fr) auto;
    grid-template-areas: "thumb copy ops";
    align-items: center;
  }
}

.nh-thumb {
  grid-area: thumb;
  display: block;
  aspect-ratio: 1;
  border-radius: 1.15rem;
  overflow: hidden;
  background: linear-gradient(145deg, var(--nh-cobalt-soft), rgba(187, 224, 52, 0.2));
  text-decoration: none;
  color: inherit;
}

.nh-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s var(--nh-ease);
}

.nh-plate:hover .nh-thumb img {
  transform: scale(1.06);
}

.nh-thumb-ph {
  display: grid;
  place-items: center;
  height: 100%;
  font-size: 1.5rem;
  color: var(--nh-cobalt);
}

.nh-copy {
  grid-area: copy;
  min-width: 0;
}

.nh-sku {
  font-size: 0.65rem;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--nh-mute);
}

.nh-copy h2 {
  margin: 0.2rem 0 0.25rem;
  font-family: var(--nh-display);
  font-size: clamp(1.05rem, 0.95rem + 0.5vw, 1.3rem);
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.nh-copy h2 a {
  color: inherit;
  text-decoration: none;
}

.nh-copy h2 a:hover {
  color: var(--nh-cobalt);
}

.nh-variant {
  margin: 0 0 0.25rem;
  font-size: 0.85rem;
  color: var(--nh-mute);
}

.nh-unit {
  margin: 0;
  font-size: var(--nh-row);
  font-weight: 700;
}

.nh-unit span {
  font-weight: 500;
  color: var(--nh-mute);
  font-size: 0.8em;
}

.nh-ops {
  grid-area: ops;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

@container plate (min-width: 34rem) {
  .nh-ops {
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
  }
}

.nh-stepper {
  display: inline-grid;
  grid-template-columns: 2.4rem 3.25rem 2.4rem;
  align-items: stretch;
  border-radius: 999px;
  overflow: hidden;
  background: var(--nh-pearl);
  border: 1px solid var(--nh-line);
  flex-shrink: 0;
}

.nh-step {
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: transparent;
  font-size: 1.15rem;
  font-weight: 700;
  cursor: pointer;
  color: var(--nh-ink);
  transition: background 0.2s;
  min-height: 2.5rem;
}

.nh-step:hover {
  background: var(--nh-volt);
}

.nh-stepper input {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0.35rem 0.15rem !important;
  text-align: center;
  font: inherit;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  color: var(--nh-ink) !important;
  outline: none;
  -moz-appearance: textfield;
  appearance: textfield;
}

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

.nh-stepper input.is-pop {
  animation: nh-pop 0.3s var(--nh-spring);
}

@keyframes nh-pop {
  50% { transform: scale(1.15); color: var(--nh-cobalt); }
}

.nh-line {
  font-family: var(--nh-display);
  font-size: 1.25rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.nh-line.is-flip {
  animation: nh-flip 0.4s var(--nh-ease);
}

@keyframes nh-flip {
  0% { transform: translateY(6px); opacity: 0.4; }
  100% { transform: none; opacity: 1; }
}

/* Floating ledger */
.nh-ledger {
  position: sticky;
  top: 0.75rem;
  align-self: start;
}

.nh-ledger-card {
  padding: 1.25rem 1.25rem 1.35rem;
  background: var(--nh-ink);
  color: #f8fafc;
  border-radius: 1.65rem;
  box-shadow: 0 28px 60px rgba(15, 23, 42, 0.28);
}

.nh-ledger-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 1rem;
}

.nh-ledger-head h2 {
  margin: 0;
  font-family: var(--nh-display);
  font-size: 1.5rem;
  font-weight: 700;
}

.nh-ledger-head span {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--nh-volt);
}

/* Promo capsule — not a ticket stub */
.nh-promo {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1.1rem;
  padding: 0.85rem 1rem;
  border-radius: 1.15rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px dashed rgba(187, 224, 52, 0.45);
}

.nh-promo.is-free {
  background: rgba(187, 224, 52, 0.14);
  border-style: solid;
  border-color: rgba(187, 224, 52, 0.35);
}

.nh-promo-core strong {
  display: block;
  font-size: 0.92rem;
  margin-bottom: 0.15rem;
}

.nh-promo-core span {
  font-size: 0.78rem;
  color: rgba(248, 250, 252, 0.65);
}

.nh-promo-tag {
  display: grid;
  place-items: center;
  min-width: 3.2rem;
  height: 3.2rem;
  border-radius: 50%;
  background: var(--nh-volt);
  color: var(--nh-ink);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.nh-sum {
  margin: 0 0 1rem;
  display: grid;
  gap: 0.55rem;
}

.nh-sum > div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.95rem;
}

.nh-sum dt {
  margin: 0;
  color: rgba(248, 250, 252, 0.65);
}

.nh-sum dd {
  margin: 0;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.nh-sum-due {
  margin-top: 0.35rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.nh-sum-due dt,
.nh-sum-due dd {
  font-family: var(--nh-display);
  font-size: 1.25rem;
  color: #fff !important;
}

.nh-sum-due dd {
  color: var(--nh-volt) !important;
}

.nh-sum dd.is-tick {
  animation: nh-pop 0.35s var(--nh-spring);
}

.nh-meter {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
  margin-bottom: 1.1rem;
}

.nh-meter-fill {
  display: block;
  height: 100%;
  width: 100%;
  transform-origin: left center;
  transform: scaleX(0.12);
  background: linear-gradient(90deg, var(--nh-volt), var(--nh-cobalt));
  border-radius: inherit;
  transition: transform 0.45s var(--nh-ease);
}

.nh-actions {
  display: grid;
  gap: 0.5rem;
}

.nh-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  box-sizing: border-box;
  padding: 0.85rem 1.15rem;
  border-radius: 999px !important;
  font-family: var(--nh-sans);
  font-weight: 750;
  font-size: 0.88rem;
  border: 1px solid transparent !important;
  box-shadow: none !important;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  color: inherit;
  transition: transform 0.3s var(--nh-spring), background 0.25s, color 0.25s, border-color 0.25s;
}

.nh-btn:hover {
  transform: translateY(-2px);
}

.nh-btn-fill {
  background: var(--nh-volt);
  color: var(--nh-ink);
}

.nh-btn-fill:hover {
  background: #fff;
  color: var(--nh-ink);
}

.nh-btn-line {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.28) !important;
  color: #fff;
}

.nh-btn-line:hover {
  border-color: var(--nh-volt) !important;
  color: var(--nh-volt);
}

.nh-btn-ghost {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.nh-btn-ghost:hover {
  background: rgba(255, 255, 255, 0.16);
}

.nh-empty .nh-btn {
  width: auto;
  min-width: 12rem;
}

.nh-empty .nh-btn-fill {
  background: var(--nh-cobalt);
  color: #fff;
}

.nh-empty .nh-btn-fill:hover {
  background: var(--nh-ink);
  color: #fff;
}

.nh-hint {
  margin: 0.75rem 0 0;
  font-size: 0.72rem;
  text-align: center;
  color: rgba(248, 250, 252, 0.5);
}

@media (max-width: 900px) {
  .nh-banner {
    align-items: flex-start;
  }

  .nh-count {
    margin-left: auto;
  }

  .nh-deck {
    grid-template-columns: 1fr;
  }

  .nh-ledger {
    position: static;
  }

  .nh-ledger-card {
    border-radius: 1.5rem;
  }

  .nh-orbit {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .nh-root {
    width: min(1120px, calc(100% - 1rem));
  }

  .nh-plate-inner {
    grid-template-columns: 4.5rem minmax(0, 1fr);
    gap: 0.7rem 0.75rem;
    padding: 0.85rem;
  }

  .nh-ops {
    flex-direction: column;
    align-items: stretch;
  }

  .nh-stepper {
    width: 100%;
    grid-template-columns: 2.75rem 1fr 2.75rem;
  }

  .nh-line {
    text-align: right;
  }

  .nh-empty {
    border-radius: 1.35rem;
    margin-top: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nh-orb,
  .nh-plate,
  .nh-count.is-pulse,
  .nh-plate.is-bump,
  .nh-line.is-flip,
  .nh-stepper input.is-pop {
    animation: none !important;
  }

  .nh-plate {
    opacity: 1;
    transform: none;
  }

  .nh-plate.is-zero {
    opacity: 0.45;
  }

  .nh-plate:hover {
    transform: none;
  }
}
