/* 공통 헤더가 켜진 페이지에서는 기존 Astra 헤더를 숨김 */
body.yjhd-on #masthead,
body.yjhd-on .ast-above-header-wrap,
body.yjhd-on .main-header-bar-wrap,
body.yjhd-on #ast-mobile-header { display: none !important; }

.yjhd-util, .yjhd-top, .yjhd-nav {
	--blue: #1f6bff;
	--ink: #1a1a1a;
	--sub: #6b7280;
	--line: #e5e7eb;
	--red: #e5333d;
	color: var(--ink);
	font-size: 15px;
	line-height: 1.5;
	letter-spacing: -0.01em;
}
.yjhd-util *, .yjhd-top *, .yjhd-nav *,
.yjhd-util *::before, .yjhd-top *::before, .yjhd-nav *::before { box-sizing: border-box; }
.yjhd-util a, .yjhd-top a, .yjhd-nav a { text-decoration: none; color: inherit; }
.yjhd-nav ul { list-style: none; margin: 0; padding: 0; }
.yjhd-in { max-width: 1240px; margin: 0 auto; padding: 0 20px; }

/* 1) 상단 링크줄 (스크롤 시 사라짐) */
.yjhd-util { border-bottom: 1px solid var(--line); background: #fafafa; }
.yjhd-util__in { display: flex; justify-content: flex-end; gap: 18px; padding-top: 7px; padding-bottom: 7px; font-size: 12.5px; color: var(--sub); }
.yjhd-util__in a:hover { color: var(--ink); }

/* 2) 로고 · 검색 · 아이콘 (스크롤 시 상단 고정) */
.yjhd-top { position: sticky; top: 0; z-index: 1000; background: #fff; border-bottom: 1px solid var(--line); transition: box-shadow .2s; }
.yjhd-top.is-stuck { box-shadow: 0 4px 16px rgba(0, 0, 0, .08); }
body.admin-bar .yjhd-top { top: 32px; }
@media (max-width: 782px) { body.admin-bar .yjhd-top { top: 46px; } }
.yjhd-top__in { display: flex; align-items: center; gap: 28px; padding-top: 16px; padding-bottom: 16px; }
.yjhd-logo { flex: none; }
.yjhd-logo img { display: block; height: 54px; width: auto; }
.yjhd-logo strong { font-size: 24px; color: var(--blue); }
.yjhd-search { position: relative; flex: 1; max-width: 640px; margin: 0 auto; }
.yjhd-search input[type="search"] {
	width: 100%; height: 50px; border: 2px solid var(--blue); border-radius: 999px;
	padding: 0 56px 0 24px; font-size: 15px; outline: none; background: #fff; color: var(--ink); box-shadow: none;
}
.yjhd-search button {
	position: absolute; right: 6px; top: 6px; width: 38px; height: 38px; border: 0; border-radius: 50%;
	background: var(--blue); color: #fff; display: grid; place-items: center; padding: 0; cursor: pointer;
}
.yjhd-icons { flex: none; display: flex; gap: 6px; }
.yjhd-icon { position: relative; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%; }
.yjhd-icon:hover { background: #f3f4f6; }
.yjhd-cartcount {
	position: absolute; top: 2px; right: 0; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px;
	background: var(--red); color: #fff; font-size: 11px; line-height: 19px; text-align: center; font-weight: 700;
}

/* 3) 카테고리 메뉴 (스크롤 시 사라짐) */
.yjhd-nav { position: relative; z-index: 900; background: #fff; border-bottom: 1px solid var(--line); }
.yjhd-nav__in { display: flex; align-items: center; gap: 8px; }
.yjhd-allcat { position: relative; }
.yjhd-allcat__btn { width: 46px; height: 50px; border: 0; background: none; display: grid; place-items: center; color: var(--ink); cursor: pointer; padding: 0; }
.yjhd-allcat__panel {
	position: absolute; left: 0; top: 50px; z-index: 950; min-width: 220px; background: #fff;
	border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 30px rgba(0, 0, 0, .12); padding: 8px;
}
.yjhd-allcat__panel[hidden] { display: none; }
.yjhd-allcat__panel a { display: flex; justify-content: space-between; padding: 11px 14px; border-radius: 8px; }
.yjhd-allcat__panel a:hover { background: #f3f6ff; color: var(--blue); }
.yjhd-allcat__panel em { font-style: normal; color: var(--sub); font-size: 13px; }
.yjhd-menu { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.yjhd-menu::-webkit-scrollbar { display: none; }
.yjhd-menu a { display: block; padding: 14px 16px; white-space: nowrap; font-size: 15.5px; }
.yjhd-menu a.yjhd-menu__hl { font-weight: 700; color: var(--blue); }
.yjhd-menu a:hover { color: var(--blue); }
.yjhd-menu li.is-current a { color: var(--blue); font-weight: 700; box-shadow: inset 0 -3px 0 var(--blue); }

@media (max-width: 720px) {
	.yjhd-util__in { justify-content: center; gap: 14px; }
	.yjhd-top__in { flex-wrap: wrap; gap: 8px 12px; padding-top: 10px; padding-bottom: 10px; }
	.yjhd-logo img { height: 38px; }
	.yjhd-search { order: 3; flex: 1 0 100%; max-width: none; }
	.yjhd-search input[type="search"] { height: 44px; }
	.yjhd-search button { top: 5px; width: 34px; height: 34px; }
	.yjhd-icons { margin-left: auto; }
	.yjhd-icon { width: 42px; height: 42px; }
}


/* 상품 페이지의 Astra "장바구니 고정 바"가 공통 헤더를 덮지 않도록: 데스크톱은 헤더 바로 아래, 모바일은 화면 하단 */
body.yjhd-on .ast-sticky-add-to-cart.top.is-active { top: var(--yjhd-top-h, 0px) !important; z-index: 990; }
body.yjhd-on.admin-bar .ast-sticky-add-to-cart.top.is-active { top: calc(var(--yjhd-top-h, 0px) + 32px) !important; }
@media (max-width: 720px) {
	body.yjhd-on .ast-sticky-add-to-cart.top.is-active,
	body.yjhd-on.admin-bar .ast-sticky-add-to-cart.top.is-active {
		top: auto !important; bottom: 0; box-shadow: 0 -4px 16px rgba(0, 0, 0, .1);
	}
}
