/* Pricing page: a two-tab rate card (Bulk / Realtime) built from tables.
   Both tabs live in the static HTML and are switched with CSS sibling selectors,
   so the Realtime table stays crawlable without JavaScript.

   Design language: this page owns no palette and no container maths of its own.
   Colours come from the site tokens declared in site.css (:root --ds-*,
   --color-brand-*, --color-accent-*, --color-signal-*), the container repeats
   Tailwind's max-w-7xl + px-4/sm:px-6/lg:px-8, the hero repeats the padding
   site.css gives every other page's grid-bg hero, and the legend badges reuse
   the .page-kicker treatment. Anything bespoke here is layout (the tabs and the
   tables), not look. */

.pricing-directory-page {
  --pricing-ink: var(--ds-color-title);
  --pricing-body: var(--ds-color-body);
  --pricing-muted: var(--ds-color-muted);
  --pricing-border: var(--ds-color-border);
  --pricing-soft: var(--ds-color-panel-soft);
  --pricing-row: var(--color-mist-100);
  --pricing-green: var(--color-signal-600);
  --pricing-brand: var(--color-brand-700);
  background: #fff !important;
  color: var(--ds-color-body);
  overflow-x: clip;
}

/* ==========================================================================
   Shell — identical geometry to every other page (see /products/, /api/)
   ========================================================================== */

/* Declared here rather than as `mx-auto max-w-7xl px-4 …`, because site.css has
   `.pricing-page .mx-auto { max-width: 100% }`, which would nullify max-w-7xl
   on this page. Values are the Tailwind defaults: 80rem + 1/1.5/2rem gutters. */
.pricing-directory-container {
  width: 100%;
  max-width: 80rem;
  margin-inline: auto;
  padding-inline: 1rem;
}

@media (min-width: 640px) {
  .pricing-directory-container {
    padding-inline: 1.5rem;
  }
}

@media (min-width: 1024px) {
  .pricing-directory-container {
    padding-inline: 2rem;
  }
}

/* site.css gives every other page this padding through
   `body:not(.pricing-page) section.grid-bg > div { padding: clamp(2.5rem, 7vh, 4.25rem) 0 clamp(2.5rem, 7vh, 4rem) }`.
   That selector excludes this page, so the same values are restated here. */
.pricing-directory-hero {
  padding-top: clamp(2.5rem, 7vh, 4.25rem);
  padding-bottom: clamp(2.5rem, 7vh, 4rem);
}

/* The same rule family also carries `main > section { padding: var(--ds-section-space) }`. */
.pricing-directory-catalog {
  padding-top: var(--ds-section-space);
  padding-bottom: var(--ds-section-space);
}

.pricing-directory-page h1,
.pricing-directory-page h2,
.pricing-directory-page h3,
.pricing-directory-page p {
  margin: 0;
}

/* h1/h2/h3 sizes are NOT set here: site.css already declares them for
   `.pricing-page main h1/h2/h3`, and that contract is the point. */

/* Only the two properties site.css does not already own are declared here.
   Its `body[class*="theme-"] section.grid-bg h1 + p` rule (specificity 0,2,4,
   higher than a single class, and !important on both sides) already supplies
   this node's colour, font-size and line-height; inheriting that is what keeps
   the lead in step with every other page's hero, so restating them here would
   be dead code. margin-top needs !important because the margin reset above
   zeroes paragraph margins. */
.pricing-directory-intro {
  max-width: 48rem;
  margin-top: 1rem !important;
}

/* ==========================================================================
   Legend badges — same shape and palette as .page-kicker
   ========================================================================== */

.pricing-mode-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 1.6rem;
  margin-top: 1.1rem;
}

.pricing-mode-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}

.pricing-mode-legend__note {
  color: var(--pricing-body);
  font-size: 0.88rem;
}

.pricing-mode-legend__note strong {
  color: var(--ds-color-title);
  font-weight: 700;
}

