/*-------------------------------------------------------*/
/* Navigation
/*-------------------------------------------------------*/
.nav {
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  z-index: 120;
  min-height: $nav-height;
  position: relative;

  &__wrap {
    margin-left: auto;
  }

  &__menu,
  &__dropdown-menu {
    list-style: none;
  }

  @media (min-width: 1400px) {
    &__container {
      max-width: 1260px;
    }
  }

  &__menu {
    position: relative;
    @include display-inline-flex;
    align-items: center;
    flex-wrap: wrap;

    li {
      position: relative;
    }

    li a {
      font-family: $heading-font;
    }

    & > li > a {
      color: $heading-color;
      font-size: 0.8175rem;
      font-weight: 500;
      text-transform: uppercase;
      line-height: $nav-height;
      display: block;
      position: relative;
      @include transition(0.1s color);

      &:hover {
        opacity: 0.9;
      }
    }
  }

  /* Dropdowns (large screen) */
  @include bp-lg-up {
    &__wrap.collapse {
      display: block;
      height: auto;
    }

    &__menu > li {
      display: inline-block;
      text-align: center;
      padding: 0 17px;

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

    &__dropdown-menu {
      position: absolute;
      left: -5px;
      top: 100%;
      z-index: 1000;
      min-width: 220px;
      width: 100%;
      text-align: left;
      padding: 16px 0;
      list-style: none;
      background-color: #fff;
      box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
      -webkit-background-clip: padding-box;
      background-clip: padding-box;
      display: block;
      visibility: hidden;
      opacity: 0;
      @include transform(scaleY(0));
      transform-origin: top center;
      @include transition(all 0.2s ease-in-out);

      & > li > a {
        color: $text-color;
        font-size: 1rem;
        padding: 7px 24px;
        line-height: 22px;
        display: block;

        &:hover,
        &:focus {
          color: var(--dinery-main-color);
        }
      }
    }

    &__item-dropdown::after {
      display: inline-block;
      content: "\e905";
      font-size: 12px;
      opacity: 0.5;
      font-family: "dinerize-icons";
      line-height: 1;
      margin-left: 4px;
    }

    &__dropdown-menu.hide-dropdown {
      visibility: hidden !important;
      opacity: 0 !important;
    }

    &__dropdown:hover > .nav__dropdown-menu,
    &__dropdown:focus > .nav__dropdown-menu,
    &__dropdown.focus > .nav__dropdown-menu {
      opacity: 1;
      visibility: visible;
      @include transform(scaleY(1));
    }

    &__dropdown-menu {
      .nav__dropdown-menu {
        left: 100%;
        top: -16px;
      }
    }

    &__dropdown &__dropdown {
      position: relative;
    }

    &__dropdown &__dropdown > a:after {
      content: "\e907"#{'/*!rtl:"\e906"\*/'};
      font-family: "dinerize-icons";
      font-size: 14px;
      position: absolute;
      right: 20px;
      top: 50%;
      @include transform(translateY(-50%));
    }

    &__dropdown-trigger {
      display: none;
    }
  }
}

/* Align last dropdown
-------------------------------------------------------*/
@include bp-lg-up {
  .nav__menu > li:last-child .nav__dropdown-menu,
  .deo-elementor-nav-menu__list > li:last-child .deo-elementor-nav-menu__dropdown-menu {
    right: -24px;
    left: auto;
  }

  .nav__menu > li:last-child .nav__dropdown-menu .nav__dropdown-menu,
  .deo-elementor-nav-menu__list
    > li:last-child
    .deo-elementor-nav-menu__dropdown-menu
    .deo-elementor-nav-menu__dropdown-menu {
    left: auto;
    right: 100%;
  }
}

/* Dropdown trigger
-------------------------------------------------------*/
.nav__dropdown-trigger {
  background-color: transparent;
  border: 0;
  padding: 0;
  color: inherit;

  &:focus {
    background-color: transparent;
    color: inherit;
  }

  i {
    display: inline-block;
    @include transition(all 0.2s ease-in-out);
  }

  &--is-open i {
    @include transform(rotate(180deg));
  }
}

.mobile body {
  cursor: pointer;
}

.nav__menu > li.active > a,
.nav__menu > .current_page_parent > a,
.nav__menu .current-menu-item > a {
  color: var(--dinery-main-color);
}

/* Logo
-------------------------------------------------------*/
.logo {
  line-height: 1;
  display: block;
  max-height: 25px;

  &-url {
    vertical-align: middle;
    color: $heading-color;
  }
}

// Transparent header logo state
.nav--default .logo--light,
.nav--transparent .logo--light {
  display: none;
}

@include bp-lg-up {
  .nav--transparent .logo--dark,
  .nav--transparent .sticky .logo--light {
    display: none;
  }

  .nav--transparent .logo--light,
  .nav--transparent .sticky .logo--dark {
    display: inline-block;
  }
}

/* Nav Flexbox
-------------------------------------------------------*/
.nav__flex-parent {
  align-items: center;
  justify-content: space-between;

  @include bp-lg-up {
    height: $nav-height;

    .nav--sticky.sticky & {
      height: $nav-short-height;
    }
  }

  @include bp-lg-down {
    display: block;
  }
}

.nav--align-right {
  margin-left: auto;
}

.nav--align-left {
  margin-right: auto;
}

/* Nav Right / Shortcode
-------------------------------------------------------*/
.nav__right {
  margin-left: 34px;

  .glf-button {
    padding: 13px 24px !important;
  }

  .btn--md {
    font-size: 0.875rem;
  }

  &--mobile {
    padding: 20px 0;
  }
}

/* Nav Icon Toggle (mobile nav)
-------------------------------------------------------*/
.nav__icon-toggle {
  display: block;
  position: relative;
  padding: 9px;
  width: 36px;
  height: 32px;
  margin-right: -9px;
  background-color: transparent;
  border: none;
  z-index: 50;
  margin-left: auto;

  @include bp-lg-up {
    display: none;
  }

  &-bar {
    background-color: $heading-color;
    width: 18px;
    display: block;
    position: absolute;
    height: 2px;
    border-radius: 1px;
  }

  span:nth-child(2) {
    top: 9px;
    @include transition(top 0.2s 0.2s ease-in, opacity 0.1s ease-in);
  }

  span:nth-child(3) {
    top: 15px;
    @include transition(opacity 0.1s ease-in);
  }

  span:nth-child(4) {
    bottom: 9px;
    @include transition(bottom 0.2s 0.2s ease-in, transform 0.22s cubic-bezier(0.55, 0.055, 0.675, 0.19));
  }

  &--is-opened {
    span:nth-child(2) {
      top: 15px;
      @include transition(0.5s cubic-bezier(0.215, 0.61, 0.355, 1));
      @include transform(rotate(45deg));
    }

    span:nth-child(3) {
      opacity: 0;
    }

    span:nth-child(4) {
      bottom: 15px;
      @include transform(rotate(-45deg));
      @include transition(bottom 0.1s ease-out, transform 0.22s 0.12s cubic-bezier(0.215, 0.61, 0.355, 1));
    }
  }

  &:focus {
    background-color: transparent;
  }
}

/* Custom Header Logo
-------------------------------------------------------*/
.deo-logo {
  &-container {
    display: inline-block;
    vertical-align: middle;
  }
}

/* Sticky Nav
-------------------------------------------------------*/
.nav--sticky {
  &.offset {
    @include transform(translate3d(0, -100%, 0));
    @include transition($all !important);
  }

  &.scrolling {
    @include transform(translate3d(0, 0px, 0));
  }

  &.sticky {
    position: fixed !important;
    background-color: #fff;
    visibility: hidden;
    opacity: 0;
    left: 0;
    right: 0;
    top: 0;
    box-shadow: 0 0 5px rgba(62, 64, 69, 0.1);

    &.scrolling {
      opacity: 1;
      visibility: visible;
    }

    @include bp-lg-up {
      .nav__menu > li > a {
        line-height: $nav-short-height;
      }
    }
  }
}

/* Transparent Nav
-------------------------------------------------------*/
@include bp-lg-up {
  .nav--transparent {
    background-color: transparent;
    position: absolute !important;
    width: 100%;
    top: 0;

    .nav__holder:not(.sticky) {
      .nav__menu > li > a,
      .nav__menu > li > a:hover,
      .nav__menu > li > a:focus,
      .nav__menu > li.active > a,
      .nav__right .btn {
        color: #fff;
      }
    }
  }
}

/* Go to Top
-------------------------------------------------------*/
#back-to-top {
  display: block;
  z-index: 100;
  width: 34px;
  height: 34px;
  text-align: center;
  font-size: 16px;
  position: fixed;
  bottom: -34px;
  right: 20px;
  line-height: 34px;
  background-color: $bg-light;
  box-shadow: 0px 1px 4px 0px rgba(154, 161, 171, 0.4);
  border-radius: 50%;
  @include transition($all);
  text-decoration: none;

  i {
    @include transition($all);
  }

  a {
    display: block;
    color: $heading-color;
  }

  &.show {
    bottom: 20px;
  }

  &:hover {
    background-color: var(--dinery-main-color);
    bottom: 24px;
  }

  &:hover i {
    color: #fff;
  }
}

