:root {
  --nav-height: 68px;
}

/* ─── Stats grid used on affiliate page ─── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
}
.stat-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}
.stat-card .stat-icon {
  width: 40px;
  height: 40px;
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.stat-card .stat-content {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.stat-card .stat-value {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
}
.stat-card .stat-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.3;
}
@media (max-width: 620px) {
  .stat-card { padding: 12px; }
  .stat-card .stat-icon { width: 32px; height: 32px; font-size: 1.1rem; }
  .stat-card .stat-value { font-size: 0.98rem; }
  .stat-card .stat-label { font-size: 0.76rem; }
}

/* ─── Mobile nav fix ─── */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2.5px;
  background: var(--text);
  border-radius: 2px;
  transition: transform .2s ease, opacity .2s ease;
}
.nav-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 900px) {
  .nav-toggle { display: flex; margin-left: auto; }
  .mobile-lang-switcher { display: none; }
  .nav-links {
    display: none;
    position: fixed;
    inset: 0 0 0 auto;
    width: min(320px, 85vw);
    height: 100vh;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: rgba(255,255,255,.98);
    backdrop-filter: blur(12px);
    border-left: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    padding: 80px 24px 24px;
    transform: translateX(120%);
    opacity: 0;
    visibility: hidden;
    transition: transform .25s ease, opacity .2s ease, visibility .25s ease;
    z-index: 99;
    overflow-y: auto;
  }
  .nav-links.open {
    display: flex;
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
  }
  .nav-links > a,
  .nav-links > button {
    display: block;
    width: 100%;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
    font-size: 1.05rem;
    color: var(--text);
  }
  .nav-links .lang-switcher {
    margin: 12px 0;
    border-bottom: 1px solid var(--border);
    padding-bottom: 12px;
  }
  .nav-links .btn-primary {
    margin-top: 10px;
    width: 100%;
    justify-content: center;
  }
}

/* ─── Backdrop overlay for mobile menu ─── */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.35);
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s ease, visibility .25s ease;
  z-index: 98;
  pointer-events: none;
}
body.menu-open::before {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* ─── Footer cleanup ─── */
.main-footer p { color: var(--text-muted); }
.footer-links h4 { text-transform: uppercase; letter-spacing: .04em; font-size: .75rem; color: var(--text-light); margin-bottom: 12px; }
.footer-links a { color: var(--text-muted); font-size: .88rem; }
.footer-links a:hover { color: var(--primary); }
.footer-bottom p { font-size: .82rem; color: var(--text-light); }

/* ─── Trust floating badge fix ─── */
.floating-trust-badge {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 90;
}
@media (max-width: 900px) {
  .floating-trust-badge { display: none; }
}

/* ─── General utility ─── */
.text-balance { text-wrap: balance; }
.clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ─── i18n cookie banner ─── */
.cookie-banner { font-size: .9rem; }
.cookie-inner { align-items: center; gap: 16px; }

/* ─── Fix language switcher vertical alignment ─── */
.lang-switcher { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: .82rem; }
.lang-switcher a { padding: 4px 8px; border-radius: 6px; color: var(--text-muted); }
.lang-switcher a.active { background: var(--primary); color: #fff; }
.lang-switcher a:not(.active):hover { background: var(--surface-2); color: var(--text); }
