// =====================================
//  header.scss
//   |
//   |-> Header
// =====================================


@import "_variables";
@import "helpers-placeholders";

/**
  * -------------------------------------------------------------------------------
  * ( 03 ) - Header
  * -------------------------------------------------------------------------------
  *
  *  This part contains logo, main menu and header bars.
  *
  * ------
  *
  *  Header is divided to the following sections:
  *
  *    |
  *    |-->  [ 01 ] - Logo
  *    |-->  [ 02 ] - Menu Main
  *    |-->  [ 03 ] - Header Bars
  *
  */


#header {
  position: relative;
  top: 0;
  left: 0;
  // z-index: 5;
  width: 100%;
  // font-size: 13px;

  @at-root .header-style-2 & {
    @include bgGradient(#2c8ee8, #429ef3, 90deg);
  }
}


/*  [ 01 ] - Logo
=================== */

.logo {
  display: inline-block;

  img {
    max-height: 100%;
  }

  h3,
  h3 + span {
    display: none;
  }

  &.text-white {
    h3,
    span {
      color: #fff;
    }

    span {
      // opacity: 0.7;
    }
  }

  &.logo-text {
    // text-align: left;

    img {
      display: none;
    }

    h3,
    h3 + span {
      display: block;
    }

    h3 {
      position: relative;
      margin-bottom: -1px;
      font-size: 20px;
      font-weight: 600;
      color: #fff;
    }

    h3 + span {
      font-size: 11px;
      // opacity: 0.7;
      color: $body-color;
    }
  }
}

.logo-header {
  position: relative;
  display: flex;
  flex-direction: column; // to set each flex childs as one column
  justify-content: center; // to center content vertically
  // align-items: center; // to center content horizontally
  height: 50px;
  margin-left: 20px;
  transition: color 0.3s, top 0.3s;

  @media (max-width: 480px) {
    height: 40px;
  } // < 480px width
  
  &.logo-text {
    text-align: left;

    h3 {

    }
  }
}



/*  [ 02 ] - Menu Main
======================== */

