/* ============================================
   Samariter Kaiseraugst — Navigation
   Single source of truth for all nav styles
   ============================================ */

/* ── Variables ─────────────────────────────── */
:root {
  --nav-red: #fe3f40;
  --nav-red-dark: #d63031;
  --nav-text: #2a2a2a;
  --nav-muted: #6b7280;
  --nav-bg: #fafafa;
  --nav-white: #ffffff;
  --nav-height: 80px;
  --nav-height-scrolled: 64px;
}

/* ── Base Nav ──────────────────────────────── */
.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  height: var(--nav-height);
  background: var(--nav-bg);
  transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.site-nav.scrolled {
  height: var(--nav-height-scrolled);
  background: rgba(250, 250, 250, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 2px 24px rgba(0, 0, 0, 0.06);
}

.site-nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ── Logo ──────────────────────────────────── */
.site-nav-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.site-nav-logo img {
  height: 48px;
  width: auto;
  transition: height 0.35s;
}

.site-nav.scrolled .site-nav-logo img {
  height: 40px;
}

/* ── Desktop Links ─────────────────────────── */
.site-nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.site-nav-links a {
  font-family: 'Poppins', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--nav-text);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
  white-space: nowrap;
}

.site-nav-links a:hover {
  color: var(--nav-red);
  background: rgba(254, 63, 64, 0.06);
}

.site-nav-links a.active {
  color: var(--nav-red);
}

/* Mehr toggle */
.site-nav-mehr {
  cursor: pointer;
}

.site-nav-mehr::after {
  content: ' ▾';
  font-size: 0.7em;
}

/* CTA button */
.site-nav-cta {
  background: var(--nav-red) !important;
  color: var(--nav-white) !important;
  padding: 10px 22px !important;
  border-radius: 50px !important;
  font-weight: 700 !important;
  font-size: 0.82rem !important;
  transition: transform 0.25s, box-shadow 0.25s, background 0.25s !important;
}

.site-nav-cta:hover {
  background: var(--nav-red-dark) !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(254, 63, 64, 0.3);
}

/* ── Burger Button ─────────────────────────── */
.site-nav-burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  z-index: 1100;
}

.site-nav-burger span {
  width: 24px;
  height: 2.5px;
  background: var(--nav-text);
  border-radius: 2px;
  transition: all 0.3s;
  transform-origin: center;
}

.site-nav-burger.active span:nth-child(1) {
  transform: translateY(7.5px) rotate(45deg);
}
.site-nav-burger.active span:nth-child(2) {
  opacity: 0;
}
.site-nav-burger.active span:nth-child(3) {
  transform: translateY(-7.5px) rotate(-45deg);
}

/* ── Mehr Dropdown (Desktop) ───────────────── */
.site-mehr-dropdown {
  position: fixed;
  z-index: 999;
  background: var(--nav-white);
  border-radius: 16px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
  padding: 10px 0;
  min-width: 200px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.2s, visibility 0.2s, transform 0.2s;
}

.site-mehr-dropdown.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.site-mehr-dropdown a {
  display: block;
  padding: 10px 20px;
  font-family: 'Poppins', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--nav-text);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.site-mehr-dropdown a:hover {
  background: rgba(254, 63, 64, 0.06);
  color: var(--nav-red);
}

.site-mehr-divider {
  height: 1px;
  background: #eee;
  margin: 6px 16px;
}

.site-mehr-divider:last-child {
  display: none;
}

.site-mehr-label {
  padding: 8px 20px 4px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--nav-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── Mobile Overlay Menu ───────────────────── */
.site-mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 1050;
  background: rgba(250, 250, 250, 0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s cubic-bezier(0.22, 1, 0.36, 1),
              visibility 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  overflow: hidden;
}

.site-mobile-menu.open {
  opacity: 1;
  visibility: visible;
}

body.nav-open {
  overflow: hidden;
}

/* Two-view system */
.site-mobile-view {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
              opacity 0.25s ease;
}

.site-mobile-main {
  transform: translateX(0);
  opacity: 1;
}
.site-mobile-main.out {
  transform: translateX(-30%);
  opacity: 0;
  pointer-events: none;
}

.site-mobile-mehr {
  transform: translateX(100%);
  opacity: 0;
  pointer-events: none;
}
.site-mobile-mehr.in {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

/* Mobile menu links */
.site-mobile-menu a {
  font-family: 'Poppins', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--nav-text);
  text-decoration: none;
  padding: 12px 0;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.3s ease-out, transform 0.3s ease-out, color 0.2s;
}

.site-mobile-menu.open a {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered animation */
.site-mobile-menu.open .site-mobile-main a:nth-child(1) { transition-delay: 0.05s; }
.site-mobile-menu.open .site-mobile-main a:nth-child(2) { transition-delay: 0.1s; }
.site-mobile-menu.open .site-mobile-main a:nth-child(3) { transition-delay: 0.15s; }
.site-mobile-menu.open .site-mobile-main a:nth-child(4) { transition-delay: 0.2s; }
.site-mobile-menu.open .site-mobile-main a:nth-child(5) { transition-delay: 0.25s; }
.site-mobile-menu.open .site-mobile-main a:nth-child(6) { transition-delay: 0.3s; }

.site-mobile-menu a:hover,
.site-mobile-menu a:active {
  color: var(--nav-red);
}

.site-mobile-menu a.active {
  color: var(--nav-red);
}

/* Mobile Mehr sub-links */
.site-mobile-mehr a {
  font-size: 1.2rem !important;
}

/* Mobile back button */
.site-mobile-back {
  font-size: 1rem !important;
  color: var(--nav-red) !important;
  font-weight: 600 !important;
  margin-bottom: 12px !important;
}

/* Mobile Mehr toggle arrow */
.site-mobile-mehr-btn::after {
  content: ' ›';
}

/* Mobile CTA */
.site-mobile-cta {
  display: inline-block !important;
  background: var(--nav-red) !important;
  color: var(--nav-white) !important;
  padding: 14px 32px !important;
  border-radius: 50px !important;
  font-size: 1rem !important;
  font-weight: 700 !important;
  margin-top: 12px !important;
  transition: transform 0.25s, box-shadow 0.25s !important;
}

.site-mobile-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(254, 63, 64, 0.3);
}

/* Mobile third view (Zusätzliche Links) */
.site-mobile-links {
  transform: translateX(100%);
  opacity: 0;
  pointer-events: none;
}
.site-mobile-links.in {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}
.site-mobile-links a {
  font-size: 1.2rem !important;
}

/* Mobile Mehr view — also slides out when links view is active */
.site-mobile-mehr.out {
  transform: translateX(-30%);
  opacity: 0;
  pointer-events: none;
}

/* Mobile divider */
.site-mobile-divider {
  width: 50px;
  height: 1px;
  background: #ddd;
  margin: 6px 0;
}

/* ── Responsive ────────────────────────────── */
@media (max-width: 768px) {
  .site-nav-links {
    display: none;
  }
  .site-nav-burger {
    display: flex;
  }
  .site-mehr-dropdown {
    display: none !important;
  }
  .site-nav {
    --nav-height: 64px;
    --nav-height-scrolled: 56px;
  }
  .site-nav-logo img {
    height: 38px;
  }
  .site-nav.scrolled .site-nav-logo img {
    height: 34px;
  }
}

/* ── Spacer for fixed nav ──────────────────── */
.nav-spacer {
  height: var(--nav-height);
}
