/* ===== 기본 헤더 스타일 ===== */
.header.fixed { background-color: #fff; border-bottom: 1px solid #ddd; }
.header.fixed .nav-link { color: #000; }
.header.fixed .logo a { background-image: url(../img/logo.png); }
.header.fixed #login-toggle { background: rgba(0, 0, 0, 0.9); }

.header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  border-bottom: 1px solid rgba(255, 255, 255, .3);
  background: transparent;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.header.hover-active {
  background: #fff !important; border-bottom: 1px solid #ddd !important; backdrop-filter: none !important;
}
.header.hover-active .logo a { background-image: url(../img/logo.png); }

.container { max-width: 100%; margin: 0 auto; padding: 0 20px; }
.nav-wrapper { display: flex; align-items: center; justify-content: space-between; height: 100px; position: relative; gap: 15px; padding: 0 20px; }

/* ===== 로고 스타일 ===== */
.logo { font-size: 28px; font-weight: 800; color: #fff; text-decoration: none; letter-spacing: -1px; flex-shrink: 0; transition: color 0.4s cubic-bezier(0.4, 0, 0.2, 1); min-width: 120px; }
.logo a { display: inline-block; padding: 10px 0; text-decoration: none; background: url(../img/logo_w.png) no-repeat; background-size: contain; width: 219px; height: 59px; transition: all 0.3s ease; }

/* ===== 데스크톱 네비게이션 ===== */
.desktop-nav { display: flex; list-style: none; gap: 0; position: absolute; left: 50%; transform: translateX(-50%); top: 50%; transform: translate(-50%, -50%); }
.nav-item { position: relative; }
.nav-link { display: block; padding: 25px 50px; color: #fff; text-decoration: none; font-weight: 500; letter-spacing: -0.5px; font-size: 20px; transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1); position: relative; white-space: nowrap; }
.header.hover-active .nav-link { color: #2c3e50; }
.nav-link:hover, .nav-item.active .nav-link { color: #967146; }

/* ===== 로그인 토글 ===== */
#login-toggle { position: relative; background: rgba(255, 255, 255, 0.15);backdrop-filter: blur(12px) saturate(180%);border: 1px solid rgba(255, 255, 255, 0.3);box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1); border-radius: 20px; padding: 6px; transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1); animation: fadeIn 0.6s ease-out; flex-shrink: 0; min-width: 100px; }
.header.hover-active #login-toggle { background: rgba(52, 152, 219, 0.1); border: 1px solid rgba(52, 152, 219, 0.3); box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1); }
#login-toggle:hover { transform: translateY(-2px); box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15); }
.toggle-button { background: none; border: none; color: #fff; font-size: 14px; font-weight: 500; padding: 8px 12px; border-radius: 16px; cursor: pointer; transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1); position: relative; overflow: hidden; min-width: 100px; display: flex; align-items: center; justify-content: center; gap: 8px; letter-spacing: -0.3px; }
.header.hover-active .toggle-button { color: #2c3e50; }
.toggle-button::before { content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%; background: linear-gradient(90deg, transparent, rgba(52, 152, 219, 0.2), transparent); transition: left 0.5s ease; }
.toggle-button:hover::before { left: 100%; }
.toggle-button:hover { background: rgba(52, 152, 219, 0.15); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); }
.icon { width: 16px; height: 16px; transition: transform 0.3s ease; }
.toggle-button:hover .icon { transform: rotate(180deg); }
.dropdown-menu { position: absolute; top: 100%; left: 0; right: 0; margin-top: 8px; background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(10px); border: 1px solid rgba(52, 152, 219, 0.2); border-radius: 12px; padding: 8px; opacity: 0; visibility: hidden; transform: translateY(-10px); transition: all 0.3s ease; z-index: 1000; }
.dropdown-menu.show { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown-item { display: block; width: 100%; padding: 10px 12px; margin: 2px 0; text-decoration: none; color: #2c3e50; font-size: 14px; border-radius: 8px; transition: all 0.2s ease; text-align: left; background: none; border: none; cursor: pointer; font-family: inherit; }
.dropdown-item:hover { background: rgba(52, 152, 219, 0.15); transform: translateX(4px); color: #3498db; }
.status-indicator { width: 8px; height: 8px; border-radius: 50%; background: #c5a065; margin-left: 4px; animation: pulse 2s infinite; }

/* ===== 메가메뉴 ===== */
.megamenu-overlay { position: fixed; left: 0; right: 0; top: var(--header-h, 70px); height: calc(100vh - var(--header-h, 70px)); background: rgba(0, 0, 0, 0.4); z-index: 999; opacity: 0; visibility: hidden; }
.megamenu-overlay.active { pointer-events: auto; transform: scaleY(1); opacity: 1; visibility: visible; transition: transform .30s ease, opacity .30s ease; }
.megamenu { position: fixed; left: 0; right: 0; top: var(--header-h, 70px); background: #fff; z-index: 1000; will-change: clip-path, opacity, transform; clip-path: inset(0 0 100% 0); opacity: 0; transform: translateY(-8px); visibility: hidden; transition: clip-path .28s ease, opacity .20s ease, transform .28s ease; }
.megamenu.active { clip-path: inset(0 0 0 0); opacity: 1; transform: translateY(0); visibility: visible; }
.megamenu.exiting { clip-path: inset(0 0 100% 0); opacity: 0; transform: translateY(-6px); transition: clip-path .18s ease, opacity .18s ease, transform .18s ease; }
.megamenu-column .column-title { transition: color .25s ease; }
.megamenu-column.is-active .column-title { color: #967146; }
.megamenu-column.is-active .column-header { border-color: #967146; }
.megamenu-container { max-width: 1600px; margin: 0 auto; padding: 50px 30px; }
.megamenu-content { display: flex; justify-content: space-between; gap: 30px; flex-wrap: wrap; }
.megamenu-column { flex: 1; min-width: 180px; max-width: 210px; opacity: 0; transform: translateY(15px); transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.23, 1, 0.32, 1); }
.megamenu.active .megamenu-column { opacity: 1; transform: translateY(0); }
.column-header { display: flex; align-items: center; margin-bottom: 25px; padding-bottom: 15px; border-bottom: 2px solid #f1f3f4; }
.column-icon { width: 40px; height: 40px; background: linear-gradient(45deg, #BB995E, #7C5833); border-radius: 50%; display: flex; align-items: center; justify-content: center; margin-right: 15px; color: white; font-weight: bold; }
.column-icon .material-symbols-outlined  { font-weight: 200;}
.column-title { font-size: 18px; font-weight: 700; color: #2c3e50; }
.column-links { list-style: none; }
.column-links a { font-size: 16px; line-height: 2.1; display: flex; align-items: center; padding: 10px 10px; color: #666; text-decoration: none; border-radius: 8px; transition: all 0.3s ease; position: relative; overflow: hidden; }
.column-links a::before { content: ''; position: absolute; left: 0; top: 0; width: 0; height: 100%; background: linear-gradient(45deg, #b98a50, #9d7039); transition: width 0.3s ease; z-index: -1; }
.column-links a:hover { color: white; transform: translateX(5px); }
.column-links a:hover::before { width: 100%; }
.link-icon { margin-right: 10px; opacity: 0.7; }
.link-icon .material-symbols-outlined { margin-top: 10px;}

/* ===== 모바일 토글 (수정된 햄버거 정렬) ===== */
.mobile-toggle { display: none; position: relative; flex-direction: column; cursor: pointer; padding: 8px; border: none; background: none; transition: all 0.3s ease; flex-shrink: 0; width: 32px; height: 22px; }
.mobile-toggle:hover { background: rgba(255, 255, 255, 0.1); border-radius: 8px; }

.hamburger {
  position: absolute;
  left: 0; width: 100%; height: 2px; background: #fff;
  border-radius: 2px; transition: all 0.35s ease;
  top: 50%; transform-origin: center;
}
.hamburger:nth-child(1) { transform: translateY(-8px); }
.hamburger:nth-child(2) { transform: translateY(0); }
.hamburger:nth-child(3) { transform: translateY(8px); }

.mobile-toggle.active .hamburger:nth-child(1) { transform: translateY(0) rotate(45deg); }
.mobile-toggle.active .hamburger:nth-child(2) { opacity: 0; }
.mobile-toggle.active .hamburger:nth-child(3) { transform: translateY(0) rotate(-45deg); }

.header.hover-active .hamburger,
.header.fixed .hamburger,
.header.mobile-menu-active .hamburger { background: #2c3e50 !important; }

/* ===== 모바일 메뉴 ===== */
.mobile-menu { position: fixed; top: 80px; left: -100%; width: 100%; height: calc(100vh - 70px); background: white; transition: left 0.3s ease; overflow-y: auto; z-index: 999; }
.mobile-menu.active { left: 0; }
.mobile-nav-item { border-bottom: 1px solid #f1f3f4; }
.mobile-nav-link { display: flex; align-items: center; justify-content: space-between; padding: 20px; color: #2c3e50; text-decoration: none; font-weight: 600; transition: all 0.3s ease; font-size: 16px; }
.mobile-nav-link:hover { background: #f8f9fa; color: #3498db; }
.mobile-arrow { font-size: 12px; transition: transform 0.3s ease; }
.mobile-nav-link.active .mobile-arrow { transform: rotate(180deg); }
.mobile-submenu { max-height: 0; overflow: hidden; background: #f8f9fa; transition: max-height 0.3s ease; }
.mobile-submenu.active { max-height: 1000px; }
.mobile-submenu-item { border-bottom: 1px solid #e9ecef; }
.mobile-submenu-link { display: block; padding: 15px 30px; color: #666; text-decoration: none; transition: all 0.3s ease; font-size: 14px; }

/* ===== 애니메이션 ===== */
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* ===== 반응형 ===== */
@media (max-width: 1530px) {
  .desktop-nav { display: none !important; }
  #login-toggle { display: none !important; }
  .mobile-toggle { display: flex !important; }
  .nav-wrapper { justify-content: space-between; }
  .header.mobile-menu-active { background: #fff !important; border-bottom: 1px solid #ddd !important; backdrop-filter: none !important; }

  .header.mobile-menu-active .logo a { background-image: url(../img/logo.png) !important;background-repeat: no-repeat;background-size: contain;}
  .header.mobile-menu-active .hamburger { background: #2c3e50 !important; }
}

/* 세부 반응형 크기 동일하게 유지 */
@media (max-width: 767px) {
  .logo a {
  .nav-wrapper { height: 80px; }
  .mobile-menu { top: 60px; height: calc(100vh - 60px); }
}
@media (max-width: 479px) {
  .hamburger { width: 20px; }
  .mobile-toggle { width: 20px; height: 20px; }
}

/* ===== 오버레이 ===== */
body:has(.megamenu-overlay.active) #login-toggle .dropdown-menu.show,
.header.overlay-open #login-toggle .dropdown-menu.show {
  position: fixed; z-index: 1400; top: calc(var(--header-h, 70px) + 8px);
  right: 20px; left: auto; max-height: 60vh; overflow: auto;
}
