/* ================================================================
   SPARK CUSTOM STORE — CANONICAL CTA / BUTTON SYSTEM
   buttons.css  ·  SINGLE SOURCE OF TRUTH for every call-to-action.

   Loaded LAST on every page so it supersedes the per-page button CSS
   that had drifted apart (8 paddings, 5 font sizes, 3 radii, mixed
   fonts/casing, solid-vs-gradient, even black text on red).

   Selectors are DOUBLED (.x.x → specificity 0,2,0) so they out-rank
   page-level compound rules such as `.hero-ctas .btn-primary` or
   `.about-cta-wrap .btn-primary` — no HTML/class changes required.

   Variants
     PRIMARY    red pill,   white text  · black sweeps in L→R on hover
     SECONDARY  outline pill (geometry only — each page keeps its own
                colours so contrast stays correct on light AND dark)
     WHATSAPP   green pill, white text  · darker green sweep on hover
   ================================================================ */

:root {
  --cta-red:      #D71920;
  --cta-black:    #0D0D0D;
  --cta-white:    #ffffff;
  --cta-green:    #25D366;
  --cta-green-dk: #128C4B;

  --cta-radius:   100px;      /* full pill */
  --cta-pad-y:    0.9rem;
  --cta-pad-x:    1.2rem;    /* client: CTAs read too wide -> tightened */
  --cta-size:     0.9rem;
  --cta-min-h:    2.75rem;   /* 44px — still a comfortable touch target */
  --cta-ease:     cubic-bezier(.65, 0, .35, 1);
}

/* ── 1 · SHARED GEOMETRY — every CTA on the site ──────────────── */
.btn-primary.btn-primary,
.btn-red.btn-red,
.btn--primary.btn--primary,
.pf-cta-btn-primary.pf-cta-btn-primary,
.pd-cta-primary.pd-cta-primary,
.sd-btn-primary.sd-btn-primary,
.sd-btn-quote.sd-btn-quote,
.btn-hero-red.btn-hero-red,
.submit-btn.submit-btn,
.cq-another-btn.cq-another-btn,
.btn-ghost.btn-ghost,
.btn--ghost.btn--ghost,
.btn--outline-white.btn--outline-white,
.btn--white.btn--white,
.pf-cta-btn-secondary.pf-cta-btn-secondary,
.pd-cta-secondary.pd-cta-secondary,
.sd-btn-outline.sd-btn-outline,
.sd-btn-contact.sd-btn-contact,
.btn-hero-ghost.btn-hero-ghost,
.btn-whatsapp.btn-whatsapp,
.ts-btn-green.ts-btn-green,
.faq-btn-whatsapp.faq-btn-whatsapp,
.gl-cta-btn.gl-cta-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  overflow: hidden;          /* clips the sweep to the pill */
  isolation: isolate;        /* stacking context so ::before sits behind text */
  z-index: 0;

  padding: var(--cta-pad-y) var(--cta-pad-x);
  min-height: var(--cta-min-h);
  /* NOTE: no `border` shorthand here on purpose — it would wipe out each
     page's ghost-button border colour. Variants below set their own. */
  border-radius: var(--cta-radius);

  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: var(--cta-size);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;

  transition: color .35s ease .06s,
              border-color .35s ease,
              transform .3s ease,
              box-shadow .3s ease;
}

/* ── 2 · THE PROGRESS-FILL SWEEP (left → right) ───────────────── */
.btn-primary.btn-primary::before,
.btn-red.btn-red::before,
.btn--primary.btn--primary::before,
.pf-cta-btn-primary.pf-cta-btn-primary::before,
.pd-cta-primary.pd-cta-primary::before,
.sd-btn-primary.sd-btn-primary::before,
.sd-btn-quote.sd-btn-quote::before,
.btn-hero-red.btn-hero-red::before,
.submit-btn.submit-btn::before,
.cq-another-btn.cq-another-btn::before,
.btn-whatsapp.btn-whatsapp::before,
.ts-btn-green.ts-btn-green::before,
.faq-btn-whatsapp.faq-btn-whatsapp::before,
.gl-cta-btn.gl-cta-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .45s var(--cta-ease);
}

