/* The shop menu: the header row (burger, logo, desktop nav, "Frage?") and the drawer that
   php/lib/funnel-layout.php tz_funnel_header() prints, driven by js/tz-menu.js.
   The funnel pages load this right after tz-funnel.css (tz_funnel_head()), which keeps the base rules, the top
   bar and the steps row. The legacy pages (tz_site_menu_head(), tz_site_menu()) load it without tz-funnel.css:
   every rule here matches only inside .tz-header, .tz-drawer or the legacy box .tz-site-menu, apart from the
   Lato @font-face and the html overflow while the drawer is open, so a legacy page keeps its own styles. */

/* the same two faces as tz-funnel.css: the legacy pages load only this file */
@font-face {
  font-family: "Lato";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/wp-content/fonts/lato/S6uyw4BMUTPHjx4wXg.woff2") format("woff2");
}

@font-face {
  font-family: "Lato";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/wp-content/fonts/lato/S6u9w4BMUTPHh6UVSwiPGQ.woff2") format("woff2");
}

/* ---------- Header row ---------- */

/* Not sticky. Above the page (.tz-bar is z-index 10), so an open dropdown covers it. */
.tz-header {
  position: relative;
  z-index: 30;
  background: var(--tz-surface);
  border-bottom: 1px solid var(--tz-divider);
}