.menu-main {
  list-style: none;
  display: flex;
  position: relative;
  margin-right: auto;
  margin-left: 50px;
  height: 100%;

  li {
    position: relative;
    white-space: nowrap; /* no need for Supersubs plugin */

    a {
      transition: all 0.15s;
      font-family: $heading-font;
    }
  }

  > li {
    height: 100%;

    &:hover a:not(.current) {
      opacity: 1;

      span {
        &::before {
          margin-top: 0;
        }
      }
    }

    > a {
      height: 100%;
      display: flex;
      align-items: center;
      padding: 20px 13px;
      font-size: 16px;
      font-family: $heading-font;
      text-transform: uppercase;
      font-weight: 500;
      transition: color 0.15s, height 0.3s, line-height 0.3s, opacity 0.3s;
      color: $theme-color-4;

      &::before {
        // content: "";
        position: absolute;
        bottom: 0;
        width: calc(100% - 26px);
        height: 3px;
        background-color: transparent;
      }

      &:not(.current) span {
        overflow: hidden;
        // padding-top: 25px;
        height: 37px;

        &::before {
          content: attr(data-content);
          display: block;
          position: relative;
          top: 0px;
          margin-top: -38px;
          transition: all 0.25s;
          color: $theme-color-3;
        }
      }

      &.current {
        opacity: 1;

        &::before {
          background-color: #fff;
        }
        
        span {
          &::after {
            content: "";
            position: absolute;
            left: 5px;
            top: 50%;
            display: inline-block;
            width: calc(100% - 10px);
            height: 1px;
            background-color: $theme-color-3;
          }
        }
      }

      // only 2nd lvl sub-menu
      + ul.sub-menu {
        border-top: 5px solid $theme-color-1;

        &::before {
          content: "";
          position: absolute;
          top: -15px;
          left: 30px;
          border-bottom: 12px solid $theme-color-1;
          border-left: 8px solid transparent;
          border-right: 8px solid transparent;

          @at-root .header-style-2 & {
            border-bottom-color: #ff991f;
          }
        }
      }
    }

    > a.current,
    &:hover > a,
    > a:hover,
    > a:focus {
      // &,
      // & span {
        color: $theme-color-1;
      // }
      
      // & span {
      //   &::before {
      //     color: $theme-color-3;
      //   }
      // }
    }

    > a.current,
    &:hover > a,
    > a:hover,
    > a:focus {
      & span {
        color: $theme-color-3;
      }
    }

    > a:not(.current) {
      & span {
        color: #192b3a;

        @at-root .header-style-2 & {
          color: #fff;
        }
      }
    }
  }

  // 2nd lvl Dropdown Menu
  ul {
    list-style: none;
    // text-align: left;

    &.sub-menu {
      
    }
  }

  li:hover > ul.sub-menu, // showing sub-menus using css
  li.sfHover > ul.sub-menu {
    display: block;
  }

  ul.sub-menu,
  ul.sub-menu li:last-child a {
    border-radius: 0 0 4px 4px;
  }

  li a + ul.sub-menu {
    display: none;
    position: absolute;
    top: calc(100% - 0px);
    left: 0;
    z-index: 99;
    // padding: 6px 20px;
    min-width: 17em; // Sub-menu min. width
    background-color: #fff;
    box-shadow: 0 1px 20px 0 rgba(0,0,0,0.2);
    // border: 1px solid #eee;
  }

  ul.sub-menu {
    li {
      a {
        display: block;
        position: relative;
        color: $dark-color;
        font-weight: 500;
        font-size: 16px;
        padding: 12px 10px 12px 0;
        border-bottom: 1px solid #eee;
      }

      &:last-child a {
        border: none;
      }

      a:hover,
      a:focus,
      &:hover > a {
        color: $theme-color-1;
        // background-color: #fbfbfb;
        padding-right: 15px;
      }
    }
  }

  ul.sub-menu > li {
    padding: 0 25px;
    
    &:first-child {
      padding-top: 6px;
    }

    &:last-child {
      padding-bottom: 6px;
    }
  }

  .megamenu ul.sub-menu li a:hover { // Megamenu case
    padding-left: 5px;
    background: transparent;
  }

  // 3rd lvl Dropdown Menu
  ul.sub-menu ul {
    top: -6px !important;
    left: 100% !important;
    border-top: 5px solid $theme-color-1;

    @at-root .header-style-2 & {
      border-top-color: #ff991f;
    }
  }

  // Reversed sub-menu case
  > li > ul.sub-menu.reverse-pos {
    right: 0 !important;
    right: auto !important;
  }

  ul.sub-menu ul.reverse-pos {
    right: 100% !important;
    left: auto !important;
  }

  // Superfish Arrows
  &.sf-arrows {
    a.sf-with-ul {
      &::after { // Arrow itself
        font-family: "Font Awesome 5 Free";
        font-size: 15px;
        font-weight: 600;
        color: #192b3a;
        transition: all 0.2s;

        @at-root .header-style-2 & {
          color: #fff;
        }
      }
    }

    // Main links arrow
    > li > a.sf-with-ul::after {
      content: '\f0d7';
      position: relative;
      top: 0;
      margin-left: 8px;
      // font-weight: lighter;
    }

    > li > a.sf-with-ul:focus:after,
    > li:hover > a.sf-with-ul:after,
    > .sfHover > a.sf-with-ul:after {
      color: $theme-color-1 !important;
    }

    // 2nd lvls arrow
    ul.sub-menu a.sf-with-ul::after {
      position: absolute;
      content: '\f0d9';
      left: 10px;
      top: 16px;
      color: #192b3a;
    }

    // li > a.sf-with-ul:focus:after,
    li:hover > a.sf-with-ul:after,
    .sfHover > a.sf-with-ul:after {
      color: $theme-color-1;
    }
  }
}

@media (max-width: 1200px) {
  .menu-main {
    display: none;
  }
} // < 1200px width



/* Btn Header */
.btn-header {
  @media (max-width: 768px) {
    
  } // < 768px width
}




/*  [ 03 ] - Header Bars
========================== */

/* Header Bar */
.header-bar,
.header-bar-wrap {
  background: transparent;
  transition: height 0.3s, background 0.3s;
}

.header-bar-wrap {
  position: relative;
  left: 0;
  top: 0;
  width: 100%;
  // border-bottom: 1px solid rgba(0,0,0,0.1);
}

.header-bar {
  .container,
  .row,
  [class*="col-"] {
    height: 100%;
  }

  .row {
    // display: flex;
  }

  .col-md-12 {
    // display: flex;
    width: 100%;
  }

  .hb-content {
    display: flex;
    align-items: center;
    height: 100%;
    transition: all 0.2s;

    [class*="position-"] {
      display: flex;
      height: 100%;
    }

    .position-right {
      margin-left: auto;
    }

    .position-left {
      margin-right: auto;
    }
  }
}

/* Header Bar Sticky */
.header-bar {
  &.is-sticky {
    .header-bar-wrap {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      z-index: 10;
      background-color: #fff;
      box-shadow: 0 0 15px rgba(0,0,0,0.2) !important;
      border-bottom-color: transparent;      
    }
  }

  .logo-header {
    &.logo-text {
      text-align: left;

      h3 {

      }

      h3 + span {
        opacity: 1;
        color: $body-color;
      }
    }
  }

  .menu-main > li > a {
    // color: $dark-color;
  }

  .menu-main > li > a.current,
  .menu-main > li:hover > a,
  .menu-main > li > a:hover,
  .menu-main > li > a:focus {
    // color: var(--theme-color-1);
  }

  .header-meta {
    // border-left-color: rgba(0,0,0,0.1);
  }
}