.btn-primary.btn-primary:hover::before,
.btn-primary.btn-primary:focus-visible::before,
.btn-red.btn-red:hover::before,
.btn-red.btn-red:focus-visible::before,
.btn--primary.btn--primary:hover::before,
.btn--primary.btn--primary:focus-visible::before,
.pf-cta-btn-primary.pf-cta-btn-primary:hover::before,
.pf-cta-btn-primary.pf-cta-btn-primary:focus-visible::before,
.pd-cta-primary.pd-cta-primary:hover::before,
.pd-cta-primary.pd-cta-primary:focus-visible::before,
.sd-btn-primary.sd-btn-primary:hover::before,
.sd-btn-primary.sd-btn-primary:focus-visible::before,
.sd-btn-quote.sd-btn-quote:hover::before,
.sd-btn-quote.sd-btn-quote:focus-visible::before,
.btn-hero-red.btn-hero-red:hover::before,
.btn-hero-red.btn-hero-red:focus-visible::before,
.submit-btn.submit-btn:hover::before,
.submit-btn.submit-btn:focus-visible::before,
.cq-another-btn.cq-another-btn:hover::before,
.cq-another-btn.cq-another-btn:focus-visible::before,
.btn-whatsapp.btn-whatsapp:hover::before,
.btn-whatsapp.btn-whatsapp:focus-visible::before,
.ts-btn-green.ts-btn-green:hover::before,
.ts-btn-green.ts-btn-green:focus-visible::before,
.faq-btn-whatsapp.faq-btn-whatsapp:hover::before,
.faq-btn-whatsapp.faq-btn-whatsapp:focus-visible::before,
.gl-cta-btn.gl-cta-btn:hover::before,
.gl-cta-btn.gl-cta-btn:focus-visible::before {
  transform: scaleX(1);
}

/* Kill legacy decorative sweeps/gloss that used to live on ::after */
.btn--primary.btn--primary::after,
.btn-primary.btn-primary::after,
.submit-btn.submit-btn::after { content: none; }

/* ── 3 · PRIMARY — red pill, black sweep ──────────────────────── */
.btn-primary.btn-primary,
.btn-red.btn-red,
.btn--primary.btn--primary,
.pf-cta-btn-primary.pf-cta-btn-primary,
.pd-cta-primary.pd-cta-primary,
.sd-btn-primary.sd-btn-primary,
.sd-btn-quote.sd-btn-quote,
.btn-hero-red.btn-hero-red,
.submit-btn.submit-btn,
.cq-another-btn.cq-another-btn {
  background: var(--cta-red);
  color: var(--cta-white);
  border: 2px solid var(--cta-red);
  box-shadow: 0 6px 20px rgba(215, 25, 32, 0.30);
}
.btn-primary.btn-primary::before,
.btn-red.btn-red::before,
.btn--primary.btn--primary::before,
.pf-cta-btn-primary.pf-cta-btn-primary::before,
.pd-cta-primary.pd-cta-primary::before,
.sd-btn-primary.sd-btn-primary::before,
.sd-btn-quote.sd-btn-quote::before,
.btn-hero-red.btn-hero-red::before,
.submit-btn.submit-btn::before,
.cq-another-btn.cq-another-btn::before {
  background: var(--cta-black);
}
.btn-primary.btn-primary:hover,
.btn-primary.btn-primary:focus-visible,
.btn-red.btn-red:hover,
.btn-red.btn-red:focus-visible,
.btn--primary.btn--primary:hover,
.btn--primary.btn--primary:focus-visible,
.pf-cta-btn-primary.pf-cta-btn-primary:hover,
.pf-cta-btn-primary.pf-cta-btn-primary:focus-visible,
.pd-cta-primary.pd-cta-primary:hover,
.pd-cta-primary.pd-cta-primary:focus-visible,
.sd-btn-primary.sd-btn-primary:hover,
.sd-btn-primary.sd-btn-primary:focus-visible,
.sd-btn-quote.sd-btn-quote:hover,
.sd-btn-quote.sd-btn-quote:focus-visible,
.btn-hero-red.btn-hero-red:hover,
.btn-hero-red.btn-hero-red:focus-visible,
.submit-btn.submit-btn:hover,
.submit-btn.submit-btn:focus-visible,
.cq-another-btn.cq-another-btn:hover,
.cq-another-btn.cq-another-btn:focus-visible {
  color: var(--cta-white);          /* text stays white through the sweep */
  border-color: var(--cta-black);
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.38);
}

/* ── 4 · SECONDARY — matching pill geometry, colours left to the
      page (keeps contrast correct on both light and dark sections) ── */
