/* New hamburger navigation replacing the legacy JTL category mega-menu.
   Uses the --navy/--orange/--font-* custom properties from globals.css,
   which cascade document-wide regardless of which stylesheet defined them. */

.hm-burger-wrap {
  position: relative;
  display: inline-flex;
  vertical-align: middle;
}

/* The legacy theme auto-appends a chevron (via ::after) to any element with
   data-toggle="collapse" that isn't the old .navbar-toggler — and that rule's
   `content` is itself `!important` with specificity (0,2,1)
   (":not(.navbar-toggler)[data-toggle=collapse]:after"). Our buttons use
   data-toggle="collapse" too (to reuse the existing generic JS), so they grow
   a stray second chevron next to our own SVG one. A plain `!important` of
   equal/lower specificity does NOT win against another `!important` rule —
   specificity still breaks the tie — so this must out-specificity it, not
   just out-important it. #hm-burger-wrap and #hm-burger-panel give (1,1,1),
   safely above the legacy rule's (0,2,1). */
#hm-burger-wrap .hm-burger-btn::after,
#hm-burger-panel .hm-burger-toggle::after,
#hm-burger-panel .hm-burger-subtoggle::after {
  content: none !important;
}

.hm-burger-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 0.5rem;
  transition: background 0.2s ease;
}

.hm-burger-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

.hm-burger-icon {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 1.4rem;
  height: 1rem;
}

.hm-burger-icon span {
  display: block;
  height: 2px;
  width: 100%;
  background: #ffffff;
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
  transform-origin: center;
}

.hm-burger-btn[aria-expanded="true"] .hm-burger-icon span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hm-burger-btn[aria-expanded="true"] .hm-burger-icon span:nth-child(2) {
  opacity: 0;
}

.hm-burger-btn[aria-expanded="true"] .hm-burger-icon span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.hm-burger-panel {
  position: absolute;
  top: calc(100% + 0.6rem);
  left: 0;
  z-index: 1050;
  width: 17rem;
  max-width: calc(100vw - 3rem);
  background: #1c1d2c;
  border-radius: 0.9rem;
  box-shadow: 0 25px 50px -15px rgba(0, 0, 0, 0.65);
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
}

.hm-burger-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: none;
  background: none;
  color: #ffffff;
  text-decoration: none;
  text-align: left;
  font-family: var(--font-heading, Montserrat, sans-serif);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.01em;
  cursor: pointer;
  border-radius: 0.55rem;
  transition: background 0.2s ease, color 0.2s ease;
}

.hm-burger-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #db7420;
}

.hm-burger-chevron {
  width: 1.05rem;
  height: 1.05rem;
  flex: none;
  transition: transform 0.25s ease;
}

.hm-burger-toggle[aria-expanded="true"] .hm-burger-chevron {
  transform: rotate(180deg);
}

.hm-burger-sublist {
  display: flex;
  flex-direction: column;
  padding: 0.15rem 0 0.4rem 0.6rem;
}

.hm-burger-sublink {
  display: block;
  padding: 0.5rem 0.9rem 0.5rem 1.2rem;
  font-family: var(--font-body, "Open Sans", sans-serif);
  font-weight: 500;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.6);
  cursor: default;
  border-left: 2px solid rgba(255, 255, 255, 0.12);
}

/* Sub-items that link to the shop (<a>) are interactive; plain <span>s stay dimmed.
   ID-scoped so the legacy theme's link rules cannot win. */
#hm-burger-panel a.hm-burger-sublink {
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
}

#hm-burger-panel a.hm-burger-sublink:hover,
#hm-burger-panel a.hm-burger-sublink:focus-visible {
  background: rgba(255, 255, 255, 0.08);
  color: #db7420;
  outline: none;
}

/* Below the lg breakpoint the language switch and customer login live in
   #shop-nav, the first row of the header. The logo block (burger + phone
   numbers) is taller than that row and comes later in the DOM, so with no
   stacking set it paints over #shop-nav and swallows every tap on it except
   the topmost few pixels. Lifting #shop-nav above it makes the whole of both
   controls tappable again. z-index stays below the burger panel (1050). */
