/* ============================================================================= */
/* Mobile (< 767px) */
/* ============================================================================= */

/* --------------- Typography --------------- */
.dropdown-wrapper > a {
  font-size: var(--font-title3-size);
  font-weight: var(--font-title3-weight);
  line-height: var(--font-title3-line-height);
  letter-spacing: var(--font-title3-letter-spacing);
}

.dropdown-wrapper > ul {
  font-size: var(--font-subtitle3-size);
  font-weight: var(--font-subtitle3-weight);
  line-height: var(--font-subtitle3-line-height);
  letter-spacing: var(--font-subtitle3-letter-spacing);
}

/* --------------- Container --------------- */
.header-container {
  display: flex;
  justify-content: center;
  height: var(--header-container-mobile-height, 6rem);
  width: 100%;
  /* box-shadow: 0 6px 6px 0 rgba(0, 0, 0, 0.05); */
  border-bottom: 1px solid #D7D7D7;
  background-color: var(--color-white);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  height: 100%;
  padding: 0 var(--margin-mobile);
}

/* ---- 로고 ---- */
.header-inner .header-logo {
  flex-shrink: 0;
}

.header-inner .logo-image {
  width: 100px;
  height: auto;
}

/* ---- 메인 내비게이션 ---- */
.header-gnb {
  position: fixed;
  top: 0;
  left: 0;
  transform: translateX(-100%);
  width: 100%; /* 화면 전체 덮기 */
  height: 100vh;
  background-color: var(--color-white);
  
  display: flex;
  flex-direction: column; /* 세로 배치 */
  justify-content: flex-start; /* 중단 메뉴 좌상단 시작 */
  align-items: flex-start;
  padding-top: 70px;    /* 상단 섹션 간격 */
  padding-bottom: 5rem; /* 하단 유틸 버튼 간격 */
  z-index: 999;
  transition: transform 0.3s ease;
}
.header-gnb.is-open {
  transform: translateX(0);
}

/* .header-gnb .dropdown-wrapper:not(:last-child) {
  padding-bottom: var(--spacing-4);
} */
.header-gnb .dropdown-wrapper {
  width: 100%;
}

.header-gnb .dropdown-wrapper > a {
  display: block;
  padding: 16px 0;
  margin: 0 16px;
  border-bottom: 1px solid #D7D7D7;
  transition: color 0.3s ease;
}
.header-gnb .dropdown-wrapper > a:hover,
.header-gnb .dropdown-wrapper > a:focus {
  color: var(--color-primary);
}

/* 드롭다운 세부 메뉴 초기 숨김 (아코디언) */
.header-gnb .dropdown-wrapper > ul {
  display: flex; 
  flex-direction: column;
  padding: 0 var(--spacing-4);
  max-height: 0;     /* 닫혀 있을 땐 높이 0 */
  overflow: hidden;  /* 넘치는 글자 숨김 */
  opacity: 0;
  transition: max-height 0.3s ease, opacity 0.3s ease;
}
.header-gnb .dropdown-wrapper > ul > li {
  padding: 8px 0 8px 8px;
}
.header-gnb .dropdown-wrapper > ul > li:first-child {
  padding-top: 16px;
}
.header-gnb .dropdown-wrapper > ul > li > a.online-link {
  display: flex;
  align-items: center;
  gap: 5px;
}
.header-gnb .dropdown-wrapper > ul > li > a.online-link::after {
  content: '';
  display: inline-block;
  width: 20px;
  height: 20px;

  /* 마스크 속성 */
  background-color: #868585;
  mask-image: url('/images/home/components/ic_open_new_window-428b13b38ade8a21740ef66e4e68f524.svg');
  mask-size: contain;
  mask-repeat: no-repeat;
  -webkit-mask-image: url('/images/home/components/ic_open_new_window-428b13b38ade8a21740ef66e4e68f524.svg');
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
}
.header-gnb .dropdown-wrapper > ul > li > a.online-link:hover::after {
  background-color: var(--color-primary);
}