.btn-ghost.btn-ghost,
.btn--ghost.btn--ghost,
.btn--outline-white.btn--outline-white,
.pf-cta-btn-secondary.pf-cta-btn-secondary,
.pd-cta-secondary.pd-cta-secondary,
.sd-btn-outline.sd-btn-outline,
.sd-btn-contact.sd-btn-contact,
.btn-hero-ghost.btn-hero-ghost {
  border-width: 2px;
  border-style: solid;   /* colour intentionally inherited from the page */
}
.btn-ghost.btn-ghost:hover,
.btn--ghost.btn--ghost:hover,
.btn--outline-white.btn--outline-white:hover,
.pf-cta-btn-secondary.pf-cta-btn-secondary:hover,
.pd-cta-secondary.pd-cta-secondary:hover,
.sd-btn-outline.sd-btn-outline:hover,
.sd-btn-contact.sd-btn-contact:hover,
.btn-hero-ghost.btn-hero-ghost:hover {
  transform: translateY(-2px);
}

/* Inverse (white pill) — used where the section itself is red */
.btn--white.btn--white {
  background: var(--cta-white);
  color: var(--cta-black);
  border: 2px solid var(--cta-white);
}

/* ── 5 · WHATSAPP — green pill, darker green sweep ────────────── */
.btn-whatsapp.btn-whatsapp,
.ts-btn-green.ts-btn-green,
.faq-btn-whatsapp.faq-btn-whatsapp,
.gl-cta-btn.gl-cta-btn {
  background: var(--cta-green);
  color: var(--cta-white);
  border: 2px solid var(--cta-green);
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.30);
}
.btn-whatsapp.btn-whatsapp::before,
.ts-btn-green.ts-btn-green::before,
.faq-btn-whatsapp.faq-btn-whatsapp::before,
.gl-cta-btn.gl-cta-btn::before {
  background: var(--cta-green-dk);
}
.btn-whatsapp.btn-whatsapp:hover,
.ts-btn-green.ts-btn-green:hover,
.faq-btn-whatsapp.faq-btn-whatsapp:hover,
.gl-cta-btn.gl-cta-btn:hover {
  color: var(--cta-white);
  border-color: var(--cta-green-dk);
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(18, 140, 75, 0.42);
}

/* ── 6 · Icons inside CTAs keep a consistent size ─────────────── */
.btn-primary.btn-primary svg, .btn-primary.btn-primary i,
.btn-red.btn-red svg, .btn-red.btn-red i,
.btn--primary.btn--primary svg, .btn--primary.btn--primary i,
.btn-ghost.btn-ghost svg, .btn-ghost.btn-ghost i,
.pf-cta-btn-primary.pf-cta-btn-primary svg,
.pd-cta-primary.pd-cta-primary svg,
.sd-btn-primary.sd-btn-primary svg { flex-shrink: 0; }

/* ── 7 · Size modifier (kept, but now consistent) ─────────────── */
/* .btn-lg used to inflate CTAs on products/services (and the Our Promise
   section). The client wants ONE CTA size site-wide, so it's now a no-op. */
.btn-lg.btn-lg { --cta-pad-y: 0.8rem; --cta-pad-x: 1.5rem; --cta-size: 0.95rem; --cta-min-h: 2.75rem; }

/* ── 8 · Large screens ────────────────────────────────────────── */
@media (min-width: 1920px) {
  :root {
    --cta-pad-y: 1.2rem;
    --cta-pad-x: 1.5rem;
    --cta-size:  1.2rem;
    --cta-min-h: 3.1rem;
  }
}

/* ── 9 · Accessibility ────────────────────────────────────────── */
.btn-primary.btn-primary:focus-visible,
.btn-red.btn-red:focus-visible,
.btn--primary.btn--primary:focus-visible,
.btn-ghost.btn-ghost:focus-visible,
.pf-cta-btn-primary.pf-cta-btn-primary:focus-visible,
.pd-cta-primary.pd-cta-primary:focus-visible,
.sd-btn-primary.sd-btn-primary:focus-visible,
.btn-whatsapp.btn-whatsapp:focus-visible,
.ts-btn-green.ts-btn-green:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.85);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .btn-primary.btn-primary::before,
  .btn-red.btn-red::before,
  .btn--primary.btn--primary::before,
  .pf-cta-btn-primary.pf-cta-btn-primary::before,
  .pd-cta-primary.pd-cta-primary::before,
  .sd-btn-primary.sd-btn-primary::before,
  .btn-hero-red.btn-hero-red::before,
  .submit-btn.submit-btn::before,
  .btn-whatsapp.btn-whatsapp::before,
  .ts-btn-green.ts-btn-green::before,
  .gl-cta-btn.gl-cta-btn::before { transition: none; }
}