.pricing-mode-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: var(--ds-badge-height);
  padding-inline: var(--ds-badge-padding-x);
  border: 1px solid var(--ds-color-border);
  border-radius: 999px;
  box-shadow: var(--ds-shadow-1);
  font-size: var(--ds-badge-font-size);
  font-weight: var(--ds-badge-font-weight);
  letter-spacing: var(--ds-badge-letter-spacing);
  line-height: 1;
  white-space: nowrap;
}

.pricing-mode-badge--realtime {
  border-color: rgba(167, 243, 208, 0.7);
  color: var(--color-signal-700);
  background: rgba(16, 185, 129, 0.08);
}

.pricing-mode-badge--bulk {
  border-color: rgba(228, 201, 255, 0.9);
  color: var(--pricing-brand);
  background: rgba(124, 58, 237, 0.08);
}

/* ==========================================================================
   Hero toolbar — popular links (site's hot-link pills) + search
   ========================================================================== */

.pricing-directory-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  margin-top: var(--ds-section-gap);
}

.pricing-popular {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-width: 0;
}

.pricing-popular__label {
  flex: 0 0 auto;
  color: var(--ds-color-muted);
  font-size: 1.05rem;
  font-weight: 700;
}

.pricing-popular__items {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.pricing-popular__item {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  min-height: 3.1rem;
  padding: 0.45rem 1rem 0.45rem 0.55rem;
  border: 1px solid var(--pricing-border);
  border-radius: 999px;
  color: var(--pricing-ink);
  background: var(--ds-color-panel);
  box-shadow: var(--ds-shadow-1);
  font-size: 0.98rem;
  font-weight: 700;
  text-decoration: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.pricing-popular__item:hover,
.pricing-popular__item:focus-visible {
  border-color: var(--color-brand-200);
  box-shadow: var(--ds-shadow-2);
  transform: translateY(-1px);
}

.pricing-popular__item img {
  width: 2rem;
  height: 2rem;
  border-radius: 0.55rem;
  object-fit: contain;
}

.pricing-popular__item strong {
  color: var(--pricing-green);
  font-weight: 780;
  white-space: nowrap;
}

.pricing-search {
  position: relative;
  display: block;
  flex: 0 1 27rem;
  min-width: 18rem;
}

.pricing-search svg {
  position: absolute;
  top: 50%;
  left: 1rem;
  width: 1.35rem;
  height: 1.35rem;
  fill: none;
  stroke: var(--ds-color-muted);
  stroke-linecap: round;
  stroke-width: 1.8;
  transform: translateY(-50%);
  pointer-events: none;
}

.pricing-search input {
  width: 100%;
  min-height: 3.1rem;
  padding: 0.7rem 1rem 0.7rem 3rem;
  border: 1px solid var(--pricing-border);
  border-radius: 999px;
  outline: 0;
  color: var(--pricing-ink);
  background: #fff;
  box-shadow: var(--ds-shadow-1);
  font: inherit;
  font-size: 0.95rem;
}

.pricing-search input::placeholder {
  color: var(--ds-color-muted);
  opacity: 1;
}

.pricing-search input:focus {
  border-color: var(--color-brand-400);
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.14);
}

/* ==========================================================================
   Tabs
   ========================================================================== */

/* The checked radio reveals its panel through a sibling combinator, so the tab
   works with JavaScript disabled and both tables stay in the static HTML. */
.pricing-tabs {
  position: relative;
}

.pricing-tabs__state {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.pricing-tabs__bar {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.35rem;
  border: 1px solid var(--pricing-border);
  border-radius: 999px;
  background: var(--pricing-soft);
  box-shadow: var(--ds-shadow-1);
}

.pricing-tabs__tab {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1.35rem;
  border-radius: 999px;
  color: var(--ds-color-body);
  cursor: pointer;
  font-size: 0.98rem;
  font-weight: 740;
  letter-spacing: -0.01em;
  line-height: 1;
  transition: background 160ms ease, color 160ms ease;
}

.pricing-tabs__tab:hover {
  color: var(--pricing-ink);
}

.pricing-tabs__count {
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  color: var(--ds-color-muted);
  background: #fff;
  font-size: 0.76rem;
  font-weight: 800;
}

/* Selected tab reuses the site's primary-button gradient. */
#pricing-view-bulk:checked ~ .pricing-tabs__bar .pricing-tabs__tab--bulk,
#pricing-view-realtime:checked ~ .pricing-tabs__bar .pricing-tabs__tab--realtime {
  color: #fff;
  background: linear-gradient(135deg, var(--color-brand-700) 0%, var(--color-accent-600) 100%);
}

#pricing-view-bulk:checked ~ .pricing-tabs__bar .pricing-tabs__tab--bulk .pricing-tabs__count,
#pricing-view-realtime:checked ~ .pricing-tabs__bar .pricing-tabs__tab--realtime .pricing-tabs__count {
  color: var(--pricing-brand);
}

