.header {
  z-index: 999; 
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  
  @media (hover: hover) and (pointer: fine) {
    &:hover {
      background: var(--color-white);

      .gnb-list {
        .gnb-button {
          color: var(--color-black);
        }
      }

      .util-nav-list {
        .util-nav-button {
          color: var(--color-black);
        }
      }

      .lnb-content-list {
        display: flex;
      }

      .lnb-container {
        display: block;
      } 

      .header-container {
        background: var(--color-white);
      }
    }
  }

  .header-container {
    z-index: 200;
    position: relative;
    height: var(--header-height);
    padding-inline: 4rem;
    background: transparent;
    transition: background 0.3s;

    .header-content {
      display: flex;
      justify-content: space-between;
      align-items: center;
      height: 100%;
    }
  }

  .logo {
    flex: 1;

    .hover-logo {
      display: none;
    }
  }

  /* gnb 상단 */
  .gnb {
    height: 100%;
  }

  .gnb-list {
    display: flex;
    height: 100%;

    .gnb-item {
      position: relative;
      display: flex;
      align-items: center;
      min-width: 12.3rem;
      height: 100%;
    }

    .gnb-button {
      width: 100%;
      text-align: center;
      color: var(--color-white);
      font-size: var(--font-size-xxs);
      font-weight: var(--font-weight-bold);
      transition: color 0.3s;

      @media (hover: hover) and (pointer: fine) {
        &:hover {
          color: var(--color-hover-bg);
        }
      }

      &:active {
        color: var(--color-hover-bg);
      }
    }
  }

  /* 상담문의 nav */
  .util-nav {
    flex: 1;
    height: 100%;
  }

  .util-nav-list {
    display: flex;
    justify-content: flex-end;
    height: 100%;

    .util-nav-item {
      position: relative;
      min-width: 12.3rem;
      height: 100%;

      .lnb-content-list::after {
        display: none;
      }

      &.menu {
        min-width: auto;
        margin-left: 1rem;
      }

      .menu-open-button {
        display: flex;
        align-items: center;
        height: 100%;
        font-size: 3.2rem;
        color: var(--color-white);
      }
    }

    .util-nav-button {
      display: flex;
      flex-direction: column;
      justify-content: center;
      height: 100%;
      color: var(--color-white);
      font-size: var(--font-size-base);
      transition: color 0.3s;

      .util-nav-title {
        font-size: 1.2rem;
      }
    }
  }

  /* lnb  */
  .lnb-content-list {
    position: absolute;
    top: 100%;
    width: 100%;
    height: calc(var(--lnb-background-height) - 4rem);
    display: none;
    flex-direction: column;
    row-gap: 2rem;
    margin-top: 2rem;

    &.util {
      .lnb-button {
        width: 100%;
        text-align: center;
        font-size: var(--font-size-xxs);
        font-weight: var(--font-weight-bold);
        color: var(--color-black);

        @media (hover: hover) and (pointer: fine) {
          &:hover {
            color: var(--color-hover-bg);
          }
        }

        &:active {
          color: var(--color-hover-bg);
        }
      }
    }
  }

  .lnb-button {
    display: block;
    text-align: center;
    font-size: var(--font-size-tiny);
    font-weight: var(--font-weight-medium);
    color: var(--color-gray-09);
    transition: color 0.3s;

    @media (hover: hover) and (pointer: fine) {
      &:hover {
        color: var(--color-hover-bg);
      }
    }

    &:active {
      color: var(--color-hover-bg);
    }
  }

  .lnb-container {
    display: none;
    position: fixed;
    top: var(--header-height);
    width: 100%;
    height: var(--lnb-background-height);
    padding-block: 2rem;
    background: var(--color-white);
    border-bottom: 1px solid #d9d9d9;
  }

  /* mobile util nav */
  .mobile-nav-wrap {
    .mobile-nav-button {
      display: none;
    }
  }

  .mobile-gnb-container {
    z-index: 200;
    overflow: hidden;
    position: fixed;
    display: block;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    transform: translate3d(100%, 0, 0);
    transition: transform 0.7s ease-in-out;

    &.show {
      transform: translate3d(0, 0, 0);
    }

    .mobile-nav-login-button,
    .mobile-nav-logout-button {
      display: flex;
      justify-content: center;
      align-items: center;
      width: 11.2rem;
      height: 4rem;
      column-gap: 0.3rem;
      border: 1px solid var(--color-black);
      border-radius: 9999px;

      .nav-text {
        font-size: var(--font-size-xxs);
      }
    }

    .mobile-nav-close-button,
    .mobile-nav-login-button,
    .mobile-nav-logout-button {
      .icon-close {
        font-size: 2rem;
        color: var(--color-black);
      }

      .icon-login2,
      .icon-logout {
        font-size: 2.8rem;
        color: var(--color-black);
      }
    }

    .mobile-gnb-wrap {
      position: relative;
      top: 0;
      left: 0;
      width: 100%;
      height: 100dvh;
      background: var(--color-white);

      .mobile-gnb-header {
        display: flex;
        align-items: center;
        column-gap: 1.5rem;
        justify-content: flex-end;
        padding: 1.8rem 1.5rem;
        height: 10rem;
        border-bottom: 1px solid #d9d9d9;
      }
    }

    .mobile-gnb-content {
      width: 100%;
      height: 100%;
    }

    .mobile-gnb {
      overflow-y: auto;
      height: 100%;
      padding: 3rem 3rem 6rem;
      box-sizing: border-box;

      .mobile-gnb-list {
        display: flex;
        flex-direction: column;
        gap: 3rem;
        padding-bottom: 6rem;
      }

      .gnb-item {
        display: flex;
        flex-direction: column;
        gap: 2rem;
      }

      .gnb-button {
        font-size: var(--font-size-tiny);
        font-weight: var(--font-weight-bold);
        color: var(--color-black);
      }

      .mobile-lnb-content-list {
        display: flex;
        flex-wrap: wrap;
        gap: 2rem;

        .mobile-lnb-button {
          min-width: 9.6rem;
          font-size: 1.2rem;
          font-weight: var(--font-weight-medium);
          color: var(--color-gray-09);
        }
      }
    }
  }
}

