/* Appily Thirtyseven — Packet Bundle cart
   New layout: due strip first + stacked glass line cards (no ledger sidebar) */

.page-cart-bundle {
  --bn-ink: #04261f;
  --bn-deep: #0a3d32;
  --bn-leaf: #0f8f72;
  --bn-mint: #2ee6a8;
  --bn-sky: #d6f3ea;
  --bn-wash: #eef9f4;
  --bn-paper: #f7fcfa;
  --bn-coral: #ff6b4a;
  --bn-gold: #e8c547;
  --bn-muted: #4d6b62;
  --bn-line: rgba(4, 38, 31, 0.12);
  --font-display: 'Fraunces', 'Georgia', serif;
  --font-body: 'Outfit', 'Segoe UI', sans-serif;
  --ease-spring: cubic-bezier(0.34, 1.45, 0.64, 1);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

.page-cart-bundle .page-main {
  padding-top: 0;
  font-family: var(--font-body);
  color: var(--bn-ink);
  background:
    radial-gradient(ellipse 55% 35% at 90% 0%, rgba(46, 230, 168, 0.16), transparent 55%),
    radial-gradient(ellipse 40% 28% at 8% 12%, rgba(232, 197, 71, 0.12), transparent 50%),
    linear-gradient(180deg, var(--bn-sky) 0%, var(--bn-wash) 30%, var(--bn-paper) 62%, #fff 100%);
}

.a37-bundle {
  padding-bottom: 3.5rem;
}

/* —— Hero —— */
.a37-bundle-hero {
  position: relative;
  padding: 2.4rem 0 1.8rem;
  overflow: hidden;
  isolation: isolate;
}

.a37-bundle-hero-mesh {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      -14deg,
      transparent,
      transparent 18px,
      rgba(15, 143, 114, 0.04) 18px,
      rgba(15, 143, 114, 0.04) 19px
    );
  mask-image: linear-gradient(180deg, #000 35%, transparent 100%);
  animation: a37BundleMesh 32s linear infinite;
}

@keyframes a37BundleMesh {
  to { transform: translateX(26px); }
}

.a37-bundle-hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) auto;
  gap: 1.75rem 2rem;
  align-items: center;
  max-width: 880px;
}

.a37-bundle-kicker {
  margin: 0 0 0.5rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--bn-leaf);
}

.a37-bundle-intro h1 {
  margin: 0 0 0.65rem;
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 4vw, 2.9rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.05;
  color: var(--bn-ink);
}

.a37-bundle-intro h1 span {
  background: linear-gradient(120deg, var(--bn-leaf), var(--bn-mint));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-style: italic;
}

.a37-bundle-lede {
  margin: 0;
  max-width: 44ch;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--bn-muted);
}

/* Pulse meter */
.a37-bundle-pulse {
  position: relative;
  width: 148px;
  height: 148px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.a37-bundle-pulse svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.a37-bundle-pulse-track {
  fill: none;
  stroke: rgba(4, 38, 31, 0.1);
  stroke-width: 8;
}

.a37-bundle-pulse-fill {
  fill: none;
  stroke: var(--bn-mint);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: var(--a37-bundle-fill, 0) 100;
  filter: drop-shadow(0 0 8px rgba(46, 230, 168, 0.5));
  transition: stroke-dasharray 0.7s var(--ease-out);
}

.a37-bundle-pulse-core {
  position: relative;
  z-index: 1;
  width: 98px;
  height: 98px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 14px 32px rgba(4, 38, 31, 0.1);
  backdrop-filter: blur(12px);
}

.a37-bundle-pulse-core strong {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 700;
  line-height: 1;
  color: var(--bn-leaf);
  letter-spacing: -0.03em;
}

.a37-bundle-pulse-core span {
  margin-top: 0.25rem;
  font-size: 0.58rem;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--bn-muted);
}

/* —— Stage —— */
.a37-bundle-stage {
  max-width: 880px;
}

/* Empty */
.a37-bundle-empty {
  max-width: 440px;
  margin: 0.5rem auto 0;
  padding: 2.25rem 1.5rem;
  text-align: center;
  border-radius: 1.5rem;
  background: rgba(255, 255, 255, 0.82);
  border: 1.5px dashed rgba(15, 143, 114, 0.3);
  box-shadow: 0 16px 36px rgba(4, 38, 31, 0.06);
  animation: a37BundleIn 0.45s var(--ease-out);
}

.a37-bundle-empty-mark {
  display: block;
  font-size: 2rem;
  color: var(--bn-mint);
  margin-bottom: 0.75rem;
}

