/* ============================================================
   HANCOT 1행 헤더 전용 CSS
   위치: static/css/hancot_header.css
   - PC: 좌측 QR/브랜드, 가운데 메뉴, 우측 도구
   - 모바일: 브랜드/도구 1행 + 메뉴 가로 스크롤
   - 기존 domain-header 스타일과 충돌할 경우 이 파일을 나중에 로드
   ============================================================ */
.hc-site-header { width:100%; background:#fff; border-bottom:1px solid #e2e8f0; }
.hc-site-header .hc-header-inner { width:100%; max-width:1920px; margin:0 auto; padding:8px 16px; display:grid; grid-template-columns:minmax(180px,1fr) minmax(0,auto) minmax(260px,1fr); align-items:center; gap:14px; }
/* 01. QR·로고: QR 크기 변경은 width/height 조정 */
.hc-header-brand,.hc-header-brand-link,.hc-header-tools,.hc-header-language {display:flex;align-items:center;}
.hc-header-brand {gap:10px;min-width:0;}
.hc-header-qr {width:48px;height:48px;object-fit:contain;display:block;}
.hc-header-brand-link {gap:8px;min-width:0;text-decoration:none;color:inherit;}
.hc-header-brand-text {display:flex;flex-direction:column;min-width:0;}
.hc-header-brand-text .brand-name {font-weight:750;font-size:1.15rem;line-height:1.3;}
.hc-header-brand-text .brand-sub {font-size:.68rem;color:#64748b;white-space:nowrap;}
/* 02. 중앙 하이브리드 메뉴: 현재 페이지에 aria-current=page 적용 */
.hc-header-nav {display:flex;align-items:center;justify-content:center;gap:3px;white-space:nowrap;min-width:0;}
.hc-header-link {display:inline-flex;align-items:center;gap:5px;min-height:36px;padding:7px 10px;border-radius:8px;color:#334155;text-decoration:none;font-size:.89rem;font-weight:600;}
.hc-header-link:hover {background:#f1f5f9;color:#1d4ed8;}
.hc-header-link[aria-current="page"],.hc-header-link.is-active {background:#eff6ff;color:#1d4ed8;}
.hc-header-count {min-width:18px;height:18px;border-radius:999px;background:#dc2626;color:#fff;font-size:10px;display:inline-flex;align-items:center;justify-content:center;padding:0 4px;}
/* 03. 국가·언어·설정·계정 */
.hc-header-tools {justify-content:flex-end;gap:10px;white-space:nowrap;}
.hc-header-country {font-size:.8rem;color:#475569;}
.hc-header-language {gap:5px;}
.hc-header-language select {border:1px solid #cbd5e1;border-radius:7px;background:#fff;padding:6px;font-size:.83rem;max-width:100px;}
.hc-header-settings {border:1px solid #e2e8f0;background:#fff;border-radius:8px;padding:7px 9px;display:inline-flex;align-items:center;gap:5px;color:#334155;cursor:pointer;}
.hc-header-account {position:relative;}
.hc-header-account summary {list-style:none;cursor:pointer;display:flex;align-items:center;gap:5px;padding:7px;}
.hc-header-account summary::-webkit-details-marker {display:none;}
.hc-header-account-menu {position:absolute;right:0;top:100%;z-index:1000;min-width:170px;padding:7px;background:#fff;border:1px solid #e2e8f0;border-radius:10px;box-shadow:0 8px 24px #0f172a1a;}
.hc-header-account-menu a,.hc-header-account-menu button {display:block;width:100%;padding:9px 10px;border:0;background:none;text-align:left;color:#334155;text-decoration:none;cursor:pointer;}
.hc-header-account-menu a:hover,.hc-header-account-menu button:hover {background:#f1f5f9;}
/* 04. 좁은 PC/태블릿: 중앙 메뉴를 다음 줄에 배치 */
@media(max-width:1199.98px) {
 .hc-site-header .hc-header-inner {grid-template-columns:minmax(0,1fr) auto;}
 .hc-header-nav {grid-column:1/-1;grid-row:2;justify-content:center;overflow-x:auto;max-width:100%;}
}
/* 05. 모바일: 좌우 영역을 압축하고 메뉴는 가로 스크롤 */
@media(max-width:767.98px) {
 .hc-site-header .hc-header-inner {padding:7px 9px;gap:6px;}
 .hc-header-qr {width:36px;height:36px;}
 .hc-header-brand {gap:5px;}
 .hc-header-brand-text .brand-name {font-size:1rem;}
 .hc-header-brand-text .brand-sub,.hc-header-country,.hc-header-settings span,.hc-header-account summary span {display:none;}
 .hc-header-tools {gap:4px;}
 .hc-header-language select {max-width:84px;font-size:.76rem;}
 .hc-header-nav {justify-content:flex-start;scrollbar-width:thin;padding-bottom:2px;}
 .hc-header-link {padding:7px 9px;font-size:.84rem;}
}
@media(prefers-reduced-motion:reduce) {.hc-header-link {transition:none;}}



/* 현재 선택된 헤더 메뉴 */
.hc-header-nav .hc-header-link[aria-current="page"] {
    background-color: #eff6ff;
    color: #2563eb;
    font-weight: 700;
    border-radius: 8px;
}


/* =========================================================
   HANCOT 1행 통합 헤더
   PC / 태블릿 / 모바일 공통
========================================================= */

.hc-site-header {
    width: 100%;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
}

.hc-site-header .hc-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
    min-height: 76px;
    padding: 10px 20px;
}

.hc-site-header .hc-header-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.hc-site-header .hc-header-brand-link {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.hc-site-header .hc-header-qr {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.hc-site-header .hc-header-brand-text {
    display: flex;
    flex-direction: column;
}

.hc-site-header .brand-name {
    font-size: 19px;
    font-weight: 700;
}

.hc-site-header .brand-sub {
    font-size: 11px;
    color: #64748b;
}

/* 중앙 메뉴 */
.hc-site-header .hc-header-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px 16px;
    min-width: 0;
}

.hc-site-header .hc-header-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 4px;
    background: transparent;
    color: #334155;
    
    /* 기존 고정 크기를 지우고, 화면 설정 배율 변수(--hc-font-scale)와 연동합니다 */
    font-size: calc(17.5px * var(--hc-font-scale, 1));
    
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
}

.hc-site-header .hc-header-link:hover,
.hc-site-header .hc-header-link.active,
.hc-site-header .hc-header-link.is-active {
    color: #1763b1;
    background: transparent;
}

/* 우측 도구 */
.hc-site-header .hc-header-tools {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-shrink: 0;
}

.hc-site-header .hc-header-language {
    display: flex;
    align-items: center;
    gap: 5px;
}

.hc-site-header .hc-header-language select {
    max-width: 100px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 5px;
    background: #fff;
}

.hc-site-header .hc-header-settings {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 0;
    background: transparent;
    color: #475569;
    cursor: pointer;
}

/* 태블릿 */
@media (max-width: 1100px) {
    .hc-site-header .hc-header-inner {
        flex-wrap: wrap;
    }

    .hc-site-header .hc-header-nav {
        order: 3;
        width: 100%;
        justify-content: center;
    }

    .hc-site-header .hc-header-country {
        display: none;
    }
}

/* 모바일 */
@media (max-width: 768px) {
    .hc-site-header .hc-header-inner {
        gap: 10px;
        padding: 8px 12px;
    }

    .hc-site-header .hc-header-qr {
        width: 40px;
        height: 40px;
    }

    .hc-site-header .brand-name {
        font-size: 17px;
    }

    .hc-site-header .brand-sub {
        font-size: 10px;
    }

    .hc-site-header .hc-header-nav {
        justify-content: flex-start;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 5px;
    }

    .hc-site-header .hc-header-link {
        font-size: 13px;
        flex-shrink: 0;
    }

    .hc-site-header .hc-header-settings span {
        display: none;
    }
}




/* ==============================================
   HANCOT MOBILE HAMBURGER DRAWER
============================================== */

.hc-mobile-menu-btn,
.hc-mobile-backdrop,
.hc-mobile-drawer {
    display: none;
}

/* 모바일 */
@media (max-width: 768px) {

    /* 모바일 헤더 */
    .hc-site-header {
        position: relative;
        overflow: visible !important;
    }

    .hc-site-header .hc-header-inner {
        width: 100% !important;
        min-width: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        flex-wrap: nowrap !important;
        padding: 8px 12px !important;
    }

    /* 로고만 표시 */
    .hc-site-header .hc-header-brand {
        display: flex !important;
        flex-shrink: 1 !important;
        min-width: 0;
    }

    /* PC 메뉴 숨김 */
    .hc-site-header .hc-header-nav,
    .hc-site-header .hc-header-tools {
        display: none !important;
    }

    /* 햄버거 버튼 */
    .hc-mobile-menu-btn {
        display: flex !important;
        position: absolute;
        top: 50%;
        right: 12px;
        transform: translateY(-50%);

        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 5px;

        width: 44px;
        height: 44px;

        border: 1px solid #d1d5db;
        border-radius: 8px;
        background: #fff;
        cursor: pointer;
        z-index: 1001;
    }

    .hc-mobile-menu-btn span {
        width: 22px;
        height: 2px;
        background: #1f2937;
        border-radius: 2px;
    }

    /* 배경 */
    .hc-mobile-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.45);
        z-index: 1098;
    }

    .hc-mobile-backdrop[hidden] {
        display: none !important;
    }

    /* 오른쪽 슬라이드 패널 */
    .hc-mobile-drawer {
        display: flex;
        flex-direction: column;

        position: fixed;
        top: 0;
        right: 0;

        width: min(320px, 88vw);
        height: 100vh;
        height: 100dvh;

        background: #fff;
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);

        transform: translateX(105%);
        visibility: hidden;
        transition: transform 0.25s ease, visibility 0.25s;

        z-index: 1099;
    }

    .hc-mobile-drawer.is-open {
        transform: translateX(0);
        visibility: visible;
    }

    .hc-mobile-drawer-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 16px;
        border-bottom: 1px solid #e5e7eb;
    }

    .hc-mobile-close-btn {
        width: 44px;
        height: 44px;
        background: #f3f4f6;
        border: 0;
        border-radius: 8px;
        cursor: pointer;
    }

    .hc-mobile-drawer-content {
        padding: 16px;
        overflow-y: auto;
        flex: 1;
    }

    /* 이동된 메뉴 세로 배치 */
    .hc-mobile-drawer .hc-header-nav,
    .hc-mobile-drawer .hc-header-tools {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
        width: 100%;
    }

    .hc-mobile-drawer .hc-header-link {
        display: block;
        padding: 12px;
        border-radius: 8px;
        text-decoration: none;
        color: #1f2937;
        background: #f8fafc;
    }

    .hc-mobile-drawer .hc-header-tools {
        margin-top: 16px;
        padding-top: 16px;
        border-top: 1px solid #e5e7eb;
    }

    .hc-mobile-drawer .hc-header-language,
    .hc-mobile-drawer .hc-header-settings,
    .hc-mobile-drawer .hc-header-account {
        width: 100%;
    }

    .hc-mobile-drawer #headerLanguageSelect {
        width: 100%;
        min-height: 44px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hc-mobile-drawer {
        transition: none;
    }
}




/* =========================================================
   HANCOT PLATFORM - BRAND LOGO
   PC / MOBILE 공통
========================================================= */

.brand-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 46px;
    height: 46px;
    min-width: 46px;

    padding: 0;

    background: linear-gradient(
        135deg,
        #2563eb 0%,
        #1d4ed8 55%,
        #1e40af 100%
    );

    color: #ffffff;

    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 13px;

    box-shadow: 0 3px 10px rgba(37, 99, 235, 0.22);

    font-family: Arial, sans-serif;
    font-size: 27px;
    font-weight: 900;
    line-height: 1;

    text-align: center;
    vertical-align: middle;

    flex-shrink: 0;
    user-select: none;
}

/* 내부 H 문자 */
.brand-logo > span {
    display: block;
    color: #ffffff;
    font-size: inherit;
    font-weight: inherit;
    line-height: 1;
}

/* 모바일 */
@media (max-width: 768px) {
    .brand-logo {
        width: 38px;
        height: 38px;
        min-width: 38px;

        font-size: 23px;
        border-radius: 11px;
    }
}

/* 작은 모바일 */
@media (max-width: 380px) {
    .brand-logo {
        width: 34px;
        height: 34px;
        min-width: 34px;

        font-size: 21px;
        border-radius: 9px;
    }
}

