/* ============================================================
   PRICING  .pricing
   "5. Services / Monthly retainers":
     heading → "why a retainer" (3 points) → two tabs
     (Store development / Email marketing) → tier cards →
     terms → one line about one-off work.
   Tabs are driven by js/modules/tabs.js. Without JS both groups
   of plans are simply shown one after another.
   Tweak: --plans-width (how wide the card row may get).
   ============================================================ */

/* ---- Why a retainer: three short points ---- */
.pricing__why {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  padding-top: 3rem;
}

.pricing__why-item {
  padding-top: 1rem;
  border-top: 1px solid var(--color-line-strong);
  color: var(--color-gray);
  font-size: 0.95rem;
  font-weight: var(--fw-light);
}

.pricing__why-number {
  color: var(--color-primary-ink);
  font-size: 0.8rem;
  font-weight: var(--fw-semibold);
  letter-spacing: 0.08em;
}

.pricing__why-title {
  padding: 0.25rem 0 0.4rem;
  color: var(--color-text);
  font-size: 1.15rem;
  font-weight: var(--fw-medium);
}

/* ---- Tabs + cards block ----
   Wider than the page's text column so three cards fit side by
   side: it breaks out of .container, centred on the page. */
.pricing__plans {
  --plans-width: min(1180px, 92vw);
  display: flex;
  flex-direction: column;
  align-items: center;
  width: var(--plans-width);
  margin: 4rem calc((100% - var(--plans-width)) / 2) 0;
}

/* ---- Tab buttons ---- */
.pricing__tabs {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  padding: 8px;
  border-radius: 20rem;
  background-color: var(--color-white);
}

/* no JS → no tab buttons, all plans listed */
html:not(.js) .pricing__tabs {
  display: none;
}

.pricing__tab {
  padding: 12px 22px;
  border: 0;
  border-radius: 20rem;
  background-color: transparent;
  color: var(--color-gray-3);
  text-align: center;
  cursor: pointer;
  transition: background-color var(--duration) ease, color var(--duration) ease;
}

/* fallback for the selected tab (before tabs.js adds the sliding pill) */
.pricing__tab[aria-selected="true"] {
  background-color: var(--color-gray-2);
  color: var(--color-white);
}

/* Sliding pill: ONE dark pill behind the tabs that glides to the
   selected one (created by js/modules/tabs.js), instead of one
   tab fading out while another fades in. */
.pricing__tabs.has-indicator {
  position: relative;
  isolation: isolate;
}

.pricing__tabs.has-indicator .pricing__tab[aria-selected="true"] {
  background-color: transparent;
}

.pricing__indicator {
  position: absolute;
  top: 0;
  left: 0;
  z-index: -1;
  border-radius: 20rem;
  background-color: var(--color-gray-2);
  pointer-events: none;
  transition:
    transform 550ms var(--ease-out-quart),
    width 550ms var(--ease-out-quart),
    height 550ms var(--ease-out-quart);
}

.pricing__indicator.is-instant {
  transition: none;
}

/* ---- Panels ----
   Desktop: both panels sit in the same grid cell. The inactive
   one is invisible (not removed), so the block keeps the height
   of the taller panel and switching tabs never moves the page.
   The new panel fades and rises in while the old one fades out.
   Phones: the inactive panel is removed (see the 767px block).
   Without JS the panels simply follow each other. */
.pricing__panels {
  display: grid;
  width: 100%;
  margin-top: 2.5rem;
}

.js .pricing__panel {
  grid-area: 1 / 1;
  transition:
    opacity 600ms var(--ease-out-quart) 120ms,
    transform 600ms var(--ease-out-quart) 120ms,
    visibility 0s;
}

/* `hidden` is set by tabs.js; visibility flips only after the fade-out,
   so the old panel is unclickable and unread once gone */
.js .pricing__panel[hidden] {
  display: block;
  visibility: hidden;
  opacity: 0;
  transform: translateY(14px) scale(0.985);
  transition:
    opacity 300ms ease,
    transform 300ms ease,
    visibility 0s linear 300ms;
}

html:not(.js) .pricing__panel + .pricing__panel {
  margin-top: 2rem;
}

.pricing__tiers {
  display: grid;
  gap: 1.25rem;
  align-items: stretch;
}

.pricing__tiers--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.pricing__tiers--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 800px;
  margin-inline: auto;
}

.pricing__note {
  max-width: 800px;
  margin: 1.25rem auto 0;
  color: var(--color-gray);
  font-size: 0.95rem;
  font-weight: var(--fw-light);
  text-align: center;
}

/* ---- Plan card ----
   Spacing rule for the "Book a Call" button:
   gap to the right = gap below = --cta-gap.
   --plan-pad is the card's normal padding for the text. */
.plan {
  --plan-pad: 1.6rem;
  --cta-gap: 1rem;
  position: relative;
  display: flex;
  flex-direction: column;
  padding: var(--plan-pad) var(--plan-pad) var(--cta-gap);
  border-radius: var(--radius-card);
  background-color: var(--color-white);
  box-shadow: var(--shadow-card);
  color: var(--color-gray);
}

.plan__kicker {
  color: var(--color-primary-ink);
  font-size: 0.95rem;
  font-weight: var(--fw-medium);
}

.plan__name {
  padding-top: 0.25rem;
  color: var(--color-text);
  font-size: 1.5rem;
  font-weight: var(--fw-medium);
  line-height: 110%;
  letter-spacing: -0.24px;
}