/* Row 1 below 850px: burger | logo (centred) | "Frage?"; from 850px logo, menu, "Frage?" (below). */
.tz-header__inner {
  display: grid;
  grid-template-columns: minmax(44px, 1fr) auto minmax(44px, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 72px;
}

.tz-burger {
  justify-self: start;
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-left: -10px; /* the icon lines up with the page edge */
  padding: 0;
  border: 0;
  background: none;
  color: rgba(74, 74, 74, .85);
  cursor: pointer;
}

.tz-logo {
  justify-self: center;
}

.tz-logo img {
  display: block;
  width: 154px;
  height: auto;
}

.tz-header__help {
  justify-self: end;
  color: var(--tz-text);
  font-size: 12.8px;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
  text-decoration: none;
}

.tz-nav {
  display: none;
}

/* ---------- Shop menu (php/lib/funnel-layout.php tz_funnel_menu(), js/tz-menu.js) ----------
   Values from the shop's Flatsome header: .nav > li margin 0 7px, uppercase 700 links, dropdowns
   min-width 260px, padding 20px 0, items 10px 0 with a #ececec divider. Desktop from 850px like the
   shop; below that the burger opens the drawer. */

@media (min-width: 850px) {
  .tz-header__inner {
    display: flex;
    gap: 24px;
    position: relative; /* the mega dropdown spans the row */
  }

  .tz-burger {
    display: none;
  }

  .tz-logo {
    flex: 0 0 auto;
  }

  .tz-nav {
    display: flex;
    align-self: stretch;
    flex: 1 1 auto;
    min-width: 0;
  }

  .tz-nav__list {
    display: flex;
    height: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
    white-space: nowrap;
  }

  /* full row height: the dropdown starts at the item's bottom, no gap for the pointer to fall through */
  .tz-nav__item {
    position: relative;
    display: flex;
    align-items: center;
    margin: 0 7px;
  }

  .tz-nav__item--mega {
    position: static; /* the mega dropdown anchors to .tz-header__inner */
  }

  .tz-nav__link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 44px;
    padding: 10px 0;
    border: 0;
    background: none;
    color: rgba(74, 74, 74, .85);
    font: 700 12.8px/1.2 Lato, sans-serif;
    letter-spacing: .02em;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
  }

  /* The chevron beside a link: a 24px wide target (WCAG 2.5.8) that takes 20px of the row as before, so the
     nav stays on one line at 850px; the other 4px reach into the item's 7px right margin, never over the
     link. The grid centres the chevron whatever font a page gives its buttons. */
  .tz-nav__toggle:not(.tz-nav__link) {
    display: inline-grid;
    place-items: center;
    width: 24px;
    min-height: 44px;
    margin-right: -4px;
    padding: 0;
    border: 0;
    background: none;
    color: rgba(74, 74, 74, .85);
    cursor: pointer;
  }

  .tz-nav__link:hover,
  .tz-nav__item.is-open > .tz-nav__link {
    color: hsla(0, 0%, 7%, .85);
  }

  .tz-nav [aria-expanded="true"] svg {
    transform: rotate(180deg);
  }

  /* At most the window's height below the header row (it starts at most 102px down, under the top bar), so
     a long one (Teezubehör, 671px) scrolls inside itself instead of running past the bottom of a short
     window. */
  .tz-nav__sub {
    position: absolute;
    top: 100%;
    left: -20px;
    z-index: 1;
    width: max-content; /* one line per link, as in the shop */
    min-width: 260px;
    max-height: calc(100vh - 110px);
    overflow-y: auto;
    padding: 20px 0;
    background: #fff;
    box-shadow: 1px 1px 15px rgba(0, 0, 0, .15);
    text-align: left;
    white-space: normal;
    visibility: hidden;
    opacity: 0;
    transition: opacity .25s, visibility .25s;
  }

  .tz-nav__item.is-open > .tz-nav__sub {
    visibility: visible;
    opacity: 1;
  }

  .tz-nav__sub ul {
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .tz-nav__sub a {
    display: block;
    margin: 0 20px;
    padding: 10px 0;
    border-bottom: 1px solid #ececec;
    color: rgba(74, 74, 74, .85);
    font-size: 14.4px;
    line-height: 1.3;
    text-decoration: none;
  }

  .tz-nav__sub a:hover {
    color: #111;
  }

  .tz-nav__sub ul ul a {
    padding-left: 12px;
    font-size: 13.6px;
  }

  .tz-nav__group {
    margin: 12px 20px 4px;
    color: var(--tz-heading);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .02em;
    text-transform: uppercase;
  }

  .tz-nav__sub--mega {
    left: 16px;
    right: 16px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0 32px;
    width: auto;
    padding: 20px;
  }

  .tz-header__help {
    margin-left: auto;
    flex: 0 0 auto;
  }
}

@media (min-width: 850px) and (hover: hover) and (pointer: fine) {
  .tz-nav__item:hover > .tz-nav__sub {
    visibility: visible;
    opacity: 1;
  }

  /* Escape hid it (js/tz-menu.js): hidden under the pointer until the pointer leaves the item */
  .tz-nav__item.is-dismissed:not(.is-open) > .tz-nav__sub {
    visibility: hidden;
    opacity: 0;
  }
}

@media (min-width: 850px) and (max-width: 1023px) {
  .tz-logo img {
    width: 120px;
  }
}

/* Without JS: no drawer; on desktop the links, hover and keyboard focus still open the dropdowns. */
@media (scripting: none) {
  .tz-burger {
    visibility: hidden;
  }

  .tz-nav__item:focus-within > .tz-nav__sub {
    visibility: visible;
    opacity: 1;
  }
}

/* Drawer: a modal <dialog> from the left (Flatsome: 300px, white at 95%, backdrop #212121 at .6). */
.tz-drawer {
  position: fixed;
  inset: 0 auto 0 0;
  width: min(300px, 85vw);
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(255, 255, 255, .95);
  box-shadow: 0 0 10px rgba(0, 0, 0, .25);
  color: var(--tz-text);
  overflow-y: auto;
  overscroll-behavior: contain;
  transition: transform .25s ease-out;
}

/* opening slides in; closing is instant */
@starting-style {
  .tz-drawer[open] {
    transform: translateX(-100%);
  }
}

.tz-drawer::backdrop {
  background: rgba(33, 33, 33, .6);
}

html:has(.tz-drawer[open]) {
  overflow: hidden;
}

.tz-drawer__panel {
  min-height: 100%;
  padding: 4px 0 24px;
}

.tz-drawer__close {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: 0 8px 0 auto;
  border: 0;
  background: none;
  color: rgba(74, 74, 74, .85);
  cursor: pointer;
}

.tz-drawer__list,
.tz-drawer ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.tz-drawer__list > li + li {
  border-top: 1px solid var(--tz-divider);
}

.tz-drawer__list > li > a,
.tz-drawer summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 12px 20px;
  color: rgba(74, 74, 74, .85);
  font-size: 12.8px;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  list-style: none;
}

