/* =========================================================
   파일명: /assets/css/header.css
   역할: 공통 헤더 / PC 드롭다운 / 모바일 토글 기본
   기준:
   - header는 templates/header.php 1개만 사용
   - PC/모바일 모두 동일 HTML 구조 사용
   - 메인/서브 페이지 분리 header 금지
   - Hero/영상 위에서 보이는 다크 반투명 브랜드형 헤더
========================================================= */

:root{
  --nb-blue:#126ee2;
  --nb-blue-2:#20a8ff;
  --nb-sky:#35bdf2;
  --nb-navy:#0f172a;
  --nb-text:#172033;
  --nb-muted:#6b7788;
  --nb-line:#e3eaf3;
  --nb-header-h:76px;
}

.sr-only{
  position:absolute;
  width:1px;
  height:1px;
  padding:0;
  margin:-1px;
  overflow:hidden;
  clip:rect(0,0,0,0);
  white-space:nowrap;
  border:0;
}

/* =========================================================
   [01] HEADER WRAP
========================================================= */
.site-header{
  position:fixed;
  top:0;
  left:0;
  right:0;
  z-index:1100;
  width:100%;
  background:rgba(13,18,25,.68);
  border-bottom:1px solid rgba(255,255,255,.16);
  box-shadow:none;
  backdrop-filter:blur(12px);
  -webkit-backdrop-filter:blur(12px);
}

.utility-bar,
.header-search{
  display:none;
}

.header-inner{
  position:relative;
  display:grid;
  grid-template-columns:220px minmax(0,1fr) 430px;
  align-items:center;
  min-height:var(--nb-header-h);
  gap:34px;
}

/* =========================================================
   [02] LOGO
========================================================= */
.logo{
  display:flex;
  align-items:center;
  min-width:0;
}

.logo img{
  display:block;
  width:132px;
  max-height:58px;
  height:auto;
  object-fit:contain;
}

.logo-fallback{
  display:none;
  color:#fff;
  font-weight:900;
}

/* =========================================================
   [03] PC NAVIGATION
========================================================= */
.main-nav{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:clamp(48px,5vw,92px);
  min-width:0;
}

.nav-item{
  position:relative;
  display:flex;
  align-items:center;
  min-height:var(--nb-header-h);
}

.nav-link{
  position:relative;
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:var(--nb-header-h);
  padding:0 8px;
  color:#fff;
  font-family:"Pretendard","Noto Sans KR","Apple SD Gothic Neo","Malgun Gothic",sans-serif;
  font-size:clamp(16px,1vw,18px);
  font-weight:900;
  letter-spacing:-.045em;
  line-height:1.12;
  white-space:nowrap;
  text-shadow:0 1px 8px rgba(0,0,0,.28);
  transition:color .18s ease;
}

.nav-link::after{
  content:"";
  position:absolute;
  left:50%;
  bottom:0;
  width:54px;
  height:4px;
  border-radius:0;
  background:var(--nb-sky);
  opacity:0;
  transform:translateX(-50%) scaleX(.45);
  transform-origin:center;
  transition:opacity .18s ease, transform .18s ease;
}

.nav-item:hover > .nav-link,
.nav-item.active > .nav-link{
  color:#fff;
}

.nav-item:hover > .nav-link::after,
.nav-item.active > .nav-link::after{
  opacity:1;
  transform:translateX(-50%) scaleX(1);
}

/* =========================================================
   [04] PC DROPDOWN
========================================================= */
.dropdown{
  position:absolute;
  left:50%;
  top:100%;
  min-width:230px;
  padding:0;
  background:rgba(17,24,39,.96);
  border:1px solid rgba(255,255,255,.16);
  border-radius:0;
  box-shadow:0 22px 44px rgba(0,0,0,.22);
  overflow:hidden;
  z-index:1110;
  opacity:0;
  visibility:hidden;
  transform:translate(-50%,10px);
  transition:opacity .18s ease, transform .18s ease, visibility .18s ease;
  backdrop-filter:blur(12px);
  -webkit-backdrop-filter:blur(12px);
}

