/**
 * bes-override.css
 *
 * Scoped stylesheet used only when the BES Layout Override is active.
 * Contains ONLY the nav and footer styles — no global resets, no body/a/h1
 * rules that would interfere with the active WordPress theme.
 *
 * All rules are namespaced under .bes-nav-* / .bes-footer-override so they
 * cannot bleed into theme content.
 */

/* ── Design tokens (scoped to BES elements only) ──────────────────────────── */
.nav,
.bes-footer-override {
  --bes-blue-700: #1e40af;
  --bes-blue-600: #2563eb;
  --bes-blue-500: #3b82f6;
  --bes-blue-50: #eff6ff;
  --bes-ink-900: #0a0a0f;
  --bes-ink-800: #18181b;
  --bes-ink-700: #27272a;
  --bes-ink-500: #71717a;
  --bes-ink-400: #a1a1aa;
  --bes-ink-300: #d4d4d8;
  --bes-ink-200: #e4e4e7;
  --bes-ink-100: #f4f4f5;
  --bes-ink-50: #fafafa;
  --bes-radius-sm: 6px;
  --bes-radius-md: 10px;
  --bes-radius-pill: 999px;
}

/* ── Nav bar ──────────────────────────────────────────────────────────────── */
.nav#nav-guest,
.nav#nav-user {
  border-bottom: none;
  background: #0f172a;
  position: sticky;
  top: 0;
  z-index: 9999;
  box-sizing: border-box;
  width: 100%;
}

.nav .nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 40px;
  max-width: 1380px;
  margin: 0 auto;
  box-sizing: border-box;
}

.nav .logo {
  display: inline-block;
  text-decoration: none;
  line-height: 0;
}

.nav .logo img {
  height: 28px;
  width: auto;
  display: block;
  filter: brightness(0) invert(1);
}

.nav .nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav .nav-link {
  padding: 8px 14px !important;
  color: rgba(255, 255, 255, 0.78);
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--bes-radius-sm, 6px);
  transition: all 0.15s;
  text-decoration: none;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', sans-serif;
}

.nav .nav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  text-decoration: none;
}

.nav .nav-cta {
  margin-left: 8px;
}

/* BES btn styles scoped to nav only */
.nav .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--bes-radius-sm, 6px);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', sans-serif;
  white-space: nowrap;
  text-decoration: none;
}

.nav .btn-primary {
  background: var(--bes-blue-600, #2563eb);
  color: #fff;
}

.nav .btn-primary:hover {
  background: var(--bes-blue-700, #1e40af);
  text-decoration: none;
}

/* Red badge on "Recently viewed" */
.nav .nav-link--badgeable {
  position: relative;
}

.nav .nav-searches-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 100%;
  letter-spacing: 0;
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 16px;
  min-height: 16px;
  animation: bes-badge-pop 0.2s ease;
}

@keyframes bes-badge-pop {
  0% {
    transform: scale(0.5);
    opacity: 0;
  }

  70% {
    transform: scale(1.15);
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Logged-in nav: avatar + name button + dropdown */
.nav .nav-user-menu {
  position: relative;
  margin-left: 8px;
}

.nav .nav-user-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px 6px 6px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--bes-radius-pill, 999px);
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  transition: background 0.15s, border-color 0.15s;
}

.nav .nav-user-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.3);
}

.nav .nav-user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--bes-blue-600, #2563eb);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nav .nav-user-name {
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav .nav-user-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  background: #fff;
  border: 1px solid var(--bes-ink-200, #e4e4e7);
  border-radius: var(--bes-radius-md, 10px);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12), 0 2px 6px rgba(15, 23, 42, 0.06);
  padding: 6px;
  z-index: 10000;
}

.nav .nav-user-dropdown.is-open {
  display: block;
}

.nav .nav-dd-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  border-radius: var(--bes-radius-sm, 6px);
  font-size: 14px;
  font-weight: 500;
  color: var(--bes-ink-700, #27272a);
  text-decoration: none;
  transition: background 0.12s, color 0.12s;
}

.nav .nav-dd-item:hover {
  background: var(--bes-ink-50, #fafafa);
  color: var(--bes-ink-900, #0a0a0f);
  text-decoration: none;
}

.nav .nav-dd-item svg {
  color: var(--bes-ink-400, #a1a1aa);
  flex-shrink: 0;
}

.nav .nav-dd-divider {
  height: 1px;
  background: var(--bes-ink-100, #f4f4f5);
  margin: 4px 0;
}

.nav .nav-dd-signout {
  color: #b91c1c;
}

.nav .nav-dd-signout:hover {
  background: #fef2f2;
  color: #991b1b;
}

.nav .nav-dd-signout svg {
  color: #f87171;
}

/* ── Footer ───────────────────────────────────────────────────────────────── */
.bes-footer-override {
  background: #1a202c;
  color: var(--bes-ink-400, #a1a1aa);
  padding: 64px 0 32px;
  box-sizing: border-box;
  width: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', sans-serif;
}

.bes-footer-override .container {
  max-width: 1380px;
  margin: 0 auto;
  padding: 0 40px;
  box-sizing: border-box;
}

.bes-footer-override .footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 28px;
}

.bes-footer-override .footer-brand p {
  font-size: 13px;
  color: var(--bes-ink-500, #71717a);
  line-height: 1.65;
  margin-top: 14px;
}

.bes-footer-override .logo img {
  height: 24px;
  width: auto;
  filter: brightness(0) invert(1) opacity(0.92);
}

.bes-footer-override .footer-col h4 {
  font-size: 11px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.45);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 14px;
}

.bes-footer-override .footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bes-footer-override .footer-col ul li a {
  font-size: 14px;
  color: var(--bes-ink-500, #71717a);
  text-decoration: none;
  transition: color 0.15s;
}

.bes-footer-override .footer-col ul li a:hover {
  color: #fff;
  text-decoration: none;
}

.bes-footer-override .footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  color: var(--bes-ink-500, #71717a);
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .bes-footer-override .footer-grid {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 32px;
  }

  .bes-footer-override .footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .nav .nav-inner {
    padding: 12px 16px;
    flex-direction: column;
  }

  .nav .logo img {
    height: 24px;
  }

  .nav .nav-link {
    padding: 6px 8px !important;
    font-size: 13px;
  }

  .bes-footer-override .container {
    padding: 0 16px;
  }

  .bes-footer-override {
    padding: 48px 0 24px;
  }

  .bes-footer-override .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 28px;
  }

  .bes-footer-override .footer-brand {
    grid-column: 1 / -1;
  }

  .bes-footer-override .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    font-size: 12px;
  }
}

@media (max-width: 400px) {
  .bes-footer-override .footer-grid {
    grid-template-columns: 1fr;
  }
}