/*==============================================================
  05. Header
================================================================*/
@use "../default/breakpoints" as bp;

.cs_site_header_style_1 {
  position: relative;
  z-index: 101;
  color: var(--gray-color1);
}

.cs_site_brand {
  min-width: 120px;
  max-width: 160px;
  flex: none;
}

.cs_site_header_style_1 {
  position: absolute;
  width: 100%;
  left: 0;
  top: 0px;
  transition: all 0.4s ease;
}

.cs_site_header_style_1 {
  .cs_main_header_in {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    height: 86px;
    padding: 15px 0;
    transition: all 0.4s ease;
  }

  .cs_main_header_right {
    .cs_btn_style_1 {
      border: 1px solid var(--gray-color2);
      padding: 9px 20px;
      text-wrap: nowrap;

      &:hover {
        border-radius: 0;
      }
    }
  }
}

.cs_site_header_style_1 {
  &.cs_sticky_active {
    background-color: var(--white-color);
    box-shadow: 0 10px 10px -10px rgba(33, 43, 53, 0.1);

    .cs_main_header_in {
      height: 80px;
    }
  }
}

.cs_site_header_style_1 {

  .cs_main_header_right {
    display: flex;
    align-items: center;
    z-index: 1000;
  }
}

@include bp.down(xl) {
  .cs_main_header .container {
    max-width: 100%;
  }

  .cs_site_header_style_1 {
    .cs_main_header_in {
      height: 72px;
    }

    &.cs_sticky_active {

      .cs_main_header_in {
        height: 72px;
      }
    }

    .cs_main_header_right {
      padding-inline-end: 45px;

      .cs_btn_style_1 {
        padding: 9px 15px;
      }
    }

    .cs_nav {
      display: flex;
    }
  }
}

.cs_nav ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.cs_sticky_header {
  position: fixed !important;
  width: 100%;
  z-index: 999;
}

.cs_site_brand {
  display: inline-block;

  img {
    max-height: 45px;
  }
}

@include bp.up(xl) {
  .cs_main_header {
    position: relative;

    .container-fluid {
      padding-right: 40px;
      padding-left: 40px;
    }
  }

  .cs_main_header_center {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
  }

  .cs_site_header_style_1 {
    .cs_main_header_center {
      display: flex;
      justify-content: center;
      align-items: center;
      height: 100%;
      width: 100%;
      max-width: calc(100% - 300px);
    }
  }

  .cs_nav {
    display: flex;
    align-items: center;
    height: 100%;
    line-height: 1.6em;

    .cs_nav_list {
      display: flex !important;
      gap: 8px;
      height: inherit;

      >li {
        height: inherit;

        &:last-child {
          margin-inline-end: 0;
        }

        >a {
          padding: 10px 15px;
          display: inline-flex;
          position: relative;
          height: inherit;
          align-items: center;
          transition: all 0.3s ease;

          &::before {
            content: "";
            width: 100%;
            height: 1px;
            position: absolute;
            left: 0;
            bottom: 0;
            transform: scale(0);
            background-color: var(--gray-color2);
            transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
          }

          &:hover {
            color: var(--primary-color);

            &::before {
              transform: scale(1);
            }
          }
        }
      }
    }
  }

  .menu-item-has-children {
    position: relative;

    >a {
      position: relative;
      padding-inline-end: 20px;

      &::before {
        display: none;
      }

      &::after {
        content: "\f078";
        font-family: "Font Awesome 7 Free";
        font-size: 10px;
        font-weight: 900;
        position: absolute;
        inset-inline-end: 0;
        top: 50%;
        transform: translateY(-50%);
      }
    }

    .cs_dropdown_list {
      display: block;
      width: 200px;
      position: absolute;
      top: calc(100% + 20px);
      inset-inline-start: 0;
      visibility: hidden;
      opacity: 0;
      pointer-events: none;
      padding: 15px 0;
      flex-direction: column;
      border-radius: 0 0 5px 5px;
      background-color: var(--white-color);
      box-shadow: 0px 1px 10px 0px rgba(0, 0, 0, 0.1);
      transition: all 0.4s ease;

      a {
        display: block;
        padding: 6px 20px;

        &:hover {
          color: var(--primary-color);
        }
      }
    }

    &:hover {
      >a {
        color: var(--primary-color);
      }

      >.cs_dropdown_list {
        visibility: visible;
        opacity: 1;
        pointer-events: auto;
        top: 100%;
      }
    }
  }

  .cs_menu_toggle,
  .cs_menu_dropdown_toggle,
  .cs_nav_contact_btn {
    display: none;
  }
}