.plan__price {
  padding-top: 0.9rem;
  font-size: 0.95rem;
}

.plan__amount {
  color: var(--color-text);
  font-size: 2.4rem;
  font-weight: var(--fw-bold);
  line-height: 100%;
  letter-spacing: -0.03em;
}

.plan__desc {
  margin-bottom: 1rem;
  padding: 0.8rem 0 1rem;
  border-bottom: 1px solid var(--color-line-strong);
  font-size: 0.95rem;
  font-weight: var(--fw-light);
  line-height: 135%;
}

.plan__features li {
  display: flex;
  align-items: flex-start;
  margin-bottom: 0.6rem;
  font-size: 0.95rem;
  font-weight: var(--fw-light);
  line-height: 135%;
}

.plan__features li:last-child {
  margin-bottom: 0;
}

.plan__features img {
  flex: none;
  width: 1.25rem;
  height: 1.25rem;
  margin: 1px 0.45rem 0 0;
}

.plan__action {
  display: flex;
  justify-content: flex-end;
  margin-top: auto;                                       /* pins the button to the card bottom */
  margin-right: calc(var(--cta-gap) - var(--plan-pad));   /* pulls it out to --cta-gap from the edge */
  padding-top: 1.5rem;                                    /* min. space above, under the last tick */
}

/* "Most popular": dark card, so it is the first one the eye lands on */
.plan--featured {
  background-color: var(--color-text);
  color: #ffffffc7;
}

.plan--featured .plan__name,
.plan--featured .plan__amount {
  color: var(--color-white);
}

.plan--featured .plan__kicker {
  color: var(--color-primary);
}

.plan--featured .plan__desc {
  border-bottom-color: #ffffff38;
}

/* on the dark card the button flips to the yellow accent */
.plan--featured .btn {
  border-color: var(--color-primary);
  background-color: var(--color-primary);
}

.plan--featured .btn__text {
  color: var(--color-text);
}

.plan--featured .btn__icon img {
  filter: invert(1);
}

.plan__badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  padding: 0.1rem 0.6rem;
  border-radius: var(--radius-pill);
  background-color: var(--color-primary);
  color: var(--color-text);
  font-size: 0.75rem;
  font-weight: var(--fw-semibold);
}

/* ---- Below the cards: one-off rates, terms, VAT fine print ---- */
.pricing__terms {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem 1.75rem;
  margin-top: 1.75rem;
  color: var(--color-gray);
  font-size: 0.95rem;
}

.pricing__terms li {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.pricing__terms img {
  width: 1.2rem;
  height: 1.2rem;
}

.pricing__oneoff {
  margin-top: 2.5rem;
  color: var(--color-gray);
  font-size: 0.95rem;
  font-weight: var(--fw-light);
  text-align: center;
}

.pricing__oneoff a {
  padding-bottom: 1px;
  border-bottom: 1px solid var(--color-primary);
  color: var(--color-text);
  font-weight: var(--fw-medium);
  transition: color var(--duration) ease;
}

.pricing__fineprint {
  max-width: 760px;
  margin: 2rem auto 0;
  color: var(--color-gray);
  font-size: 0.8rem;
  font-weight: var(--fw-light);
  text-align: center;
}

.pricing__oneoff a:hover,
.pricing__oneoff a:focus-visible {
  color: var(--color-primary-ink);
}

/* ============ Tablet ============ */
@media (max-width: 991px) {
  .pricing__why {
    gap: 1.25rem;
    padding-top: 2rem;
  }

  .pricing__plans {
    width: 100%;
    margin: 3rem 0 0;
  }

  .pricing__tab {
    padding-inline: 14px;
    font-size: 16px;
  }

  .pricing__tiers {
    gap: 0.75rem;
  }

  .plan {
    --plan-pad: 1.1rem;
  }

  .plan__amount {
    font-size: 2rem;
  }

  /* badge moves into the flow so it never covers a long plan name */
  .plan__badge {
    position: static;
    align-self: flex-start;
    margin-bottom: 0.6rem;
  }
}

/* ============ Phones: cards stack, the inactive panel is removed ============ */
@media (max-width: 767px) {
  /* phones: hide the 3 "why a retainer" points so the tabs and cards
     sit right under the heading (the intro line already says the same) */
  .pricing__why {
    display: none;
  }

  .pricing__tabs {
    gap: 6px;
    width: 100%;
  }

  .pricing__tiers--3,
  .pricing__tiers--2 {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .plan {
    --plan-pad: 1.4rem;
  }

  .js .pricing__panel[hidden] {
    display: none;
  }

  /* the panel that appears fades and rises in */
  .js .pricing__panel:not([hidden]) {
    animation: pricing-panel-in 500ms var(--ease-out-quart) both;
  }

  .pricing__plans {
    margin-top: 2.5rem;
  }

  .pricing__tab {
    flex: 1;
    padding-inline: 8px;
  }

  .pricing__terms {
    flex-direction: column;
    align-items: flex-start;
    width: fit-content;
    margin-inline: auto;
  }
}

@keyframes pricing-panel-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .js .pricing__panel,
  .js .pricing__panel[hidden],
  .js .pricing__panel:not([hidden]),
  .pricing__indicator {
    transition: none;
    animation: none;
  }
}
