/* 자체 헤더(세로형 메뉴, 2026-11-27) — 마크업 templates/parts/site-header.php · 켜는 곳 kdg-core inc/header.php(body.kdg-sh-on).
   ≥1280px = 왼쪽 고정 세로 메뉴(폭 232px, body 왼쪽을 비운다) · <1280px = 위쪽 띠(스크롤 시 화면 위에 붙음) + 왼쪽 서랍.
   폭 232 · 기준 1280 을 바꾸면 kdg-core header.php 의 KDG_HEADER_W · KDG_HEADER_BP(= --kdg-vw 정의)도 같이 바꿀 것.
   ⚠ 이 파일엔 container-type 을 쓰지 않는다 — 고정(fixed) 요소의 기준이 바뀌어 팝업 · 모바일 구매바가 깨진다. */

.kdg-sh {
	--sh-w: 232px;
	--sh-bg: #0f0f0f;
	--sh-line: #2c2c2a;
	--sh-fg: #ecebe7;
	--sh-muted: #9a9890;
	--sh-y: #ffd75b;
	--sh-ink: #121212;
	--sh-red: #e2342b;
	font-family: "Inter", "Noto Sans KR", sans-serif;
	-webkit-font-smoothing: antialiased;
}
.kdg-sh *, .kdg-sh *::before, .kdg-sh *::after { box-sizing: border-box; }
.kdg-sh a { text-decoration: none; }
.kdg-sh a:focus-visible, .kdg-sh button:focus-visible { outline: 2px solid var(--sh-y); outline-offset: 2px; }
.kdg-sh-home { display: inline-flex; align-items: center; line-height: 0; }
.kdg-sh-logo { display: block; width: 140px; height: auto; }
.kdg-sh-logo-txt { width: auto; color: var(--sh-fg); font-weight: 800; font-size: 18px; line-height: 1.2; }

