/* ============================================================
   SOMAKO PHP HEADER
   ============================================================ */

/* 기존 FSE 헤더 숨기기 */
header.wp-block-template-part { display: none !important; height: 0 !important; overflow: hidden !important; margin: 0 !important; padding: 0 !important; line-height: 0 !important; font-size: 0 !important; border: none !important; box-shadow: none !important; }
/* FSE 빈 헤더 래퍼 제거 */
.wp-block-template-part:empty { display: none !important; }
/* 헤더 바로 아래 중복 border 방지 */
.somako-header + * { border-top: none !important; }

/* ── 헤더 컨테이너 ── */
.somako-header {
    position: sticky;
    top: 0;
    z-index: 9999;
    background: #fff;
    font-family: 'Pretendard Variable', 'Noto Sans KR', -apple-system, sans-serif;
}
.somako-header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    border-bottom: 1px solid #e4e4e7;
}
.somako-header-flex {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 3.5rem;
}

/* ── 로고 ── */
.somako-logo { display: flex; align-items: center; flex-shrink: 0; }
.somako-logo img { width: 120px; height: auto; display: block; }

/* ── PC 네비게이션 ── */
.somako-nav-pc { display: flex; align-items: center; }
.somako-nav-list {
    list-style: none;
    margin: 0; padding: 0;
    display: flex;
    gap: 1.5rem;
}
.somako-nav-item { position: relative; }
.somako-nav-item > a,
.somako-nav-item > span {
    font-size: 0.875rem;
    font-weight: 500;
    color: #52525b;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.15s;
    padding: 0.5rem 0;
    display: block;
}
.somako-nav-item > a:hover,
.somako-nav-item > span:hover { color: #09090b; }

/* 서브메뉴 (PC) */
.somako-submenu {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    border: 1px solid #e4e4e7;
    border-radius: 0.5rem;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    list-style: none;
    margin: 0.25rem 0 0;
    padding: 0.5rem 0;
    min-width: 140px;
    z-index: 100;
}
.somako-nav-item:hover .somako-submenu { display: block; }
.somako-submenu li a {
    display: block;
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
    color: #52525b;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.15s;
}
.somako-submenu li a:hover {
    background: #f4f4f5;
    color: #09090b;
}

/* ── 우측 버튼 ── */
.somako-header-right {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
.somako-search-btn,
.somako-mobile-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: #52525b;
    padding: 0.375rem;
    border-radius: 0.375rem;
    display: flex;
    align-items: center;
    transition: all 0.15s;
}
.somako-search-btn:hover,
.somako-mobile-toggle:hover {
    color: #09090b;
    background: #f4f4f5;
}

/* PC에서 햄버거 숨기기 */
.somako-mobile-toggle { display: none; }

/* ── 검색 오버레이 ── */
.somako-search-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 10000;
    justify-content: center;
    padding-top: 8rem;
}
.somako-search-overlay.active { display: flex; }
.somako-search-box {
    background: #fff;
    border-radius: 1rem;
    width: 90%;
    max-width: 600px;
    height: fit-content;
    padding: 1.5rem;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}
.somako-search-input-wrap {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 2px solid #09090b;
    padding-bottom: 0.75rem;
}
.somako-search-input-wrap svg { color: #a1a1aa; flex-shrink: 0; }
.somako-search-input {
    border: none;
    outline: none;
    font-size: 1.125rem;
    font-family: inherit;
    width: 100%;
    color: #09090b;
    background: transparent;
}
.somako-search-input::placeholder { color: #d4d4d8; }
.somako-search-close {
    background: none; border: none; cursor: pointer;
    color: #a1a1aa; padding: 0.25rem; display: flex;
}
.somako-search-close:hover { color: #09090b; }
.somako-search-hint {
    margin-top: 0.75rem;
    font-size: 0.75rem;
    color: #a1a1aa;
}

/* ── 모바일 메뉴 오버레이 ── */
.somako-mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: #fff;
    z-index: 10000;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex-direction: column;
}
.somako-mobile-overlay.active {
    display: flex;
}
.somako-mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e4e4e7;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 10;
    flex-shrink: 0;
}
.somako-mobile-header .somako-logo img { width: 100px; }
.somako-mobile-close {
    background: none; border: none; cursor: pointer;
    color: #52525b; padding: 0.375rem; display: flex;
}

/* 모바일 네비 */
.somako-mobile-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 0 3rem;
}
.somako-mobile-list {
    list-style: none;
    margin: 0; padding: 0;
}
.somako-mobile-item { border-bottom: 1px solid #f4f4f5; }
.somako-mobile-parent {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    font-size: 1rem;
    font-weight: 600;
    color: #09090b;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
}
.somako-mobile-parent svg {
    transition: transform 0.2s;
    flex-shrink: 0;
}
.somako-mobile-parent.open svg {
    transform: rotate(180deg);
}
.somako-mobile-sub {
    display: none;
    list-style: none;
    margin: 0;
    padding: 0 0 0.5rem 0;
    background: #fafafa;
}
.somako-mobile-sub.open { display: block; }
.somako-mobile-sub li a {
    display: block;
    padding: 0.75rem 1.25rem 0.75rem 2rem;
    font-size: 0.9375rem;
    color: #52525b;
    text-decoration: none;
}
.somako-mobile-sub li a:hover { color: #09090b; }

/* body 스크롤 잠금 */
body.somako-menu-open,
body.somako-search-open {
    overflow: hidden !important;
}

/* ── 반응형 ── */
@media (max-width: 768px) {
    .somako-header-inner { padding: 0 1rem; }
    .somako-header-flex { height: 3rem; }
    .somako-logo img { width: 100px; }
    .somako-nav-pc { display: none; }
    .somako-mobile-toggle { display: flex; }
    .somako-search-overlay { padding-top: 4rem; }
}

/* admin bar 보정 */
.admin-bar .somako-header { top: 32px; }
@media (max-width: 782px) {
    .admin-bar .somako-header { top: 46px; }
}