#pricing-view-bulk:focus-visible ~ .pricing-tabs__bar .pricing-tabs__tab--bulk,
#pricing-view-realtime:focus-visible ~ .pricing-tabs__bar .pricing-tabs__tab--realtime {
  outline: 3px solid rgba(124, 58, 237, 0.28);
  outline-offset: 3px;
}

.pricing-tabs__panel {
  display: none;
  margin-top: var(--ds-section-gap);
}

#pricing-view-bulk:checked ~ .pricing-tabs__panel[data-tab-panel="bulk"],
#pricing-view-realtime:checked ~ .pricing-tabs__panel[data-tab-panel="realtime"] {
  display: block;
}

.pricing-tabs__lead {
  max-width: 62rem;
  margin-bottom: var(--ds-section-gap) !important;
  color: var(--pricing-body) !important;
  font-size: 1.02rem !important;
  line-height: 1.78 !important;
}

.pricing-tabs__lead strong {
  color: var(--ds-color-title);
  font-weight: 700;
}

/* ==========================================================================
   Tables — one block per category inside the Bulk tab
   ========================================================================== */

/* Each block heading is the site's own .page-section-intro / .page-kicker pair
   (same as /products/), so these only carry spacing. */
.pricing-table-block + .pricing-table-block {
  margin-top: var(--ds-section-space);
}