.nav-item:hover > .dropdown,
.nav-item:focus-within > .dropdown{
  opacity:1;
  visibility:visible;
  transform:translate(-50%,0);
}

.dropdown a{
  display:flex;
  align-items:center;
  justify-content:flex-start;
  min-height:50px;
  padding:0 20px;
  border-bottom:1px solid rgba(255,255,255,.08);
  background:transparent;
  color:rgba(255,255,255,.9);
  font-family:"Pretendard","Noto Sans KR","Apple SD Gothic Neo","Malgun Gothic",sans-serif;
  font-size:15px;
  font-weight:850;
  letter-spacing:-.035em;
  line-height:1.25;
  white-space:nowrap;
  transition:background .16s ease, color .16s ease;
}

.dropdown a:last-child{
  border-bottom:0;
}

.dropdown a:hover,
.dropdown a:focus{
  background:rgba(18,110,226,.96);
  color:#fff;
}

/* =========================================================
   [05] HEADER ACTIONS / PC SEARCH / MOBILE BUTTON
========================================================= */
.header-actions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:12px;
  min-width:0;
}

.header-product-search{
  display:flex;
  align-items:center;
  flex:0 1 300px;
  width:300px;
  max-width:300px;
  height:42px;
  margin:0;
  border:1px solid rgba(18,110,226,.72);
  border-radius:6px;
  background:rgba(255,255,255,.96);
  box-shadow:0 6px 18px rgba(10,40,80,.10);
  overflow:hidden;
}

.header-product-search input{
  flex:1 1 auto;
  min-width:0;
  height:100%;
  padding:0 12px 0 15px;
  border:0;
  outline:0;
  background:transparent;
  color:#10243d;
  font-size:14px;
  font-weight:800;
  letter-spacing:-.025em;
}

.header-product-search input::placeholder{
  color:#7a8da3;
  font-weight:750;
  opacity:1;
}

.header-product-search button{
  display:flex;
  align-items:center;
  justify-content:center;
  flex:0 0 44px;
  width:44px;
  height:100%;
  border:0;
  border-left:1px solid rgba(18,110,226,.18);
  background:transparent;
  color:#0f4d92;
  font-size:0;
  line-height:1;
  cursor:pointer;
}

.header-product-search button svg{
  width:20px;
  height:20px;
  fill:currentColor;
}

.header-product-search button:hover,
.header-product-search button:focus{
  background:#f0f7ff;
  color:#126ee2;
}

.header-phone-link{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:7px;
  color:#fff;
  font-size:15px;
  font-weight:900;
  letter-spacing:-.025em;
  line-height:1;
  white-space:nowrap;
  text-shadow:0 1px 8px rgba(0,0,0,.22);
  transition:color .18s ease;
}

.header-phone-link::before{
  content:"☎";
  display:inline-block;
  font-size:17px;
  line-height:1;
  color:var(--nb-sky);
}

.header-phone-link:hover,
.header-phone-link:focus{
  color:var(--nb-sky);
}

.header-contact-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  height:40px;
  padding:0 22px;
  border:1px solid rgba(255,255,255,.74);
  border-radius:0;
  color:#fff;
  font-size:14px;
  font-weight:900;
  letter-spacing:-.03em;
  white-space:nowrap;
  transition:background .18s ease,border-color .18s ease,color .18s ease;
}

.header-contact-btn:hover,
.header-contact-btn:focus{
  background:var(--nb-sky);
  border-color:var(--nb-sky);
  color:#fff;
}

.menu-toggle{
  display:none;
  align-items:center;
  justify-content:center;
  flex-direction:column;
  width:44px;
  height:44px;
  border:0;
  border-radius:0;
  background:transparent;
  cursor:pointer;
}

.menu-toggle span{
  display:block;
  width:22px;
  height:2px;
  margin:3px 0;
  border-radius:0;
  background:#fff;
  transition:transform .18s ease, opacity .18s ease;
}

