/* Arian — mobile menu: animated accordions for Products / Raw materials / Blog / About.
   Everything is inside the mobile breakpoint, so the desktop menu is untouched. */
@media (max-width: 61.24em) {

  /* ---------- panel & top-level rows ---------- */
  .c-header__wrap { box-sizing: border-box; }
  .c-header__wrap .c-menu {
    gap: 0;
    padding-top: 6vh;
    padding-right: 0;
    padding-left: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .c-header__wrap .c-menu > li {
    width: 100%;
    border-bottom: 1px solid rgba(255, 255, 255, .1);
    direction: inherit;
  }
  .c-header__wrap .c-menu > li:last-child { border-bottom: 0; }
  .c-header__wrap .c-menu > li > a {
    width: 100%;
    padding: 15px 4px;
    font-size: 1.0625rem;
    line-height: 1.5;
    text-align: start;
  }

  /* rows that own a submenu: label + chevron on one line */
  .c-header__wrap .c-menu > li > a.parent-sub-menu {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .c-header__wrap .c-menu > li.apm-products-item {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center !important;
  }
  .c-header__wrap .c-menu > li.apm-products-item > a {
    flex: 1 1 auto;
    width: auto;
    cursor: pointer;
  }

  /* ---------- chevrons (one look for every accordion) ---------- */
  .c-menu > li > a.parent-sub-menu .has-sub-menu {
    position: static;
    left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .08);
    transition: background .3s ease, transform .35s cubic-bezier(.4, 0, .2, 1);
  }
  .c-menu > li > a.parent-sub-menu .has-sub-menu::after,
  .apm-products-toggle span,
  .apm-raw-toggle span {
    content: "";
    display: block;
    width: 8px;
    height: 8px;
    margin: -3px 0 0;
    padding: 0;
    background: none;
    border: 0;
    border-right: 2px solid #fff;
    border-bottom: 2px solid #fff;
    border-radius: 0;
    transform: rotate(45deg);
    transition: none;
  }
  .c-header__wrap .c-menu > li > .apm-products-toggle,
  .c-header__wrap .apm-products-dropdown .apm-raw-toggle {
    flex: 0 0 32px;
    width: 32px;
    min-width: 32px;
    height: 32px;
    min-height: 32px;
    padding: 0;
    margin: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .08);
    color: #fff !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .3s ease, transform .35s cubic-bezier(.4, 0, .2, 1);
    -webkit-tap-highlight-color: transparent;
  }
  .apm-products-toggle span,
  .apm-raw-toggle span { transform: rotate(45deg) !important; margin: -3px 0 0 !important; }

  /* open state: chevron flips, circle lights up */
  .c-menu > li.is-sub-open > a.parent-sub-menu .has-sub-menu,
  .c-menu > li.is-sub-open > .apm-products-toggle,
  .apm-raw-parent.is-sub-open > .apm-raw-toggle {
    transform: rotate(180deg);
    background: rgba(255, 255, 255, .22);
  }
  .c-menu > li.is-sub-open > a { color: #fff; }

  /* ---------- collapsible panels ---------- */
  .c-header__wrap .c-menu > li > ul,
  .c-header__wrap .c-menu > li.apm-products-item > .apm-products-dropdown {
    position: relative !important;
    top: 0 !important;
    right: auto !important;
    left: auto !important;
    display: block !important;
    flex-basis: 100%;
    width: 100% !important;
    max-width: 100% !important;
    max-height: 0;
    margin: 0 !important;
    padding: 0 8px !important;
    overflow: hidden;
    box-sizing: border-box;
    list-style: none;
    background: rgba(255, 255, 255, .07) !important;
    border: 0 !important;
    border-radius: 14px !important;
    box-shadow: none !important;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: none !important;
    transition: max-height .42s cubic-bezier(.4, 0, .2, 1),
                opacity .3s ease,
                margin .42s cubic-bezier(.4, 0, .2, 1),
                visibility 0s linear .42s;
  }
  .c-header__wrap .c-menu > li.is-sub-open > ul,
  .c-header__wrap .c-menu > li.apm-products-item.is-sub-open > .apm-products-dropdown {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    margin: 2px 0 14px !important;
    transition: max-height .42s cubic-bezier(.4, 0, .2, 1),
                opacity .3s ease .05s,
                margin .42s cubic-bezier(.4, 0, .2, 1),
                visibility 0s;
  }

  /* ---------- sub items ---------- */
  .c-header__wrap .c-menu ul > li {
    display: block;
    width: 100%;
    margin: 0;
    border: 0 !important;
    direction: inherit;
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity .3s ease, transform .35s cubic-bezier(.4, 0, .2, 1);
  }
  .c-header__wrap .c-menu li.is-sub-open > ul > li { opacity: 1; transform: none; }
  .c-header__wrap .c-menu li.is-sub-open > ul > li:nth-child(1) { transition-delay: .06s; }
  .c-header__wrap .c-menu li.is-sub-open > ul > li:nth-child(2) { transition-delay: .10s; }
  .c-header__wrap .c-menu li.is-sub-open > ul > li:nth-child(3) { transition-delay: .14s; }
  .c-header__wrap .c-menu li.is-sub-open > ul > li:nth-child(4) { transition-delay: .18s; }
  .c-header__wrap .c-menu li.is-sub-open > ul > li:nth-child(5) { transition-delay: .22s; }
  .c-header__wrap .c-menu li.is-sub-open > ul > li:nth-child(n+6) { transition-delay: .26s; }

  .c-header__wrap .c-menu ul > li:first-child { margin-top: 8px; }
  .c-header__wrap .c-menu ul > li:last-child { margin-bottom: 8px; }
  /* the nested raw-materials list has its own spacing */
  .c-header__wrap .c-menu .apm-raw-children > li:first-child { margin-top: 0; }
  .c-header__wrap .c-menu .apm-raw-children > li:last-child { margin-bottom: 0; }

  .c-header__wrap .c-menu ul > li > a,
  .c-header__wrap .apm-products-dropdown > li > a {
    display: block;
    padding: 12px 14px;
    border: 0 !important;
    border-radius: 10px;
    background: transparent;
    color: rgba(255, 255, 255, .86) !important;
    font-size: .9375rem;
    font-weight: 400;
    line-height: 1.6;
    text-align: start;
    text-decoration: none;
    transition: background .2s ease, color .2s ease;
    -webkit-tap-highlight-color: transparent;
  }
  .c-header__wrap .c-menu ul > li > a:active,
  .c-header__wrap .c-menu ul > li > a:hover,
  .c-header__wrap .c-menu ul > li > a:focus-visible {
    background: rgba(255, 255, 255, .12);
    color: #fff !important;
    font-weight: 400;
  }
  /* injected "all …" link at the top of a submenu */
  .c-header__wrap .c-menu ul > li.apm-m-all > a {
    font-weight: 700;
    color: #fff !important;
    background: rgba(255, 255, 255, .08);
    margin-bottom: 4px;
  }

  /* ---------- nested accordion: raw materials ---------- */
  .c-header__wrap .apm-products-dropdown > li.apm-raw-parent {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0 4px;
    position: relative;
  }
  .c-header__wrap .apm-raw-parent > a { flex: 1 1 auto; width: auto; cursor: pointer; }
  .c-header__wrap .apm-raw-parent > .apm-raw-toggle { margin-inline-end: 4px; }
  .c-header__wrap .apm-raw-parent > .apm-raw-children {
    position: relative !important;
    top: 0 !important;
    right: auto !important;
    left: auto !important;
    display: block !important;
    flex-basis: 100%;
    width: 100% !important;
    max-height: 0;
    margin: 0 !important;
    padding: 0 6px !important;
    overflow: hidden;
    box-sizing: border-box;
    background: rgba(0, 0, 0, .2) !important;
    border: 0 !important;
    border-radius: 12px !important;
    box-shadow: none !important;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: none !important;
    transition: max-height .4s cubic-bezier(.4, 0, .2, 1),
                opacity .28s ease,
                margin .4s cubic-bezier(.4, 0, .2, 1),
                visibility 0s linear .4s;
  }
  .c-header__wrap .apm-raw-parent.is-sub-open > .apm-raw-children {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    margin: 4px 0 8px !important;
    transition: max-height .4s cubic-bezier(.4, 0, .2, 1),
                opacity .28s ease .04s,
                margin .4s cubic-bezier(.4, 0, .2, 1),
                visibility 0s;
  }
  .c-header__wrap .apm-raw-children > li:first-child { margin-top: 6px !important; }
  .c-header__wrap .apm-raw-children > li:last-child { margin-bottom: 6px !important; }
  .c-header__wrap .c-menu .apm-raw-children > li > a {
    position: relative;
    padding-inline-start: 26px;
    font-size: .9rem;
    color: rgba(255, 255, 255, .78) !important;
  }
  .c-header__wrap .c-menu .apm-raw-children > li > a::before {
    content: "";
    position: absolute;
    inset-inline-start: 11px;
    top: 50%;
    width: 5px;
    height: 5px;
    margin-top: -2.5px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .45);
    transition: background .2s ease, transform .2s ease;
  }
  .c-header__wrap .c-menu .apm-raw-children > li > a:hover::before,
  .c-header__wrap .c-menu .apm-raw-children > li > a:active::before {
    background: #fff;
    transform: scale(1.4);
  }
}

@media (max-width: 61.24em) and (prefers-reduced-motion: reduce) {
  .c-header__wrap .c-menu ul,
  .c-header__wrap .c-menu ul > li,
  .c-menu .has-sub-menu,
  .c-menu .apm-products-toggle,
  .c-menu .apm-raw-toggle { transition: none !important; }
}