/*-------------------------------------------------------*/
/* Nav Mobile Styles
/*-------------------------------------------------------*/

@include bp-lg-down {
  .nav {
    &__wrap {
      margin-left: 0;
    }

    &__header {
      height: $nav-height;
      @include display-flex;
      align-items: center;
    }

    &__menu {
      display: block;
    }

    &__menu li a {
      padding: 14px 0;
      line-height: 1.3;
      display: block;
      border-bottom: 1px solid $border-color;
    }

    &__dropdown-menu a {
      color: $text-color;

      &:hover {
        color: #000;
      }
    }

    &__dropdown-menu > li > a {
      padding-left: 10px;
    }

    &__dropdown-menu > li > ul > li > a {
      padding-left: 20px;
    }

    &__dropdown-trigger {
      display: block;
      width: 20px;
      min-height: 46px;
      line-height: 46px;
      font-size: 14px;
      text-align: center;
      position: absolute;
      right: 0;
      top: 0;
      z-index: 50;
      cursor: pointer;
    }

    &__dropdown-menu {
      display: none;
      width: 100% !important;
    }

    &__dropdown-trigger.active + .nav__dropdown-menu {
      display: block;
    }
  }

  .logo-wrap {
    float: left;

    a {
      display: table-cell;
      vertical-align: middle;
      height: $nav-height;
    }
  }

  .nav__btn {
    width: 100%;
    margin-bottom: 18px;
  }

  .sticky-on-mobile .navbar {
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
    background: #fff;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
  }
}