/* 서랍 · 세로 메뉴 공용 판 */
.kdg-sh-panel { display: flex; flex-direction: column; gap: 14px; background: var(--sh-bg); color: var(--sh-fg); }
.kdg-sh-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.kdg-sh-menu { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.kdg-sh-menu li { margin: 0; padding: 0; }
.kdg-sh-menu a { display: block; padding: 8px 12px; border-radius: 8px; color: var(--sh-fg); font-weight: 700; font-size: 15px; line-height: 1.4; letter-spacing: -.005em; transition: background-color .15s, color .15s; }
.kdg-sh-menu a:hover { background: rgba(255,255,255,.06); color: #fff; }
.kdg-sh-menu a.is-on, .kdg-sh-menu a.is-on:hover { background: var(--sh-y); color: var(--sh-ink); }
.kdg-sh-new { display: inline-block; margin-left: 6px; vertical-align: 2px; background: var(--sh-red); color: #fff; font-family: "Noto Sans KR", sans-serif; font-size: 9px; font-weight: 700; letter-spacing: .04em; line-height: 1; padding: 3px 5px 2px; border-radius: 9px; animation: kdgShNew 2.4s ease-in-out infinite; }
@keyframes kdgShNew { 0%, 100% { opacity: 1 } 50% { opacity: .45 } }

/* 섹션(2026-11-27): 소제목 = 작은 흐린 글씨 + 오른쪽으로 이어지는 반투명 선 · 섹션 끝에도 같은 선 한 줄. 소제목 = WP 메뉴의 맨 윗단 항목(자식이 있는 것) */
.kdg-sh-nav { display: flex; flex-direction: column; }
.kdg-sh-sec-h { display: flex; align-items: center; gap: 10px; margin: 28px 0 8px; padding: 0 0 0 12px; font-family: "Inter", "Noto Sans KR", sans-serif; font-size: 12px; font-weight: 700; line-height: 1.3; letter-spacing: .12em; text-transform: uppercase; color: var(--sh-muted); } /* 영문 소제목(SERVICE · STUDIO, 2026-11-27) */
.kdg-sh-sec-h::after { content: ""; flex: 1; height: 1px; background: rgba(236,235,231,.14); }
.kdg-sh-sec:first-child .kdg-sh-sec-h { margin-top: 10px; }
.kdg-sh-sec.has-title::after { content: ""; display: block; height: 1px; margin: 12px 0 0; background: rgba(236,235,231,.14); }
.kdg-sh-menu a.kdg-sh-machine { display: flex; margin-top: 6px; padding: 10px 15px; border-radius: 99px; font-weight: 800; font-size: 14px; }
.kdg-sh-menu a.kdg-sh-machine:hover { background: var(--sh-y); filter: brightness(1.06); }
.kdg-sh-acct.is-foot { flex-direction: column; gap: 6px; }
.kdg-sh-acct.is-foot .kdg-sh-acct-main { flex: none; padding: 9px 0; font-size: 14px; color: var(--sh-fg); }
.kdg-sh-acct.is-foot a.is-on { color: var(--sh-y); border-color: var(--sh-y); }
.kdg-sh-acct.is-foot .kdg-sh-logout { flex: none; align-self: center; border: 0; padding: 2px 8px; }
.kdg-sh-logout { align-self: flex-start; padding: 2px 12px; font-size: 12px; font-weight: 500; color: #6f6d66; transition: color .15s; }
.kdg-sh-logout:hover { color: var(--sh-fg); }

.kdg-sh-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding-top: 8px; }
.kdg-sh-machine { display: inline-flex; align-items: center; justify-content: center; gap: 7px; background: var(--sh-y); color: var(--sh-ink) !important; font-weight: 800; font-size: 14px; line-height: 1.2; padding: 10px 15px; border-radius: 99px; white-space: nowrap; transition: filter .15s; }
.kdg-sh-machine::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--sh-ink); flex: none; }
.kdg-sh-machine small { font-size: 11px; font-weight: 700; opacity: .7; }
.kdg-sh-machine:hover { filter: brightness(1.06); }
.kdg-sh-acct { display: flex; gap: 8px; }
.kdg-sh-acct a { flex: 1; text-align: center; border: 1px solid var(--sh-line); border-radius: 8px; padding: 8px 0; font-size: 13px; font-weight: 700; line-height: 1.3; color: var(--sh-muted); transition: color .15s, border-color .15s; }
.kdg-sh-acct a:hover { color: var(--sh-fg); border-color: #4a4945; }
.kdg-sh-acct a.is-on { color: var(--sh-y); border-color: var(--sh-y); }

.kdg-sh-burger, .kdg-sh-x { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin: 0 -10px 0 0; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--sh-fg); cursor: pointer; }
.kdg-sh-burger span { display: block; width: 22px; height: 16px; background: linear-gradient(currentColor 0 0) top / 100% 2px no-repeat, linear-gradient(currentColor 0 0) center / 100% 2px no-repeat, linear-gradient(currentColor 0 0) bottom / 100% 2px no-repeat; }
.kdg-sh-x span { position: relative; display: block; width: 20px; height: 20px; }
.kdg-sh-x span::before, .kdg-sh-x span::after { content: ""; position: absolute; left: 0; top: 9px; width: 20px; height: 2px; background: currentColor; transform: rotate(45deg); }
.kdg-sh-x span::after { transform: rotate(-45deg); }

/* ───── ≥1280 : 왼쪽 고정 세로 메뉴 ───── */
@media (min-width: 1280px) {
	body.kdg-sh-on { padding-left: 232px; }
	.kdg-sh-bar, .kdg-sh-dim, .kdg-sh-x { display: none !important; }
	.kdg-sh-panel { position: fixed; z-index: 9990; top: var(--wp-admin--admin-bar--height, 0px); left: 0; bottom: 0; width: var(--sh-w); padding: 22px 22px 20px; border-right: 1px solid var(--sh-line); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #2c2c2a transparent; }
	.kdg-sh-top .kdg-sh-logo { width: 140px; }
	.kdg-sh-top { margin: 0 0 6px 4px; }
	/* /shop(Avada 상점 목록, noindex) — 행의 음수 여백이 메뉴 쪽으로 밀려 들어가는 것만 막는다 */
	body.kdg-sh-on.woocommerce-shop #main { overflow-x: clip; }
}

/* ───── <1280 : 위쪽 띠 + 서랍 ───── */
@media (max-width: 1279.98px) {
	.kdg-sh { position: sticky; top: 0; z-index: 9990; }
	.kdg-sh-bar { height: 64px; display: flex; align-items: center; gap: 10px; padding: 0 16px; background: transparent; transition: height .25s, background-color .25s, box-shadow .25s; }
	.kdg-sh.is-scrolled .kdg-sh-bar { height: 54px; background: rgba(18,18,18,.96); box-shadow: 0 1px 0 var(--sh-line); }
	.kdg-sh-bar .kdg-sh-home { margin-right: auto; }
	.kdg-sh-bar .kdg-sh-logo { width: auto; height: 40px; transition: height .25s; }
	.kdg-sh.is-scrolled .kdg-sh-bar .kdg-sh-logo { height: 32px; }
	.kdg-sh-machine.is-sm { font-size: 12px; padding: 6px 11px; gap: 6px; }
	.kdg-sh-machine.is-sm::before { width: 5px; height: 5px; }

	.kdg-sh-dim { position: fixed; inset: 0; z-index: 100000; background: rgba(0,0,0,.6); }
	.kdg-sh-dim[hidden] { display: none; }
	.kdg-sh-panel { position: fixed; z-index: 100001; top: 0; left: 0; bottom: 0; width: min(78%, 320px); padding: 16px 16px 20px; overflow-y: auto; overscroll-behavior: contain; border-right: 1px solid var(--sh-line); transform: translateX(-100%); visibility: hidden; transition: transform .28s ease, visibility 0s linear .28s; }
	.kdg-sh.is-open .kdg-sh-panel { transform: none; visibility: visible; transition: transform .28s ease, visibility 0s; }
	.kdg-sh-top .kdg-sh-logo { width: 120px; }
	.kdg-sh-menu a { padding: 10px 12px; }
	/* 스크롤 잠금은 body 에만 — html 에 걸면 body 가 따로 스크롤 상자가 되어 위쪽 띠의 sticky 가 풀린다(검수에서 확인) */
	html.kdg-sh-lock body { overflow: hidden !important; }
}
@media (min-width: 768px) and (max-width: 1279.98px) {
	.kdg-sh-bar { padding: 0 28px; }
}
/* 관리자 막대(로그인한 관리자만) — 600px 이하에선 막대가 같이 스크롤되므로 띠는 맨 위에 붙인다 */
@media (min-width: 601px) and (max-width: 1279.98px) {
	body.admin-bar .kdg-sh { top: var(--wp-admin--admin-bar--height, 0px); }
}

/* [단고머신] 이동 중 덮개(header.js 가 누르는 순간 붙인다) */
.kdg-sh-busy { position: fixed; inset: 0; z-index: 100010; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgba(10,10,10,.92); font-family: "Noto Sans KR", sans-serif; animation: kdgShBusyIn .15s ease-out; }
.kdg-sh-busy-in { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
/* 회전 표시 = 김단고 얼굴 그림(assets/machine-face.webp, 176×155 투명) — 2026-11-27 노란 고리 대신 */
.kdg-sh-face { display: block; width: 88px; height: 88px; object-fit: contain; animation: kdgShSpin 1.5s linear infinite; will-change: transform; }
@media (max-width: 1279.98px) { .kdg-sh-face { width: 72px; height: 72px; } }
/* 얼굴 아래 진행 막대(2026-11-28 시안) — header.js 가 다음 프레임에 is-go(4초 동안 90%까지 점점 느리게) · 떠날 때 is-done(100%) */
.kdg-sh-prog { display: block; width: 200px; height: 4px; overflow: hidden; border-radius: 2px; background: rgba(255,215,91,.18); }
.kdg-sh-prog-fill { display: block; width: 100%; height: 100%; border-radius: inherit; background: #ffd75b; transform: scaleX(0); transform-origin: left center; }
.kdg-sh-prog.is-go .kdg-sh-prog-fill { transform: scaleX(.9); transition: transform 4s cubic-bezier(.08,.6,.25,1); }
.kdg-sh-prog.is-done .kdg-sh-prog-fill { transform: scaleX(1); transition: transform .2s ease-out; }
@media (max-width: 767.98px) { .kdg-sh-prog { width: 160px; } }
.kdg-sh-busy-t { margin: 0; word-break: keep-all; color: #ecebe7; font-size: 16px; font-weight: 700; line-height: 1.5; }
.kdg-sh-busy-slow { margin: 0; max-width: 320px; word-break: keep-all; text-wrap: balance; color: #9a9890; font-size: 13px; line-height: 1.6; }
.kdg-sh-busy-slow[hidden] { display: none; }
@keyframes kdgShSpin { to { transform: rotate(360deg); } }
@keyframes kdgShBusyIn { from { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
	.kdg-sh-new { animation: none; }
	.kdg-sh-face { animation: none; }
	.kdg-sh-busy { animation: none; }
	.kdg-sh-bar, .kdg-sh-bar .kdg-sh-logo, .kdg-sh-panel, .kdg-sh.is-open .kdg-sh-panel { transition: none; }
}
@media print {
	.kdg-sh { display: none !important; }
	body.kdg-sh-on { padding-left: 0 !important; }
}
