/* Safari am iPhone färbt Uhrzeile und Adressleiste deckend ein, sobald eine feste Fläche mit Grund
   am Rand liegt. Mobil bleibt der Kopf darum selbst durchsichtig, nur die Karte darin trägt Glas. */

.nav__mobile:not(.da) {
  display: none !important;
}

@media (max-width: 768px) {
  .nav,
  .nav.scrolled {
    background: transparent;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    box-shadow: none;
    transition: height 380ms cubic-bezier(0.22, 1, 0.36, 1);
  }

  /* Der feste Kopf selbst hält Abstand zum Rand, sonst nimmt Safari die Glaskarte als Leistenfarbe */
  .nav {
    top: 0.625rem;
    height: calc(var(--nav-h) - 0.625rem);
  }

  .nav::before {
    content: "";
    position: absolute;
    inset: 0;
    -webkit-backdrop-filter: saturate(1);
    backdrop-filter: saturate(1);
    pointer-events: none;
  }

  .nav > .container {
    padding-inline: 0.625rem;
  }

  .nav__inner {
    position: relative;
    padding-inline: 2.625rem 2.625rem !important;
    border-radius: 16px;
    transition:
      height 380ms cubic-bezier(0.22, 1, 0.36, 1),
      padding 380ms cubic-bezier(0.22, 1, 0.36, 1),
      background-color 300ms ease,
      box-shadow 300ms ease,
      -webkit-backdrop-filter 300ms ease,
      backdrop-filter 300ms ease;
  }

  .nav__logo--split img {
    transition: opacity 300ms ease, filter 250ms ease, height 380ms cubic-bezier(0.22, 1, 0.36, 1);
  }

  .hero--ueberhang .hero__dots {
    bottom: 7.5rem;
  }

  .nav.nav--glas {
    height: 4.25rem;
  }

  .nav--glas .nav__inner {
    height: 4.25rem;
    padding-inline: 1.125rem 1rem !important;
    background-color: rgba(250, 248, 245, 0.8);
    -webkit-backdrop-filter: blur(20px) saturate(170%);
    backdrop-filter: blur(20px) saturate(170%);
    box-shadow: 0 10px 28px -14px rgba(44, 44, 44, 0.28), 0 1px 3px rgba(44, 44, 44, 0.06);
  }

  .nav--glas .nav__logo--split .nav__logo-leaf {
    height: 2.25rem !important;
  }

  .nav--glas .nav__logo--split .nav__logo-text {
    height: 0.9375rem !important;
  }

  /* Volle Überlagerungen bleiben 6px vom Rand weg, sonst übernimmt Safari ihre Farbe in die Leisten
     und hält sie bis zum nächsten Seitenwechsel */
  .nav__mobile,
  .ladeschicht,
  .aktion {
    clip-path: inset(6px 0 6px 0);
  }

  /* Bis unter die schwebende Adressleiste, nicht nur bis zu ihrer Oberkante */
  .nav__mobile {
    height: 100lvh !important;
  }

  html.menue-offen body::before,
  html.menue-offen body::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    z-index: 99;
    background: var(--bg);
    pointer-events: none;
  }

  html.menue-offen body::before {
    top: 0;
    height: calc(var(--deck-y, 0px) + 6px);
  }

  html.menue-offen body::after {
    top: calc(var(--deck-y, 0px) + 100lvh - 6px);
    height: 6px;
  }

  /* Unter Uhr und Adressleiste steht die Seite außerhalb des Fensters. Beim Gutschein wird sie dort
     genauso abgedunkelt wie darunter. */
  body.aktion-offen::before,
  body.aktion-offen::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    z-index: 9999;
    background: rgba(28, 30, 24, 0.62);
    pointer-events: none;
    animation: abdunkeln 300ms ease both;
  }

  body.aktion-offen::before {
    top: 0;
    height: calc(var(--deck-y, 0px) + 6px);
  }

  body.aktion-offen::after {
    top: calc(var(--deck-y, 0px) + var(--deck-h, 100svh) - 6px);
    height: calc(100lvh - var(--deck-h, 100svh) + 10rem);
  }
}

@keyframes abdunkeln {
  from { opacity: 0; }
}

@media (max-width: 480px) {
  .nav__inner {
    padding-inline: 1.875rem 1.875rem !important;
  }
}

@media (max-width: 768px) and (prefers-reduced-motion: reduce) {
  .nav,
  .nav__inner,
  .nav__logo--split img {
    transition: none;
  }
}