@include bp.down(xl) {
  .cs_site_brand {
    position: relative;
    z-index: 101;
  }

  .cs_nav {
    .cs_nav_list_wrap {
      position: fixed;
      width: 100vw;
      inset-inline-start: -100vw;
      background-color: #fff;
      color: var(--primary-color);
      padding: 10px 0;
      top: 0;
      /* Bounded to the viewport height so a long menu scrolls inside the
        panel instead of running off the bottom of the screen. 100vh is the
        fallback for browsers without the dynamic viewport unit. */
      height: 100vh;
      height: 100dvh;
      overflow-y: auto;
      overscroll-behavior: contain;
      -webkit-overflow-scrolling: touch;
      line-height: 1.6em;
      padding-top: 80px;
      padding-bottom: 40px;
      transition: all 0.4s ease;

      &.active {
        inset-inline-start: 0vw;
      }

      /* Links now scroll up behind the brand and the toggle, which sit above
        the panel. This strip - the height of the mobile header row, and the
        panel's own colour by inheritance - keeps that top row clean. */
      &.active::before {
        content: "";
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 80px;
        background-color: inherit;
        z-index: 100;
      }

      ul {
        padding-inline-start: 15px;
      }

      a {
        display: block;
        font-size: 16px;
        padding-block: 10px;
        padding-inline: 0 15px;
        line-height: 1.4em;
      }
    }

    .menu-item-has-children {
      position: relative;

      .cs_dropdown_list {
        display: none;
      }
    }

    .cs_menu_dropdown_toggle {
      position: absolute;
      height: 40px;
      width: 100%;
      top: 0;
      left: 0px;
      display: flex;
      align-items: center;
      justify-content: flex-end;
      padding: 23px 18px;
      border: 0;
      background: none;
      color: inherit;
      cursor: pointer;
      z-index: 3;

      span {
        display: block;
        position: relative;
        height: 10px;
        width: 10px;

        &:before,
        &:after {
          content: "";
          display: block;
          position: absolute;
          left: 50%;
          top: 50%;
          transform: translate(-50%, -50%);
          height: 2px;
          width: 10px;
          background-color: currentColor;
          transition: all 0.3s ease;
        }

        &:before {
          transform: translate(-50%, -50%) rotate(90deg);
        }
      }

      &.active {
        span {
          &:before {
            transform: translate(-50%, -50%) rotate(0deg);
          }
        }
      }
    }
  }

  /*Mobile Menu Button*/
  /* 44x44 touch target; the padding keeps the 30x27 icon. */
  .cs_menu_toggle {
    display: flex;
    flex-direction: column; // top-aligns the icon (buttons center content by default)
    width: 44px;
    height: 44px;
    padding: 8.5px 7px;
    border: 0;
    background: none;
    color: inherit;
    line-height: 0;
    cursor: pointer;
    position: absolute;
    top: 18.5px;
    inset-inline-end: 23px;
    z-index: 1002;

    span,
    span:before,
    span:after {
      width: 100%;
      height: 2px;
      background-color: currentColor;
      display: block;
    }

    span {
      margin: 0 auto;
      position: relative;
      top: 12px;
      transition-duration: 0s;
      transition-delay: 0.2s;

      &:before {
        content: "";
        position: absolute;
        margin-top: -9px;
        transition-property: margin, transform;
        transition-duration: 0.2s;
        transition-delay: 0.2s, 0s;
      }

      &:after {
        content: "";
        position: absolute;
        margin-top: 9px;
        transition-property: margin, transform;
        transition-duration: 0.2s;
        transition-delay: 0.2s, 0s;
      }
    }
  }

  .cs_site_header_style_1 .cs_menu_toggle {
    top: 50%;
    inset-inline-end: -7px;
    margin-top: -22px;
  }

  /*Contact Button Inside The Mobile Menu*/
  .cs_site_header_style_1 .cs_main_header_right {
    display: none;
  }

  .cs_nav .cs_nav_list_wrap .cs_nav_contact_btn {
    padding-top: 14px;

    a {
      display: inline-flex;
      padding: 12px 28px;
    }
  }

  .cs_toggle_active {
    span {
      background-color: rgba(0, 0, 0, 0);
      transition-delay: 0.2s;

      &:before {
        margin-top: 0;
        transform: rotate(45deg);
        transition-delay: 0s, 0.2s;
      }

      &:after {
        margin-top: 0;
        transform: rotate(-45deg);
        transition-delay: 0s, 0.2s;
      }
    }
  }

  .cs_nav .cs_nav_list a {
    position: relative;
  }

  .cs_site_header_style_1 .cs_main_header_center {
    .cs_site_brand {
      position: absolute;
      inset-inline-start: 0px;
      top: 50%;
      transform: translateY(-50%);
    }
  }

  .cs_site_header_style_1 {
    top: 0;
  }
}

@include bp.down(lg) {
  .cs_site_header_style_1 .container {
    max-width: 100%;
  }
}
/* Full-width submenu button: draw its focus ring inside so the screen edge does not clip it. */
.cs_nav .cs_menu_dropdown_toggle:focus-visible {
  outline-offset: -2px;
  box-shadow: none;
}
