﻿@charset "UTF-8";

/* ============================================
   헤더 기본 (공통)
   ============================================ */
header {
  position: fixed;
  top: 0;
  z-index: 100;
  width: 100%;
  background-color: #fff;
}
.headerWrap__menu a {
  color: #333;
}

/* ============================================
   PC - 헤더 + 풀 드롭다운
   ============================================ */
@media screen and (min-width: 1024px) {
  /* 헤더 */
  header {
    height: 72px;
  }

  /* border-bottom 대신 가상요소로 처리 → li::after(z-index:1)에 가려지지 않음 */
  header::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: #f1f1f1;
  }

  .mobileBtn {
    display: none;
  }

  /*
    headerWrap: 로고(좌) + nav(우) space-between
    nav li: 142px 고정폭, 중앙정렬
    fullDrop__inner: justify-content:flex-end + col 142px 고정
    → 동일한 컨테이너(max-width/padding)에서 우측 정렬하므로 컬럼이 nav 항목과 정렬됨
  */
  .headerWrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    margin: 0 auto;
    max-width: 1320px;
    height: 72px;
  }

  .headerWrap h1,
  .headerWrap h1 a {
    display: flex;
    align-items: center;
    height: 72px;
  }

  .headerWrap img {
    width: 160px;
  }

  /* 메뉴 ul: 각 항목 142px 고정 */
  .headerWrap__menu {
    display: flex;
    height: 72px;
    overflow: visible;
  }

  .headerWrap__menu > li {
    position: relative;
    width: 142px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
  }

  .headerWrap__menu a {
    display: flex;
    align-items: center;
    padding: 0 10px;
    height: 72px;
    font-size: 16px;
    font-weight: 500;
    letter-spacing: -0.8px;
  }

  /* 호버 밑줄 - 가운데에서 양쪽으로 펼쳐짐 */
  .headerWrap__menu > li::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background-color: #7e4f40;
    transition: width 0.2s linear;
    z-index: 1;
  }

  .headerWrap__menu > li:hover::after,
  .headerWrap__menu > li.active::after,
  header:has(.fullDrop:hover) .hasSub::after {
    width: 100%;
  }

  /* 풀 드롭다운 패널 - 기본 숨김 */
  .fullDrop {
    display: none;
    position: absolute;
    top: 70px;
    left: 0;
    width: 100%;
    background-color: #fff;
    border-bottom: solid 1px #f1f1f1;
  }

  /* 방문요양(li.hasSub) 호버 시 드롭다운 노출,
     드롭다운 위에 있을 때도 유지 (마우스 이동 중 닫힘 방지) */
  header:has(.hasSub:hover) .fullDrop,
  .fullDrop:hover {
    display: block;
  }

  /* fullDrop__inner: headerWrap과 동일한 컨테이너 + justify-content:flex-end
     → nav 우측 정렬과 동일한 기준점, col 142px로 nav li와 1:1 정렬 */
  .fullDrop__inner {
    display: flex;
    justify-content: flex-end;
    padding: 0 20px;
    margin: 0 auto;
    max-width: 1320px;
  }

  .fullDrop__col {
    width: 142px;
    flex-shrink: 0;
    padding: 20px 0;
    text-align: center;
  }

  /* li가 있는 컬럼만 배경색 적용 */
  .fullDrop__col:has(li) {
    background-color: #fbfbfb;
  }

  .fullDrop__col a {
    display: block;
    color: #777;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.5;
    letter-spacing: -0.8px;
    transition: color 0.15s;
  }

  .fullDrop__col li + li {
    margin-top: 20px;
  }

  .fullDrop__col a:hover {
    color: #7e4f40;
    font-weight: 500;
  }

  /* PC에서 모바일 전용 요소 숨김 */
  .mobileSubMenu {
    display: none;
  }
}

/* ============================================
   모바일 - 헤더 + 아코디언 서브메뉴
   ============================================ */
@media screen and (max-width: 1023px) {
  /* 헤더 */
  .headerWrap {
    position: relative;
  }

  .headerWrap h1 {
    padding: 0 20px;
    height: 60px;
    border-bottom: solid 1px #f1f1f1;
  }

  .headerWrap h1 a {
    width: 130px;
    height: 100%;
    background: url(../../img/img_logo01_m.png) no-repeat center / 130px;
  }

  .headerWrap h1 img {
    display: none;
  }

  .mobileBtn {
    position: absolute;
    top: 0;
    right: 0;
    width: 64px;
    height: 60px;
    font-size: 0;
    text-indent: -9999px;
    background: url(../../img/icon_menu_m.png) no-repeat right 20px center / 24px;
  }

  .headerWrap__menu {
    display: none;
  }

  .mobileBtn.open {
    background-image: url(../../img/icon_close_m.png);
  }

  .mobileBtn.open + .headerWrap__menu {
    display: block;
    height: calc(100vh - 60px);
  }

  .headerWrap__menu a {
    padding: 24px 20px;
    width: 100%;
    font-size: 20px;
    font-weight: 500;
    line-height: 1.4;
    letter-spacing: -1px;
    border-bottom: solid 1px #f1f1f1;
  }

  /* 메인 메뉴 클릭(open) 시 활성 스타일 */
  .headerWrap__menu > li.open > a {
    color: #7e4f40;
    font-weight: 700;
  }

  /* PC 풀드롭 패널 숨김 */
  .fullDrop {
    display: none !important;
  }

  /* 서브메뉴 있는 항목(hasSub)만 화살표 표시 */
  .headerWrap__menu > li.hasSub > a {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .headerWrap__menu > li.hasSub > a::after {
    content: "";
    flex-shrink: 0;
    width: 12px;
    height: 7px;
    background: url(../../img/ic_arrowTop-a1.svg) no-repeat center / 12px 7px;
    transform: rotate(180deg);
    transition: transform 0.25s;
  }

  /* 열린 상태 - 화살표 위로 */
  .headerWrap__menu > li.hasSub.open > a::after {
    transform: rotate(0deg);
  }

  /* 서브메뉴 기본 숨김 */
  .mobileSubMenu {
    display: none;
    background-color: #fbfbfb;
    border-bottom: solid 1px #f1f1f1;
  }

  /* 열린 상태 - 서브메뉴 노출 */
  .headerWrap__menu > li.open .mobileSubMenu {
    display: block;
  }

  /* 서브메뉴 아이템 */
  .mobileSubMenu li a {
    padding: 0 32px;
    color: #333;
    font-size: 16px;
    font-weight: 400;
    line-height: 24px;
    letter-spacing: -0.8px;
    border-bottom: none;
  }

  .mobileSubMenu {
    padding: 20px 0;
  }

  .mobileSubMenu li + li {
    margin-top: 20px;
  }
}
