/* ==========================================================================
   Public pricing page (/pricing) — scoped: .pp-*
   Desktop: comparison table. Mobile: horizontal snap cards.
   ========================================================================== */

.pp-eyebrow {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.9rem;
  border-radius: 9999px;
  border: 1px solid hsl(var(--primary) / 0.35);
  background-color: hsl(var(--primary) / 0.08);
  color: hsl(var(--primary));
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   Controls row (billing toggle + differences filter)
   -------------------------------------------------------------------------- */
.pp-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.9rem 1.5rem;
  margin-bottom: 1.75rem;
}

.pp-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.3rem;
  border-radius: 9999px;
  border: 1px solid hsl(var(--border));
  background-color: hsl(var(--card));
}

.pp-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.25rem;
  border: none;
  background: transparent;
  border-radius: 9999px;
  font-size: 0.9rem;
  font-weight: 600;
  color: hsl(var(--muted-foreground));
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.pp-toggle-btn:hover {
  color: hsl(var(--foreground));
}

.pp-toggle-btn.is-active {
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}

.pp-toggle-btn .pp-save-chip {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.1rem 0.5rem;
  border-radius: 9999px;
  background-color: hsl(var(--primary) / 0.12);
  color: hsl(var(--primary));
  white-space: nowrap;
}

.pp-toggle-btn.is-active .pp-save-chip {
  background-color: hsl(var(--primary-foreground) / 0.2);
  color: hsl(var(--primary-foreground));
}

/* "Only differences" switch — desktop only, cards show their own lists */
.pp-diff-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  cursor: pointer;
  user-select: none;
}

.pp-diff-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.pp-diff-track {
  position: relative;
  flex: none;
  width: 2.15rem;
  height: 1.2rem;
  border-radius: 9999px;
  background-color: hsl(var(--input));
  transition: background-color 0.2s ease;
}

.pp-diff-track::before {
  content: "";
  position: absolute;
  top: 0.15rem;
  left: 0.15rem;
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 9999px;
  background-color: hsl(var(--card));
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.25);
  transition: transform 0.2s ease;
}

.pp-diff-toggle input:checked+.pp-diff-track {
  background-color: hsl(var(--primary));
}

.pp-diff-toggle input:checked+.pp-diff-track::before {
  transform: translateX(0.95rem);
}

.pp-diff-toggle input:focus-visible+.pp-diff-track {
  outline: 2px solid hsl(var(--ring));
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   Desktop table
   -------------------------------------------------------------------------- */
.pp-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) + 8px);
  background-color: hsl(var(--card));
}

.pp-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.pp-table th,
.pp-table td {
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid hsl(var(--border));
  text-align: center;
  min-width: 172px;
  font-size: 0.9rem;
  background-color: hsl(var(--card));
}

.pp-table tbody tr:last-child th,
.pp-table tbody tr:last-child td {
  border-bottom: none;
}

/* Sticky feature-label column; shadow only appears once actually scrolled */
.pp-table th:first-child,
.pp-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  min-width: 190px;
  max-width: 260px;
  text-align: left;
  font-weight: 500;
  box-shadow: inset -1px 0 0 hsl(var(--border));
}

.pp-table-wrap.is-scrolled .pp-table th:first-child,
.pp-table-wrap.is-scrolled .pp-table td:first-child {
  box-shadow: inset -1px 0 0 hsl(var(--border)), 6px 0 12px -6px rgb(0 0 0 / 0.18);
}

/* Plan header cells */
.pp-table thead th {
  vertical-align: top;
  padding: 1.5rem 1.25rem 1.4rem;
  text-align: left;
}

.pp-plan-header {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.pp-plan-badge-row {
  min-height: 1.5rem;
  /* reserved on every column so headers align */
  margin-bottom: 0.35rem;
}

.pp-plan-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.65rem;
  border-radius: 9999px;
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  white-space: nowrap;
}

