:root {
  --submenu-shadow: 0 10px 20px rgba(0, 0, 0, 0.09);
}

/* active menu item */
header .current-menu-item > a > span,
header .current-menu-parent > a > span,
header .current_page_item > a > span,
header .current_page_parent > a > span,
header .current-menu-ancestor > a > span {
  color: var(--brand-accent-color) !important;
}

header .sub-menu .current-menu-item > a > span,
header .sub-menu .current-menu-parent > a > span,
header .sub-menu .current_page_item > a > span,
header .sub-menu .current_page_parent > a > span,
header .sub-menu .current-menu-ancestor > a > span {
  color: #fff !important;
}

header .sub-menu .current-menu-item > a,
header .sub-menu .current-menu-parent > a,
header .sub-menu .current_page_item > a,
header .sub-menu .current_page_parent > a,
header .sub-menu .current-menu-ancestor > a {
  background: var(--brand-accent-color) !important;
}
header .burger-menu .sub-menu .current-menu-item > a,
header .burger-menu .sub-menu .current-menu-parent > a,
header .burger-menu .sub-menu .current_page_item > a,
header .burger-menu .sub-menu .current_page_parent > a,
header .burger-menu .sub-menu .current-menu-ancestor > a {
  background: none !important;
}

header .burger-menu .sub-menu .current-menu-item > a > span,
header .burger-menu .sub-menu .current-menu-parent > a > span,
header .burger-menu .sub-menu .current_page_item > a > span,
header .burger-menu .sub-menu .current_page_parent > a > span,
header .burger-menu .sub-menu .current-menu-ancestor > a > span {
  color: var(--brand-accent-color) !important;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 999;
}

.header {
  width: 100%;
  z-index: 999;
}

.header-desktop {
  width: 100%;
  background: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.header-desktop.hide {
  transform: translateY(-110%);
  transition: transform 0.3s ease;
}

.header-top {
  background: #fff;
}

.header-top-inner {
  min-height: 125px;
}

.header-bottom {
  background: var(--brand-primary-color);
}

.header-bottom .navbar {
  padding: 0 !important;
  min-height: 50px;
  justify-content: center;
}

/* logo */
.logo,
.logo-mobile {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.logo img,
.logo-mobile img {
  max-width: 170px;
  max-height: 74px;
  width: auto;
  height: auto;
  object-fit: contain;
}

.logo-text {
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--brand-header-text-color);
}

/* search */
.header-search-form .input-group,
.mobile-search-form .input-group {
  overflow: hidden;
  border-radius: 999px;
}

.header-search-form .form-control,
.mobile-search-form .form-control {
  min-height: 30px;
  background: var(--brand-primary-color);
  color: var(--brand-primary-color-darkest);
  border: none;
  border-right: 0;
  border-radius: 999px;
  padding: 0.75rem 1.75rem;
  box-shadow: none;
  font-size: 0.95rem;
  font-weight: 400 !important;
}

.header-search-form .form-control:focus,
.mobile-search-form .form-control:focus {
  border-color: var(--brand-accent-color);
  box-shadow: none;
}

.btn-search,
.mobile-search-form .btn {
  min-height: 30px;
  padding: 0.75rem 1.5rem;
  border: 1px solid var(--brand-accent-color);
  background: var(--brand-accent-color);
  color: #fff;
  border-radius: 999px !important;
  font-weight: 500;
  z-index: 99 !important;
}

.btn-search {
  transform: translateX(-1.25rem);
}

.btn-search:hover,
.mobile-search-form .btn:hover {
  background: var(--brand-accent-color-hover);
  border-color: var(--brand-accent-color-hover);
  color: #fff;
}

.btn-search:active,
.mobile-search-form .btn:active {
  background: var(--brand-accent-color-hover) !important;
  border-color: var(--brand-accent-color-hover) !important;
  color: #fff;
}

.search-icon {
  margin-right: 0.4rem;
}

/* tools */
.header-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2rem;
}

.header-tool {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--brand-primary-text-color);
  text-decoration: none;
  font-weight: 400;
}

.header-tool:hover {
  color: var(--brand-accent-color);
}

.tool-icon {
  font-size: 1.4rem;
  line-height: 1;
}
.tool-text {
  font-size: 0.9rem;
  line-height: 1;
}

.cart-link {
  position: relative;
}

