/* ------------------------------------------------------------------
 * H24 Megamenü
 * Baut auf Hummingbird/Bootstrap-5-Variablen auf; alle Werte lassen sich
 * über die Tokens unten an das Shop-Design anpassen.
 * ------------------------------------------------------------------ */

.h24mm {
  --h24mm-accent: var(--bs-primary, #3f6b2b);
  --h24mm-text: var(--bs-body-color, #1f2420);
  --h24mm-muted: #6a7168;
  --h24mm-surface: var(--bs-body-bg, #fff);
  --h24mm-border: var(--bs-border-color, #dfe3dc);
  --h24mm-hover-bg: #f2f5ef;
  --h24mm-panel-bg: #ccffcc; /* f6f8f3; */
  --h24mm-panel-bg-alt: #e6ffe6;
  --h24mm-radius: 4px;
  --h24mm-bar-height: 48px;
  --h24mm-gap: 1.75rem;
  --h24mm-shadow: 0 12px 28px -18px rgba(20, 32, 18, .55);

  position: relative;
  font-size: .95rem;
  color: var(--h24mm-text);
}

.h24mm *,
.h24mm *::before,
.h24mm *::after { box-sizing: border-box; }

.h24mm a { color: inherit; text-decoration: none; }
.h24mm ul { list-style: none; margin: 0; padding: 0; }

.h24mm :focus-visible {
  outline: 2px solid var(--h24mm-accent);
  outline-offset: 2px;
}

/* --- Leiste ------------------------------------------------------- */

.h24mm--horizontal {
  border-top: 1px solid var(--h24mm-border);
  border-bottom: 1px solid var(--h24mm-border);
  background: var(--h24mm-surface);
}

.h24mm--sticky {
  position: sticky;
  top: 0;
  z-index: 1030;
}

.h24mm__bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: var(--h24mm-bar-height);
}

.h24mm__list {
  display: flex;
  align-items: stretch;
  gap: var(--h24mm-gap);
}

.h24mm__item { position: relative; display: flex; align-items: center; }

.h24mm__link {
  display: inline-flex;
  align-items: center;
  min-height: var(--h24mm-bar-height);
  font-weight: 600;
  letter-spacing: .01em;
  border-bottom: 2px solid transparent;
}

.h24mm__item:hover > .h24mm__link,
.h24mm__item.is-open > .h24mm__link {
  color: var(--h24mm-accent);
  border-bottom-color: var(--h24mm-accent);
}

.h24mm__link--static { cursor: default; }

.h24mm__chevron {
  display: inline-block;
  width: .45rem;
  height: .45rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translate(-1px, -1px);
  transition: transform .15s ease;
}

/* --- Panel -------------------------------------------------------- */

.h24mm__panel {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 40;
  display: none;
  min-width: 22rem;
  max-width: calc(100vw - 2rem);
  background: var(--h24mm-panel-bg);
  border: 1px solid var(--h24mm-border);
  border-top: 2px solid var(--h24mm-accent);
  border-radius: 0 0 var(--h24mm-radius) var(--h24mm-radius);
  box-shadow: var(--h24mm-shadow);
}

.h24mm__item.is-open > .h24mm__panel { display: block; }

/* Panel an der Menueleiste ausrichten statt am einzelnen Menuepunkt.
   Nur ab Desktop-Breite, darunter bleibt das Akkordeon im Eintrag. */
@media (min-width: 992px) {
  .h24mm--fullwidth .h24mm__item { position: static; }

  .h24mm--fullwidth .h24mm__panel {
    left: 0;
    right: 0;
    width: auto;
    min-width: 0;
    max-width: none;
  }

  /* Ohne Fullwidth: Panel am rechten Rand ausrichten, wenn es sonst herauslaeuft */
  .h24mm__panel--flip { left: auto; right: 0; }
}

.h24mm__panel-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  padding: 1.5rem 1.75rem;
  min-width: 0;
}

.h24mm__cols {
  display: grid;
  grid-template-columns: repeat(var(--h24mm-cols, 3), minmax(0, 1fr));
  gap: 1.25rem 2rem;
  flex: 1 1 auto;
  min-width: 0;
}

.h24mm__col { display: flex; flex-direction: column; gap: 1.1rem; min-width: 0; }

/* Lange Pflanzennamen umbrechen statt die Spalte aufzublaehen */
.h24mm__group-title,
.h24mm__sublist a,
.h24mm__sublist span,
.h24mm__vlink,
.h24mm__vsublist a {
  overflow-wrap: break-word;
  hyphens: auto;
}

.h24mm__group-title {
  display: block;
  font-weight: 600;
  color: var(--h24mm-text);
  padding-bottom: .35rem;
  border-bottom: 1px solid var(--h24mm-border);
}

.h24mm__group-title:hover { color: var(--h24mm-accent); }
.h24mm__group-title--static { cursor: default; }

.h24mm__subtitle {
  display: block;
  font-weight: 400;
  font-size: .8rem;
  color: var(--h24mm-muted);
}

.h24mm__sublist { margin-top: .5rem; display: flex; flex-direction: column; }

.h24mm__sublist a,
.h24mm__sublist span {
  display: block;
  padding: .28rem .4rem .28rem 0;
  color: var(--h24mm-muted);
  line-height: 1.35;
}

.h24mm__sublist a:hover { color: var(--h24mm-accent); }

.h24mm__promo {
  flex: 1 1 15rem;
  max-width: 20rem;
  padding: 1rem 1.25rem;
  background: var(--h24mm-panel-bg-alt);
  border-radius: var(--h24mm-radius);
}

.h24mm__promo-img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--h24mm-radius);
  margin-bottom: .75rem;
}

