/* ===============================
   Reset
================================ */
a {
    text-decoration: none;
    color: inherit;
}

/* 고정 헤더에 앵커 섹션이 가려지지 않도록 */
section[id] {
    scroll-margin-top: 84px;
}

/* ===============================
   Header Select Disable
================================ */
.site-header,
.site-header * {
    user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
}

/* ===============================
   Header Base
================================ */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #ffffff;
}

.site-header::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(
        to right,
        transparent,
        #e5e7eb,
        transparent
    );
}

.header-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
    height: 64px;
    display: flex;
    align-items: center;
}

/* ===============================
   Logo
================================ */
.logo {
    margin-right: 40px;
}

.logo img {
    height: 36px;
    width: auto;
    display: block;
}

/* ===============================
   GNB
================================ */
.gnb {
    display: flex;
    gap: 28px;
}

.menu-item {
    position: relative;
}

.menu-item > a {
    font-size: 13.5px;
    font-weight: 500;
    color: #1f2937;
    padding: 4px 0;
    display: inline-block;
}

/* ===============================
   Sub Menu
================================ */
.sub-menu {
    position: absolute;
    top: 42px;
    left: 50%;
    transform: translateX(-50%);
    min-width: 160px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    padding: 10px 0;
    margin: 0;
    list-style: none;
    opacity: 0;
    visibility: hidden;
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
    transition: all 0.25s ease;
    z-index: 100;
}

.menu-item:hover .sub-menu {
    opacity: 1;
    visibility: visible;
    top: 36px;
}

.sub-menu li {
    text-align: center;
}

.sub-menu a {
    display: block;
    padding: 8px 16px;
    font-size: 13px;
    color: #374151;
}

.sub-menu a:hover {
    background: #f9fafb;
    color: #2563eb;
}

/* ===============================
   Right Area
================================ */
.header-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Language Switcher (desktop) */
.lang-switch {
    position: relative;
}

.lang-switch-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 0 14px;
    font-size: 12.5px;
    font-weight: 600;
    color: #374151;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    cursor: pointer;
    white-space: nowrap;
}

.lang-switch-btn:hover {
    border-color: #2563eb;
    color: #2563eb;
}

.lang-switch-chevron {
    font-size: 11px;
    transition: transform 0.2s ease;
}

.lang-switch.open .lang-switch-chevron {
    transform: rotate(180deg);
}

.lang-switch-menu {
    position: absolute;
    top: 42px;
    left: 50%;
    transform: translateX(-50%);
    min-width: 130px;
    margin: 0;
    padding: 8px 0;
    list-style: none;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 100;
}

.lang-switch.open .lang-switch-menu {
    opacity: 1;
    visibility: visible;
    top: 38px;
}

.lang-switch-menu a {
    display: block;
    padding: 8px 16px;
    font-size: 13px;
    color: #374151;
    text-align: center;
}

.lang-switch-menu a:hover,
.lang-switch-menu a.active {
    background: #f9fafb;
    color: #2563eb;
}

/* 모바일 언어 목록 — 데스크톱에서는 항상 숨김 */
.gnb-lang {
    display: none;
}

/* Search */
.header-search input {
    width: 140px;
    height: 32px;
    padding: 0 12px;
    font-size: 12.5px;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    outline: none;
    transition: all 0.25s ease;
}

.header-search input::placeholder {
    color: #9ca3af;
}

.header-search input:focus {
    border-color: #2563eb;
    width: 170px;
}

/* Contact Button */
.contact-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    font-size: 13px;
    font-weight: 600;
    color: #2563eb;
    border: 1px solid #2563eb;
    border-radius: 999px;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.contact-btn span {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.contact-btn:hover {
    background: #2563eb;
    color: #ffffff;
}

/* 모바일 드롭다운 전용 CTA — 데스크톱에서는 항상 숨김 */
.gnb-cta {
    display: none;
}

/* ===============================
   Mobile Menu Toggle (hamburger)
================================ */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 32px;
    height: 32px;
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
    flex-shrink: 0;
}

.menu-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background: #1f2937;
    border-radius: 2px;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.menu-toggle.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ===============================
   Mobile / Tablet
================================ */
@media (max-width: 992px) {
    .header-inner {
        padding: 0 16px;
    }

    .logo {
        margin-right: 20px;
    }
}

@media (max-width: 900px) {
    .header-search {
        display: none;
    }

    .lang-switch {
        display: none;
    }

    .menu-toggle {
        display: flex;
    }

    .contact-btn {
        display: none;
    }

    .gnb {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        gap: 0;
        background: #ffffff;
        border-top: 1px solid #e5e7eb;
        border-bottom: 1px solid #e5e7eb;
        max-height: calc(100vh - 64px);
        overflow-y: auto;
        box-shadow: 0 16px 28px rgba(0,0,0,0.1);
    }

    .gnb.active {
        display: flex;
    }

    .gnb-cta {
        display: block;
        margin: 16px 20px;
        padding: 12px;
        text-align: center;
        font-size: 14px;
        font-weight: 700;
        color: #ffffff;
        background: #2563eb;
        border-radius: 8px;
    }

    .gnb-lang {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        margin: 0 20px 16px;
    }

    .gnb-lang a {
        padding: 6px 14px;
        font-size: 13px;
        color: #4b5563;
        background: #f9fafb;
        border: 1px solid #e5e7eb;
        border-radius: 999px;
    }

    .gnb-lang a.active {
        color: #fff;
        background: #2563eb;
        border-color: #2563eb;
    }

    .menu-item {
        width: 100%;
        border-bottom: 1px solid #f1f5f9;
    }

    .menu-item > a {
        display: block;
        padding: 16px 20px;
        font-size: 15px;
    }

    /* 모바일은 터치 환경이라 hover 서브메뉴 대신 항상 펼친 상태로 표시 */
    .sub-menu {
        position: static;
        transform: none;
        opacity: 1;
        visibility: visible;
        box-shadow: none;
        border: none;
        min-width: 0;
        width: 100%;
        padding: 0 0 8px;
        background: #f9fafb;
    }

    .sub-menu li {
        text-align: left;
    }

    .sub-menu a {
        padding: 10px 32px;
        font-size: 13.5px;
        color: #4b5563;
    }
}

@media (max-width: 400px) {
    .logo img {
        height: 30px;
    }
}
