$menu-black: #000000;
$menu-light-gray: #DDDDDD;
$menu-lighter-gray: #e4e4e4;
$menu-border-gray: #D9D9D9;
$menu-color_gray: #B8B8B8;
$menu-color-white: #FFFFFF;

@mixin scrollbar-styles {
  &::-webkit-scrollbar {
    width: 4px;
  }

  &::-webkit-scrollbar-track {
    background-color: $menu-light-gray;
  }

  &::-webkit-scrollbar-thumb {
    background-color: $menu-black;
  }
}

.menu-font-style {
  font-family: "F Grotesk";
  font-weight: 400;
  letter-spacing: 0;
}

.flex-center {
  display: flex;
  justify-content: center;
  align-items: center;
}

.flex-items-center {
  display: flex;
  align-items: center;
}

.header__inline-menu {
  details[open]:hover > .header__menu-item {
    text-decoration-thickness: 0;
  }

  .mega-menu__content {
    border: none;
    padding: 21px 14px 56px;
    z-index: 9;
    max-height: 322px;
    overflow-x: hidden;
    top: calc(100%);
    border-radius: 3px;
    @include scrollbar-styles;
    
    @media (min-width: 768px) {
      top: calc(100%);
      padding-top: 16px;
    }
  }

  .mega-menu__content__container {
    width: 100%;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 40px;
  }

  .mega-menu__list {
    gap: 40px 81px;
    flex-wrap: wrap;
    padding: 0;
    width: auto;
  }

  .mega-menu__link {
    color: $menu-black;
    font-size: 12px;
    line-height: 15px;
    padding: 0;
    text-decoration: none;
    @extend .menu-font-style;

    &:hover {
      text-decoration: underline;
    }
  }

  .list-unstyled {
    &.mega-menu__column {
      column-count: 2;
      column-gap: 40px;
    }

    &.mega-menu__column-two {
      column-count: 3;
      column-gap: 40px;
    }
  }

  .mega-menu__link--level-2 {
    color: $menu-color_gray;
    pointer-events: none;
  }

  .mega-menu__link--level-3 {
    padding-bottom: 6px;

    &.mega-menu__link--view-all {
      font-weight: 600;
      padding-bottom: 16px;
    }

    &:hover {
      color: $menu-black !important;
      text-decoration: underline !important;
    }
  }

  .mega-menu__link--level-2:not(:only-child) {
    margin-bottom: 16px;
  }

  .mega-menu__content__container-image {
    gap: 20px;
    padding-bottom: 24px;
    @extend .flex-center;
  }

  .featured-image-container {
    max-height: 280px;
    max-width: 500px;
    position: relative;
  }

  .featured-image-container__image {
    border-radius: 4px;
    object-fit: cover;
  }

  .featured-image-container__placehoder {
    background: $menu-lighter-gray;
    border-radius: 4px;
    width: 500px;
    height: 280px;
  }

  .featured-image-container__text {
    position: absolute;
    font-size: 14px;
    line-height: 17px;
    @extend .menu-font-style;
  }
}

.menu-drawer-container {
  .header__icon--menu::before {
    display: none;
  }
}