/* Header Bar 1 */
#header-bar-1 {
  background-color: $theme-color-4;
  color: #ccc;

  &,
  .header-bar-wrap {
    height: 60px;

    @media (max-width: 768px) {
      padding: 10px 0;
      height: auto;
    } // < 768px width
  }

  .hb-content {
    @media (max-width: 768px) {
      flex-direction: column;

      [class*="position-"] {
        justify-content: center;
        width: 100%;
      }

      .position-left {
        margin-bottom: 5px;
      }
    } // < 768px width
  }

  .social-icons {
    margin-right: -10px;
  }
}

/* Header Bar 2 */
#header-bar-2 {
  position: relative;
  left: 0;
  top: 0;
  z-index: 10;
  width: 100%;
  border-bottom: 1px solid rgba(#fff, 0.2);
  
  .hb-content {
    // align-items: initial;
    // at responsive it needs to change.
    margin-left: auto;
  }

  &,
  .header-bar-wrap {
    height: 110px;
    // background-color: #fff;

    @at-root .page-single & {
      box-shadow: 0 0 12px rgba(0,0,0,0.06);
    }
  }

  .header-bar-wrap {
    z-index: 1;
    background-color: #fff;
  }

  &.is-sticky {
    &,
    .header-bar-wrap { 
      height: 90px; // height when is-sticky

      @media (max-width: 480px) {
        height: auto;
      } // < 480px width
    }

    .header-bar-wrap {
      background-color: #fff;
    }

    .hb-content {
      @media (max-width: 480px) {
        padding: 20px 0;
      } // < 480px width
    }
  }

  .logo-header {
    // margin-left: 20px;
  }

  &.text-white {
    .header-bar {

    }

    .header-bar-wrap {
      background-color: $dark-color;
    }

    .menu-main > li > a,
    .menu-main > li > a:focus {
      color: #fff;
    }

    .menu-main > li > a.current,
    .menu-main > li:hover > a,
    .menu-main > li > a:hover {
      color: $theme-color-1;
    }
  }
}