/* 모바일 메뉴 타이틀 클릭 시 세부 항목 등장 */
.header-gnb .dropdown-wrapper.is-open > ul {
  max-height: 500px; /* 충분히 큰 값 */
  opacity: 1;
}

/* ---- 언어 및 메뉴 버튼 ---- */
.header-utils {
  margin-left: auto; 
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: var(--spacing-4);
}

/* 모바일 기본 헤더에서는 유틸 요소 숨김 */
.utils-group,
.lang-dropdown-wrapper {
  display: none;
}

body.is-menu-open .header-logo {
  visibility: hidden; /* 로고 영역만 가려서 우측 X버튼 위치 유지 */
}

/* 상단 섹션 > 언어선택 버튼 */
body.is-menu-open .lang-dropdown-wrapper {
  display: flex;
  position: fixed;
  left: var(--margin-mobile);
  z-index: 1000;
}

/* 하단 유틸 섹션 */
body.is-menu-open .utils-group {
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: fixed;
  bottom: 24px;
  left: var(--margin-mobile);
  z-index: 1000;
}

.header-utils .lang-dropdown-wrapper {
  padding: var(--spacing-5) 0;
  color: #404040;
}

.header-utils .utils-group {
  color: #404040;
}

.header-utils .instagram-link,
.header-utils .lang-change-button,
.header-utils .check-link {
  display: flex;
  align-items: center;
  gap: var(--spacing-1);
}

/* 예약 변경 및 취소 아이콘  */
.check-link::before {
  content: '';
  display: block;
  width: 24px;
  height: 24px;

  /* 마스크 속성 */
  background-color: currentColor; /* 현재 부모의 글자색 */
  mask-image: url('/images/home/components/ic_edit-2e6bf66043a3e43452f4fc607f1f22a4.svg');
  mask-size: contain;
  mask-repeat: no-repeat;
  -webkit-mask-image: url('/images/home/components/ic_edit-2e6bf66043a3e43452f4fc607f1f22a4.svg');
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  transform: rotate(180deg);
}
.instagram-link::before {
  content: '';
  display: block;
  width: 24px;
  height: 24px;

  /* 마스크 속성 */
  background-color: currentColor; /* 현재 부모의 글자색 */
  mask-image: url('/images/home/components/ic_instagram-c7b43b93a7678f5e913d9e952c1c148a.svg');
  mask-size: contain;
  mask-repeat: no-repeat;
  -webkit-mask-image: url('/images/home/components/ic_instagram-c7b43b93a7678f5e913d9e952c1c148a.svg');
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
}

/* 언어변환 마스크 아이콘 */
.lang-change-button::before {
  content: '';
  display: block;
  width: 20px;
  height: 20px;

  /* 마스크 속성 */
  background-color: currentColor; /* 현재 부모의 글자색 */
  mask-image: url('/images/home/components/ic_globe-20896f176545bdc5e52ad0617ec17afc.svg');
  mask-size: contain;
  mask-repeat: no-repeat;
  -webkit-mask-image: url('/images/home/components/ic_globe-20896f176545bdc5e52ad0617ec17afc.svg');
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
}
.lang-change-button::after {
  content: '';
  display: block;
  width: 20px;
  height: 20px;

  /* 마스크 속성 */
  background-color: currentColor; /* 현재 부모의 글자색 */
  mask-image: url('/images/home/components/ic_arrow_top-ffa281ef1a2f2831ba503e1dc0095bc3.svg');
  mask-size: contain;
  mask-repeat: no-repeat;
  -webkit-mask-image: url('/images/home/components/ic_arrow_top-ffa281ef1a2f2831ba503e1dc0095bc3.svg');
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  transform: rotate(180deg);
}

.dropdown-wrapper {
  position: relative; /* 드롭다운의 기준점 */
}

.header-utils .lang-dropdown-list {
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  background-color: var(--color-white);
  box-shadow: 0px 2px 8px 0px rgb(0 0 0 / 10%);
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  min-width: 100%;
  padding: var(--spacing-2);
  border: 1px solid var(--color-line-gray);
  border-radius: 5px;
  z-index: 1000;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  overflow: visible; /* 화살표 노출을 위해 설정 */
}

