.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: 1600px; margin: 0 auto; padding: 0 30px; }
.nav-wrapper { display: flex; align-items: center; justify-content: space-between; height: 70px; position: relative; }

.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);}
.logo a { display: inline-block; padding: 10px 0; text-decoration: none; background: url(../img/logo_w.png) no-repeat; background-size: contain; width: 150px; height: 40px; }


.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: 600; font-size: 18px; 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: #3498db; }

#login-toggle { position: relative; background: rgba(52, 152, 219, 0.1); backdrop-filter: blur(10px);border: 1px solid rgba(52, 152, 219, 0.2); 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;}
.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: #4ade80; margin-left: 4px; animation: pulse 2s infinite; }

/* ===== Overlay: 헤더 바로 밑에서 펼쳐짐(scaleY) ===== */
.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: 헤더 바로 밑에서 clip-path로 슬라이드 다운 ===== */
.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: #3498db; }   /* 강조 색상 */
.megamenu-column.is-active .column-header { border-color: #3498db; } /* 하단 보더도 강조(선택) */


.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: 220px; 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, #3498db, #2ecc71); border-radius: 50%; display: flex; align-items: center; justify-content: center; margin-right: 15px; color: white; font-weight: bold; }
.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, #3498db, #2ecc71); 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; }

/* 모바일 */
.mobile-toggle { display: none; flex-direction: column; cursor: pointer; padding: 8px; border: none; background: none; transition: all 0.3s ease; flex-shrink: 0; }
.mobile-toggle:hover { background: rgba(255, 255, 255, 0.1); border-radius: 8px; }
.hamburger { width: 25px; height: 2px; background: #fff; margin: 3px 0; transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1); border-radius: 3px; }
.header.hover-active .hamburger { background: #2c3e50; }
.mobile-toggle.active .hamburger:nth-child(1) { transform: rotate(45deg) translate(6px, 6px); }
.mobile-toggle.active .hamburger:nth-child(2) { opacity: 0; }
.mobile-toggle.active .hamburger:nth-child(3) { transform: rotate(-45deg) translate(6px, -6px); }

.mobile-menu {position: fixed; top: 70px; 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:15px }
.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; }
.mobile-submenu-link:hover { background: #e9ecef; color: #3498db; padding-left: 35px; }

@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: 900px) {
  .desktop-nav { display: none; }
  #login-toggle { display: none; }
  .mobile-toggle { display: flex; }
  .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 { color: #2c3e50 !important; }
  .header.mobile-menu-active .logo:hover { color: #3498db !important; }
  .header.mobile-menu-active .hamburger { background: #2c3e50 !important; }
  .mobile-toggle:hover { background: rgba(255, 255, 255, 0.1); }
  .header.mobile-menu-active .mobile-toggle:hover { background: rgba(52, 152, 219, 0.1) !important; }
  .header.fixed .hamburger { background: #2c3e50 }
}
