/* =========================================
   NAVBAR — Skoolapps (Floating Pill, Fixed)
   ========================================= */

/* The navbar NEVER scrolls — it's always a fixed overlay */
.navbar {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: var(--z-nav);
  width: calc(100% - 48px);
  max-width: 900px;
  /* Only animate the width/position — NOT top (it never moves) */
  transition: width 0.5s cubic-bezier(0.4,0,0.2,1),
              max-width 0.5s cubic-bezier(0.4,0,0.2,1),
              transform 0.5s cubic-bezier(0.4,0,0.2,1),
              top 0.5s cubic-bezier(0.4,0,0.2,1);
}

/* The pill shell */
.navbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 62px;
  padding: 0 8px 0 16px;
  background: #5cba5c;
  border-radius: 9999px;
  box-shadow: 0 8px 36px rgba(42,122,75,0.30), 0 2px 8px rgba(0,0,0,0.10);
  gap: 16px;
  transition: border-radius 0.5s cubic-bezier(0.4,0,0.2,1),
              height 0.4s ease,
              background 0.4s ease,
              padding 0.4s ease,
              box-shadow 0.4s ease;
  /* Ensure navbar NEVER participates in scroll */
  will-change: transform;
}

/* ── Scrolled: snap to top edge, expand full-width, flatten bottom ── */
.navbar--scrolled {
  top: 0;
  width: 100%;
  max-width: 100%;
  transform: translateX(-50%); /* keep centered but now full width */
}

.navbar--scrolled .navbar__inner {
  border-radius: 0 0 28px 28px;
  height: 68px;
  background: #4aaa4a;
  box-shadow: 0 6px 32px rgba(42,122,75,0.32);
  padding: 0 40px;
}

/* Logo */
.navbar__logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
}
.navbar__logo img {
  height: 42px;
  width: auto;
  display: block;
  object-fit: contain;
}

/* Desktop nav */
.navbar__nav { flex: 1; display: flex; justify-content: center; }
.navbar__links { display: flex; align-items: center; gap: 2px; }
.navbar__link {
  display: inline-block;
  padding: 8px 16px;
  font-size: 0.875rem;
  font-weight: 500;
  color: rgba(255,255,255,0.9);
  border-radius: 9999px;
  transition: color 0.15s ease, background 0.15s ease;
  white-space: nowrap;
  text-decoration: none;
}
.navbar__link:hover,
.navbar__link--active {
  color: #fff;
  background: rgba(255,255,255,0.16);
}

/* Right-side actions */
.navbar__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.navbar__cta {
  background: #fff;
  color: #1d5c38;
  font-weight: 700;
  font-size: 0.875rem;
  padding: 8px 20px;
  border-radius: 9999px;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  white-space: nowrap;
  text-decoration: none;
  display: inline-block;
}
.navbar__cta:hover {
  background: #e8f5ed;
  transform: scale(1.04);
  box-shadow: 0 4px 14px rgba(0,0,0,0.14);
}

/* ── "Book a Demo" sticky CTA — hero btn morphs to top-right ──
   Sits in fixed position, hidden until scroll threshold.
   Uses a smooth slide-in from top-right.                        */
.navbar__scroll-cta {
  position: fixed;
  top: 16px;
  right: 28px;
  z-index: calc(var(--z-nav) + 10);
  background: var(--clr-accent);
  color: #0d1b12;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.875rem;
  padding: 10px 24px;
  border-radius: 9999px;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 22px rgba(0,201,122,0.50);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  /* Hidden by default — slides down from above */
  opacity: 0;
  transform: translateY(-48px);
  pointer-events: none;
  transition: opacity 0.45s cubic-bezier(0.34,1.56,0.64,1),
              transform 0.45s cubic-bezier(0.34,1.56,0.64,1);
  will-change: transform, opacity;
}
.navbar__scroll-cta::before {
  content: '🚀';
  font-size: 14px;
}
.navbar__scroll-cta.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.navbar__scroll-cta:hover {
  background: #00e88a;
  transform: translateY(0) scale(1.06) !important;
  box-shadow: 0 8px 28px rgba(0,201,122,0.55);
}

/* Burger */
.navbar__burger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px; height: 36px;
  padding: 6px;
  flex-shrink: 0;
  cursor: pointer;
}
.navbar__burger span {
  display: block;
  height: 2px;
  background: white;
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.navbar__burger--open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.navbar__burger--open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.navbar__burger--open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile menu drops below the pill */
.navbar__mobile {
  background: #4aaa4a;
  border-radius: 0 0 24px 24px;
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.4s ease;
  margin-top: 4px;
  box-shadow: 0 14px 36px rgba(42,122,75,0.22);
}
.navbar__mobile--open { max-height: 460px; }
.navbar__mobile-links {
  display: flex;
  flex-direction: column;
  padding: 16px 24px 24px;
  gap: 6px;
}
.navbar__mobile-links .navbar__link {
  padding: 12px 16px;
  font-size: 1rem;
}
.navbar__mobile-links .btn {
  margin-top: 10px;
  width: 100%;
  text-align: center;
  justify-content: center;
}

@media (max-width: 768px) {
  .navbar { width: calc(100% - 24px); top: 10px; }
  .navbar--scrolled { top: 0; }
  .navbar__nav { display: none; }
  .navbar__actions .navbar__cta { display: none; }
  .navbar__scroll-cta { right: 14px; top: 10px; font-size: 0.8rem; padding: 8px 16px; }
  .navbar--scrolled .navbar__inner { padding: 0 16px; }
}
@media (min-width: 769px) {
  .hide-desktop { display: none !important; }
}
