/* =========================================================
   BG STICKY MOBILE CTA BAR
   Mobile-only conversion bar pinned to viewport bottom.
   - Hidden on desktop (>=768px)
   - Hidden on form pages (Lets Talk, Careers apply, etc.)
   - Adds body padding so content is not hidden behind it
   - Sits below the floating chat launcher and the nav drawer
========================================================= */

.bgsc {
  /* Hidden by default — only shown via media query below */
  display: none;
}

@media (max-width: 767px) {
  .bgsc {
    display: flex;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 8800; /* below concierge panel (9200) + drawer (110 is fine — drawer covers from top:60) */
    align-items: stretch;
    gap: 8px;
    padding: 10px 12px calc(env(safe-area-inset-bottom, 0px) + 10px);
    background:
      linear-gradient(180deg, rgba(4, 7, 15, 0.55) 0%, rgba(4, 7, 15, 0.96) 38%, rgba(4, 7, 15, 0.99) 100%);
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    border-top: 1px solid rgba(79, 200, 255, 0.16);
    box-shadow:
      0 -1px 0 rgba(79, 200, 255, 0.04) inset,
      0 -10px 30px rgba(0, 0, 0, 0.35);
    transform: translate3d(0, 0, 0);
    transition: transform 240ms cubic-bezier(0.22, 1, 0.36, 1), opacity 200ms ease;
    will-change: transform;
    contain: layout style;
  }

  /* Body padding so content is never hidden behind the bar.
     76px = ~56 (bar) + 20 (breathing room). Safe-area extra is in the bar itself. */
  body.bgsc-has {
    padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  }

  /* When the user explicitly hides the bar (e.g. nav drawer open, or scrolled
     past the closing CTA into the footer) — slide it offscreen. */
  .bgsc.bgsc-hide {
    transform: translate3d(0, 120%, 0);
    pointer-events: none;
  }
}

/* ---------- Primary CTA: Talk to an AI Architect ---------- */
.bgsc-primary {
  position: relative;
  flex: 1 1 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 14px;
  font-family: var(--font-display, "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);
  font-size: 14.5px;
  font-weight: 500;
  letter-spacing: -0.005em;
  color: #04060F;
  background: linear-gradient(135deg, #5EFFC0 0%, #4FC8FF 60%, #4FC8FF 100%);
  border: 0;
  border-radius: 6px;
  text-decoration: none;
  white-space: nowrap;
  box-shadow:
    0 0 0 1px rgba(79, 200, 255, 0.6) inset,
    0 8px 24px rgba(79, 200, 255, 0.28),
    0 0 0 0 rgba(79, 200, 255, 0.4);
  transition: transform 160ms ease, box-shadow 200ms ease;
  -webkit-tap-highlight-color: transparent;
}
.bgsc-primary:active {
  transform: translateY(1px);
  box-shadow:
    0 0 0 1px rgba(79, 200, 255, 0.6) inset,
    0 4px 14px rgba(79, 200, 255, 0.28);
}
.bgsc-primary:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}
.bgsc-primary .bgsc-i {
  display: inline-flex; width: 16px; height: 16px;
  color: #04060F;
  flex-shrink: 0;
}
.bgsc-primary .bgsc-arrow {
  width: 14px; height: 14px;
  margin-left: 2px;
  flex-shrink: 0;
  transition: transform 200ms ease;
}
.bgsc-primary:hover .bgsc-arrow { transform: translateX(2px); }

/* Pulse ring on the primary button — subtle attention every ~6s.
   Disabled by prefers-reduced-motion. */
.bgsc-primary::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 6px;
  pointer-events: none;
  box-shadow: 0 0 0 0 rgba(79, 200, 255, 0.0);
  animation: bgsc-pulse 6s ease-in-out infinite;
  animation-delay: 1.5s;
}
@keyframes bgsc-pulse {
  0%, 92%, 100% { box-shadow: 0 0 0 0 rgba(79, 200, 255, 0); }
  94%           { box-shadow: 0 0 0 4px rgba(79, 200, 255, 0.18); }
  98%           { box-shadow: 0 0 0 10px rgba(79, 200, 255, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .bgsc-primary::after { animation: none; }
  .bgsc { transition: none; }
}

/* ---------- Compact secondary: View Products ---------- */
.bgsc-secondary {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 92px;
  min-height: 48px;
  padding: 0 12px;
  font-family: var(--font-mono, "JetBrains Mono", "SF Mono", Menlo, monospace);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #ECF0FA;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(79, 200, 255, 0.22);
  border-radius: 6px;
  text-decoration: none;
  white-space: nowrap;
  transition: background 200ms ease, border-color 200ms ease, color 200ms ease;
  -webkit-tap-highlight-color: transparent;
}
.bgsc-secondary:hover,
.bgsc-secondary:focus-visible {
  background: rgba(79, 200, 255, 0.08);
  border-color: rgba(79, 200, 255, 0.4);
  color: #fff;
  outline: none;
}
.bgsc-secondary:focus-visible {
  outline: 2px solid var(--site-cyan, #4FC8FF);
  outline-offset: 2px;
}

/* On very small phones (<360px wide) — compress secondary to icon */
@media (max-width: 359px) {
  .bgsc-secondary .bgsc-secondary-l { display: none; }
  .bgsc-secondary { min-width: 48px; padding: 0 10px; }
}

/* On somewhat-narrow phones (360–380px) — secondary remains label-only, but tighter */
@media (max-width: 380px) {
  .bgsc { padding: 8px 10px calc(env(safe-area-inset-bottom, 0px) + 8px); }
  .bgsc-primary { font-size: 13.5px; padding: 0 10px; }
  .bgsc-primary .bgsc-arrow { display: none; }
}

/* ---------- Concierge launcher lift ----------
   When the sticky CTA is mounted, push the floating chat launcher
   above it so it never overlaps. The launcher's default bottom is 28px;
   on mobile we lift it to clear the 56px bar + safe area. */
@media (max-width: 767px) {
  body.bgsc-has .bgc-launch {
    /* If concierge.css hides .bgc-launch at ≤720px, this override re-shows it
       as a compact circle floating above the new CTA bar. */
    display: inline-flex !important;
    bottom: calc(84px + env(safe-area-inset-bottom, 0px)) !important;
    right: 14px !important;
    padding: 0 !important;
    width: 48px; height: 48px;
    border-radius: 50% !important;
    justify-content: center !important;
  }
  body.bgsc-has .bgc-launch .bgc-launch-status,
  body.bgsc-has .bgc-launch .bgc-launch-arrow {
    display: none !important;
  }
  body.bgsc-has .bgc-launch .bgc-launch-icon {
    width: 40px !important;
    height: 40px !important;
  }
  /* Suppress concierge's own 4-button mobile bar — replaced by sticky CTA + launcher */
  body.bgsc-has .bgc-mob { display: none !important; }
  body.bgsc-has.bgc-has-mob { padding-bottom: 0 !important; }
}

/* ---------- Page-level opt-outs ----------
   Form pages and other dedicated-task pages can suppress the bar via this class. */
body.bgsc-suppress .bgsc { display: none !important; }
body.bgsc-suppress { padding-bottom: 0 !important; }
