/*
 * Task #1439764 + #1439768: Full Purchase Widget — Eligibility + Filing + Guided
 * Used on: settlement detail pages, settlements browse page
 * Design: slim collapsed bar; expandable packs drawer below — Stripe-level elegance
 */

/* ── Detail page widget ─────────────────────────────────────────────── */
.ec-widget {
  background: #fff;
  border: 1.5px solid rgba(0, 179, 125, 0.35);
  border-radius: 12px;
  padding: 0.65rem 1rem;
  margin: 0.75rem 0;
  overflow: hidden;
}

/* Top row: label + primary CTAs + expand toggle */
.ec-widget-top {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.ec-widget-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: #374151;
  white-space: nowrap;
  flex-shrink: 0;
}

.ec-widget-pills {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  flex: 1;
}

.ec-widget-sub {
  width: 100%;
  font-size: 0.72rem;
  color: #6b7280;
  margin-top: 0.1rem;
  padding-top: 0.4rem;
  border-top: 1px solid #f3f4f6;
}

/* ── Packs expand toggle ─────────────────────────────────────────────── */
.ec-packs-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: none;
  border: none;
  font-size: 0.78rem;
  font-weight: 700;
  color: #005CC5;
  cursor: pointer;
  padding: 0.3rem 0.5rem;
  border-radius: 6px;
  white-space: nowrap;
  transition: background 0.12s;
  line-height: 1.3;
  text-decoration: none;
  flex-shrink: 0;
}
.ec-packs-toggle:hover,
.ec-packs-toggle:focus-visible {
  background: #eff6ff;
  color: #003fa3;
  outline: none;
}
.ec-packs-toggle-arrow {
  font-style: normal;
  display: inline-block;
  transition: transform 0.18s;
}
.ec-packs-toggle[aria-expanded="true"] .ec-packs-toggle-arrow {
  transform: rotate(90deg);
}

/* ── Packs drawer ─────────────────────────────────────────────────────── */
.ec-packs-drawer {
  display: none;
  padding-top: 0.65rem;
  margin-top: 0.55rem;
  border-top: 1px solid #f3f4f6;
  gap: 0.8rem;
  flex-direction: column;
}
.ec-packs-drawer.ec-packs-open {
  display: flex;
}

/* Each category group inside the drawer */
.ec-packs-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.ec-packs-group-label {
  font-size: 0.72rem;
  font-weight: 800;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ec-packs-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

/* ── Shared pill styles (detail + browse strip) ─────────────────────── */
.ec-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border-radius: 100px;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  padding: 0.38rem 0.9rem;
  transition: background 0.14s, color 0.14s, border-color 0.14s;
  cursor: pointer;
  line-height: 1.3;
}

/* Primary green — eligibility CTA */
.ec-pill-primary {
  background: #00B37D;
  color: #fff;
  border: 1.5px solid #00B37D;
}
.ec-pill-primary:hover,
.ec-pill-primary:focus-visible {
  background: #009966;
  border-color: #009966;
  color: #fff;
}

/* Primary blue — filing CTA */
.ec-pill-filing {
  background: #1a56db;
  color: #fff;
  border: 1.5px solid #1a56db;
}
.ec-pill-filing:hover,
.ec-pill-filing:focus-visible {
  background: #1447c0;
  border-color: #1447c0;
  color: #fff;
}

/* Primary indigo — guided filing CTA */
.ec-pill-guided {
  background: #6366f1;
  color: #fff;
  border: 1.5px solid #6366f1;
}
.ec-pill-guided:hover,
.ec-pill-guided:focus-visible {
  background: #4f46e5;
  border-color: #4f46e5;
  color: #fff;
}

/* Secondary: outlined — the pack options (green family) */
.ec-pill-secondary {
  background: #fff;
  color: #065f46;
  border: 1.5px solid rgba(0, 179, 125, 0.5);
}
.ec-pill-secondary:hover,
.ec-pill-secondary:focus-visible {
  background: #f0fdf4;
  border-color: #00B37D;
  color: #065f46;
}

/* Outlined blue — filing pack pills */
.ec-pill-secondary-blue {
  background: #fff;
  color: #1e3a8a;
  border: 1.5px solid rgba(26, 86, 219, 0.4);
}
.ec-pill-secondary-blue:hover,
.ec-pill-secondary-blue:focus-visible {
  background: #eff6ff;
  border-color: #1a56db;
  color: #1e3a8a;
}

/* Outlined indigo — guided pack pills */
.ec-pill-secondary-indigo {
  background: #fff;
  color: #312e81;
  border: 1.5px solid rgba(99, 102, 241, 0.4);
}
.ec-pill-secondary-indigo:hover,
.ec-pill-secondary-indigo:focus-visible {
  background: #eef2ff;
  border-color: #6366f1;
  color: #312e81;
}

/* Save badge inside pill */
.ec-save-badge {
  font-size: 0.68rem;
  font-weight: 700;
  background: rgba(0, 179, 125, 0.12);
  color: #065f46;
  border-radius: 100px;
  padding: 0.1rem 0.4rem;
  white-space: nowrap;
}
.ec-save-badge-blue {
  font-size: 0.68rem;
  font-weight: 700;
  background: rgba(26, 86, 219, 0.1);
  color: #1e3a8a;
  border-radius: 100px;
  padding: 0.1rem 0.4rem;
  white-space: nowrap;
}
.ec-save-badge-indigo {
  font-size: 0.68rem;
  font-weight: 700;
  background: rgba(99, 102, 241, 0.1);
  color: #312e81;
  border-radius: 100px;
  padding: 0.1rem 0.4rem;
  white-space: nowrap;
}

/* ── Mobile: stack pills vertically below 480px ─────────────────────── */
@media (max-width: 480px) {
  .ec-widget-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .ec-widget-pills {
    width: 100%;
  }

  .ec-pill {
    width: 100%;
    justify-content: center;
    padding: 0.55rem 1rem;
    font-size: 0.88rem;
  }

  .ec-widget-sub {
    font-size: 0.75rem;
  }

  .ec-packs-row {
    flex-direction: column;
    align-items: stretch;
  }
  .ec-packs-row .ec-pill {
    width: 100%;
    justify-content: center;
  }
}
