/* WEBER.KAUF-FLIR: controlled wrapping for the dynamic product navigation.
   Works both when the product tree is nested below one static menu item and
   when its root categories are injected as normal siblings in the main menu. */
.wkf-dynamic-product-menu-item,
.wkf-dynamic-product-menu-item > a {
  min-width: 0;
  word-break: normal !important;
  overflow-wrap: normal !important;
  hyphens: none !important;
}

.wkf-dynamic-product-menu-item > a {
  max-width: 100%;
  white-space: normal !important;
  text-wrap: pretty;
}

/* Desktop fly-outs receive enough width for normal category names. */
@media (min-width: 1025px) {
  .wkf-dynamic-product-menu-item > ul.sub-menu {
    min-width: 15rem !important;
    max-width: min(23rem, calc(100vw - 2rem)) !important;
  }

  /* Compact category and product names stay on one line on desktop. */
  .wkf-product-menu-label--short > a {
    white-space: nowrap !important;
  }
}

/* Mobile/Elementor dropdowns use the complete panel width. Normal line wrapping
   then occurs only when the text really no longer fits into that width. */
@media (max-width: 1024px) {
  .wkf-dynamic-product-menu-item > ul.sub-menu,
  .elementor-nav-menu--dropdown .wkf-dynamic-product-menu-item > ul.sub-menu {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  .wkf-dynamic-product-menu-item,
  .wkf-dynamic-product-menu-item > a {
    width: 100%;
    white-space: normal !important;
  }
}
