/**
 * MT Site-Header — wird auf allen nicht-Landing-Seiten geladen.
 * Logik: gleiche Element-Anordnung wie Landing (Burger | Logo | Cart+Login),
 * aber mit initial-wide → scroll-narrow Verhalten (Enfold-Style).
 */

/* === Enfold-Default-Header verstecken === */
#header,
#header_meta,
#header_main { display: none !important; }
/* #main hat normalerweise margin-top fürs Enfold-Header — bei uns 0 */
#main { margin-top: 0 !important; padding-top: 0 !important; }

/* === Fixed Header === */
.mt-mh {
  position: fixed;
  top: 0; left: 0; right: 0;
  background: rgba(7,9,10,0.78);
  backdrop-filter: saturate(160%) blur(16px);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  border-bottom: 1px solid rgba(255,255,255,0.04);
  z-index: 9999;
  transition: background .25s ease;
}
body.admin-bar .mt-mh { top: 32px; }
@media screen and (max-width: 782px) {
  body.admin-bar .mt-mh { top: 46px; }
}

.mt-mh__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-left: max(14px, env(safe-area-inset-left, 14px));
  padding-right: max(14px, env(safe-area-inset-right, 14px));
  max-width: 1180px;
  margin: 0 auto;
  /* Initial: wide */
  height: 52px;
  transition: height .25s ease;
}
.mt-mh.is-scrolled .mt-mh__row {
  height: 52px;
}

.mt-mh__burger {
  width: 48px; height: 34px;
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 5px;
  background: transparent; cursor: pointer; padding: 0;
  border: 2px solid #00b94a;
  border-radius: 7px;
  flex: 0 0 auto;
  transition: background .15s, border-color .15s;
}
.mt-mh__burger:hover {
  background: rgba(0,185,74,0.12);
  border-color: #00d65a;
}
.mt-mh__burger span {
  display: block; width: 28px; height: 4px;
  background: #fff; border-radius: 2px;
  transition: transform .25s ease, opacity .25s ease;
}

.mt-mh__brand {
  display: inline-flex; align-items: center;
  flex: 0 1 auto;
  text-decoration: none;
}
.mt-mh__brand img {
  height: 32px; width: auto; display: block;
  transition: height .25s ease;
}
.mt-mh.is-scrolled .mt-mh__brand img {
  height: 32px;
}

.mt-mh__right {
  display: inline-flex; align-items: center; gap: 4px;
  flex: 0 0 auto;
}
.mt-mh__lang {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
}
.mt-mh__lang::after {
  content: "";
  position: absolute;
  left: -6px;
  right: -6px;
  top: 100%;
  height: 10px;
}
.mt-mh__lang-toggle {
  height: 32px;
  width: 40px;
  padding: 0 9px;
  border: 1px solid rgba(79,210,122,0.34);
  box-sizing: border-box;
  border-radius: 999px;
  background: rgba(255,255,255,0.07);
  color: #eff6f0;
  cursor: pointer;
  font-family: poppins, Inter, Arial, sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1;
}
.mt-mh__lang-toggle:hover,
.mt-mh__lang:focus-within .mt-mh__lang-toggle {
  border-color: rgba(79,210,122,0.62);
  background: rgba(79,210,122,0.12);
}
.mt-mh__lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 86px;
  padding: 6px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  background: rgba(7,9,10,0.94);
  box-shadow: 0 14px 36px rgba(0,0,0,0.34);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity .16s ease, transform .16s ease, visibility 0s linear .16s;
  z-index: 10030;
}
.mt-mh__lang:hover .mt-mh__lang-menu,
.mt-mh__lang:focus-within .mt-mh__lang-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
  transition-delay: 0s;
}
.mt-mh__lang-menu a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 8px 10px;
  border-radius: 10px;
  color: #edf3ee !important;
  font-family: poppins, Inter, Arial, sans-serif;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  line-height: 1;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
}
.mt-mh__lang-menu a:visited { color: #edf3ee !important; }
.mt-mh__lang-menu a:hover,
.mt-mh__lang-menu a.is-active {
  color: #f6fbf7 !important;
  background: rgba(79,210,122,0.09);
}
.mt-mh__cart,
.mt-mh__login {
  width: 44px; height: 44px;
  flex: 0 0 44px;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; text-decoration: none;
  border-radius: 999px;
  position: relative;
  transition: background .15s;
}
.mt-mh__cart:hover, .mt-mh__login:hover { background: rgba(255,255,255,0.08); }
.mt-mh__cart svg {
  width: 26px;
  height: 26px;
  stroke-width: 2.1;
}
.mt-mh__login svg {
  width: 30px;
  height: 30px;
  stroke-width: 2.1;
}
.mt-mh__cart-count {
  position: absolute;
  top: 3px; right: 3px;
  min-width: 18px; height: 18px;
  border-radius: 9px;
  background: #009639;
  color: #fff;
  font-family: "Inter", sans-serif;
  font-size: 11px; font-weight: 700;
  line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 4px;
  pointer-events: none;
}
.mt-mh__cart-count[data-count="0"] { display: none; }

/* Body padding-top — konstant auf Initial-Höhe, damit beim Scroll-Shrink
   der Inhalt nicht springt (Header rutscht „über" den Inhalt). */
body { padding-top: 52px; }
body.admin-bar { padding-top: calc(52px + 32px); }
@media screen and (max-width: 782px) {
  body.admin-bar { padding-top: calc(52px + 46px); }
}

/* === Drawer === */
.mt-drawer {
  position: fixed; top: 0; left: 0;
  padding-top: env(safe-area-inset-top, 0);
  padding-bottom: env(safe-area-inset-bottom, 0);
  width: min(72vw, 300px); height: 100dvh;
  background: rgba(7,9,10,0.86);
  backdrop-filter: saturate(160%) blur(22px);
  -webkit-backdrop-filter: saturate(160%) blur(22px);
  border-right: 1px solid rgba(255,255,255,0.06);
  transform: translateX(-100%);
  transition: transform .35s cubic-bezier(.22,.61,.36,1);
  z-index: 99999;
  display: flex; flex-direction: column;
  overflow-y: auto;
}
body.admin-bar .mt-drawer { top: 32px; height: calc(100dvh - 32px); }
@media screen and (max-width: 782px) {
  body.admin-bar .mt-drawer { top: 46px; height: calc(100dvh - 46px); }
}
.mt-drawer.is-open {
  transform: translateX(0);
  box-shadow: 6px 0 32px rgba(0,0,0,.55);
}

.mt-drawer__overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(2px);
  z-index: 99998;
  opacity: 0; pointer-events: none;
  transition: opacity .25s;
}
.mt-drawer__overlay.is-open { opacity: 1; pointer-events: auto; }

