:root {
  --menu-search-border: rgb(91 103 112 / 50%);
  --menu-placeholder: #5B6770;
}

.header__mega-menu {
  -ms-overflow-style: none;
  scrollbar-width: none;

  &::-webkit-scrollbar {
    display: none;
  }

  .header__mega-menu-category-products {
    display: block;
  }
}

.header__mega-menu-wrapper:focus .header__mega-menu-outer {
  visibility: visible;
  opacity: 1;
}

.header__menu-item > .triangle {
  margin-top: 0;
  margin-left: 7px;
}

.header__right .btn-small {
  line-height: 1;
}

.header__search-form .header__search-input {
  padding: 10px 0;
}

.header__search-form .header__search-input:focus {
  outline: none;
}

.header__menu > .header__menu-list > li {
  .header__menu-item:has(.caret.triangle) {
    position: relative;

    & > .triangle {
      transition: transform .3s ease-in-out, -webkit-transform .3s ease-in-out;
    }

    &::after {
      background-color: #00474F;
      bottom: 18px;
      content: '';
      height: 2px;
      left: 0;
      position: absolute;
      transition: width .3s ease-in-out;
      width: 0;
      will-change: width;
    }
  }

  &:hover .header__menu-item:has(.caret.triangle) {
    & > .triangle {
      -webkit-transform: rotate(-180deg);
      transform: rotate(-180deg);
    }

    &::after {
      width: 100%;
    }
  }
}

.header__new-mega-menu {
  .header__mega-menu-cards-container {
    padding: 32px 0 45px;
  }

  .header__mega-menu-categories .header__mega-menu-category-text {
    opacity: 1;
    flex: auto;
    text-align: left;
    padding-left: 20px;
    font-weight: 500;
  }

  .header__mega-menu-categories .header__mega-menu-category-text:after {
    display: none;
  }

  .header__mega-menu-category-products-title,
  .header__mega-menu-categories-title,
  .header__mega-menu-link-title,
  .header__mega-menu-cards-title {
    margin-bottom: 25px;
    margin-top: 0;
  }

  .header__mega-menu-category-product-title .product-title__arrow {
    height: 0.75em;
    margin-left: 0.5em;
  }

  .header__mega-menu-category-products {
    .header__mega-menu-category-product {
      gap: 25px;
      margin-bottom: 12px;

      .header__mega-menu-category-image-wrapper {
        max-width: 125px;
        width: 100%;

        .header__mega-menu-category-product-image {
          background-color: var(--beige);
          height: auto;
          margin: 0;
          padding-bottom: 67.25%;
          position: relative;
          width: 100%;
  
          & > * {
            height: 100%;
            left: 50%;
            object-fit: cover;
            position: absolute;
            top: 50%;
            translate: -50% -50%;
            width: 100%;
          }
        }
      }

      .header__mega-menu-category-product-content {
        .header__mega-menu-category-product-title {
          text-wrap-style: pretty;
        }

        p {
          font-size: 16px;
          font-weight: 500;
          line-height: 1.3;
          margin-top: 0;
          margin-bottom: 0;
  
          ~ p {
            font-weight: 300;
            margin-top: .25em;
            max-width: 300px;
            text-transform: none;
          }
        }
      }
    }

    .header__mega-menu-category-products-shop-all {
      padding: 0;
      text-transform: none;
      color: var(--dark-teal);
    }
  }

  .header__mega-menu-card__items {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(3, 1fr);
  }

  .header__mega-menu-card-image {
    background-color: var(--beige);
    margin-bottom: 1em;
  }

  .header__mega-menu-card-title {
    align-items: center;
    display: flex;
    gap: 4px;

    .header__mega-menu-card-arrow {
      align-items: center;
      display: flex;
      width: 1em;
    }
  }

  .header__mega-menu-links ul li {
    opacity: 1;
    text-transform: none;
    white-space: nowrap;
  }
}

.header__mega-menu-promo {
  flex: 0 1 360px;
  min-width: 0px;

  .header__mega-menu-promo-image {
    overflow: hidden;
    padding-bottom: 100%;

    img {
      left: 50%;
      height: 100%;
      object-fit: cover;
      position: absolute;
      top: 50%;
      translate: -50% -50%;
      width: 100%;
    }
  }
}

.mega-menu-drawer .header__mega-menu-promo {
  max-width: 100%;
  padding: 15px 20px;
}

.header__mega-menu-promo-container h3 {
  color: #222;
  font-size: 16px;
  margin-top: 1em;
  position: static;
  text-align: left;
  text-transform: uppercase;
  transform: unset;
}