.shopify-section-group-header-group.menu-open .header-wrapper {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.js .header {
  details[open] > .menu-drawer,
  .gradient.menu-drawer {
    transition: none;
    z-index: 5;
  }
}

.js .gradient.menu-drawer {
  background-color: $menu-color-white;
  width: 100%;

  .menu-drawer__navigation-container {
    padding: 0 0 43px;
    @include scrollbar-styles;
  }

  .search-modal__drawer-form {
    padding: 12px 12px 23px;
    width: 100%;
  }

  .search__input-drawer-form {
    color: $menu-black;
    border: 1px solid $menu-border-gray;
    border-radius: 3px;
    width: 100%;
    outline: none;
    box-shadow: none;
    padding: 10px;
    font-size: 14px;
    line-height: 17px;
    height: 38px;
    @extend .menu-font-style;

    &::-ms-input-placeholder {
      color: $menu-color_gray;
    }

    &::placeholder {
      color: $menu-color_gray;
    }
  }

  .menu-drawer__navigation {
    padding: 0;

    .menu-drawer__navigation-level-1 {
      overflow-x: auto;
      column-gap: 17px;
      -ms-overflow-style: none;
      scrollbar-width: none;
      padding-bottom: 35px;
      margin-bottom: 0;
      @extend .flex-items-center;

      &::-webkit-scrollbar {
        display: none;
      }
      a {
        text-decoration: none;
      }

      li {
        margin: 0;

        &:first-child {
          padding-left: 12px;
        }

        &:last-child {
          padding-right: 12px;
        }
      }

      .list-menu__drawer-item {
        &.active,
        &:hover {
          color: $menu-black;
          text-decoration: underline;
        }
      }
    }

    .menu-drawer__navigation-level-2 {
      display: none;
      padding: 0 12px;

      &.active {
        display: block;  
      }

      li {
        padding-bottom: 20px;

        &.view-all {
          padding-bottom: 34px;

          .list-menu__drawer-item {
            font-weight: 600;
          }
        }
      }

      .list-menu__drawer-item {
        text-decoration: none;

        &.active {
          .icon-vector-dropdown {
            transform: rotate(180deg);
          }
        }
      }

      .list-menu__drawer-item-link {
        color: $menu-black;
        font-size: 14px;
        line-height: 17px;
        text-decoration: none;
        @extend .menu-font-style;
      }

      .icon-vector-dropdown {
        width: 12px;
        height: 13px;
        flex-shrink: 0;
        margin-left: 4px;
        position: relative;
        left: 2px;
      }
    }

    .menu-drawer__navigation-level-3 {
      max-height: 0;
      overflow: hidden;
      transition: max-height 0.3s ease;

      &.active {
        height: auto;
        max-height: 100vh;
        transition: max-height 0.5s ease;
      }

      li {
        padding-left: 12px;
        padding-bottom: 12px;

        &:first-child {
          padding-top: 20px;
        }

        &:last-child {
          padding-bottom: 0;
        }
      }

      .list-menu__drawer-item  {
        font-size: 12px;
        line-height: 15px;
      }
    }
  }

  .list-menu__drawer-item {
    color: $menu-black;
    font-size: 14px;
    line-height: 17px;
    text-underline-offset: 5px;
    justify-content: space-between;
    @extend .flex-items-center ;
    @extend .menu-font-style;
  }

  .menu-drawer__utility-links {
    padding: 39px 12px 0;
    background-color: $menu-color-white;

    .list-menu__drawer-item {
      text-decoration: none;
      padding: 0;
      margin-bottom: 22px;
      width: max-content;

      &:last-child {
        margin-bottom: 0;
      }

      &:hover {
        text-decoration: underline;
      }
    }
  }

  .mega-menu_image {
    display: block;
  }

  .mobile-image-container {
    max-width: 100%;
    @extend .flex-center;
  }

  .mobile-image-container__content {
    max-width: unset;
    max-height: unset;
    position: relative;
    width: 100%;
    display: block;
    padding-top: 56%;
  }

  .mobile-image-container__image {
    object-fit: cover;
    border-radius: 4px;
    max-height: unset;
    max-width: unset;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
  }

  .mobile-image-container__placehoder {
    background: $menu-lighter-gray;
    border-radius: 4px;
    width: 100%;
    max-height: 280px;
    max-width: 500px;
  }

  .mobile-image-container__text {
    position: absolute;
    font-size: 14px;
    line-height: 17px;
    @extend .menu-font-style;
  }
}

@media (min-width: 990px) {
  .shopify-section-group-header-group.menu-open .header-wrapper {
    border-bottom-left-radius: 3px;
    border-bottom-right-radius: 3px;
  }
}
.mega-menu__content {
  min-height: 202px;
}
.mega-menu__list__item {
	position: relative;
}
.mega-menu__content_sub {
	position: absolute;
	background: #fff;
	left: 161px;
	width: calc(100vw - 180px);
	top: 0;
	display: none;
}
.mega-menu__item_sub {
	&.active {
		.mega-menu__content_sub {
			display: block;
		}
    .mega-menu__link-sub {
      text-decoration: underline;
    }
	}
}
.mega-menu__content_sub {
	&.mega-menu__content_static {
		> .mega-menu__list {
			display: block;
			.mega-menu__list__item {
				position: static;
				&.active {
					.mega-menu__content_sub {
						display: block;
					}
					.mega-menu__link-sub-sub {
						text-decoration: underline;
					}
				}
				.mega-menu__link {
					text-decoration: none;
				}
			}
			.mega-menu__link--level-2 {
				&.margin {
					margin-bottom: 16px;
				}
			}
		}
		.mega-menu__content_sub {
			display: none;
		}
	}
}
.menu-drawer__navigation-level-2 {
	.menu-drawer__navigation-static {
		font-family: F Grotesk;
		font-weight: 600;
		font-size: 12px;
		line-height: 15px;
		letter-spacing: 0;
		color: #B8B8B8;
		margin-bottom: 16px;
		display: block;
	}
	.list-menu {
		& + .menu-drawer__navigation-static {
			margin-top: 32px;
		}
		&.list-menu-parent {
			> li {
				padding-bottom: 13px !important;
				border-bottom: 1px solid #D9D9D9;
				& + li {
					margin-top: 14px;
				}
				.menu-drawer__navigation-level-3 {
					li {
						padding-left: 16px !important;
						padding-bottom: 0 !important;
						& + li {
							margin-top: 16px;
						}
						&:first-child {
							padding-top: 16px !important;
						}
					}
				}
			}	
		}
	}
}