/* ==================================================
   COMPONENT: NAVBAR
   ================================================== */

.cx-navbar {
  position: sticky !important;
  top: 0;
  z-index: 1000;
  height: var(--cx-navbar-height);
  background-color: var(--cx-navbar-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--cx-border);
  box-shadow: var(--cx-navbar-shadow);
}

.cx-navbar-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Everything right of the brand: nav collapse + theme toggle + mobile
   menu button. Keeping this as one wrapper means cx-navbar-inner only
   ever has 2 children, so the space-between above works identically
   at every breakpoint. */
.cx-navbar-right {
  display: flex;
  align-items: center;
  gap: var(--cx-space-md);
  flex: 1;
  justify-content: flex-end;
}

/* ---------- Brand ---------- */
.cx-navbar-brand {
  display: flex;
  align-items: center;
}

.cx-logo-img {
  display: block;
  height: 66px;
  width: auto;
}

.cx-logo-dark {
  display: none;
}

[data-theme="dark"] .cx-logo-light {
  display: none;
}

[data-theme="dark"] .cx-logo-dark {
  display: block;
}

/* ---------- Links + actions (desktop layout) ---------- */
.cx-navbar-collapse {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 1;
  gap: var(--cx-space-lg);
}

.cx-navbar-links {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  gap: 2.25rem;
  margin: 0;
}

/* Extra links (e.g. Refund Policy) that only make sense to show
   in the mobile hamburger menu, where there's vertical room to
   spare — hidden on desktop to keep the primary nav short.
   Un-hidden again inside the mobile breakpoint in responsive.css.
   Two classes combined for specificity, so this reliably wins
   over the plain .cx-navbar-link's display: inline-block. */
a.cx-navbar-link.cx-navbar-link-mobile-only {
  display: none;
}

.cx-navbar-link {
  position: relative;
  display: inline-block;
  padding-block: 0.4rem;
  font-family: var(--cx-font-display);
  font-size: var(--cx-fs-sm);
  font-weight: 600;
  color: var(--cx-text);
  transition: color var(--cx-transition-fast);
}

.cx-navbar-link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: var(--cx-gradient-brand);
  border-radius: var(--cx-radius-pill);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--cx-transition-fast);
}

.cx-navbar-link:hover,
.cx-navbar-link.is-active {
  color: var(--cx-heading);
}

.cx-navbar-link:hover::after,
.cx-navbar-link.is-active::after {
  transform: scaleX(1);
}

.cx-navbar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.cx-navbar-btn-outline {
  border-color: var(--cx-border);
}

/* ---------- Theme toggle ---------- */
.cx-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1px solid var(--cx-border);
  background-color: var(--cx-bg-alt);
  color: var(--cx-text);
  transition: background-color var(--cx-transition-fast), border-color var(--cx-transition-fast), color var(--cx-transition-fast), transform var(--cx-transition-fast);
}

.cx-theme-toggle:hover {
  border-color: var(--cx-primary);
  color: var(--cx-primary);
  transform: translateY(-2px);
}

/* Mobile copy hidden on desktop; shown instead via responsive.css below lg */
.cx-theme-toggle-mobile {
  display: none;
}

.cx-theme-icon-moon {
  display: none;
}

[data-theme="dark"] .cx-theme-icon-sun {
  display: none;
}

[data-theme="dark"] .cx-theme-icon-moon {
  display: block;
}

/* ---------- Mobile toggler ---------- */
.cx-navbar-toggler {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  border-radius: var(--cx-radius-sm);
  transition: background-color var(--cx-transition-fast);
}

.cx-navbar-toggler:hover {
  background-color: var(--cx-primary-light);
}

.cx-navbar-toggler-bar {
  display: block;
  width: 20px;
  height: 2px;
  background-color: var(--cx-heading);
  border-radius: var(--cx-radius-pill);
  transition: transform var(--cx-transition-fast), opacity var(--cx-transition-fast);
}