.header__mega-menu-promo > a {
  margin-top: 5px;
  padding: 0;
  text-transform: none;
  color: #00474F !important;
  font-size: 16px;
  font-family: Outfit,sans-serif;
}

.header__mega-menu-footer {
  background-color: var(--beige);
  padding: 10px;
  text-align: center;
  text-transform: none;

  a {
    color: #00474F !important;
    text-decoration: underline;
    text-underline-offset: 0.25em;
    font-size: 16px;
  }
}

/* Mega Menu Drawer */
.mega-menu-drawer {
  .menu-drawer__header .button {
    align-items: center;
    background: none;
    color: #000;
    display: flex;
    gap: .5em;
    line-height: 1;
  }

  .header__mega-menu-category-products {
    display: block;
  }

  .menu-drawer:not(:has(.menu-drawer__menu-level.active)) .menu-drawer__header .menu-drawer__back {
    display: none;
  }

  .menu-drawer__header .menu-drawer__close {
    margin-left: auto;
  }

  .menu-drawer__content a,
  .menu-drawer__content button {
    color: #000000;
  }

  .menu-drawer__content,
  .menu-drawer__menu-level.active {
    overflow-x: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;

    &::-webkit-scrollbar {
      display: none;
    }
  }


  .menu-drawer__menu-search {
    padding: 0 20px;
  }

  .menu-drawer__search-form {
    background: none;
    border: 1px solid var(--menu-search-border);
    border-radius: 3em;

    .menu-drawer__search-input,
    .menu-drawer__search-input:focus {
      outline: none;
    }

    ::-webkit-input-placeholder {
      color: var(--menu-placeholder);
      opacity: 1;
    }

    ::-moz-placeholder {
      color: var(--menu-placeholder);
      opacity: 1;
    }

    :-ms-input-placeholder {
      color: var(--menu-placeholder);
      opacity: 1;
    }

    :-moz-placeholder {
      color: var(--menu-placeholder);
      opacity: 1;
    }
  }

  .menu-drawer__menu-item {
    border: none;
    font-size: 16px;
  }

  .menu-drawer__menu-first-level {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 24px 0;

    & > .menu-drawer__menu-item.menu-button {
      font-size: 22px;
      letter-spacing: 0;
      padding: 0 20px;
      text-transform: capitalize;
    }
  }

  .menu-drawer__menu-level a, 
  .menu-drawer__menu-level button {
    color: #000000;
  }

  .menu-drawer__menu-level {
    display: flex;
    flex-direction: column;

    .menu-drawer__menu-item {
      display: block;
      position: relative;

      &::after {
        background-color: var(--menu-search-border);
        bottom: 0;
        content: '';
        display: block;
        height: 1px;
        left: 20px;
        margin: 0 auto;
        position: absolute;
        right: 20px;
      }
    }

    .menu-drawer__menu-header.caption {
      background: none;
      border: none;
      font-size: 22px;
      font-weight: 600;
      letter-spacing: 0;
      padding: 10px 20px;
      text-align: left;
      text-transform: capitalize;
    }

    .menu-button {
      align-items: center;
      display: flex;
      font-size: 16px;
      justify-content: space-between;
      text-transform: capitalize;
      width: 100%;
    }

    .menu-button::-webkit-details-marker {
      display: none;
    }

    .menu-drawer__menu-list {
      max-height: 0;
      overflow: hidden;
      transition: max-height .35s ease-in-out;

      .menu-drawer__menu-list_inner {
        display: flex;
        flex-direction: column;
        gap: 20px;
        padding: 15px 12px;

        &.no-padd {
          padding: 15px 0;
        }
      }

      .header__mega-menu-category-product {
        display: flex;
        gap: 10px;
        color: #222222;

        .header__mega-menu-category-product-image {
          height: auto;
          margin: 0;
          padding-bottom: 67.2%;
          position: relative;
          width: 100%;
          width: 125px;

          & > * {
            height: 100%;
            left: 50%;
            object-fit: cover;
            position: absolute;
            top: 50%;
            translate: -50% -50%;
            width: 100%;
          }
        }

        p {
          font-size: 15px;
          font-weight: 300;
          line-height: 1.4;
        }
        
        .header__mega-menu-category-product-title {
          font-weight: 400;
          line-height: 1.3;
          letter-spacing: 0.05em;
          text-transform: capitalize;
          font-size: 16px;
        }
      }

      .header__mega-menu-category-products-shop-all {
        border-radius: 3em;
        display: block;
        justify-self: left;
        padding: 15px 11px;
        text-decoration: none;
        width: auto;
        font-weight: 400;
        text-transform: capitalize;
        font-size: 15px;
        color: #222;
        
      }

      .header__mega-menu-category-products-shop-all::after {
        display: none;
      }
    }

    .drawer-accordion[open] {
      font-weight: 400;

      .plus-first {
        display: none;
      }

      .menu-drawer__menu-list {
        max-height: var(--menu-list-height);
      }
    }

    .header__mega-menu-card__items {
      display: grid;
      gap: 12px;
      grid-template-columns: repeat(auto-fit, minmax(calc(33.33% - 12px), 1fr));

      .header__mega-menu-card-image {
        background-color: var(--beige);
        margin-bottom: 1em;

        img {
          height: auto;
          max-width: 100%;
        }
      }

      .header__mega-menu-card-title {
        align-items: center;
        display: flex;
        gap: 4px;

        .header__mega-menu-card-arrow {
          align-items: center;
          display: flex;
          width: 1em;
        }
      }

      .header__mega-menu-card-title span{
        color: #222222;
      }
    }
  }

  .menu-drawer__helper-menu,
  .menu-drawer__sub-menu {
    padding: 12px 0;
    position: relative;

    &::before {
      background-color: var(--menu-search-border);
      content: '';
      display: block;
      height: 1px;
      left: 20px;
      margin: 0 auto;
      position: absolute;
      right: 20px;
      top: 0;
    }

    .menu-drawer__menu-item {
      align-items: center;
      gap: 12px;
      justify-content: start;
      padding: 12px 20px;
    }
  }

  @media screen and (width < 768px) {
    .menu-drawer {
      width: 100%;
    }
  }
}

