/* =========================================================
   Make it Popp · nav.css
   Gemeinsame Navigation für alle Seiten: Sub-Menüs unter
   „Collection“ und „Materials & Care“ + Handy-Menü (Burger).
   Wird nach dem <style>-Block jeder Seite geladen.
   ========================================================= */

/* ── Desktop ── */
#nav .nav-links > li { position: relative; }
#nav .nav-links a { white-space: nowrap; }
#nav .nav-links .nav-mobile-cta { display: none !important; }
#nav .nav-cta { margin-left: auto; }

/* kleiner Pfeil neben Menüpunkten mit Sub-Menü */
#nav .has-sub > a::after {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-left: 0.5rem;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: rotate(45deg);
  vertical-align: 0.25em;
  opacity: 0.6;
}

/* unsichtbare Brücke, damit das Menü beim Runterfahren nicht zuklappt */
#nav .has-sub::before {
  content: "";
  position: absolute;
  left: -1rem;
  right: -1rem;
  top: 100%;
  height: 1.2rem;
}

#nav .sub-nav {
  list-style: none;
  position: absolute;
  top: calc(100% + 1rem);
  left: 50%;
  min-width: 210px;
  margin: 0;
  padding: 0.6rem 0;
  background: #faf6f1;
  border: 1px solid rgba(80, 60, 50, 0.12);
  box-shadow: 0 10px 28px rgba(42, 37, 32, 0.08);
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 0.4rem);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  z-index: 120;
}
#nav .has-sub:hover > .sub-nav,
#nav .has-sub:focus-within > .sub-nav {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}
#nav .sub-nav a {
  display: block;
  padding: 0.55rem 1.5rem;
  font-family: "Jost", sans-serif;
  font-size: 0.74rem;
  font-weight: 300;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  color: #2a2520;
  opacity: 0.75;
  text-decoration: none;
  transition: opacity 0.2s, color 0.2s;
}
#nav .sub-nav a:hover,
#nav .sub-nav a:focus-visible {
  opacity: 1;
  color: #6b2232;
}

/* Burger (auf dem Desktop ausgeblendet) */
#nav .nav-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  z-index: 200;
}
#nav .nav-burger span {
  display: block;
  width: 24px;
  height: 1.5px;
  background: #2a2520;
  transition: transform 0.3s ease, opacity 0.3s ease;
}
#nav .nav-burger.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
#nav .nav-burger.open span:nth-child(2) { opacity: 0; }
#nav .nav-burger.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* schmalere Laptops: Menü kompakter, damit es nicht ans Logo stößt */
@media (min-width: 1101px) and (max-width: 1320px) {
  #nav .nav-links {
    position: static;
    transform: none;
    gap: 1.4rem;
    margin: 0 1.5rem;
  }
  #nav .nav-links a { font-size: 0.74rem; }
}
@media (min-width: 1321px) {
  #nav .nav-links { margin: 0 2rem; }
}

@media (prefers-reduced-motion: reduce) {
  #nav .sub-nav,
  #nav .nav-burger span { transition: none; }
}

/* ── Handy, Tablet & kleine Laptops: Burger-Menü ── */
@media (max-width: 1100px) {
  #nav { padding: 1.2rem 1.5rem; }
  #nav .nav-burger { display: flex; }
  #nav .nav-cta { display: none !important; }

  #nav .nav-links {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1.6rem;
    padding: 5rem 1.5rem 2rem;
    overflow-y: auto;
    background: #faf6f1;
    transform: none;
    z-index: 150;
  }
  #nav .nav-links.open { display: flex; }
  #nav .nav-links a {
    font-size: 1.1rem;
    opacity: 1;
    color: #2a2520;
  }

  #nav .has-sub {
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  #nav .has-sub::before,
  #nav .has-sub > a::after { display: none; }

  #nav .sub-nav {
    position: static;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    min-width: 0;
    padding: 0.6rem 0 0;
    background: none;
    border: 0;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    transform: none;
  }
  #nav .sub-nav a {
    padding: 0.15rem 0;
    font-size: 0.78rem;
    opacity: 0.65;
  }

  #nav .nav-links .nav-mobile-cta {
    display: inline-block !important;
    margin-top: 0.6rem;
    padding: 0.65rem 1.8rem;
    background: #6b2232;
    color: #faf6f1 !important;
    font-size: 0.78rem !important;
    letter-spacing: 0.16em;
    opacity: 1 !important;
  }
}