#shop-nav {
  position: relative;
  z-index: 2;
}

/* Keep the whole header bar (burger menu, phone numbers, login, language) visible
   while scrolling: the legacy <header> already has `sticky-top`; this makes the
   wrapper rendered by Header.tsx transparent so that sticky works against the page. */
.hm-header-host {
  display: contents;
}

/* Narrow screens (phones, small windows, phones in landscape): keep the whole header on
   screen while scrolling, in two rows without overlap. Row 1: language + customer login
   (right). Row 2: burger + both phone numbers on one line. In a single row the phone
   numbers collide with language/login below ~700px (measured), so switch at 768px.
   Originally the burger/phone block was absolutely positioned under the login row and
   the second number wrapped out of the header; that would overlap the page now that the
   header stays put. */
@media (max-width: 767.98px) {
  #jtl-nav-wrapper > .container-fluid {
    display: flex;
    flex-direction: column;
  }

  #jtl-nav-wrapper .toggler-logo-wrapper {
    position: static;
    order: 2;
    width: 100%;
  }

  #jtl-nav-wrapper nav {
    order: 1;
    width: 100%;
    justify-content: flex-end;
  }

  #jtl-nav-wrapper #logo h3 {
    white-space: nowrap;
    margin-bottom: 0 !important;
  }
}

/* Small phones: smaller phone line so both numbers fit on one row */
@media (max-width: 575.98px) {
  #jtl-nav-wrapper #logo h3 {
    font-size: 0.78rem !important;
    word-spacing: -0.12em;
  }
}

@media (max-width: 359.98px) {
  #jtl-nav-wrapper #logo h3 {
    font-size: 0.68rem !important;
  }
}

@media (max-width: 339.98px) {
  #jtl-nav-wrapper #logo h3 {
    font-size: 0.6rem !important;
  }
}

/* One line: burger + phone numbers on the same height as language + customer login.
   The legacy markup starts the logo block with an empty `<h3>&nbsp</h3>` spacer that
   pushed burger and phone numbers ~19px below the login/language items. */
#jtl-nav-wrapper #logo h3:first-child {
  display: none;
}

@media (min-width: 768px) {
  #jtl-nav-wrapper #logo h3 {
    padding-top: 4px;
  }
}


/* Nested level of the Service menu (Dokumentation > Bedienungsanleitung > JENSEN).
   The toggle rows are <button>s styled like sub-links. */
#hm-burger-panel button.hm-burger-subtoggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  background: none;
  border-top: 0;
  border-right: 0;
  border-bottom: 0;
  text-align: left;
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
}
#hm-burger-panel button.hm-burger-subtoggle:hover,
#hm-burger-panel button.hm-burger-subtoggle:focus-visible {
  background: rgba(255, 255, 255, 0.08);
  color: #db7420;
  outline: none;
}
.hm-burger-subtoggle[aria-expanded="true"] .hm-burger-chevron { transform: rotate(180deg); }
.hm-burger-subtoggle .hm-burger-chevron { width: 1rem; height: 1rem; flex: none; }
.hm-burger-sublist2 { padding-left: 0.6rem; }

/* Phone numbers in the header are tel: links (open the phone app on tap);
   they keep the look of the plain text. ID-free but scoped to the header host. */
.hm-header-host a.hm-tel,
.hm-header-host a.hm-tel:hover,
.hm-header-host a.hm-tel:focus-visible {
  color: inherit;
  text-decoration: none;
}
.hm-header-host a.hm-tel:hover { opacity: 0.8; }


/* Customer login dropdown (rendered by components/account/AccountMenu.tsx into the empty mount points). */
[data-hm-account-label]:empty::before { content: attr(data-default); }

.dropdown-menu.hm-account-menu {
  width: min(22rem, calc(100vw - 1rem));
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0 0 0.5rem 0.5rem;
  box-shadow: 0 18px 40px -12px rgba(0, 0, 0, 0.55);
}
