/* Header Styles */
:root {
  --primary-color: #ef487b;
  --primary-light: rgba(239, 72, 123, 0.1);
  --primary-lighter: rgba(239, 72, 123, 0.05);
  --text-dark: #231f20;
}

.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: transparent;
  height: 100px;
  transition: all 0.3s ease;
}

.header-container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100px;
}

/* Logo */
.logo-image {
  height: 36px;
  width: auto;
}

/* Navigation */
.nav-list {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 48px;
}

.nav-link {
  text-decoration: none;
  color: var(--text-dark);
  font-weight: 400;
  font-size: 18px;
  padding: 10px 0;
  transition: color 0.3s ease;
}

.nav-link:hover {
  color: var(--primary-color);
}

/* 활성 메뉴 스타일 (데스크톱) */
.nav-item.active > a,
.nav-link.nav-selected {
  color: var(--primary-color);
  font-weight: 500;
}

.nav-item.active {
  position: relative;
}

.nav-item.active::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 0;
  right: 0;
  height: 2px;
  background-color: var(--primary-color);
}

/* Selected navigation item style when header is scrolled */
.header.scrolled .nav-link.nav-selected {
  color: var(--primary-color);
}

.header.scrolled .nav-item.active::after {
  bottom: -1px;
}

.header.scrolled {
  background: #fff;
  border-bottom: 1px solid #ddd;
}

.user-menu-container {
  display: flex;
}

.user-menu-container > .user-menu-line {
  position: relative;
  margin-left: 8px;
  display: flex;
  align-items: center;
}

.user-menu-container .bag-num {
  top: -2px;
  right: -6px;
  position: absolute;
  background-color: #231f20;
  color: white;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
}

.header-auth-container {
  display: flex;
  align-items: center;
  margin-left: 20px;
  font-size: 16px;
}
.header-auth-container .down-arrow {
  width: 12px;
  margin-left: 6px;
  margin-right: 6px;
}

.user-vip {
  display: flex;
  align-items: center;
  font-weight: 300;
  justify-content: center;
  border-radius: 500px;
  background-color: var(--primary-color);
  color: white;
  padding: 2px 8px;
  margin-right: 4px;
  font-size: 10px;
}

/* Header Auth Container States - JSP에서 조건부 표시 제어 */

/* User Menu Line Spacing */
.user-menu-line.language-menu {
  margin-left: 16px;
}

.user-menu-line.language-menu .language-text {
  margin-left: 2px;
  font-size: 14px;
}

@media (max-width: 768px) {
  .user-menu-line.language-menu .language-text {
    display: none;
  }
}

.header-mobile-auth {
  display: none;
  position: absolute;
  top: 16px;
  right: 86px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .header {
    height: 104px;
  }

  .logo-image {
    position: absolute;
    left: 12px; 
    top: 8px;
    height: 25px;
  }

  /* 모바일 로그인 전 아이콘만 표시 */
  .header-mobile-auth {
    display: block !important;
  }
  
  /* 로그인 후에는 모바일 아이콘 숨김 */
  .header-mobile-auth[style*="display:none"] {
    display: none !important;
  }

  .header.scrolled {
    height: 104px;
    background: #fff;
    /* border-bottom: 1px solid #ddd; */
  }

  .header-container {
    height: 102px;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    padding: 10px 0;
    position: relative;
  }

  /* 첫 번째 줄: 로고 */
  .header-logo {
    position: absolute;
  }

  /* 우측 메뉴들을 첫 번째 줄 우측에 배치 */

  .user-menu-container {
    position: absolute;
    top: 18px;
    right: 20px;
  }

  /* 두 번째 줄: 네비게이션을 아래로 */
  .header-nav {
    position: absolute;
    top: 56px;
    width: calc(100%);
  }

  .header.scrolled .header-nav {
    border-top: 1px solid #d8d8d8;
  }

  .nav-list {
    width: 100%;
    justify-content: center; /* Changed to center */
    gap: 24px;
    flex-wrap: wrap;
    padding: 0; /* Removed horizontal padding */
    height: 46px;
    align-items: center;
  }

  .nav-link {
    font-size: 16px;
    white-space: nowrap;
    line-height: 1;
  }

  .nav-item {
    height: 46px;
    display: flex;
    align-items: center;
    position: relative;
  }

  /* 모바일 활성 메뉴 스타일 */
  .nav-item.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background-color: var(--primary-color);
  }
  
  .nav-item.active > a {
    color: var(--primary-color) !important;
    font-weight: 600;
  }
  
  /* 호버 효과도 핑크로 통일 */
  .nav-link:hover {
    color: var(--primary-color);
  }
  
  /* 모바일에서 일반 메뉴 아이템 스타일 */
  .nav-item {
    transition: all 0.3s ease;
  }

  /* flex spacer 요소들 숨김 */
  .flex-3,
  .flex-4 {
    display: none;
  }

  /* 모바일에서 로그인 전: 아이콘 표시, 로그인 후: header-auth-container 표시 */
  .header-auth-container.user-unauth-container {
    display: none !important;
  }
  
  /* 로그인 후 사용자 정보는 모바일에서도 표시 */
  .header-auth-container:not(.user-unauth-container) {
    display: flex !important;
    font-size: 14px;
    position: absolute;
    top: 18px;
    right: 80px;
    margin-left: 0;
  }
}