.h24mm__promo-text { font-size: .875rem; color: var(--h24mm-muted); }
.h24mm__html { font-size: .875rem; color: var(--h24mm-muted); margin-top: .4rem; }

/* --- Burger / Schublade ------------------------------------------- */

.h24mm__burger,
.h24mm__toggle,
.h24mm__close,
.h24mm__vtoggle {
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
  cursor: pointer;
}

.h24mm__burger {
  display: none;
  align-items: center;
  gap: .6rem;
  min-height: var(--h24mm-bar-height);
  font-weight: 600;
}

.h24mm__burger-icon,
.h24mm__burger-icon span,
.h24mm__burger-icon::before,
.h24mm__burger-icon::after {
  display: block;
  width: 20px;
  height: 2px;
  background: currentColor;
}

.h24mm__burger-icon { position: relative; height: 14px; background: none; }
.h24mm__burger-icon span { position: absolute; top: 6px; }
.h24mm__burger-icon::before { content: ""; position: absolute; top: 0; }
.h24mm__burger-icon::after { content: ""; position: absolute; bottom: 0; }

.h24mm__toggle { display: none; }
.h24mm__drawer-head { display: none; }

.h24mm__backdrop {
  position: fixed;
  inset: 0;
  z-index: 1035;
  background: rgba(16, 24, 14, .45);
}

/* --- Vertikales Menü ---------------------------------------------- */

.h24mm--vertical {
  border: 1px solid var(--h24mm-border);
  border-radius: var(--h24mm-radius);
  background: var(--h24mm-surface);
  overflow: hidden;
}

.h24mm__vtitle {
  margin: 0;
  padding: .75rem 1rem;
  font-weight: 600;
  background: var(--h24mm-accent);
  color: #fff;
}

.h24mm__vitem + .h24mm__vitem { border-top: 1px solid var(--h24mm-border); }

.h24mm__vrow { display: flex; align-items: stretch; }

.h24mm__vlink {
  flex: 1 1 auto;
  padding: .7rem 1rem;
  font-weight: 500;
}

.h24mm__vlink:hover { background: var(--h24mm-hover-bg); color: var(--h24mm-accent); }
.h24mm__vitem.is-current > .h24mm__vrow > .h24mm__vlink { color: var(--h24mm-accent); }

.h24mm__vtoggle {
  flex: 0 0 2.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-left: 1px solid var(--h24mm-border);
}

.h24mm__vtoggle[aria-expanded="true"] .h24mm__chevron { transform: rotate(225deg) translate(-1px, -1px); }

.h24mm__vsublist { padding: .25rem 0 .6rem; background: var(--h24mm-hover-bg); }

.h24mm__vsublist a,
.h24mm__vsublist span {
  display: block;
  padding: .35rem 1rem .35rem 1.75rem;
  color: var(--h24mm-muted);
}

.h24mm__vsublist a:hover { color: var(--h24mm-accent); }
.h24mm__vsublist--deep { background: none; }
.h24mm__vsublist--deep a { padding-left: 2.75rem; font-size: .875rem; }

/* --- Mobil / Tablet ----------------------------------------------- */

@media (max-width: 991.98px) {
  .h24mm__burger { display: inline-flex; }

  .h24mm__nav {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1040;
    width: min(20rem, 88vw);
    background: var(--h24mm-surface);
    border-right: 1px solid var(--h24mm-border);
    transform: translateX(-100%);
    transition: transform .22s ease;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .h24mm.is-drawer-open .h24mm__nav { transform: translateX(0); }

  .h24mm__drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .9rem 1rem;
    font-weight: 600;
    border-bottom: 1px solid var(--h24mm-border);
  }

  .h24mm__close { font-size: 1.6rem; line-height: 1; }

  .h24mm__list { flex-direction: column; gap: 0; }

  .h24mm__item {
    display: block;
    position: relative;
    border-bottom: 1px solid var(--h24mm-border);
  }

  .h24mm__link {
    display: block;
    min-height: 0;
    padding: .8rem 3.25rem .8rem 1rem;
    border-bottom: 0;
  }

  .h24mm__toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 0;
    right: 0;
    width: 3rem;
    height: 100%;
    border-left: 1px solid var(--h24mm-border);
  }

  .h24mm__toggle[aria-expanded="true"] .h24mm__chevron { transform: rotate(225deg) translate(-1px, -1px); }

  .h24mm__panel {
    position: static;
    min-width: 0;
    border: 0;
    border-top: 1px solid var(--h24mm-border);
    border-radius: 0;
    box-shadow: none;
    max-width: none;
    background: var(--h24mm-panel-bg);
  }

  .h24mm__panel-inner { display: block; padding: .75rem 1rem 1rem; }
  .h24mm__cols { grid-template-columns: 1fr; gap: 1rem; }
  .h24mm__promo { max-width: none; margin-top: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  .h24mm__nav,
  .h24mm__chevron { transition: none; }
}
