/* Global Responsive Header — PC(수평메뉴+햄버거) & 모바일(햄버거전용) 통합 */
:root {
    --global-header-height: 100px;
}

html {
    scrollbar-gutter: stable;
}
@media (max-width: 1024px) {
    html {
        scrollbar-gutter: auto;
    }
}

body.no-scroll {
    overflow: hidden;
    touch-action: none;
}

#header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--global-header-height);
    min-height: var(--global-header-height);
    max-height: var(--global-header-height);
    padding: 0 3%;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    z-index: 1000003;
    transition: background 0.3s ease, border-color 0.3s ease, backdrop-filter 0.3s ease;
    background: #ffffff !important;
    border-bottom: 1px solid #eee;
    font-family: 'Inter', sans-serif;
    box-sizing: border-box;
    overflow: visible;
    -webkit-font-smoothing: antialiased;
    text-rendering: geometricPrecision;
}

#header.scrolled {
    background: rgba(255, 255, 255, 0.9) !important;
    backdrop-filter: blur(10px);
}

#header .header-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    background: transparent !important;
    z-index: 10002;
    flex-shrink: 0;
}

#header .header-logo img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    display: block;
}

#header .logo-text {
    color: #000000 !important;
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: 700;
    font-size: 1.60rem;
    letter-spacing: 0;
    margin-left: 10px;
    white-space: nowrap;
    transition: color 0.25s ease;
}

/* 햄버거 메뉴 활성(오버레이 표시) 시 로고 텍스트 흰색 */
body.no-scroll #header .logo-text {
    color: #ffffff !important;
}

/* === 기본 PC 수평 네비게이션 (복구) === */
#main-nav {
    flex: 0 1 auto;
    margin-left: auto;
    display: flex;
    align-items: center;
}

#main-nav ul {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: clamp(20px, 2.5vw, 40px);
}

#main-nav ul li a {
    color: #000000 !important;
    text-transform: uppercase;
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 0.1em;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.3s ease;
}

#main-nav ul li a:hover {
    color: #F85A03 !important;
}

/* === Request 스타일 버튼 (복구) === */
#main-nav ul li a.nav-request-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 18px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: #000;
    color: #fff !important;
    position: relative;
    overflow: hidden;
    transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

#main-nav ul li a.nav-request-btn .nav-request-canvas-wrap {
    position: absolute;
    inset: -3px;
    z-index: 0;
    opacity: 0;
    border-radius: inherit;
    overflow: hidden;
    pointer-events: none;
    transition: opacity 0.28s ease;
}

#main-nav ul li a.nav-request-btn .nav-request-canvas {
    display: block;
    width: 100%;
    height: 100%;
}

#main-nav ul li a.nav-request-btn .nav-request-label {
    position: relative;
    z-index: 1;
    pointer-events: none;
    font-size: inherit;
    font-weight: inherit;
    letter-spacing: inherit;
}

#main-nav ul li a.nav-request-btn:hover {
    background: #000;
    border-color: transparent;
    color: #fff !important;
}

#main-nav ul li a.nav-request-btn:hover .nav-request-canvas-wrap,
#main-nav ul li a.nav-request-btn:focus-visible .nav-request-canvas-wrap,
#main-nav ul li a.nav-request-btn.is-nav-effect-active .nav-request-canvas-wrap {
    opacity: 1;
}

/* === 공통 햄버거 토글 버튼 (PC/모바일 공통 항상 노출) === */
#header .nav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 10001;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: transparent;
    transition: background 0.3s ease;
    margin-left: 30px; /* PC 수평메뉴 우측에 배치 */
}

#header .nav-toggle:hover {
    background: #f5f5f5;
}

#header .nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: #000000 !important;
    margin: 4px 0;
    transition: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* 메뉴 열렸을 때 햄버거 버튼 흰색으로 (검정 배경 대비) */
#header .nav-toggle.active span {
    background: #ffffff !important;
}

/* 메뉴 열렸을 때 닫기 버튼은 오른쪽 끝에 고정 (main-nav가 fixed로 빠져 위치가 당겨지는 현상 방지) */
#header .nav-toggle.active {
    position: absolute;
    right: 3%;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 0;
    z-index: 10002;
}
@media (max-width: 768px) {
    #header .nav-toggle.active {
        right: 5%;
    }
}

#header .nav-toggle:hover span {
    background: #F85A03 !important;
}

/* 햄버거 애니메이션 활성화 */
.nav-toggle.active span:nth-child(1) { transform: translateY(10px) rotate(45deg); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: translateY(-10px) rotate(-45deg); }

/* === 풀스크린 오버레이 네비게이션 (햄버거 클릭 시 나타남) === */
#main-nav.active {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100vh;
    background: #0a0a0a;
    display: flex !important;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

#main-nav.active ul {
    flex-direction: column !important;
    gap: 30px !important;
    text-align: center;
}

/* 오버레이 메뉴 내의 모든 링크 스타일 통일 (흰색 텍스트) */
#main-nav.active ul li a {
    color: #ffffff !important;
    font-size: 2.2rem !important;
    background: transparent !important; /* Request 배경 제거 */
    padding: 0 !important;             /* Request 패딩 제거 */
    border: none !important;            /* Request 테두리 제거 */
    min-height: 0 !important;           /* Request 높이 초기화 */
}

/* 오버레이 메뉴 내에서는 Request 효과(캔버스) 비활성화 */
#main-nav.active ul li a.nav-request-btn .nav-request-canvas-wrap {
    display: none !important;
}

#main-nav.active ul li a.nav-request-btn .nav-request-label {
    position: static;
    color: #ffffff !important;
}

/* === 모바일(≤768px) 최적화 === */
@media (max-width: 768px) {
    :root {
        --global-header-height: 72px;
    }
    #header {
        padding: 0 5%;
        justify-content: space-between;
    }
    #header .header-logo img {
        width: 42px;
        height: 42px;
    }
    #header .logo-text {
        font-size: 1.15rem;
        margin-left: 8px;
    }

    /* 모바일 기본 main-nav 숨김 (햄버거 누르기 전) */
    #main-nav {
        display: none;
        right: -100%;
        transition: 0.5s cubic-bezier(0.77, 0, 0.175, 1);
    }
    #main-nav.active {
        display: flex !important;
        right: 0;
    }

    #main-nav.active ul {
        gap: 20px !important;
    }
    #main-nav.active ul li a {
        font-size: 1.6rem !important;
    }

    #header .nav-toggle {
        width: 40px;
        height: 40px;
        margin-left: 0;
    }
    #header .nav-toggle span {
        width: 20px;
        margin: 3px 0;
    }
    /* 모바일 햄버거→X 변환: span outer-height 8px 기준 (PC 기본값 10px과 다름) */
    .nav-toggle.active span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    .nav-toggle.active span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
}

@media (max-width: 420px) {
    #header .logo-text {
        font-size: 1rem;
    }
    #header .header-logo img {
        width: 36px;
        height: 36px;
    }
}
