@use "./shared.scss" as *;

$sub-list-height: 350px;

.outter {
  display: flex;
  justify-content: center;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
}

.container {
  margin-top: 24px;
  background-color: white;
  max-width: $content-max-width;
  display: flex;
  justify-content: space-between;
  width: 100%;
  height: 90px;
  align-items: center;
  position: relative;

  // 로고
  .logo {
    height: 46px;
    width: auto;
    margin-left: 30px;
    .logo-icon {
      height: 46px;
      width: auto;
    }
  }

  // 리스트
  .list {
    display: flex;
    height: 100%;
    margin-right: 12px;
  }

  // 서브리스트 배경
  .sub-background {
    background-color: #f6f5f5;
    opacity: 0;
    height: 0px;
    position: absolute;
    top: 100%;
    width: 100%;
    transition: all 250ms ease 0s;
  }
}

// 리스트 아이템
.list-item {
  position: relative;
  font-size: 1rem;
  height: 100%;
  .list-link {
    display: flex;
    justify-content: center;
    flex-direction: column;
    font-weight: bold;
    color: #333;
    text-decoration: none;
    padding: 0 30px;
    position: relative;
    height: 100%;
    &::after {
      @include line-animation;
    }
  }

  // 오버레이 서브리스트
  .sub-list {
    padding: 40px 0 0 0;
    overflow: hidden;
    height: 0px;
    position: absolute;
    top: 100%;
    width: 100%;
    .sub-item {
      width: 100%;
      display: flex;
      justify-content: center;
      padding: 12px 0;
      text-decoration: none;
      .sub-text {
        position: relative;
        line-height: 120%;
        font-weight: 300;
        color: #373737;
        text-align: center;
        &::after {
          visibility: hidden;
          content: '';
          position: absolute;
          top: 100%;
          left: 0;
          height: 1px;
          width: 100%;
          background-color: #373737;
        }
      }
      &:hover .sub-text {
        font-weight: normal;
        &::after {
          visibility: visible;
        }
      }
    }
  }
}

// 리스트 아이템 호버링
.list-link:hover,
.list-item:has(.sub-list .sub-item:hover) .list-link {
  color: $brand-color;
  &::after {
    width: calc(100% - 60px);
  }
}

// 서브리스트 오픈
.container:has(:is(.list-item:hover, .list-item:has(.sub-list:hover))) {
  .sub-background {
    opacity: .95;
    height: $sub-list-height;
  }
  .sub-list {
    height: $sub-list-height;
  }
}
