/**
 * COM_head_3line — 라인1/라인2 전용 스타일
 * 라인3은 기존 head.php의 <header> 마크업 그대로 사용 → 영향 없음
 *
 * 모든 셀렉터 .head3_root 또는 .head3_line 프리픽스 사용 → 다른 스킨 영향 0
 */

.head3_root {
    width: 100%;
    position: relative;
    z-index: 9999;
    box-sizing: border-box;
    background-color: var(--h3-line2-bg, transparent);
}
/* 디버깅: 라인이 살아있는지 시각적 확인용 (컬러 안 정해도 보이게 최소 배경) */
.head3_root .head3_line1:not([data-bg-set]) {
    background-color: var(--h3-line1-bg, #f5f5f5);
}
.head3_root .head3_line2:not([data-bg-set]) {
    background-color: var(--h3-line2-bg, #ffffff);
}

/* 라인 공통 */
.head3_root .head3_line {
    width: 100%;
    box-sizing: border-box;
    position: relative;
}
/* ★ 라인1·2 사이 구분선 (라인1 하단) */
.head3_root .head3_line1 {
    border-bottom: var(--h3-divider-h, 0px) solid var(--h3-divider, transparent);
}
/* ★ 라인2 하단 구분선 (라인2 → 라인3 경계) */
.head3_root .head3_line2 {
    border-bottom: var(--h3-divider-h, 0px) solid var(--h3-divider, transparent);
}
/* divider 변수가 없을 때(빈값일 때) 출력 안 함 */
.head3_root[data-h3-divider="0"] .head3_line1,
.head3_root[data-h3-divider="0"] .head3_line2 {
    border-bottom: 0;
}
.head3_root .head3_inner {
    width: 100%;
    height: 100%;
    box-sizing: border-box;
}

/* 라인1 */
.head3_root .head3_line1 {
    height: var(--h3-line1-h, 40px);
    background-color: var(--h3-line1-bg, transparent);
}
.head3_root .head3_line1 .h3_l1_grid {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.head3_root .head3_line1 .h3_l1_left {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}
.head3_root .head3_line1 .h3_l1_right {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

/* 외부 로고 */
.head3_root .h3_extlogo {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    text-decoration: none;
}
.head3_root .h3_extlogo img {
    max-height: calc(var(--h3-line1-h, 40px) * 0.6);
    width: auto;
    display: block;
}

/* 공지 슬롯 */
.head3_root .h3_notice_slot {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    line-height: 1;
}
.head3_root .h3_notice_label {
    font-size: 12px;
    font-weight: 700;
    padding: 4px 8px;
    background-color: rgba(0,0,0,0.06);
    border-radius: 4px;
    flex-shrink: 0;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    height: 22px;
}
/* ★ 아이콘 모드 라벨 — 배경/패딩 제거, 아이콘만 표시 */
.head3_root .h3_notice_label_icon {
    background: transparent;
    padding: 0;
    border-radius: 0;
    height: 22px;
    width: auto;
}
.head3_root .h3_notice_label_icon img {
    height: 18px;
    width: auto;
    display: block;
}
.head3_root .h3_notice_list {
    list-style: none;
    margin: 0;
    padding: 0;
    position: relative;
    height: 22px;
    overflow: hidden;
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
    display: flex;
    align-items: center;
}
.head3_root .h3_notice_list li {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.4s ease, transform 0.4s ease;
    pointer-events: none;
}
.head3_root .h3_notice_list li.is-on {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
.head3_root .h3_notice_list a {
    display: inline-flex;
    align-items: center;
    font-size: var(--h3-notice-fs, 13px);
    color: inherit;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    line-height: 1;
    height: 100%;
}

/* 우측 메뉴 (preset_a) */
.head3_root .h3_rmenu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 16px;
}
.head3_root .h3_rmenu li a {
    font-size: var(--h3-rmenu-fs, 13px);
    color: inherit;
    text-decoration: none;
    line-height: 1.2;
}
.head3_root .h3_rmenu li a:hover {
    text-decoration: underline;
}

/* 자유 슬롯 (free 모드) */
.head3_root .h3_free_slot {
    min-width: 0;
}
.head3_root .h3_free_slot:empty {
    display: none;
}

/* 글로벌 슬롯 */
.head3_root .h3_global_slot {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

/* 라인2 */
.head3_root .head3_line2 {
    height: var(--h3-line2-h, 80px);
    background-color: var(--h3-line2-bg, transparent);
}
.head3_root .head3_line2 .h3_l2_grid {
    width: 100%;
    height: 100%;
    display: grid;
    align-items: center;
    gap: 16px;
}
.head3_root .head3_line2 .h3_l2_grid[data-logo-align="left"] {
    grid-template-columns: auto 1fr;
}
.head3_root .head3_line2 .h3_l2_grid[data-logo-align="center"] {
    grid-template-columns: 1fr auto 1fr;
}
.head3_root .head3_line2 .h3_l2_slot {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}
.head3_root .head3_line2 .h3_l2_right {
    justify-content: flex-end;
}
.head3_root .head3_line2 .h3_l2_center {
    justify-content: center;
}

.head3_root .h3_logo {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
}
.head3_root .h3_logo img {
    max-height: calc(var(--h3-line2-h, 80px) * 0.6);
    width: auto;
    display: block;
}
.head3_root .h3_logo .h3_logo_mo { display: none; }
@media (max-width: 767px) {
    .head3_root .h3_logo .h3_logo_pc { display: none; }
    .head3_root .h3_logo .h3_logo_mo { display: block; }
}

.head3_root .h3_l2_widget {
    flex-shrink: 0;
}

/* ========================================
   모바일 — 라인1 숨김, 라인2만 표시
   라인1 콘텐츠는 햄버거 패널로 흡수 (별도 처리)
   ======================================== */
@media (max-width: 767px) {
    .head3_root .head3_line1 {
        display: none;
        height: var(--h3-line1-h-mo, 0);
    }
    .head3_root .head3_line2 {
        height: var(--h3-line2-h-mo, var(--h3-line2-h, 60px));
    }
    .head3_root .head3_line2 .h3_l2_grid {
        grid-template-columns: 1fr !important;
    }
    .head3_root .head3_line2 .h3_l2_slot {
        gap: 10px;
    }
}
