/* mixin */ 
@import "../mixin/ui-mixin";

/* ******************** header ******************** */
.header-container { 
  position: relative; width: 100%; z-index: 99;
  .header-wrap {    
    position: relative; padding: 30px 0 10px;
    .mo-hamburger {
      display:none
    }
    .logo-area { 
      float: left; position: relative; width: 230px; height: auto; top: 8px; cursor:pointer; 
      > img { width: 100%; height: 100%; object-fit: contain;} 
    } 
    .search-area { 
      float: left; width: calc(100% - 560px); position: relative; margin-left: 90px;
      .search-input { 
        position: relative; width: 100%; height: 55px; border: 1px solid var(--main-color); padding: 0 140px 0 20px; 
        .clear-btn { 
          position: absolute; top:16px; right:110px; cursor: pointer; width: 19px; height: 19px; border-radius: 20px; text-align: center; 
          &:hover {background:#eee;}
          > img { width: 8px; height: 8px; position: relative; top: 6px; }
        }
        .fold-btn {
          position: absolute; top:22px; right:85px; width:10px; height: 6px; cursor: pointer; 
          > img { width: 100%; height: 100%; }
        }
      }
      .search-btn { 
        position: absolute; top:-5px; right:-5px; background-color: var(--main-color); height: calc(100% + 10px); width: 65px; text-align: center; border-radius: 0 0 10px 0; cursor: pointer; transition: background-color .2s; z-index: 20;
        &:hover {background-color: var(--main-hover-color);}
        > img { width:20px; height: 20px; @include alignCenter; }
      }
      .search-keyword {
        width: 100%; max-height: 250px; position: absolute; top: 100%; left:0; z-index: 10; background: #fff; border: 1px solid var(--main-color); border-top: 0; 
        .key-ul { 
          position: relative; overflow: hidden; padding: 10px 0 7px;
          .key-li {
            a { 
              position:relative; padding: 8px 37px; color:#555; display: block; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; border-bottom:1px solid rgba(255,255,255,0.05); font-weight: 500; font-size: 1.1rem;
              img.his-icon,
              img.key-icon { width:15px; height:15px; position: absolute; top:7px; left:15px; opacity: 1; }
              img.del-icon { width:15px; height:15px; position: absolute; top:7px; right:15px; opacity: 0.7; }
            }
            &:hover {
              a {
                background:#f4f4f4;
                img.key-icon:hover,
                img.search-icon:hover,
                img.del-icon:hover { opacity: 1;}
              }
            }
          }
        }
      }
    }
    .util-area { 
      float: right; width: 140px; position: relative; top: -10px; 
      .login { display: none; }
      .logout { display: block; }
      &.on {
        .login { display: block; }
        .logout { display: none; }
      } 
      .util-item { 
        float: left; width: 50%; text-align: center; cursor: pointer; padding: 10px 0; border-radius: 5px; 
        &:hover { background:#f5f5f5; } 
        > p { font-size: 1.2rem; color: #333; font-weight: 500; }
        > img { width: 40px; height: 40px; }
      }
    }
  }
  .gnb-area { 
    position: relative; width: 100%; border-top: 1px solid var(--line-color); border-bottom: 1px solid var(--line-color);
    .nav-pc {
      position:relative;
      > ul { 
        text-align: center; 
        > li { 
          display: inline-block; vertical-align: top;
          > a { 
            display: block; padding:20px 40px; font-size: 1.6rem; font-weight: 500; position: relative;
            &:before { 
              content: ''; display: block; position: absolute; top:14px; right:0; width: 1px; height: 25px; background:var(--line-color); 
            }
            .arrow {
              display: none; border-left: 6px solid transparent; border-right: 6px solid transparent; border-bottom: 8px solid var(--main-color); position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
            }
          }
          &:first-child {
            > a:after { 
              content: ''; display: block; position: absolute; top:14px; left:0px; width: 1px; height: 25px; background:var(--line-color); 
            }
          }
          &:hover {
            > a {
              color: var(--main-color); font-weight: 600;
              .arrow {
                display: block;
              }
            }
            .dropdown-menu {
              display: block;
            }
          }
          .dropdown-menu {
            display: none; position: absolute; top: 100%; left: 0; width: 100%; z-index: 99;
              &:after {
                content: ""; display: block; width: 100%; height: 100%; position: absolute; top: 0; left: 0; z-index: -1; -webkit-box-shadow: 0 5px 5px rgba(0, 0, 0, .1); box-shadow: 0 5px 5px rgba(0, 0, 0, .1); background-color: #fff; border-top: 1px solid var(--main-color);
              }
              .flex-area {
                display: flex; align-items: stretch; position: relative;
                .flex-left {
                  width: 180px;
                }
                .flex-right {
                  width: calc(100% - 180px); position: relative; top: 1px; border-left: 1px solid #D7DBE3; background: #fff;
                }
              }
              .submenu {
                &:after {
                  content: ''; width: 100vw; height: 100%; position: absolute; top: 1px; right: 30px; background: #F2F5F6; 
                }
                ul {
                  padding: 30px 0; text-align: left; position: relative; z-index: 1;
                  li {
                    &.active {
                      > a {
                        background: var(--main-color); color: #fff; border-radius: 7px 0 0 7px;
                      }
                    }
                    > a {
                      font-size: 1.6rem; color: #000; padding: 13px; display: block; 
                    }
                    .opne-new {
                      width: 12px; height: 12px;
                    }
                  }
                }
              }
              .detail {
                display: none; flex-wrap: wrap; gap: 0 15px; position: relative; padding: 40px 30px; text-align: left;
                &.active {
                  display: flex;
                }
                &.single {
                  gap: 40px 10px;
                  .single-item {
                    flex: 1 1 auto;
                    &:only-child { // wrap 안에 item이 1개일 때
                      flex-basis: 100%;
                    }
                    &:nth-child(3):nth-last-child(3), 
                    &:nth-child(4),
                    &:nth-child(5),
                    &:nth-child(n) { // wrap 안에 item이 3개 이상일 때
                      flex-basis: calc(33.33% - 10px);
                    }

                    &.active {
                      .submenu-tit {
                        color: var(--main-color);
                      }
                    }
                  }
                }
                .submenu-tit {
                  width: 100%; font-size: 1.9rem; font-weight: 600; padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid var(--line-color);
                }
                .description {
                  font-size: 1.4rem; width: 100%; line-height: 1.6;
                }
                .more-btn {
                  display: inline-block; font-size: 1.2rem; color: #737373; padding: 10px 20px; border-radius: 3px; border: 1px solid #BFC2CB; margin-top: 20px; font-weight: 500;
                  &:hover {
                    border-color: #8a8c93; color: #111; 
                  }
                }
                .depth-4 {
                  width: 179px;
                  .tit {
                    color: #fff; background: #0B1534; padding: 10px 15px; border-radius: 3px; font-size: 1.5rem; font-weight: 500;
                  }
                  ul {
                    padding: 5px 0;
                    li {
                      position: relative; font-size: 1.5rem; font-weight: 500;
                      &:after {
                        content: ''; width: 3px; height: 3px; background: #9B9B9B; position: absolute; top: 14px; left: 9px;
                      }
                      &.active {
                        &:after {
                          background: var(--main-color);
                        }
                        a {
                          color: var(--main-color); font-weight: 600;
                        }
                      }
                      a {
                        padding: 8px 10px 8px 20px; display: block;
                        &:hover {
                          font-weight: 600; color: var(--main-color);
                        }
                      }
                      .link {
                        padding-left: 32px; position: relative;
                        &:after {
                          content: ''; width: 8px; height: 10px; border-bottom: 1px solid #888; border-left: 1px solid #888; position: absolute; top: 8px; left: 20px;
                        }
                      }
                    }
                  }
                }
              }
              .opne-new {
                display: inline-block; width: 11px; height: 11px; position: relative; top: 2px; margin-left: 4px;
              }
            }
          }
        }
      }
    .nav-mo {
      display: none;
    }
  }
}
@media(max-width: 1200px) {
  .header-container {
    .header-wrap {
      padding:20px;
      .util-area, .util-area.on {
        display:none;
      }
      .logo-area {
        float:none; width:158px; height:35px; 
      }
      // nav mo hamburger 
      .mo-hamburger {
        position:absolute; right:20px; top:23px; z-index:100; cursor:pointer; transition:opacity .25s ease; display:block;
        &:hover {
          opacity:0.7;
        }
        > img {
          width:30px; height:30px;
          &.close {
            display:none; background: #0a1b43; border-radius: 50%; padding: 3px;
          }
        }
        &.on {
          img.menu {
            display:none;
          }
          img.close {
            display:block;
          }
        }
      }
      .search-area {
        float:none; width:100%; margin-left:0; margin-top:25px;
        .search-input {
          height:50px;
          .clear-btn {
            top:14px; right:95px;
          } 
          .fold-btn {
            top:21px; right:70px;
          }
        }
        .search-btn {
          top:-2px; width:55px; height:calc(100% + 5px)
        }
      }
    }
  }
  // nav mo
  .header-container { 
    .gnb-area {
        &:before {
          content:none;
        }
        &:hover:after {
          content:none;
        }
        .nav-pc {
          display: none;
        }
        .nav-mo {
          display: none;
          &.mo-open {display:block;}
          .nav-mo-area {
            position:fixed; background:#fff; width:335px; height:100vh; top:0; right:0; padding:80px 0 50px; z-index:99; -ms-overflow-style: none; box-shadow: -3px 0 6px rgba(0,0,0,0.15); border-left: 1px solid var(--line-color);
            &::-webkit-scrollbar {display:none;}
            .util-area {
              .user-tool {
                background:#172547; padding:7px; text-align: center; margin: 0 20px 20px; border-radius: 5px;              
                ul li {
                  float:left; width:50%;
                  &:first-child {
                    border-right:1px solid rgba(255,255,255,0.3);
                  } 
                  a {
                    color:#fff; font-weight:600; transition:opacity .25s ease;
                    > img {
                      margin-right:5px;
                      filter: brightness(0) invert(1);
                    }
                    &:hover {
                      opacity:0.8;
                    }
                    > img {
                      width:30px; height:30px; vertical-align: middle;
                    }
                  } 
                }
                &.login {
                  display:none;
                }
                &.logout {
                  display:block;
                }
              }
              &.on {
                .user-tool {
                  &.login {
                    display:block;
                  }
                  &.logout {
                    display:none
                  }
                }
              }
            }
          }

          .menu-list {
            height: 100%; background: #eef0f5; border-top: 1px solid var(--line-color); padding: 10px 0;
            > li {
              display: flex;
              &.active,
              &:hover {
                > a {
                  color: var(--main-color);
                }
                .submenu-wrap {
                  display: block;
                }
              }
              > a {
                width: 150px; font-size: 1.4rem; font-weight: 600; padding: 15px 0 15px 20px;
              }
              .submenu-wrap {
                display: none; position: absolute; top: 145px; right: 0; width: calc(100% - 150px); height: calc(100% - 145px); background: #fff; border-left: 1px solid var(--line-color); padding: 15px 20px; overflow-y: auto;
                .item {
                  &.active {
                    > .tit {
                      &.arrow:after {
                        transform: rotate(45deg);
                      }
                    }
                    .dropdown-menu {
                      display: block;
                    }
                  }
                  > .tit {
                    font-size: 1.4rem; font-weight: 600; padding:10px 0; position: relative; display: block;
                    &.arrow:after {
                      content: ''; width: 6px; height: 6px; border-top: 2px solid #000; border-left: 2px solid #000; transform: rotate(-135deg); position: absolute; top: 13px; right: 0;
                    }
                  }
                  .dropdown-menu {
                    display: none; padding: 5px 15px; background: #eef0f5; border-radius: 5px; margin-bottom: 10px;
                    .depth-4 {
                      &:last-child {
                        ul {
                          border-bottom: 0;
                        }
                      }
                      &.active {
                        > .tit {
                          &.arrow:after {
                            transform: rotate(45deg);
                          }
                        }
                        ul {
                          display: block;
                        }
                      }
                      .tit {
                        position: relative; font-size: 1.3rem; font-weight: 600; padding: 15px 0; display: block;
                        &.arrow:after {
                          content: ''; width: 6px; height: 6px; border-top: 2px solid #aaa; border-left: 2px solid #aaa; transform: rotate(-135deg); position: absolute; top: 18px; right: 0;
                        }
                      }
                      ul {
                        display: none; padding: 7px 0 7px 10px; border-bottom: 1px dashed #D1D1D1; border-top: 1px dashed #D1D1D1;
                        li {
                          a {
                            padding: 8px 0 8px 10px; position: relative; font-size: 1.4rem; display: block; font-weight: 500;
                            &:after {
                              content: ''; width: 3px; height: 3px; background: #9B9B9B; position: absolute; top: 14px; left: 0;
                            }
                            &.link {
                              padding-left: 32px; position: relative;
                              &:after {
                                content: ''; width: 8px; height: 10px; border-bottom: 1px solid #888; border-left: 1px solid #888; position: absolute; top: 8px; left: 20px; background: none;
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
            .opne-new {
              display: inline-block; width: 11px; height: 11px; position: relative; top: 2px; margin-left: 4px;
            }
          }
        }
      }
  }
}
@media(max-width:500px) {
  .header-container {
    .header-wrap {
      .search-area {
        .search-input {
          height:40px; padding:0 85px 0 20px;
          .clear-btn {
            top:8px; right:57px;
          }
          .fold-btn {
            display:none;
          }
        }
        .search-btn {
          width:44px;
          > img {
            width:16px; height:16px;
          }
        }
      }
    }
  }
  .header-container { 
    .gnb-area {
      .nav-mo {
        .nav-mo-area {
          width:100%;
        } 
      }
    }
  }
}