.a37-bundle-empty h2 {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
}

.a37-bundle-empty p {
  margin: 0 0 1.25rem;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--bn-muted);
}

@keyframes a37BundleIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Form stack: due strip THEN lines */
.a37-bundle-form {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

/* Due strip (summary first — not right sidebar) */
.a37-bundle-due {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1.25rem;
  align-items: center;
  padding: 1.35rem 1.45rem;
  border-radius: 1.5rem;
  background: linear-gradient(145deg, var(--bn-deep), var(--bn-ink));
  color: #fff;
  border: 1px solid rgba(46, 230, 168, 0.28);
  box-shadow: 0 22px 48px rgba(4, 38, 31, 0.24);
  overflow: hidden;
  animation: a37BundleIn 0.45s var(--ease-out);
}

.a37-bundle-due-glow {
  position: absolute;
  inset: auto -15% -45% auto;
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, rgba(46, 230, 168, 0.4), transparent 65%);
  pointer-events: none;
  animation: a37BundleGlow 5s ease-in-out infinite alternate;
}

@keyframes a37BundleGlow {
  from { transform: scale(0.9); opacity: 0.65; }
  to { transform: scale(1.15); opacity: 1; }
}

.a37-bundle-due-main,
.a37-bundle-due-actions {
  position: relative;
  z-index: 1;
}

.a37-bundle-due-tag {
  display: inline-block;
  margin-bottom: 0.35rem;
  font-size: 0.62rem;
  font-weight: 750;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bn-mint);
}

.a37-bundle-due-amount {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3.5vw, 2.35rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: 0.75rem;
}

.a37-bundle-due-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.1rem;
  margin: 0 0 0.65rem;
}

.a37-bundle-due-meta div {
  display: flex;
  gap: 0.4rem;
  align-items: baseline;
}

.a37-bundle-due-meta dt {
  margin: 0;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
}

.a37-bundle-due-meta dd {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 650;
}

.a37-bundle-ship {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.7);
}

.a37-bundle-ship em {
  font-style: italic;
  color: var(--bn-mint);
}

.a37-bundle-due-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 200px;
}

/* Shelf / lines */
.a37-bundle-shelf {
  padding: 1.25rem 1.3rem 1.35rem;
  border-radius: 1.5rem;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--bn-line);
  box-shadow: 0 16px 36px rgba(4, 38, 31, 0.07);
  backdrop-filter: blur(12px);
  animation: a37BundleIn 0.5s var(--ease-out) 0.06s both;
}

.a37-bundle-shelf-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.1rem;
  padding-bottom: 0.95rem;
  border-bottom: 1px solid var(--bn-line);
}

.a37-bundle-code {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.62rem;
  font-weight: 750;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bn-leaf);
}

.a37-bundle-shelf-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.a37-bundle-shelf-head p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--bn-muted);
}

.a37-bundle-lines {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.a37-bundle-line {
  position: relative;
  display: grid;
  grid-template-columns: auto 88px 1fr auto;
  gap: 0.85rem 1rem;
  align-items: center;
  padding: 0.95rem 1.05rem;
  border-radius: 1.2rem;
  background: #fff;
  border: 1px solid var(--bn-line);
  overflow: hidden;
  transition: transform 0.3s var(--ease-spring), box-shadow 0.3s, border-color 0.25s;
}

@media (prefers-reduced-motion: no-preference) {
  .a37-bundle-line {
    animation: a37BundleIn 0.45s var(--ease-out) both;
    animation-delay: var(--line-delay, 0s);
  }
}

.a37-bundle-line.tone-mint { --line-accent: var(--bn-mint); }
.a37-bundle-line.tone-teal { --line-accent: var(--bn-leaf); }
.a37-bundle-line.tone-coral { --line-accent: var(--bn-coral); }
.a37-bundle-line.tone-gold { --line-accent: var(--bn-gold); }

.a37-bundle-line::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--line-accent, var(--bn-mint));
  opacity: 0.7;
}

.a37-bundle-line:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--line-accent, var(--bn-mint)) 45%, transparent);
  box-shadow: 0 16px 32px rgba(4, 38, 31, 0.1);
}

.a37-bundle-line-index {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  font-style: italic;
  color: var(--line-accent, var(--bn-leaf));
  opacity: 0.85;
}

.a37-bundle-line-media {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 88px;
  height: 88px;
  border-radius: 1rem;
  background:
    radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--line-accent, var(--bn-mint)) 25%, transparent), transparent 60%),
    linear-gradient(165deg, #fff, var(--bn-sky));
  text-decoration: none !important;
  overflow: hidden;
}