.header-gap {
  height: var(--header-height);
}

body[data-page="sub"] {
  .header {
    background: var(--color-white);
    border-bottom: 1px solid var(--alpha-black-10);

    .gnb-button {
      color: var(--color-black);
    }
  }
}

body.section06-active,
body.section08-active,
body.section09-active,
body.section17-active {
  .header {
    .gnb-list {
      .gnb-button { 
        color: var(--color-gray-02 ) !important;
      }
    }

    .util-nav-list {
      .util-nav-button {
        color: var(--color-gray-02 ) !important;
      }
    }

    .mobile-nav-wrap {
      .mobile-nav-button {
        &.call {
          border: 1px solid var(--color-black);
  
          .nav-text {
            color: var(--color-black);
          }
        }

        .icon-wh {
          display: none;
        }
        
        .icon-bk {
          display: block;
        }
      }
    }
  }
}

@media screen and (max-width: 1440px) {
  .header {
    .logo {
      flex: auto;
    }

    .util-nav {
      flex: auto;
    }

    .header-container {
      padding-inline: 2rem;
    }

    /* gnb */
    .gnb-list {
      .gnb-item {
        min-width: 11rem;
      }
    }
  }
}

@media screen and (max-width: 1024px) {
  .header {
    .logo {
      flex: unset;
      width: 18rem;
    }

    &:hover {
      .lnb-container {
        display: none;
      }
    }

    .gnb {
      display: none;
    }

    .util-nav {
      display: none;
    }

    .mobile-nav-wrap {
      display: flex;
      align-items: center;
      column-gap: 1.5rem;
      
      .mobile-nav-button {
        display: block;
  
        &.call {
          display: flex;
          align-items: center;
          column-gap: 1rem;
          border: 1px solid var(--color-white);
          border-radius: 9999px;
          padding: 1rem 1.5rem;
  
          .nav-text {
            font-size: var(--font-size-sm);
            color: var(--color-white);
          }
        }

        &.menu {
          display: flex;
          align-items: center;
          column-gap: 0.5rem;
        }

        .icon-wh {
          display: block;
        }
        
        .icon-bk {
          display: none;
        }
      }
    }
  }
}

@media screen and (max-width: 780px) {
  .header {
    .header-container {
      padding-inline: 3.2rem;
      height: 10rem;
    }
  }
}

@media screen and (max-width: 600px) {
  .header {
    .mobile-nav-wrap {
      .mobile-nav-button {
        &.call {
          .nav-text {
            font-size: 3.2vw;
          }

          img{
            width: 3.8vw;
        }
      }

        &.menu {
          img{
            width: 8vw;
          }
        }
      }
    }

    .mobile-gnb-container {
      .mobile-nav-login-button,
      .mobile-nav-logout-button {
        width: 23vw;
      }

      .mobile-nav-login-button {
        img {width: 5vw;}
      }
  
      .mobile-gnb {
        overflow-y: auto;
        height: 100%;
        padding: 3rem 3rem 6rem;
        box-sizing: border-box; 
  
        .mobile-gnb-list {
          display: flex;
          flex-direction: column;
          gap: 3rem;
          padding-bottom: 6rem;
        }
  
        .gnb-item {
          display: flex;
          flex-direction: column;
          gap: 2rem;
        }
  
        .gnb-button {
          font-size: var(--font-size-tiny);
          font-weight: var(--font-weight-bold);
          color: var(--color-black);
        }
  
        .mobile-lnb-content-list {
          display: flex;
          flex-wrap: wrap;
          gap: 2rem;
  
          .mobile-lnb-button {
            min-width: 9.6rem;
            font-size: 1.2rem;
            font-weight: var(--font-weight-medium);
            color: var(--color-gray-09);
          }
        }
      }

      .mobile-nav-close-button {
        img {width: 7vw;}
      }
    }
  }
}

@media screen and (max-width: 480px) {
  .header {
    .mobile-nav-wrap {
      .mobile-nav-button {
        &:first-child {
          .mobile-nav-button-icon {
            font-size: 2.2rem;
          }
        }
      }
    }

    .mobile-gnb-container {
      .mobile-nav-login-button,
      .mobile-nav-logout-button {
        height: 3.4rem;

        .icon-login2,
        .icon-logout {
          font-size: 2rem;
        }
      }
    }
  }

}

@media screen and (max-width: 320px) {
  .header {
    .logo {
      width: 10rem;
    }

    .mobile-nav-wrap {
      column-gap: 1rem;
      .mobile-nav-button {
        &:first-child {
          .mobile-nav-button-icon {
            font-size: 1.5rem;
          }
        }
      }
    }

    .mobile-gnb-container {
      .mobile-nav-login-button,
      .mobile-nav-logout-button {
        width: 7.5rem;
        height: 2.4rem;
      }
    }
  }
}