.mt-drawer__head {
  display: flex; justify-content: flex-end;
  padding: 14px 14px 6px;
}
.mt-drawer__close {
  width: 38px; height: 38px;
  background: transparent; border: 0; color: #fff;
  cursor: pointer; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px;
}
.mt-drawer__close:hover { background: rgba(255,255,255,0.06); }

.mt-drawer__nav {
  list-style: none; margin: 0; padding: 8px 0;
}
.mt-drawer__nav li { margin: 0; }
.mt-drawer__nav a {
  display: block;
  padding: 12px 22px;
  font-family: "Inter Tight", "Inter", sans-serif;
  font-weight: 700; font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #e6e8e6;
  text-decoration: none;
  transition: color .15s, background .15s;
}
.mt-drawer__nav a:hover,
.mt-drawer__nav a:focus-visible {
  color: #4fd27a;
  background: rgba(255,255,255,0.03);
}

/* Search-Form — direkt über Legal */
.mt-drawer__search {
  padding: 14px 18px 18px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.mt-drawer__search-form {
  display: flex;
  align-items: center;
  height: 46px;
  background: rgba(255,255,255,0.075);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 999px;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.035);
  transition: background .2s, border-color .2s;
}
.mt-drawer__search-form:focus-within {
  background: rgba(255,255,255,0.11);
  border-color: rgba(79,210,122,0.28);
}
.mt-drawer__search-input,
#top .mt-drawer__search-form input.mt-drawer__search-input[type="search"] {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  height: 100%;
  min-height: 0;
  margin: 0;
  padding: 0 6px 0 16px;
  background: transparent !important;
  border: 0 !important;
  outline: none !important;
  box-shadow: none !important;
  border-radius: 999px !important;
  color: #f4f7f2 !important;
  font-family: "Inter", sans-serif !important;
  font-size: 14px !important;
  line-height: 1 !important;
  -webkit-appearance: none;
  appearance: none;
}
.mt-drawer__search-input::placeholder { color: rgba(230,232,230,0.58); }
.mt-drawer__search-btn {
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  color: #cfd3d0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color .15s, background .15s;
}
.mt-drawer__search-btn:hover {
  color: #4fd27a;
  background: rgba(255,255,255,0.045);
}

.mt-drawer__nav--legal {
  margin-top: 0;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.mt-drawer__nav--legal a {
  padding: 8px 22px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: #8a8e8a;
}
.mt-drawer__nav--legal a:hover { color: #cfd3d0; }

.mt-drawer__shop {
  margin: 8px 18px 24px;
  padding: 16px 22px;
  background: linear-gradient(135deg, #009639 0%, #00b94a 100%);
  color: #fff;
  border-radius: 14px;
  font-family: "Inter Tight", "Inter", sans-serif;
  font-weight: 700; font-size: 17px;
  letter-spacing: -0.01em;
  text-align: center;
  text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center;
  gap: 10px;
  box-shadow: 0 6px 20px rgba(0,150,57,0.35);
  transition: transform .15s, box-shadow .15s;
}
.mt-drawer__shop:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(0,150,57,0.45);
}

/* Body scroll-lock wenn Drawer offen */
body.mt-drawer-open { overflow: hidden; }

/* === Desktop-Overrides === */
@media (min-width: 1024px) {
  .mt-mh__row { padding: 0 32px; }
  .mt-drawer { width: min(50vw, 380px); }
}

/* Login-Icon gruen wenn eingeloggt */
body.logged-in .mt-mh__login { color: #00b94a; }