.menu-toggle.active span:nth-child(1),
.menu-toggle.is-active span:nth-child(1){transform:translateY(8px) rotate(45deg)}
.menu-toggle.active span:nth-child(2),
.menu-toggle.is-active span:nth-child(2){opacity:0}
.menu-toggle.active span:nth-child(3),
.menu-toggle.is-active span:nth-child(3){transform:translateY(-8px) rotate(-45deg)}

/* =========================================================
   [06] RESPONSIVE HEADER
========================================================= */
@media (max-width:1180px){
  .header-inner{
    grid-template-columns:160px minmax(0,1fr) 360px;
    gap:18px;
  }

  .main-nav{
    gap:clamp(18px,2.3vw,34px);
  }

  .nav-link{
    font-size:15px;
  }

  .header-product-search{
    flex-basis:250px;
    width:250px;
    max-width:250px;
  }

  .header-phone-link{
    display:none;
  }
}

@media (max-width:1024px){
  :root{--nb-header-h:72px}

  .header-inner{
    grid-template-columns:150px minmax(0,1fr) 54px;
    min-height:72px;
  }

  .logo img{
    width:118px;
  }

  .header-product-search,
  .header-phone-link,
  .header-contact-btn{
    display:none;
  }

  .menu-toggle{
    display:flex;
  }

  .main-nav{
    position:fixed;
    top:72px;
    left:0;
    right:0;
    display:none;
    flex-direction:column;
    align-items:stretch;
    justify-content:flex-start;
    gap:0;
    max-height:calc(100vh - 72px);
    overflow:auto;
    background:rgba(13,18,25,.96);
    border-top:1px solid rgba(255,255,255,.12);
    box-shadow:0 18px 44px rgba(0,0,0,.22);
  }

  .main-nav.active{
    display:flex;
  }

  .nav-item{
    width:100%;
    min-height:58px;
    display:block;
  }

  .nav-link{
    width:100%;
    min-height:58px;
    justify-content:flex-start;
    padding:0 22px;
    font-size:16px;
    text-shadow:none;
  }

  .nav-link::after,
  .dropdown{
    display:none;
  }
}

/* =========================================================
   [V20] COMMON WHITE HEADER DESIGN
   목적: 모든 페이지 헤더를 흰색 배경 기준으로 통일하고 메뉴 가독성 복구
========================================================= */
.site-header{
  position:fixed;
  top:0;
  left:0;
  right:0;
  z-index:1100;
  width:100%;
  background:rgba(255,255,255,.96);
  border-bottom:1px solid #dbe6f2;
  box-shadow:0 6px 22px rgba(11,34,62,.06);
  backdrop-filter:saturate(1.15) blur(10px);
  -webkit-backdrop-filter:saturate(1.15) blur(10px);
}

.nav-link{
  color:#14243a;
  text-shadow:none;
}

.nav-item:hover > .nav-link,
.nav-item.active > .nav-link{
  color:#126ee2;
}

.nav-link::after{
  background:#126ee2;
}

.header-phone-link{
  color:#14243a;
  text-shadow:none;
}

.header-phone-link:hover,
.header-phone-link:focus{
  color:#126ee2;
}

.header-contact-btn{
  border-color:#1d2d44;
  color:#1d2d44;
  background:rgba(255,255,255,.38);
}

.header-contact-btn:hover,
.header-contact-btn:focus{
  background:#126ee2;
  border-color:#126ee2;
  color:#fff;
}

.menu-toggle span{
  background:#14243a;
}

@media (max-width:1024px){
  .main-nav{
    background:rgba(255,255,255,.98);
    border-top:1px solid #dbe6f2;
    box-shadow:0 18px 44px rgba(9,31,57,.14);
  }

  .nav-link{
    color:#14243a;
  }

  .nav-item:hover > .nav-link,
  .nav-item.active > .nav-link{
    color:#126ee2;
  }
}
