/*
 * EE Theme - components/header.css
 * Purpose: 헤더/메가메뉴/모바일 메뉴 등 헤더 컴포넌트 규칙 통합
 * Load order: 3 (after layout, before existing header-mega.css)
 * Migration notes:
 *  - header-mega.css, template.css의 헤더 관련 공통 규칙을 점진 이관
 *  - 상위 레이어(legacy.css)에서 임시 override 가능
 */

/* Header structure (low-risk, layout only)
 * [source] assets/css/header-mega.css
 * [risk] low (구조만 복제, 시각/상태 전환은 원본 유지)
 */
.site-header .headerbx{height:100%;}
.site-header .max_container{
  max-width:none;
  width:100%;
  padding:0 40px;
  height:100%;
  display:flex;
  align-items:center;
  position:relative;
}
@media (min-width:1201px){
  .site-header .max_container{min-width:1200px;}
}

/* Layout: logo | menu | right utilities */
.site-header .logobx{
  position:absolute;
  left:40px;
  display:flex;
  align-items:center;
  z-index:2;
}
.site-header .ee-gnb{
  position:absolute;
  left:60%;
  transform:translateX(-60%);
  z-index:1;
}
.site-header .header_contbx{
  position:absolute;
  right:0;
  display:flex;
  align-items:center;
  width:auto !important;
  border:none !important;
}
.site-header .header_contbx .top_bx{
  display:flex;
  align-items:center;
  gap:16px;
  height:100%;
}

/* Centering helpers */
.site-header .ee-gnb{justify-self:center;}
.site-header .top_bx{justify-self:end;}
.ee-gnb > .ee-container{display:contents;padding:0;margin:0;}

/* Primary nav list skeleton (no colors here) */
.ee-gnb{height:100%;}
.ee-gnb .gnb{
  display:flex;
  gap:0;
  height:100%;
  align-items:center;
  list-style:none;
  margin:0;
  padding:0;
  justify-content:center;
}
.site-header .ee-gnb .gnb>li{
  flex:0 0 var(--gnb-tab-w);
  width:var(--gnb-tab-w);
  max-width:none;
  text-align:center;
}
.site-header.is-scrolled .ee-gnb .gnb>li,
.site-header.is-hover .ee-gnb .gnb>li{
  flex-basis:var(--gnb-tab-w-scrolled);
  width:var(--gnb-tab-w-scrolled);
}
.ee-gnb .gnb>li>a{
  display:block;
  line-height:var(--hdr-height);
  padding:0;
  font-weight:700;
}

/* Mega menu panel skeleton (layout only) */
.ee-gnb .mega-menu-panel{
  position:absolute;
  left:0;
  top:0;
  width:100%;
  height:100%;
  display:none;
  align-items:flex-start;
  justify-content:flex-start;
  padding:40px 0;
  opacity:0;
  transform:translateY(-10px);
}

/* Safe transitions (do not set colors/backgrounds here) */
.site-header{
  transition: background .25s ease, box-shadow .25s ease;
}
.site-header .logobx .fixed{
  transition: opacity .25s ease;
}
.site-header .logobx a img{
  transition: opacity .25s ease;
}
.ee-gnb .gnb>li>a{
  transition: color .22s ease, padding .22s ease, background .22s ease;
}

/* Avoid baseline gaps for logo images globally */
.site-header .logobx a,
.site-header .logobx a img{
  display:block;
}

/* Responsive header at <=1200px */
@media (max-width: 1200px){
  .site-header{ height:50px !important}
  .site-header .headerbx{ height:50px; }
  .site-header .max_container{ padding:0 16px; height:50px; }
  /* Logo centered via Grid (no left offset) */
  .site-header .logobx{ display:flex; align-items:center; gap:4px; height:100%; margin:0; padding:0; line-height:0; }
  .site-header .logobx a img{ height:16px !important; width:auto; }
  .site-header .logobx a img.fixed{ height:16px !important; position: absolute !important; top: 10px !important; }
  .site-header .logobx a{ display:flex; align-items:center; height:100%; padding:0; margin:0; }
  /* Hide desktop GNB */
  .site-header .ee-gnb{ display:none !important; }
  /* Hide top header utilities (lang/search/sns) */
  .site-header .header_contbx{ display:none !important; }
}

/* Mega Utility Bar (layout & visibility only) */
.site-header .mega-utility{
  position:fixed;
  left:0;
  top:0;
  width:100%; /* avoid horizontal overflow caused by 100vw */
  height:var(--hdr-height);
  z-index:1001;
  visibility:hidden;
  opacity:0;
  transform:translateY(-300px);
  box-sizing:border-box;
}
.site-header.is-hover .mega-utility{
  visibility:visible;
  opacity:1;
  transform:translateY(0);
}
.mega-utility-inner{display:flex;align-items:center;justify-content:space-between;gap:24px;height:100%;}
.mega-utility-left .logo1{display:inline-block;position:relative;}
.mega-utility-left .logo1 img{display:block;height:36px;}
.mega-utility-left .logo1 img.fixed{position:absolute;left:0;top:0;}
.is-scrolled_fixed{max-width:200px;padding-right:10px;}
.is-scrolled_fixed_ee{max-width:110px;padding-left:10px;}
.mega-utility-nav .mega-utility-gnb{display:flex;gap:0;list-style:none;margin:0;padding:0;}
.mega-utility-gnb>li{flex:1 1 0;min-width:0;}
.mega-utility-right{display:flex;align-items:center;gap:16px;}

/* Mega menu background (layout only) */
.mega-menu-bg{
  position:fixed;
  left:0;
  top:var(--hdr-height);
  z-index:1200;
  width:100vw;
  height:0;
  overflow:hidden;
  opacity:0;
  visibility:hidden;
  display:none;
}
.site-header.is-hover .mega-menu-bg{
  display:block;
  height:258px;
  opacity:1;
  visibility:visible;
}
.ee-gnb:hover ~ .mega-menu-bg,
.site-header.is-hover .mega-menu-bg{
  height:258px;
  opacity:1;
  visibility:visible;
}
.ee-gnb:hover .mega-menu-panel,
.site-header.is-hover .ee-gnb .mega-menu-panel{
  display:flex;
  height:258px;
  pointer-events:auto;
  opacity:1;
  transform:translateY(0);
}