.pricing-table-wrap {
  margin-top: var(--ds-section-gap);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

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

.pricing-table th {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--pricing-border);
  color: var(--ds-color-muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.pricing-table td {
  padding: 0.95rem 1rem;
  border-bottom: 1px solid var(--pricing-row);
  vertical-align: middle;
}

.pricing-table tbody tr:last-child td {
  border-bottom: 0;
}

.pricing-table tbody tr {
  transition: background 140ms ease;
}

.pricing-table tbody tr:hover {
  background: var(--color-mist-50);
}

.pricing-table th:first-child,
.pricing-table td:first-child {
  padding-left: 0;
}

.pricing-table th:last-child,
.pricing-table td:last-child {
  padding-right: 0;
}

.pricing-table__cell--platform {
  width: 13rem;
}

/* The descriptive column absorbs whatever the fixed numeric columns leave, so
   the price cells stay pinned right instead of drifting into open space. */
.pricing-table__cell--product {
  width: 100%;
}

.pricing-table__cell--num,
.pricing-table__cell--price {
  width: 9rem;
  text-align: right;
  white-space: nowrap;
}

.pricing-table th.pricing-table__cell--num,
.pricing-table th.pricing-table__cell--price {
  text-align: right;
}

.pricing-table__platform {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ds-color-body);
  font-size: 0.94rem;
  font-weight: 700;
}

.pricing-table__logo {
  width: 1.4rem;
  height: 1.4rem;
  flex: 0 0 1.4rem;
  border-radius: 0.35rem;
  object-fit: contain;
}

.pricing-table__mark {
  display: inline-flex;
  width: 1.4rem;
  height: 1.4rem;
  flex: 0 0 1.4rem;
  align-items: center;
  justify-content: center;
  border-radius: 0.35rem;
  color: #fff;
  background: var(--color-ink-900);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 1;
}

.pricing-table__mark--linkedin {
  border-radius: 999px;
  background: #147bb5;
  font-size: 0.72rem;
}

.pricing-table__mark--tiktok {
  background: #050505;
  font-size: 1rem;
  text-shadow: 1px 1px #25f4ee, -1px -1px #fe2c55;
}

.pricing-table__product {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
}

.pricing-table__name {
  color: var(--pricing-ink);
  font-size: 1.02rem;
  font-weight: 740;
  letter-spacing: -0.02em;
  line-height: 1.3;
  text-decoration: none;
}

a.pricing-table__name {
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 0.22em;
  transition: color 140ms ease, text-decoration-color 140ms ease;
}

a.pricing-table__name:hover,
a.pricing-table__name:focus-visible {
  color: var(--pricing-brand);
  text-decoration-color: currentColor;
}

.pricing-table__desc {
  color: var(--pricing-body);
  font-size: 0.9rem;
  line-height: 1.5;
}

.pricing-table__price {
  color: var(--pricing-ink);
  font-size: 1.08rem;
  font-weight: 780;
  letter-spacing: -0.02em;
}

.pricing-table__min {
  color: var(--ds-color-body);
  font-size: 0.95rem;
  font-weight: 700;
}

/* Reciprocal price: a row sold both ways links across to the other tab. */
.pricing-table__alt {
  display: block;
  margin-top: 0.2rem;
  color: var(--color-signal-700);
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.pricing-table__alt:hover,
.pricing-table__alt:focus-visible {
  color: var(--color-signal-600);
  text-decoration: underline;
}

.pricing-search-empty {
  padding: 1rem 0 0;
  color: var(--pricing-body) !important;
  font-size: 0.95rem !important;
}

.pricing-directory-page a:focus-visible,
.pricing-directory-page input:focus-visible {
  outline: 3px solid rgba(124, 58, 237, 0.28);
  outline-offset: 3px;
}

.pricing-directory-page [hidden] {
  display: none !important;
}

@media (max-width: 1120px) {
  .pricing-directory-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .pricing-search {
    flex-basis: auto;
    width: min(100%, 31rem);
  }

  .pricing-table__cell--platform {
    width: 10.5rem;
  }

  .pricing-table__cell--num,
  .pricing-table__cell--price {
    width: 8rem;
  }
}

/* Below this the tables restack into labelled rows: the header row is dropped
   and every numeric cell carries its own label from data-label. */
@media (max-width: 760px) {
  .pricing-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }

  .pricing-table,
  .pricing-table tbody,
  .pricing-table tr,
  .pricing-table td {
    display: block;
    width: 100%;
  }

  .pricing-table tbody tr {
    padding: 1.1rem 0;
    border-bottom: 1px solid var(--pricing-border);
  }

  .pricing-table tbody tr:hover {
    background: none;
  }

  .pricing-table td {
    padding: 0;
    border-bottom: 0;
    text-align: left;
  }

  /* Qualified with td: the restack rule above sets `display: block` on every
     cell, and `.pricing-table td` outweighs a bare class selector. */
  .pricing-table td.pricing-table__cell--num,
  .pricing-table td.pricing-table__cell--price {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
    margin-top: 0.55rem;
    text-align: right;
  }

  .pricing-table__cell--num::before,
  .pricing-table__cell--price::before {
    content: attr(data-label);
    color: var(--pricing-muted);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }
}

@media (max-width: 640px) {
  .pricing-popular {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.8rem;
  }

  .pricing-popular__items {
    width: 100%;
  }

  .pricing-popular__item {
    max-width: 100%;
    font-size: 0.86rem;
  }

  .pricing-search {
    width: 100%;
    min-width: 0;
  }

  .pricing-mode-legend {
    gap: 0.5rem 1rem;
  }

  .pricing-tabs__bar {
    display: flex;
    width: 100%;
  }

  .pricing-tabs__tab {
    flex: 1 1 auto;
    justify-content: center;
    padding-inline: 0.8rem;
    font-size: 0.88rem;
  }

  .pricing-tabs__panel {
    margin-top: 1.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pricing-directory-page * {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