/* 드롭다운 상단 중앙 화살표 */
.header-utils .lang-dropdown-list::before,
.header-utils .lang-dropdown-list::after {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
}
/* 테두리용 삼각형 (조금 더 위에 배치하여 노출) */
.header-utils .lang-dropdown-list::before {
  top: -13px; 
  border-bottom: 12px solid var(--color-line-gray);
  z-index: 1;
}
/* 배경색용 삼각형 (테두리보다 1px 아래에 겹침) */
.header-utils .lang-dropdown-list::after {
  top: -12px;
  border-bottom: 12px solid var(--color-white);
  z-index: 2;
}

.dropdown-wrapper.is-open .lang-dropdown-list{
  pointer-events: auto;
  opacity: 1;
  visibility: visible;
}

.header-utils .lang-dropdown-wrapper .lang-link {
  display: block;
  padding: var(--spacing-3) var(--spacing-4); /* 12px 16px */
  text-decoration: none;
  white-space: nowrap;
  border-radius: 5px;
  color: var(--color-text-black);
  transition: background-color 0.3s ease;
}

.header-utils .lang-dropdown-wrapper .lang-link.is-active {
  color: var(--color-primary);
  font-weight: bold;
  background-color: var(--color-kimchikan-red-light);
}

.header-utils .lang-dropdown-wrapper .lang-link:hover {
  color: var(--color-text-black);
  font-weight: inherit;
  background-color: var(--color-kimchikan-red-light);
}

.header-utils .lang-dropdown-wrapper .lang-link:active {
  background-color: var(--color-kimchikan-red-medium);
  transition: background-color 0s;
}

/* --------------- Mobile Hamburger --------------- */
.mobile-menu-button {
  display: block;
  width: 1.5rem;
  height: 1.5rem;
  margin-left: var(--spacing-4);
  position: relative;
  z-index: 1000;
}

/* 버튼 focus 시 outline 미표시 방지 */
.mobile-menu-button::before {
  content: '';
  display: block;
  width: 100%;
  height: 100%;
  background-color: currentColor;
  mask-image: url('/images/home/components/ic_menu-5550c3023b55a6c26c355d9993e5dc0c.svg');
  mask-size: contain;
  mask-repeat: no-repeat;
  -webkit-mask-image: url('/images/home/components/ic_menu-5550c3023b55a6c26c355d9993e5dc0c.svg');
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
}

/* 키보드 탐색 시 포커스 표시 */
/* .mobile-menu-button:focus-visible {
  outline: 2px solid var(--color-text-black);
  outline-offset: 2px;
  border-radius: 4px;
} */

body.is-menu-open .mobile-menu-button::before {
  mask-image: url('/images/home/components/ic_close-9f44d088113b428c1ca021ed12c40754.svg');
  -webkit-mask-image: url('/images/home/components/ic_close-9f44d088113b428c1ca021ed12c40754.svg');
}

.mobile-menu-button .icon-bar {
  display: block;
  width: 22px;
  height: 2px;
  background-color: var(--color-text-black);
  border-radius: 1px;
}

.mobile-menu-button .icon-bar + .icon-bar {
  margin-top: 4px;
}

/* --------------- To Top Button --------------- */
.to-top-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--color-text-gray);
  border-radius: 50%;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease, visibility 0.5s ease;
  z-index: 800;
  backdrop-filter: blur(3px);
}

/* 화살표 아이콘 */
.to-top-btn::after {
  content: '';
  display: block;
  width: 20px;
  height: 20px;
  background-color: var(--color-text-gray); /* 아이콘 색상 */
  mask-image: url('/images/home/components/ic_arrow_top-ffa281ef1a2f2831ba503e1dc0095bc3.svg');
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  -webkit-mask-image: url('/images/home/components/ic_arrow_top-ffa281ef1a2f2831ba503e1dc0095bc3.svg');
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
}

