/* ============================================
   Header — 법인설립지원센터 파트너스
   ============================================ */

/* ==========================================
   1. 헤더 기본 구조
   ========================================== */

.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height-pc, 72px);
  z-index: var(--z-sticky, 200);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

  /* 기본: 투명 (히어로 위) */
  background: transparent;
}

.header__inner {
  max-width: var(--container-max, 1200px);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 0;
  position: relative;
}


/* ==========================================
   2. 스크롤 상태 (header--scrolled)
   ========================================== */

.header--scrolled {
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}


/* ==========================================
   3. 로고
   ========================================== */

.header__logo {
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  flex-shrink: 0;
  height: 32px;
}

/* 투명 상태 로고 */
.header__logo .logo-white {
  display: flex;
}
.header__logo .logo-color {
  display: none;
}

/* 스크롤 후 로고 전환 */
.header--scrolled .header__logo .logo-white {
  display: none;
}
.header--scrolled .header__logo .logo-color {
  display: flex;
}

/* 텍스트 로고 공통 */
.logo-white,
.logo-color {
  align-items: baseline;
  gap: 5px;
}

.logo__main {
  font-family: var(--font-number, 'Montserrat', sans-serif);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1;
}

.logo__sub {
  font-family: var(--font-primary, 'Pretendard Variable', sans-serif);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1;
}

/* 흰색 로고 */
.logo-white .logo__main,
.logo-white .logo__sub {
  color: #ffffff;
}