.a37-bundle-line-media img {
  width: 72%;
  height: 72%;
  object-fit: contain;
  transition: transform 0.4s var(--ease-spring);
}

.a37-bundle-line:hover .a37-bundle-line-media img {
  transform: scale(1.08);
}

.a37-bundle-line-placeholder {
  font-size: 1.6rem;
}

.a37-bundle-line-copy {
  min-width: 0;
}

.a37-bundle-line-copy h3 {
  margin: 0 0 0.25rem;
  font-size: 0.98rem;
  font-weight: 650;
  line-height: 1.3;
}

.a37-bundle-line-copy h3 a {
  color: var(--bn-ink);
  text-decoration: none !important;
}

.a37-bundle-line-copy h3 a:hover { color: var(--bn-leaf); }

.a37-bundle-line-meta {
  margin: 0 0 0.3rem;
  font-size: 0.78rem;
  color: var(--bn-muted);
}

.a37-bundle-line-unit {
  font-size: 0.74rem;
  font-weight: 650;
  color: var(--bn-leaf);
}

.a37-bundle-line-controls {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.55rem;
}

.a37-bundle-qty {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  padding: 0.2rem;
  border-radius: 999px;
  background: var(--bn-wash);
  border: 1px solid var(--bn-line);
}

.a37-bundle-qty-btn {
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: var(--bn-ink);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(4, 38, 31, 0.06);
  transition: background 0.2s, color 0.2s, transform 0.2s;
}

.a37-bundle-qty-btn:hover {
  background: var(--bn-ink);
  color: var(--bn-mint);
  transform: scale(1.05);
}

.a37-bundle-qty input {
  width: 2.4rem;
  border: 0;
  background: transparent;
  text-align: center;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--bn-ink);
  -moz-appearance: textfield;
}

.a37-bundle-qty input::-webkit-outer-spin-button,
.a37-bundle-qty input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.a37-bundle-line-total {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--bn-leaf);
  letter-spacing: -0.02em;
}

.a37-bundle-shelf-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.15rem;
  padding-top: 1rem;
  border-top: 1px solid var(--bn-line);
}

/* Buttons */
.a37-bundle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.25rem;
  border-radius: 999px;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none !important;
  border: 0;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s, color 0.2s;
}

.a37-bundle-btn--primary {
  color: var(--bn-ink);
  background: linear-gradient(135deg, var(--bn-mint), #7ef0c4);
  box-shadow: 0 12px 28px rgba(46, 230, 168, 0.35);
}

.a37-bundle-btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 34px rgba(46, 230, 168, 0.45);
}

.a37-bundle-btn--ghost {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.28);
}

.a37-bundle-btn--ghost:hover {
  background: rgba(255, 255, 255, 0.18);
}

.a37-bundle-btn--soft {
  color: var(--bn-ink);
  background: rgba(46, 230, 168, 0.18);
  border: 1px solid rgba(46, 230, 168, 0.35);
}

.a37-bundle-btn--soft:hover {
  background: var(--bn-ink);
  color: var(--bn-mint);
}

.a37-bundle-btn--outline {
  color: var(--bn-ink);
  background: transparent;
  border: 1px solid var(--bn-line);
}

.a37-bundle-btn--outline:hover {
  border-color: var(--bn-ink);
  background: var(--bn-ink);
  color: var(--bn-mint);
}

/* Responsive */
@media (max-width: 780px) {
  .a37-bundle-hero-inner {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .a37-bundle-lede {
    margin-inline: auto;
  }

  .a37-bundle-due {
    grid-template-columns: 1fr;
  }

  .a37-bundle-due-actions {
    min-width: 0;
  }

  .a37-bundle-line {
    grid-template-columns: auto 72px 1fr;
    grid-template-rows: auto auto;
  }

  .a37-bundle-line-controls {
    grid-column: 2 / -1;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 100%;
  }
}

@media (max-width: 480px) {
  .a37-bundle-line {
    grid-template-columns: 64px 1fr;
  }

  .a37-bundle-line-index {
    display: none;
  }

  .a37-bundle-line-media {
    width: 64px;
    height: 64px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .a37-bundle-hero-mesh,
  .a37-bundle-due-glow,
  .a37-bundle-due,
  .a37-bundle-shelf,
  .a37-bundle-line,
  .a37-bundle-empty {
    animation: none !important;
  }
}