.tz-drawer summary::-webkit-details-marker {
  display: none;
}

.tz-drawer details[open] > summary svg {
  transform: rotate(180deg);
}

.tz-drawer details a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 6px 20px 6px 28px;
  color: var(--tz-text);
  font-size: 14.4px;
  text-decoration: none;
}

.tz-drawer details ul ul a {
  padding-left: 40px;
}

.tz-drawer__group {
  padding: 12px 20px 4px 28px;
  color: var(--tz-muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

/* An untitled group after the first (the third of Tee Sortiment) starts with a rule where a title would be. */
.tz-drawer__group--untitled {
  height: 1px;
  margin: 12px 20px 8px 28px;
  padding: 0;
  background: var(--tz-divider);
}

.tz-drawer :focus-visible {
  outline-offset: -3px;
}

/* ---------- Small screens ---------- */

@media (max-width: 549px) {
  .tz-header__inner {
    min-height: 60px;
  }

  .tz-logo img {
    width: 120px;
  }

  .tz-header__help {
    display: none;
  }
}

/* ---------- Legacy pages (tz_site_menu(): agb.php, nutzerprofil_*.php, …) ----------
   The .tz-site-menu box keeps the header's height in the page flow (73px, 61px below 550px: the row's
   min-height plus the 1px border) and the header lies on it at the full window width: left and right 0
   against the initial containing block, as a legacy body can be narrower than the window (css/styles.css
   makes html and body 70% wide on desktop) or centre its text. The box is never positioned.
   The tokens are tz-funnel.css's :root values, which these pages do not load. */
.tz-site-menu {
  --tz-primary: #086068;
  --tz-text: #575757;
  --tz-heading: #4f4f4f;
  --tz-muted: #707070;
  --tz-divider: #ececec;
  --tz-surface: #fff;
  --tz-container: 1230px;
  position: static;
  display: block;
  height: 73px;
  margin: 0;
  padding: 0;
}

.tz-site-menu > .tz-header {
  position: absolute;
  left: 0;
  right: 0;
}

.tz-site-menu > .tz-header,
.tz-site-menu > .tz-drawer {
  color: var(--tz-text);
  font: 400 16px/1.6 Lato, sans-serif;
  letter-spacing: normal;
  text-align: left;
  text-transform: none;
  word-break: normal;
}

.tz-site-menu,
.tz-site-menu *,
.tz-site-menu *::before,
.tz-site-menu *::after {
  box-sizing: border-box;
}

.tz-site-menu .tz-container {
  width: 100%;
  max-width: var(--tz-container);
  margin: 0 auto;
  padding: 0 16px;
}

.tz-site-menu .tz-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* A legacy page's bare element rules must not reach the menu: page_variation2/css and css/styles.css set
   button {margin: auto; padding: 14px 20px; border-radius: 100px; box-shadow; transition: .5s; font-size: 2em},
   p {font-family: Roboto; margin-bottom: 5%; text-align: justify}, div {width: 100%; text-align: center} and
   ul {text-align: justify}; MDL sets ul {font-size: 14px; line-height: 24px} and a {color; font-weight: 500}.
   These resets have the specificity (0,0,2): above such a rule (0,0,1), below every .tz-* rule. */
:where(.tz-site-menu) :is(header, dialog) :is(div, nav, ul, li, p, a, span, details, summary) {
  width: auto;
  height: auto;
  margin: 0;
  padding: 0;
  border: 0;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  letter-spacing: inherit;
  text-align: inherit;
  word-break: normal;
}

:where(.tz-site-menu) :is(header, dialog) button {
  width: auto;
  height: auto;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-align: inherit;
  text-transform: none;
  transition: none;
  -webkit-appearance: none;
  appearance: none;
}

:where(.tz-site-menu) :focus-visible {
  outline: 3px solid var(--tz-primary);
  outline-offset: 2px;
}

@media (max-width: 549px) {
  .tz-site-menu {
    height: 61px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tz-site-menu *,
  .tz-site-menu *::before,
  .tz-site-menu *::after {
    animation: none !important;
    transition: none !important;
  }
}