@media screen and (width >=850px) {
.header__mega-menu-categories .header__mega-menu-category-text{
    text-transform: uppercase;
  }
  .header__mega-menu__list_mega_menu .header__mega-menu-content {
    --menu_categories_width: 45%;
  }
  .header__mega-menu-categories{
    margin-right: 50px;
    max-width: 439px;
  }
  .header__mega-menu__list_mega_menu .header__mega-menu-content{
    max-width: 97%;
  }
  .header__mega-menu-category-content {
    width: var(--menu_categories_content_width, auto);
    width: unset;
  }

  .header__mega-menu-cards {
    flex: 0;
    padding-right: 40px;
  }

  .header__mega-menu-promo {
    margin-left: auto;
  }
}

@media screen and (width >=1440px) {
  .header__mega-menu__list_mega_menu .header__mega-menu-content {
    --menu_categories_content_width: 560px;
  }

  .header__mega-menu-category-content,
  .header__mega-menu-cards {
    padding-right: 72px;
  }

  .header__mega-menu-links {
    /* flex-shrink: 1; */
    flex: 1;
    padding-left: 48px;
    width: auto;
  }
}

@media screen and (width < 1440px) {
  .header__mega-menu__list_mega_menu .header__mega-menu-content {
    /* --menu_categories_content_width: 350px; */
    --menu_categories_content_width: 480px;
  }

  .header__mega-menu-categories {
    padding: 16px 0 20px;
  }

  .header__mega-menu-cards {
    padding-right: 20px;
  }

  .header__mega-menu-category-content,
  .header__mega-menu-links {
    /* flex: 1; */
    padding: 16px 20px;
    width: auto;
  }

  .header__mega-menu-category-content {
    flex: 0 0 var(--menu_categories_content_width, auto);
  }

  .header__mega-menu-promo {
    flex: 1;
    min-width: 240px;
    padding: 16px 0 16px 20px;
    max-width: 450px;
    max-width: 320px;
    width: 100%;
  }

  .header__mega-menu-divider {
    margin: 15px 0;
  }
}

@media screen and (width < 1280px) and (width >=850px) {
  .announcement-bar .page-width {
    padding: 0 20px;
  }

  .announcement-bar__text {
    font-size: 12px;
    margin-right: 15px;
  }

  .announcement-bar__link {
    font-size: 12px;
    padding: 0 15px;
  }

  .header__mega-menu-promo {
    min-width: 150px;
    max-width: 200px;
  }
}

@media screen and (width < 850px) {
  .mega-menu-drawer .header__mega-menu-promo{
    padding-bottom: 30px;
  }
  .menu-drawer__third-item-categories{
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .header:has(~ .mega-menu-drawer) .header__container:has(.header__right .js-open-menu) {
    grid-template-areas: "logo right";
    grid-template-columns: 1fr auto;

    .header__right {
      align-items: center;

      .customer-link {
        display: block;
      }
    }
  }
}

@media screen and (width < 768px) {
  .announcement-bar__text {
    margin: 0;
    text-align: center;
  }
}