/* 기존 CSS에 추가할 모바일 메뉴 스타일 - 320px 기준 최적화 */

/* 헤더 z-index 수정 */
.header-wrap {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1002;
  transition: all 0.3s ease;
}

.header-container {
  width: calc(100% - 20px);
  max-width: 300px;
  z-index: 1002;
  position: relative;
  height: 50px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: rgba(80, 80, 80, 0.5);
  border-radius: 8px;
  padding-left: 8px;
  padding-right: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
  margin: 8px auto;
}

.header-wrap.scrolled .header-container {
  background-color: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.header-container.active{
  background-color: rgba(255, 255, 255, 0);
  border: 1px solid rgba(255, 255, 255, 0);
}

.header-container .logo {
  display: flex;
  align-items: center;
  transition: 0.1s;
}

.header-container .logo.active {
  opacity: 0;
}

.header-container .logo a {
  display: flex;
  align-items: center;
}

.header-container .logo a img {
  height: 40px;
  margin-right: 6px;
}

/* PC 네비게이션 메뉴 */
.pc-nav {
  display: none;
}

.nav-menu {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 30px;
}

.nav-item {
  position: relative;
}

.nav-link {
  font-family: 'Pretendard';
  font-size: 15px;
  font-weight: 500;
  color: #fff;
  text-decoration: none;
  padding: 8px 0;
  display: block;
  transition: color 0.3s;
}

.nav-link:hover {
  color: #6daf5b;
}

/* 스크롤 시 PC 네비게이션 텍스트 색상 변경 */
.header-wrap.scrolled .nav-link {
  color: #333;
}

.header-wrap.scrolled .nav-link:hover {
  color: #2F6022;
}

/* 드롭다운 메뉴 */
.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background-color: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  min-width: 160px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-radius: 6px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  z-index: 1003;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.nav-item:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  font-family: 'Pretendard';
  display: block;
  padding: 10px 16px;
  color: #333;
  text-decoration: none;
  font-size: 13px;
  font-weight: 400;
  transition: all 0.2s;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.dropdown-item:last-child {
  border-bottom: none;
}

.dropdown-item:hover {
  background-color: #f8f9fa;
  color: #2F6022;
  padding-left: 20px;
}

/* 햄버거 메뉴 버튼 애니메이션 */
.menu-btn {
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 1003;
  position: relative;
  width: 22px;
  height: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.menu-btn span {
  transition: 0.3s;
  display: block;
  width: 100%;
  height: 2.5px;
  background-color: #fff;
  border-radius: 1px;
}

/* 스크롤 시 햄버거 메뉴 색상 변경 */
.header-wrap.scrolled .menu-btn span {
  background-color: #333;
}

.menu-btn.active span {
  background-color: #333;
}

.menu-btn.active span:nth-child(1) {
  transform: rotate(-45deg) translate(-4px, 5px);
}

.menu-btn.active span:nth-child(2) {
  opacity: 0;
}

.menu-btn.active span:nth-child(3) {
  transform: rotate(45deg) translate(-4px, -5px);
}

/* 모바일 메뉴 컨테이너 */
.mobile-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background-color: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  z-index: 999;
  transform: translateX(-100%);
  transition: transform 0.3s ease-in-out;
  overflow-y: auto;
}

.mobile-menu.active {
  transform: translateX(0);
}

/* 메뉴 콘텐츠 */
.menu-content {
  padding: 80px 0 30px 0;
}

.menu-section {
  margin-bottom: 0;
}

/* 메뉴 타이틀 */
.menu-title {
  font-family: 'Pretendard';
  font-size: 16px;
  font-weight: 600;
  color: #333;
  padding: 16px 20px;
  border-bottom: 1px solid #e0e0e0;
  background-color: #f8f9fa;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background-color 0.2s;
  margin: 0;
}

.menu-title:hover {
  background-color: #e9ecef;
}

.menu-title::after {
  content: '▶';
  font-size: 12px;
  color: #666;
  transition: transform 0.3s;
}

.menu-title.expanded::after {
  transform: rotate(90deg);
}

/* 서브메뉴 */
.sub-menu {
  background-color: #fff;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-in-out;
}

.sub-menu.expanded {
  max-height: 500px;
}

.sub-menu-item {
  font-family: 'Pretendard';
  padding: 12px 35px;
  color: #555;
  font-size: 14px;
  font-weight: 400;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
  transition: all 0.2s;
  display: block;
  text-decoration: none;
}

.sub-menu-item:hover {
  background-color: #f8f9fa;
  color: #2F6022;
  padding-left: 40px;
}

.sub-menu-item:last-child {
  border-bottom: none;
}

/* 오버레이 */
.close-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.3);
  z-index: 998;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
}

.close-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* 모바일 추가 최적화 (320px~374px) */
@media (max-width: 374px) {
  .header-container {
    max-width: 280px;
    height: 46px;
    padding-left: 6px;
    padding-right: 6px;
    margin: 6px auto;
  }
  
  .header-container .logo a img {
    height: 36px;
    margin-right: 4px;
  }
  
  .menu-btn {
    width: 20px;
    height: 14px;
  }
  
  .menu-btn span {
    height: 2px;
  }
  
  .menu-title {
    font-size: 15px;
    padding: 14px 16px;
  }
  
  .sub-menu-item {
    font-size: 13px;
    padding: 10px 28px;
  }
  
  .sub-menu-item:hover {
    padding-left: 32px;
  }
}

/* 태블릿 버전 (375px~767px) */
@media (min-width: 375px) and (max-width: 767px) {
  .header-container {
    max-width: 350px;
    height: 60px;
    padding-left: 10px;
    padding-right: 10px;
    margin: 10px auto;
  }
  
  .header-container .logo a img {
    height: 42px;
    margin-right: 6px;
  }
  
  .menu-btn {
    width: 24px;
    height: 17px;
  }
  
  .menu-content {
    padding: 90px 0 35px 0;
  }
  
  .menu-title {
    font-size: 17px;
    padding: 18px 25px;
  }
  
  .sub-menu-item {
    font-size: 15px;
    padding: 14px 40px;
  }
  
  .sub-menu-item:hover {
    padding-left: 45px;
  }
}

/* 태블릿 버전 (768px 이상) */
@media (min-width: 768px) {
  .header-container {
    width: 720px;
    max-width: none;
    height: 70px;
    padding-left: 15px;
    padding-right: 15px;
  }
  
  .header-container .logo a img {
    height: 50px;
  }
  
  .menu-btn {
    width: 28px;
    height: 20px;
  }
  
  .menu-btn span {
    height: 3px;
  }
}

/* PC 버전 (1024px 이상) */
@media (min-width: 1024px) {
  .inner {
    max-width: 1200px;
  }
  
  .header-container {
    width: 1200px;
    height: 75px;
    padding-left: 20px;
    padding-right: 20px;
  }
  
  .header-container .logo a img {
    height: 55px;
  }
  
  .nav-menu {
    gap: 40px;
  }
  
  .nav-link {
    font-size: 16px;
    padding: 10px 0;
  }
  
  .dropdown-menu {
    min-width: 180px;
  }
  
  .dropdown-item {
    padding: 12px 20px;
    font-size: 14px;
  }
  
  .dropdown-item:hover {
    padding-left: 25px;
  }
  
  /* PC에서는 햄버거 메뉴 숨기고 PC 네비게이션 표시 */
  .menu-btn {
    display: none;
  }
  
  .mobile-menu {
    display: none;
  }
  
  .close-overlay {
    display: none;
  }
  
  .pc-nav {
    display: block;
  }
}