/* =============================================================
   BUNDLED-CARD — V36 DAV-167 · DAV-164 Phase 3
   Brand-Confident treatment: ink + lemon + mint + amber-friction.
   BEM namespace .bc-* — no collision with .plan-card__*, .addon-row__*,
   .prv36-*, .jb-*.
   Mobile breakpoint 480px. Reduced-motion respected.
   ============================================================= */

/* ─── CUSTOM PROPERTIES ─────────────────────────────────────── */
.bc-subcard,
.bc-combined-price {
  --bc-ink:          var(--ink, #0F172A);
  --bc-lemon:        var(--lemon, #FACC15);
  --bc-mint-bg:      #DCFCE7;
  --bc-mint-border:  #166534;
  --bc-mint-light:   #F2FBF7;
  --bc-amber-bg:     #FFF8EE;
  --bc-amber-border: #FFCE80;
  --bc-amber-text:   #9A3412;
  --bc-mute:         #64748B;
  --bc-rule:         #E4E4E7;
  --bc-surface:      #F7FBFD;
  --bc-off:          #FAFAFA;
  --bc-transition:   border-color 200ms ease, background 200ms ease;
  font-family: 'Inter', system-ui, sans-serif;
}

/* ─── SUBCARD ROOT ──────────────────────────────────────────── */
.bc-subcard {
  border: 1.5px solid var(--bc-rule);
  border-radius: 10px;
  background: var(--bc-surface);
  padding: 14px 16px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  transition: var(--bc-transition);
  box-sizing: border-box;
}

.bc-subcard[data-checked="true"] {
  border-color: var(--bc-mint-border);
  background: linear-gradient(180deg, var(--bc-mint-light) 0%, var(--bc-surface) 100%);
}

.bc-subcard[data-checked="false"] {
  border-color: var(--bc-rule);
  background: var(--bc-off);
}

/* ─── TOGGLE BUTTON (checkbox affordance) ────────────────────── */
.bc-toggle {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 2px solid var(--bc-mute);
  background: transparent;
  cursor: pointer;
  padding: 0;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition:
    background 180ms ease,
    border-color 180ms ease,
    transform 120ms ease;
  margin-top: 1px; /* optical alignment with first line of content */
}

.bc-toggle:hover {
  border-color: var(--bc-ink);
  transform: scale(1.05);
}

.bc-toggle:focus-visible {
  outline: 2px solid var(--bc-mint-border);
  outline-offset: 2px;
}

/* Checked state — ink bg + lemon checkmark (matches addon-row pattern) */
.bc-subcard[data-checked="true"] .bc-toggle {
  background: var(--bc-ink);
  border-color: var(--bc-ink);
}

.bc-toggle-check {
  font-size: 13px;
  font-weight: 700;
  color: var(--bc-lemon);
  line-height: 1;
  display: none;
}

.bc-subcard[data-checked="true"] .bc-toggle-check {
  display: block;
}

/* ─── SUBCARD CONTENT ───────────────────────────────────────── */
.bc-subcard-content {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.bc-subcard-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--bc-ink);
  line-height: 1.3;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
}

.bc-subcard-meta {
  font-size: 11px;
  font-weight: 400;
  color: var(--bc-mute);
  white-space: nowrap;
}

.bc-subcard-detail {
  font-size: 12px;
  color: var(--bc-mute);
  line-height: 1.4;
}

.bc-subcard-price {
  font-size: 14px;
  font-weight: 700;
  color: var(--bc-mint-border);
  margin-top: 2px;
  font-family: 'IBM Plex Mono', 'JetBrains Mono', monospace;
}

.bc-subcard[data-checked="false"] .bc-subcard-price {
  color: var(--bc-mute);
}

/* ─── FRICTION BOX ──────────────────────────────────────────── */
.bc-friction {
  background: var(--bc-amber-bg);
  border: 1px solid var(--bc-amber-border);
  border-radius: 8px;
  padding: 12px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--bc-amber-text);
  line-height: 1.5;
  /* spans full width — sits below the flex row */
  width: 100%;
  box-sizing: border-box;
  /* Subcard uses flex row — we want friction to break to its own row.
     Achieve this with flex wrapping: the toggle is fixed-width (24px),
     content fills the rest. Friction sits inside .bc-subcard-content
     so it naturally flows below the price. */
}

.bc-friction[hidden] {
  display: none;
}

.bc-friction-body {
  margin-bottom: 8px;
}

.bc-friction-body strong {
  display: block;
  font-weight: 700;
  margin-bottom: 4px;
}

.bc-friction-restore {
  display: inline-flex;
  align-items: center;
  background: transparent;
  border: 1px solid var(--bc-amber-border);
  border-radius: 5px;
  color: var(--bc-amber-text);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  cursor: pointer;
  transition: background 140ms ease;
  font-family: 'Inter', system-ui, sans-serif;
}

.bc-friction-restore:hover {
  background: var(--bc-lemon);
  border-color: var(--bc-lemon);
  color: var(--bc-ink);
}

.bc-friction-restore:focus-visible {
  outline: 2px solid var(--bc-mint-border);
  outline-offset: 2px;
}

/* ─── COMBINED PRICE FOOTER ─────────────────────────────────── */
.bc-combined-price {
  background: var(--bc-ink);
  color: #FFFFFF;
  padding: 12px 16px;
  border-radius: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: baseline;
  font-family: 'IBM Plex Mono', 'JetBrains Mono', 'JetBrains Mono', monospace;
  box-sizing: border-box;
  transition: background 200ms ease;
}

.bc-combined-price[data-checked="false"] {
  background: var(--bc-mute);
}

.bc-cp-label {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.75;
  font-family: 'Inter', system-ui, sans-serif;
  flex: 1 1 auto;
}

.bc-cp-reduced {
  opacity: 0.9;
  font-style: italic;
  font-family: 'Inter', system-ui, sans-serif;
  text-transform: none;
  letter-spacing: 0;
  font-size: 11px;
}

.bc-cp-breakdown {
  font-size: 12px;
  opacity: 0.65;
  white-space: nowrap;
}

.bc-cp-total {
  font-size: 18px;
  font-weight: 700;
  margin-left: auto;
  white-space: nowrap;
}

/* ─── PER-SURFACE OVERRIDES ─────────────────────────────────── */

/* Compare surface — slightly compact (lives inside a card grid) */
.bc-subcard[data-surface="compare"] {
  padding: 12px 14px;
}

.bc-subcard[data-surface="compare"] .bc-subcard-label {
  font-size: 13px;
}

.bc-subcard[data-surface="compare"] .bc-subcard-detail {
  font-size: 11px;
}

/* Enroll surface — slightly larger */
.bc-subcard[data-surface="enroll"] {
  padding: 16px 18px;
}

.bc-subcard[data-surface="enroll"] .bc-subcard-label {
  font-size: 15px;
}

/* ─── MOBILE (≤480px) ───────────────────────────────────────── */
@media (max-width: 480px) {
  .bc-friction {
    font-size: 11px;
  }

  .bc-friction-restore {
    font-size: 11px;
  }

  .bc-combined-price {
    flex-direction: column;
    gap: 4px;
    align-items: flex-start;
  }

  .bc-cp-total {
    margin-left: 0;
    font-size: 20px;
  }

  .bc-cp-breakdown {
    font-size: 11px;
  }
}

/* ─── REDUCED MOTION ────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .bc-subcard,
  .bc-combined-price,
  .bc-toggle,
  .bc-friction-restore {
    transition: none;
  }
}