.to-top-btn.is-show {
  opacity: 1;
  visibility: visible;
}

/* ============================================================================= */
/* Tablet (>= 768px) */
/* ============================================================================= */
@media (min-width: 768px) {
  /* --------------- Typography --------------- */

  /* --------------- To Top Button --------------- */
  .to-top-btn {
    bottom: 30px;
    right: 30px;
    width: 45px;
    height: 45px;
  }

  .to-top-btn::after {
    width: 25px;
    height: 25px;
  }
}

/* ============================================================================= */
/* >= 1024px */
/* ============================================================================= */
@media (min-width: 1040px) {
  /* --------------- Typography --------------- */
  .dropdown-wrapper > a {
    font-size: var(--font-title3-size);
    font-weight: var(--font-title3-weight);
    line-height: var(--font-title3-line-height);
    letter-spacing: var(--font-title3-letter-spacing);
  }
  
  .dropdown-wrapper > ul {
    font-size: var(--font-subtitle3-size);
    font-weight: var(--font-subtitle3-weight);
    line-height: var(--font-subtitle3-line-height);
    letter-spacing: var(--font-subtitle3-letter-spacing);
  }

  /* Container */
  .header-container {
    height: var(--header-container-pc-height, 6rem);
  }

  .header-inner {
    padding: 0 var(--margin-tablet);
  }

  /* ---- 로고 ---- */
  .header-inner .logo-image {
    width: 135px;
    /* display: inline-block; */
    /* line-height: 0; */
  }

  /* ---- 메인 내비게이션 ---- */
  .header-gnb {
    position: relative;
    width: auto;
    height: calc(var(--header-container-pc-height));
    padding: 0;

    /* PC 레이아웃 규칙 적용 (가로 배치) */
    transform: translateX(0);
    display: flex;
    flex-direction: row; 
    align-items: center;
    margin-left: 24px; /* 첫 항목 패딩(16px)을 고려하여 40px - 16px = 24px 로 조정 */
    gap: 0; /* 간격을 패딩으로 대체하여 호버 영역 확장 */
    background-color: transparent !important;
  }

  /* 드롭다운의 기준점을 헤더 높이 100%로 꽉 채움 */
  .header-gnb .dropdown-wrapper {
    position: static; /* 부모인 .header-gnb 기준으로 메뉴가 뜨도록 자신의 위치 속성 해제 */
    height: 100%;
    width: auto; /* 모바일의 width: 100% 초기화 */
    display: flex;
    align-items: center;
    padding: 0 16px; /* 항목 사이의 간격을 패딩으로 채워 호버 영역을 확장 (32px 간격 유지) */
  }

  /* 2번째 이후 dropdown-wrapper는 자신이 기준점이 되도록 relative 설정 */
  .header-gnb .dropdown-wrapper:not(:first-child) {
    position: relative;
  }

  .header-gnb .dropdown-wrapper > a {
    padding: 0;
    margin: 0;
    border-bottom: none;
  }
  
  /* 세부 메뉴 (가로 나열 공통 스타일) */
  .header-gnb .dropdown-wrapper > ul {
    position: absolute;
    top: 100%;
    display: flex; /* 서브메뉴 가로 배치 */
    flex-direction: row;
    color: var(--color-text-black);
    gap: var(--spacing-6); /* 서브메뉴 간의 간격 24px */
    padding: 0; /* 패딩을 링크(a) 쪽으로 옮겨, a 태그가 패널 바닥에 닿게 만듦 */

    opacity: 0;
    visibility: hidden;
    overflow: visible;
    max-height: fit-content;
    
    min-width: max-content;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 1000;
  }

  /* 첫 번째 dropdown: .header-gnb 좌측 끝에 정렬 */
  .header-gnb .dropdown-wrapper:first-child > ul {
    left: 0;
  }

  /* 2번째 이후 dropdown: 해당 상위 메뉴(dropdown-wrapper) 중앙 기준으로 중앙 정렬 */
  .header-gnb .dropdown-wrapper:not(:first-child) > ul {
    left: 50%;
    transform: translateX(-50%);
  }

  /* 서브메뉴 링크 호버 밑줄 포지셔닝 */
  .header-gnb .dropdown-wrapper > ul a {
    display: block;
    position: relative;
    padding: var(--spacing-4) 0; /* ul의 위아래 패딩을 이쪽으로 이동 */
    color: var(--color-text-black);
    transition: color 0.3s ease;
  }

  .header-gnb .dropdown-wrapper > ul a:hover,
  .header-gnb .dropdown-wrapper > ul a:focus {
    color: var(--color-primary);
  }

  /* 드롭다운 세부 메뉴 hover 시 하단선 */
  .header-gnb .dropdown-wrapper > ul a::before {
    content: '';
    position: absolute;
    bottom: 0px; /* 하단선의 상하 위치 */
    left: 0;
    width: 100%;
    height: 4px;
    background-color: var(--color-primary);
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    transform: translateY(-5px); /* 선이 아래로 내려오는 애니메이션 */
    z-index: 1; /* 배경 패널 위로 (배경 패널: -1) */
  }

  .header-gnb .dropdown-wrapper > ul a:hover::before,
  .header-gnb .dropdown-wrapper > ul a:focus::before {
    opacity: 1;
    transform: translateY(0);
  }
  /* 화면을 100% 채우는 배경 패널 */
  .header-gnb .dropdown-wrapper > ul::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100vw; /* 화면을 충분히 덮을 만큼 좌측으로 당김 */
    width: 300vw; /* 브라우저 너비 초과 */
    height: 100%;
    background-color: var(--color-white);
    /* border-top: 1px solid #D7D7D7; */
    border-bottom: 1px solid #D7D7D7;
    z-index: -1; /* 서브메뉴 글씨들보다 뒤에 배치 */
  }
  /* 드롭다운 제목 hover */
  .header-gnb .dropdown-wrapper.is-open > ul {
    opacity: 1;
    visibility: visible;
  }
  .header-gnb .dropdown-wrapper > ul > li,
  .header-gnb .dropdown-wrapper > ul > li:first-child,
  .header-gnb .dropdown-wrapper > ul > li:last-child {
    padding: 0;
  }

  /* ---- 언어 및 메뉴 버튼 ---- */
  .header-utils {
    gap: var(--spacing-6);
    color: #404040 !important; 
  }
  .utils-group,
  .lang-dropdown-wrapper {
    display: flex;
  }
  .utils-group {
    gap: var(--spacing-6);
  }
  .header-utils .check-link {
    display: none;
  }
  .header-utils .instagram-link,
  .header-utils .lang-change-button,
  .header-utils .check-link {
    transition: color 0.3s ease;
  }
  .header-utils .instagram-link:hover,
  .header-utils .lang-change-button:hover,
  .header-utils .check-link:hover {
    color: var(--color-primary);
  }
  
  .top-menu {
    cursor: pointer;
    /* text-decoration: none; */
  }
  
  .top-menu.top-menu-active {
    color: var(--color-primary);
  }

  .mobile-menu-button {
    display: none;
  }

  /* --------------- To Top Button --------------- */
  .to-top-btn {
    bottom: 30px;
    right: 30px;
    width: 45px;
    height: 45px;
  }

  .to-top-btn::after {
    width: 25px;
    height: 25px;
  }

  /* 메뉴 전환 시(is-switching) 애니메이션을 꺼서 깜빡임을 방지 */
  .header-gnb.is-switching .dropdown-wrapper > ul,
  .header-gnb.is-switching .dropdown-wrapper > ul::before {
    transition: none !important;
  }
}

/* ============================================================================= */
/* PC (>= 1280px) */
/* ============================================================================= */
@media (min-width: 1280px) {
  .header-inner {
    width: var(--layout-width-max);
    padding: 0;
  }

  /* --------------- To Top Button --------------- */
  .to-top-btn {
    bottom: 40px;
    right: 40px;
    width: 50px;
    height: 50px;
  
    background-size: 1.5rem 1.5rem; 
  }
}