.cart-count {
  position: absolute;
  top: -8px;
  right: -12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--brand-accent-color);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
}

/* desktop nav */
.nav-list,
.nav-list .sub-menu,
.nav-list .children,
.mobile-menu,
.mobile-menu .sub-menu,
.mobile-menu .children {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-list {
  padding: 0 5rem;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.nav-list > li {
  margin-bottom: 0;
}

.nav-list a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 1rem 0;
  text-decoration: none;
  white-space: nowrap;
  color: var(--brand-header-text-color);
  font-weight: 700;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.01em;
}

.menu-item a span:hover,
.menu-item a:hover span,
.menu-item a:focus-visible span {
  color: var(--brand-accent-color);
}

.nav-list .menu-item-has-children > a::after {
  content: '';
  background-image: url('/wp-content/themes/wmo/assets/images/pfeil-nach-unten.svg');
  background-size: contain;
  background-repeat: no-repeat;
  width: 12px;
  height: 12px;
  font-size: 0.8rem;
  line-height: 1;
  transition: transform 0.2s ease;
}

.nav-list .menu-item-has-children:hover > a::after,
.nav-list .menu-item-has-children:focus-within > a::after {
  filter: invert(55%) sepia(85%) saturate(1200%) hue-rotate(10deg) brightness(95%) contrast(95%);
  transform: rotate(180deg);
}
.nav-list .menu-item-has-children.current-menu-item > a::after {
  filter: invert(55%) sepia(85%) saturate(1200%) hue-rotate(10deg) brightness(95%) contrast(95%);
}
.nav-list .menu-item-has-children.current-menu-ancestor > a::after,
.nav-list .menu-item-has-children.current-menu-parent > a::after,
.nav-list .menu-item-has-children.current-product_cat-parent > a::after {
  filter: invert(55%) sepia(85%) saturate(1200%) hue-rotate(10deg) brightness(95%) contrast(95%);
}
.nav-list .sub-menu,
.nav-list .children {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 250px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
  padding: 3rem 5rem;
  background: #fff;
  border-radius: 0 0 20px 20px;
  box-shadow: var(--submenu-shadow);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(8px);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease,
    visibility 0.2s ease;
}

.nav-list li:hover > .sub-menu,
.nav-list li:hover > .children,
.nav-list li:focus-within > .sub-menu,
.nav-list li:focus-within > .children {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.sub-menu .menu-item {
  aspect-ratio: 4 / 3;
  position: relative;
  background: var(--brand-secondary-color-light);
  height: 170px;
  margin: 0;
  border-radius: 12px;
}

.sub-menu .menu-item::after {
  content: '';
  position: absolute;
  pointer-events: none;
  background-image: url('/wp-content/themes/wmo/assets/images/pfeil-rechts-kreis.png');
  background-size: contain;
  background-repeat: no-repeat;
  width: 30px;
  height: 30px;
  top: 1rem;
  right: 1rem;
  z-index: 1;
}

.nav-list .sub-menu a,
.nav-list .children a {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 0.5rem;
  width: 100%;
  padding: 1rem;
  border-radius: 12px;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  text-wrap: balance;
}

.nav-list .sub-menu a span,
.nav-list .children a span {
  min-height: 45px;
  max-height: 45px;
}
.nav-list .sub-menu a:hover,
.nav-list .sub-menu a:focus-visible,
.nav-list .children a:hover,
.nav-list .children a:focus-visible {
  background: var(--brand-accent-color);
}
.sub-menu .menu-item a:hover span,
.sub-menu .menu-item a:focus-visible span {
  color: #fff !important;
}

.sub-menu .menu-icon {
  opacity: 0.3;
  width: 50px;
  height: 50px;
}

/* mobile */
.header-mobile {
  top: 0;
  left: 0;
  display: none;
  width: 100%;
  min-height: 76px;
  background: #fff;
  border-bottom: 1px solid var(--brand-secondary-color-lightest);
}

.mobile-header-inner {
  min-height: 76px;
}

.mobile-header-right {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.header-mobile .burger {
  position: relative;
  z-index: 1001;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.header-mobile .burger span {
  position: absolute;
  width: 24px;
  height: 2px;
  border-radius: 999px;
  background: var(--brand-header-text-color);
  transition:
    transform 0.25s ease,
    opacity 0.25s ease;
}

.header-mobile .burger span:first-child {
  transform: translateY(-7px);
}

.header-mobile .burger span:last-child {
  transform: translateY(7px);
}

.header-mobile .burger.open span:first-child {
  transform: rotate(45deg);
}

.header-mobile .burger.open span:nth-child(2) {
  opacity: 0;
}

.header-mobile .burger.open span:last-child {
  transform: rotate(-45deg);
}

.burger-menu {
  position: fixed;
  top: 76px;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  width: min(92vw, 420px);
  padding: 1rem 1rem 2rem;
  background: #fff;
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.12);
  overflow-y: auto;
  transform: translateX(105%);
  transition: transform 0.3s ease;
}

.burger-menu.active {
  transform: translateX(0);
}

.mobile-search-form {
  margin-bottom: 1rem;
}

.mobile-menu > li {
  position: relative;
  margin: 0 !important;
  border-bottom: 1px solid #efefef;
}

.mobile-menu a {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 1rem 2rem 1rem 0;
  text-decoration: none;
  color: var(--brand-header-text-color);
  font-size: 1rem;
  font-weight: 700;
}

.mobile-menu .sub-menu,
.mobile-menu .children {
  display: none;
  padding: 0 0 0.5rem 1rem;
}

.mobile-menu .submenu-open > .sub-menu,
.mobile-menu .submenu-open > .children {
  display: block;
}

.mobile-menu .submenu-toggle {
  position: absolute;
  top: 0.6rem;
  right: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--brand-header-text-color);
  cursor: pointer;
  transition: transform 0.2s ease;
  font-size: 0;
}

.mobile-menu .submenu-toggle::after {
  content: '';
  background-image: url('/wp-content/themes/wmo/assets/images/pfeil-nach-unten.svg');
  background-size: contain;
  background-repeat: no-repeat;
  width: 12px;
  height: 12px;
}

.mobile-menu .submenu-toggle.is-open {
  transform: rotate(180deg);
}

.mobile-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.mobile-action-link {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  justify-content: flex-start;
  height: 45px;
  padding: 0.75rem 1rem;
  background: var(--brand-primary-color);
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--brand-primary-text-color);
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  line-height: 1.2;
  text-decoration: none;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease;
}

.mobile-action-link:hover {
  border-color: var(--brand-accent-color);
  color: var(--brand-accent-color);
  transform: translateY(-1px);
}
.mobile-action-link svg {
  height: 18px;
  width: auto;
}
.mobile-action-link .cart-count {
  position: static;
  min-width: 22px;
}

/* responsive */
@media (max-width: 1450px) {
  .nav-list .sub-menu,
  .nav-list .children {
    grid-template-columns: repeat(4, 1fr);
  }
}
@media (max-width: 1199px) {
  .nav-list {
    gap: 1.2rem;
  }

  .nav-list a {
    font-size: 0.93rem;
  }

  .tool-text {
    display: none;
  }

  .nav-list .sub-menu,
  .nav-list .children {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 991.98px) {
  .header-mobile {
    display: block;
  }

  .no-scroll .header-mobile {
    position: fixed;
  }

  .header-desktop {
    display: none;
  }

  .sub-menu {
    padding: 2rem 1.5rem;
    grid-template-columns: 1fr;
  }
  .sub-menu .menu-item {
    position: relative;
    background: none;
    height: auto;
    aspect-ratio: auto;
    border-radius: 0;
  }
  .sub-menu .menu-item:not(:last-child) {
    border-bottom: 1px solid #efefef;
  }

  .sub-menu .menu-item .menu-icon {
    width: 35px;
    height: 35px;
    margin-right: 1rem;
  }

  .sub-menu .menu-item a:hover span,
  .sub-menu .menu-item a:focus-visible span,
  .sub-menu .menu-item a:active span {
    color: var(--brand-accent-color) !important;
  }

  .logo img,
  .logo-mobile img {
    max-width: 130px;
    max-height: 54px;
  }

  header .floating-buttons {
    gap: 1.5rem;
    position: static;
    padding-top: 1rem;
    flex-direction: row;
    flex: 1;
    align-items: flex-end;
    justify-content: center;
  }
}

@media (min-width: 992px) {
  .header-mobile {
    display: none;
  }

  .header-desktop {
    display: block;
  }
}
