/* ========================================
   Hoftalblick — Custom Menu Styles
   Desktop: horizontal nav + dropdowns
   Mobile: hamburger → slide-down panel
   ======================================== */

/* ── Header Layout ── */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* Keep header height stable on scroll.
   Legacy Quark shrinks #header.scrolled to 2.3rem, but the new menu layout is
   taller, so items overflow the bar. Override back to full height — no jump,
   no overflow. */
body.header-fixed.header-animated #header.scrolled {
  height: 4rem;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0;
}

.header-logo {
  flex-shrink: 0;
}

.header-nav-desktop {
  display: none;
  align-items: center;
  gap: 0.5rem;
}

/* ── Hamburger ── */
.hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 28px;
  height: 24px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1001;
}

.hamburger-line {
  display: block;
  width: 100%;
  height: 3px;
  background: #3a414e;
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.hamburger.active .hamburger-line:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.hamburger.active .hamburger-line:nth-child(2) {
  opacity: 0;
}

.hamburger.active .hamburger-line:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* ── Mobile Nav Panel ── */
.header-nav-mobile {
  display: none;
  border-top: 1px solid #eee;
  padding: 1rem 0;
  max-height: calc(100vh - 70px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.header-nav-mobile.open {
  display: block;
}

/* ── Site Nav (shared between desktop & mobile) ── */
.site-nav {
  font-family: inherit;
}

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-item {
  position: relative;
}

.nav-link {
  display: block;
  text-decoration: none;
  color: #000;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-link:hover,
.nav-link:focus,
.nav-link.active {
  color: #62b91e;
}

/* ── Sub-menu ── */
.nav-sub {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* ── Instagram logo ── */
.header-instagram {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem;
  flex-shrink: 0;
}

.header-instagram img {
  height: 22px;
  width: auto;
  display: block;
}

.nav-item-instagram .instagram-logo {
  height: 28px;
  width: auto;
  vertical-align: middle;
}

/* ── Language switcher in header ── */
.header-nav-desktop .language-switcher {
  margin-left: 0.5rem;
}

.header-nav-desktop .language-switcher ul {
  display: flex;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.header-nav-desktop .language-switcher li {
  margin: 0;
}

.header-nav-desktop .language-switcher a {
  padding: 0.2rem 0.4rem;
  font-size: 0.9rem;
  color: #3a414e;
  text-decoration: none;
}

.mobile-lang {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid #eee;
}

.mobile-lang ul {
  display: flex;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
  justify-content: center;
}

.mobile-lang a {
  padding: 0.3rem 0.6rem;
  font-size: 0.95rem;
  color: #3a414e;
  text-decoration: none;
}

/* ── Mobile-only / Desktop-only helpers ── */
@media (max-width: 839px) {
  .desktop-only { display: none !important; }
}

@media (min-width: 840px) {
  .mobile-only { display: none !important; }
}

/* ═══════════════════════════════════════
   MOBILE STYLES (≤ 839px)
   ═══════════════════════════════════════ */
@media (max-width: 839px) {
  /* Full-screen solid beige panel */
  .header-nav-mobile {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    max-height: none;
    background: #fef9ef;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    padding: 5rem 1.5rem 2rem;
    z-index: 999;
    border-top: none;
  }

  .nav-list {
    display: flex;
    flex-direction: column;
    max-width: 24rem;
    margin: 0 auto;
  }

  .nav-link {
    padding: 0.85rem 0;
    font-size: 1.15rem;
    color: #3a414e;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  }

  .nav-link:hover,
  .nav-link:focus,
  .nav-link.active {
    color: #62b91e;
    background: none;
  }

  .nav-item.has-children > .nav-link {
    font-weight: 600;
    color: #2d2d2d;
  }

  .nav-sub {
    padding-left: 1.25rem;
    margin-bottom: 0.25rem;
  }

  .nav-sub .nav-link {
    font-size: 1rem;
    font-weight: 400;
    padding: 0.6rem 0;
    color: #5a6577;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  }

  .nav-sub .nav-link::before {
    content: "— ";
    color: #ccc;
  }

  .nav-item-instagram {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
  }

  .nav-item-instagram .nav-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: #3a414e;
    border-bottom: none;
  }

  /* Mobile language switcher on beige bg */
  .mobile-lang {
    border-top-color: rgba(0, 0, 0, 0.08);
    max-width: 24rem;
    margin-left: auto;
    margin-right: auto;
  }

  .mobile-lang a {
    color: #5a6577;
  }

  .mobile-lang a:hover {
    color: #62b91e;
  }
}

/* ═══════════════════════════════════════
   DESKTOP STYLES (≥ 840px)
   ═══════════════════════════════════════ */
@media (min-width: 840px) {
  .header-nav-desktop {
    display: flex;
  }

  .hamburger {
    display: none;
  }

  .header-nav-mobile {
    display: none !important;
  }

  .site-nav {
    display: flex;
  }

  .nav-list {
    display: flex;
    align-items: center;
    gap: 0.25rem;
  }

  .nav-link {
    padding: 0.5rem 0.75rem;
    font-size: 0.95rem;
    border-radius: 4px;
  }

  .nav-link:hover {
    background: #f5f5f5;
  }

  /* Dropdown on hover */
  .nav-item.has-children {
    position: relative;
  }

  .nav-item.has-children > .nav-link::after {
    content: " ▾";
    font-size: 0.7rem;
    color: #999;
  }

  .nav-sub {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    opacity: 0;
    visibility: hidden;
    transform: translateY(4px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    z-index: 1001;
    padding: 0.5rem 0;
  }

  .nav-item.has-children:hover > .nav-sub,
  .nav-item.has-children:focus-within > .nav-sub {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .nav-sub .nav-link {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    border-radius: 0;
  }

  .nav-sub .nav-link:hover {
    background: #f0fdf4;
  }
}