body:not(.site--is-pwa) {
  .spr-pwa-menu {
    display: none;
  }

  /* Override for the Storybook wrapper */
  .sb-override .spr-pwa-menu {
    display: flex;
  }
}

.spr-pwa-menu {
  position: fixed;
  z-index: 100;
  bottom: 1rem;
  display: flex;
  overflow: hidden;
  flex-direction: column;
  padding: 0.375rem;
  transition: max-block-size 0.5s linear(0, 0.03 1.5%, 0.121 3.2%, 0.851 13%, 0.99 16.4%, 1.063 20.2%, 1.076 22.3%, 1.075 24.8%, 1.013 35.9%, 0.995 43.4%, 1);
  transform: translateX(-50%);
  border-radius: 1.3125rem;
  background-color: var(--color-white);
  box-shadow:
    0 5px 10px -2px rgba(0, 0, 0, 0.1),
    0 15px 45px 0 rgba(50, 50, 93, 0.25);
  max-inline-size: 95%;
  margin-inline: auto;
  inline-size: 100%;
  inset-inline-start: 50%;
  max-block-size: none;

  &::after {
    position: absolute;
    z-index: 100;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0.375rem;
    content: "";
    background-color: var(--color-white);
  }

  &:has(.spr-pwa-menu__sub-menu.active) {
    max-inline-size: 95%;
    inline-size: 100%;
    transition: max-block-size 0.5s linear(0, 0.03 1.5%, 0.121 3.2%, 0.851 13%, 0.99 16.4%, 1.063 20.2%, 1.076 22.3%, 1.075 24.8%, 1.013 35.9%, 0.995 43.4%, 1);
    max-block-size: 100%;
  }

  ul:not(.spr-pwa-menu__sub-menu) {
    position: relative;
    z-index: 20;
    display: flex;
    justify-content: space-between;
    order: 2;
    width: 100%;
    margin: 0;
    padding: 0.375rem;
    list-style: none;
    border-radius: 0.9375rem;
    background: var(--color-gray-light);
    gap: 0.375rem;
    max-block-size: 6.5rem;

    li {
      display: flex;
      flex: 1 0 auto;
      flex-wrap: wrap;

      a {
        display: flex;
        flex-direction: column;
        align-items: center;
        transition: background 0.3s ease;
        text-decoration: none;
        text-wrap: pretty;
        color: var(--color-text);
        border-radius: 1rem;
        font-size: 0.75rem;
        inline-size: 100%;
        padding-block: 0.625rem;
        block-size: 100%;

        span {
          display: flex;
          flex-grow: 1;
          align-items: center;
          text-align: center;
          line-height: 120%;
        }

        &::before {
          display: flex;
          margin-block-end: 0.125rem;
          padding: 0.5rem;
          content: "";
          border-radius: 50%;
          background-repeat: no-repeat;
          background-position: center center;
          inline-size: 2rem;
          block-size: 2rem;
        }

        &:hover,
        &:active,
        &:focus {
          color: var(--color-white);
        }
      }

      &:nth-child(1) a {
        background: transparent;

        &::before {
          background-image: url("../../images/icons/icon-pwa-home.svg"), var(--gradient-greenish-dark);
        }

        &:hover,
        &:active,
        &:focus {
          background-image: var(--gradient-greenish-dark);

          &::before {
            background-image: url("../../images/icons/icon-pwa-home.svg");
          }
        }
      }

      &:nth-child(2) a {
        background: transparent;

        &::before {
          background-image: url("../../images/icons/icon-pwa-incidents.svg"), var(--gradient-orange-dark);
        }

        &:hover,
        &:active,
        &:focus {
          background-image: var(--gradient-orange-dark);

          &::before {
            background-image: url("../../images/icons/icon-pwa-incidents.svg");
          }
        }
      }

      &:nth-child(3) {
        text-align: center;
        a {
          background: transparent;

          &::before {
            background-image: url("../../images/icons/icon-pwa-whattdo.svg"), var(--gradient-blue-dark);
          }

          &:hover,
          &:active,
          &:focus {
            background-image: var(--gradient-blue-dark);

            &::before {
              background-image: url("../../images/icons/icon-pwa-whattdo.svg");
            }
          }
        }
      }

      &:nth-child(4) a {
        text-align: center;
        background: transparent;

        &::before {
          background-image: url("../../images/icons/icon-pwa-externalsources.svg"), var(--gradient-green-dark);
        }

        &:hover,
        &:active,
        &:focus {
          background-image: var(--gradient-green-dark);

          &::before {
            background-image: url("../../images/icons/icon-pwa-externalsources.svg");
          }
        }
      }

      &:nth-child(5) a {
        background: transparent;

        &::before {
          background-image: url("../../images/icons/icon-pwa-more.svg"), var(--gradient-red-dark);
        }

        &:hover,
        &:active,
        &:focus {
          background-image: var(--gradient-red-dark);

          &::before {
            background-image: url("../../images/icons/icon-pwa-more.svg");
          }
        }
      }

      &:last-of-type {
        position: relative;
      }
    }
  }

  ul.spr-pwa-menu__sub-menu {
    position: relative;
    z-index: 10;
    /* display: none; */
    overflow: hidden;
    order: 1;
    margin: 0;
    padding: 0;
    list-style-type: none;
    transition: transform 0.5s linear(0, 0.03 1.5%, 0.121 3.2%, 0.851 13%, 0.99 16.4%, 1.063 20.2%, 1.076 22.3%, 1.075 24.8%, 1.013 35.9%, 0.995 43.4%, 1);
    transform: translateY(100%);
    transform-origin: bottom;
    opacity: 0;
    block-size: 100%;
    max-block-size: 0;
    inline-size: 100%;

    &.active {
      /* display: block; */
      overflow: visible;
      transition: transform 0.5s linear(0, 0.03 1.5%, 0.121 3.2%, 0.851 13%, 0.99 16.4%, 1.063 20.2%, 1.076 22.3%, 1.075 24.8%, 1.013 35.9%, 0.995 43.4%, 1);
      transform: translateY(0%);
      opacity: 1;
      max-block-size: 100%;
      inline-size: 100%;
    }

    li {
      padding-inline-end: 1.1325rem;
      text-align: right;
      border-block-start: 0.0625rem solid var(--color-gray-light);

      &:first-of-type {
        border-block-start: none;
      }

      a {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        text-decoration: none;
        color: var(--color-text);
        font-size: 0.875rem;
        font-weight: 700;
        padding-block: 0.875rem;
        gap: 1rem;

        &::after {
          display: flex;
          align-items: center;
          justify-content: center;
          padding: 0.5rem;
          padding-block-start: 0.75rem;
          border-radius: 50%;
          background: var(--gradient-red-dark);
          inline-size: 2rem;
          block-size: 2rem;
        }

        &:hover,
        &:active,
        &:focus {
          text-decoration: underline;
          text-underline-offset: var(--base-underline-offset);
          text-decoration-thickness: 0.125rem;
        }
      }

      &:nth-child(1) a::after {
        content: url("../../images/icons/icon-pwa-settings.svg");
      }

      &:nth-child(2) a::after {
        content: url("../../images/icons/icon-pwa-actueel.svg");
      }

      &:nth-child(3) a::after {
        content: url("../../images/icons/icon-pwa-aboutus.svg");
      }
    }
  }
}