/* 컬러 로고 */
.logo-color .logo__main {
  color: var(--color-primary, #3972DF);
}
.logo-color .logo__sub {
  color: var(--color-primary-dark, #153B84);
}


/* ==========================================
   4. 네비게이션 (PC only)
   ========================================== */

.header__nav {
  display: flex;
  align-items: center;
  gap: 32px;
  margin-left: 48px;
}

.header__nav-link {
  font-family: var(--font-primary, 'Pretendard Variable', sans-serif);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.9);
  transition: color 0.2s ease;
  white-space: nowrap;
  cursor: pointer;
}

.header__nav-link:hover {
  color: #ffffff;
}

/* 스크롤 후 네비 색상 */
.header--scrolled .header__nav-link {
  color: var(--color-gray-600, #323B49);
}

.header--scrolled .header__nav-link:hover {
  color: var(--color-primary, #3972DF);
}

/* 현재 섹션 활성화 */
.header__nav-link.is-active {
  color: var(--color-primary, #3972DF);
  font-weight: 600;
}

.header--scrolled .header__nav-link.is-active {
  color: var(--color-primary, #3972DF);
}


/* ==========================================
   5. 액션 영역 (CTA 버튼)
   ========================================== */

.header__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

/* 공통 CTA 버튼 베이스 */
.header__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 24px;
  border-radius: var(--radius-full, 9999px);
  font-family: var(--font-primary, 'Pretendard Variable', sans-serif);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  line-height: 1;
}

/* 투명 상태: 아웃라인 흰 버튼 */
.header__cta--outline {
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: transparent;
  color: #ffffff;
}

.header__cta--outline:hover {
  border-color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.1);
}

/* 투명 상태: 꽉찬 흰 버튼 (카카오) */
.header__cta--kakao {
  border: none;
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  display: none; /* PC 헤더에서는 숨김, 필요시 표시 */
}

/* 스크롤 후: 파란 그라디언트 버튼 */
.header--scrolled .header__cta--outline {
  border: none;
  background: var(--gradient-cta, linear-gradient(135deg, #3972DF 0%, #153B84 100%));
  color: #ffffff;
  box-shadow: var(--shadow-primary, 0 8px 24px rgba(57, 114, 223, 0.35));
}

.header--scrolled .header__cta--outline:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 32px rgba(57, 114, 223, 0.45);
}


/* ==========================================
   6. 스크롤 프로그레스 바
   ========================================== */

.header__progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background: var(--color-primary, #3972DF);
  transition: width 0.1s linear;
  pointer-events: none;
}


/* ==========================================
   7. 햄버거 버튼 (모바일)
   ========================================== */

.header__hamburger {
  display: none; /* PC에서 숨김 */
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  margin-left: auto;
  -webkit-tap-highlight-color: transparent;
}

.header__hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: #ffffff;
  border-radius: 2px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: center;
}

/* 스크롤 후 햄버거 색상 */
.header--scrolled .header__hamburger span {
  background: var(--color-gray-600, #323B49);
}

/* 열린 상태 X 변환 */
.header__hamburger.is-open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.header__hamburger.is-open span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.header__hamburger.is-open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* 열린 상태에서는 항상 흰색 (오버레이 위) */
.header__hamburger.is-open span {
  background: #ffffff;
}


/* ==========================================
   8. 모바일 메뉴 오버레이
   ========================================== */

.header__mobile-menu {
  position: fixed;
  inset: 0;
  background: var(--color-primary-deeper, #07142C);
  z-index: var(--z-modal, 300);
  display: flex;
  flex-direction: column;
  overflow-y: auto;

  /* 기본: 숨김 */
  opacity: 0;
  visibility: hidden;
  transform: translateX(100%);
  transition:
    opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1),
    visibility 0.35s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 열린 상태 */
.header__mobile-menu.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

/* 메뉴 오픈 시 헤더 배경 고정 — 배경 사라짐 방지 */
.header.menu-open {
  background: var(--color-primary-deeper, #07142C) !important;
}

/* 모바일 메뉴 상단: 로고 + 닫기 버튼 */
.mobile-menu__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: var(--header-height-mobile, 60px);
  flex-shrink: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.mobile-menu__logo {
  display: flex;
  align-items: baseline;
  gap: 5px;
  text-decoration: none;
}

.mobile-menu__logo .logo__main {
  color: #ffffff;
  font-size: 20px;
}
.mobile-menu__logo .logo__sub {
  color: rgba(255, 255, 255, 0.7);
  font-size: 10px;
}

.mobile-menu__close {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: #ffffff;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

.mobile-menu__close svg {
  width: 24px;
  height: 24px;
}

/* 메뉴 항목 목록 */
.mobile-menu__nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 32px;
  padding: 0 32px;
}

.mobile-menu__nav-link {
  font-family: var(--font-primary, 'Pretendard Variable', sans-serif);
  font-size: 28px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  transition: color 0.2s ease;
  cursor: pointer;
  display: block;
}

.mobile-menu__nav-link:hover,
.mobile-menu__nav-link:active {
  color: #ffffff;
}

/* 모바일 메뉴 하단 CTA */
.mobile-menu__footer {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* 파트너 신청하기 버튼 (파란) */
.mobile-menu__cta-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 16px;
  border-radius: var(--radius-full, 9999px);
  background: var(--gradient-cta, linear-gradient(135deg, #3972DF 0%, #153B84 100%));
  color: #ffffff;
  font-family: var(--font-primary, 'Pretendard Variable', sans-serif);
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: opacity 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.mobile-menu__cta-primary:active {
  opacity: 0.85;
}

/* 카카오 버튼 */
.mobile-menu__cta-kakao {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 16px;
  border-radius: var(--radius-full, 9999px);
  background: var(--color-kakao, #FEE500);
  color: var(--color-kakao-text, #191919);
  font-family: var(--font-primary, 'Pretendard Variable', sans-serif);
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: opacity 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.mobile-menu__cta-kakao:active {
  opacity: 0.85;
}

.mobile-menu__cta-kakao svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* 전화번호 */
.mobile-menu__phone {
  text-align: center;
  font-family: var(--font-primary, 'Pretendard Variable', sans-serif);
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  padding-top: 4px;
  display: block;
  letter-spacing: 0.5px;
}

.mobile-menu__phone:hover {
  color: rgba(255, 255, 255, 0.9);
}


/* ==========================================
   9. 반응형 (모바일 ≤ 768px)
   ========================================== */

@media (max-width: 768px) {
  .header {
    height: var(--header-height-mobile, 60px);
  }

  .header__inner {
    padding: 0 20px;
  }

  /* 네비, 액션 숨기기 */
  .header__nav,
  .header__actions {
    display: none;
  }

  /* 햄버거 표시 */
  .header__hamburger {
    display: flex;
    margin-left: auto;
  }

  /* 로고 모바일 크기 */
  .header__logo {
    height: 28px;
  }
  .logo__main {
    font-size: 19px;
  }
  .logo__sub {
    font-size: 10px;
  }
}

/* PC (≥ 769px): 모바일 메뉴 강제 숨김 */
@media (min-width: 769px) {
  .header__mobile-menu {
    display: none !important;
  }
  .header__hamburger {
    display: none !important;
  }
}


/* ==========================================
   10. 본문 상단 여백 보정 (헤더 고정 대응)
   ========================================== */

body {
  padding-top: 0; /* 히어로가 full-screen인 경우 0 유지 */
}

/* 히어로 없는 페이지용 */
.page-has-header-offset {
  padding-top: var(--header-height-pc, 72px);
}

@media (max-width: 768px) {
  .page-has-header-offset {
    padding-top: var(--header-height-mobile, 60px);
  }
}