.pp-plan-name {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.pp-plan-tagline {
  min-height: 3.9rem;
  /* three lines reserved so prices align */
  margin-top: 0.35rem;
  font-size: 0.8rem;
  font-weight: 400;
  line-height: 1.3rem;
  color: hsl(var(--muted-foreground));
  white-space: normal;
}

.pp-price-zone {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 4.4rem;
  /* value + note reserved so CTAs align */
  margin: 0.4rem 0 1rem;
}

.pp-price-value {
  font-size: 1.9rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: hsl(var(--foreground));
}

.pp-price-period {
  font-size: 0.85rem;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
}

.pp-price-note {
  min-height: 2.2rem;
  /* two small lines: yearly note wraps */
  margin-top: 0.35rem;
  font-size: 0.72rem;
  font-weight: 400;
  line-height: 1.1rem;
  color: hsl(var(--muted-foreground));
  white-space: normal;
}

.pp-price {
  transition: opacity 0.15s ease;
}

.pp-price[hidden] {
  display: none;
}

.pp-price.is-switching {
  opacity: 0;
}

/* Group header rows */
.pp-table .pp-group-row th,
.pp-table .pp-group-row td {
  padding: 0.65rem 1.1rem;
  background-color: hsl(var(--muted));
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground));
}

/* Featured column */
.pp-table .is-featured {
  background-color: hsl(var(--primary) / 0.05);
}

.pp-table thead th.is-featured {
  border-top: 3px solid hsl(var(--primary));
}

.pp-table .pp-group-row .is-featured {
  background-color: hsl(var(--muted));
}

/* Row + column hover highlight */
.pp-table tbody tr:not(.pp-group-row):hover td:not(:first-child) {
  background-color: hsl(var(--accent) / 0.35);
}

.pp-table td.is-col-hover:not(:first-child),
.pp-table thead th.is-col-hover {
  background-color: hsl(var(--accent) / 0.35);
}

.pp-table .is-featured.is-col-hover {
  background-color: hsl(var(--primary) / 0.09);
}

/* "Only differences" filter */
.pp-table.pp-only-diff tr[data-identical="1"] {
  display: none;
}

.pp-table tr.pp-group-hidden {
  display: none;
}

/* Checks & dashes */
.pp-feature-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.3rem;
  height: 1.3rem;
  border-radius: 9999px;
  background-color: hsl(var(--primary) / 0.12);
  color: hsl(var(--primary));
}

.pp-dash {
  display: inline-block;
  vertical-align: middle;
  color: hsl(var(--muted-foreground));
  opacity: 0.4;
}

/* CTA buttons */
.pp-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 2.5rem;
  padding: 0 1rem;
  border-radius: var(--radius);
  font-size: 0.83rem;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid hsl(var(--primary));
  color: hsl(var(--primary));
  transition: background-color 0.2s ease, color 0.2s ease;
}

.pp-cta:hover {
  background-color: hsl(var(--primary) / 0.08);
}

.pp-cta--primary {
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}

.pp-cta--primary:hover {
  background-color: hsl(var(--primary) / 0.9);
  color: hsl(var(--primary-foreground));
}

.pp-table tfoot td {
  padding: 1rem 1.25rem 1.25rem;
  border-bottom: none;
  border-top: 1px solid hsl(var(--border));
}

/* --------------------------------------------------------------------------
   Small screens: same table, compact cells + horizontal scroll
   -------------------------------------------------------------------------- */
@media (max-width: 640px) {

  .pp-table th,
  .pp-table td {
    padding: 0.7rem 0.8rem;
    min-width: 150px;
    font-size: 0.85rem;
  }

  .pp-table th:first-child,
  .pp-table td:first-child {
    min-width: 136px;
    max-width: 180px;
  }

  .pp-table thead th {
    padding: 1.1rem 0.9rem 1rem;
  }

  .pp-plan-tagline {
    min-height: 0;
  }

  .pp-price-value {
    font-size: 1.6rem;
  }

  .pp-price-note {
    min-height: 0;
  }
}