/* List Info */
.list-info {
  list-style: none;
  position: relative;
  display: flex;
  align-items: center;

  & + .list-info {
    margin-right: 40px;
  }

  > li {
    display: flex;
    align-items: center;
    
    & + li {
      margin-left: 20px;
      padding-left: 20px;
      border-left: 1px solid rgba(#fff, 0.15);
    }

    > a {
      display: flex;
      align-items: center;
      color: #ccc;
  
      &:hover {
        &,
        & i {
          color: #fff;
        }
      }
    }
  }


  i {
    margin-left: 7px;
    font-size: 13px;
    color: $dark-color;

    &::before {
      transition: all 0.2s;
    }
  }
}




/* Side Panel Menu */
.side-panel-menu {
  overflow-x: auto;
  position: fixed;
  z-index: 120;
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  padding: 60px 30px;
  width: 350px;
  height: 100%;
  top: 0;
  left: 0;
  transform: translateX(calc(-100% - 10px));
  box-shadow: -2px 0 4px rgba(#000, 0.15);
  background-color: $theme-color-4;
  transition: all 0.3s;

  &.viewed {
    transform: translateX(0);
  }

  .logo-side-panel {
    height: 60px;
  }
  
  .popup-bg {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    background-color: rgba($dark-color, 0.7);
    transition: all 0.4s;
  }

  .mobile-side-panel-menu {
    position: relative;
    z-index: 30;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 50px 0;
    margin: auto 0;
    width: 100%;

    h5 {
      padding: 30px;
      margin-bottom: 0;
      height: 85px;
      background-color: var(--theme-color-1);
      color: #fff;
    }
  }

  
  .side-panel-close {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 35px;
    height: 35px;
    cursor: pointer;
    border-radius: 999px;
    transition: all 0.2s;
    border: 1px solid rgba(#fff, 0.1);
    background-clip: content-box;
    background-color: rgba(#fff, 0.1);

    &:hover {
      border-color: rgba(#fff, 0.3);
      background-color: transparent;
    }

    .hamburger {
      display: block;
      padding: 0;
      opacity: 0.5;
      
      .hamburger-box {
        display: block;
        width: 15px;
      }

      &-inner,
      &-inner::before,
      &-inner::after {
        width: 15px;
        height: 2px;
        background-color: #fff;
      }
    }
  }
}

@media (max-width: 480px) {
  .side-panel-menu {
    .mobile-side-panel-menu {
      width: 280px;
    }
  }
} // < 480px width

.popup-preview-overlay {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 10;
  width: 100%;
  height: 100%;
  opacity: 0;
  visibility: hidden;
  background: $dark-color;
  transition: all 0.3s;

  &.viewed {
    opacity: 0.8;
    visibility: visible;
  }
}

@media (min-width: 1200px) {
  .side-panel-menu,
  .popup-preview-overlay {
    display: none;
  }
} // > 1200px width

/* Menu Mobile */
#menu-mobile {
  list-style: none;
  overflow: hidden;
  overflow-y: auto;
  position: relative;
  clear: both;
  // height: 200px;
  padding: 20px 0 50px;
  margin-top: 30px;
  width: 100%;
  // background-color: #fff;

  ul {
    list-style: none;
  }

  .ss-content {
    padding: 0 5px 0 0;
  }

  .ss-scroll {
    opacity: 0.5;
    width: 6px;
  }

  &.ss-container:hover .ss-scroll {
    // background-color: $theme-color-1;
    opacity: 1;
  }
}

.menu-mobile {
  // max-width: 1140px;
  // margin: 0 auto;

  li {
    border-bottom: 1px solid rgba(#fff, 0.15);
    position: relative;

    &:last-child {
      border-bottom: none;
    }

    &:hover > a {
      // color: $theme-color-3;
    }

    a {
      display: block;
      position: relative;
      font-size: 16px;
      font-weight: 500;
      opacity: 0.7;
      padding: 15px 30px 15px 0;
      font-family: $heading-font;
      color: #fff;
    }
  }

  > li > a:hover,
  // >li>a.current,
  > li > a.active {
    opacity: 1;
  }

  > li > a.current {
    opacity: 1;
  }


  /* 2nd Level Menus */
  ul {
    display: none;
    margin-top: 0 !important;
    padding-top: 20px;
    padding-left: 15px;
    padding-bottom: 20px;
    border-top: 1px solid rgba(#fff, 0.15);

    a {
      color: #fff;
      font-weight: 600;
      font-size: 16px;
      padding: 15px 30px 15px 0;

      &:hover,
      &.active {
        font-weight: 600;
        color: $theme-color-3;
      }
    }

    li:hover > ul {
      /*display: block;*/
      // Useful if plugin not working
    }
  }

  // Menu Arrows
  li.has-ul > a::after {
    // Arrow itself
    position: absolute;
    font-family: "Font Awesome 5 Free";
    color: #fff;
    transition: all 0.2s;
  }

  // Main links arrow
  > li.has-ul > a::after {
    /*display: none;*/
    content: '\f0d8';
    font-size: 17px;
    font-weight: 600;
    right: 10px;
    top: 16px;
    transform: rotate(90deg);
  }

  >li.has-ul>a.active::after,
  >li.has-ul:hover>a::after {
    color: #fff;
    // font-weight: 700;
  }

  >li.has-ul>a.active::after {
    transform: rotate(180deg);
  }

  // 2nd lvls arrow
  ul.sub-menu li.has-ul > a::after {
    content: '\f0d9';
    font-size: 15px;
    top: 15px;
    left: 10px;
  }

  ul.sub-menu li.has-ul>a.active::after,
  ul.sub-menu li.has-ul:hover>a::after {
    color: $theme-color-1;
    // font-weight: 700;
  }

  ul.sub-menu li.has-ul>a.active::after {
    transform: rotate(-90deg);
  }
}



/* Mobile Menu Button */
.menu-mobile-btn {
  display: none;
  position: relative;
  margin-left: auto;
  padding: 12px;
  border-radius: 5px;
  transition: top 0.3s;
  @include bgGradient($theme-color-1, $theme-color-2, 90deg);

  @at-root .header-style-2 & {
    @include bgGradient($theme-color-4, $theme-color-3, 90deg);
  }

  .hamburger-box {
    display: block;
    width: 25px;
  }

  .hamburger {
    padding: 0;

    &-inner,
    &-inner::before,
    &-inner::after {
      width: 25px;
      height: 2px;
      background-color: #fff;
    }
  }
}

@media (max-width: 1200px) {
  .menu-mobile-btn {
    display: flex;
    align-items: center;
  }
}

// width < 1200px



@media (max-width: 480px) {
  #header-bar-2 {
    &,
    .header-bar-wrap {
      height: auto;
    }
    
    .hb-content {
      // flex-direction: column;
      padding: 25px 0;
      // margin-bottom: -5px;
    }

    .logo-header {
      margin: 0;
    }
  }
} // < 480px width





// Imports ( Rest imports )
// ==================================

@import "helpers-placeholders";

// ==================================
