/**********************************************************
* 공통 레이아웃: 헤더 · 모바일 메뉴
* (본문 스타일은 main.css · sub.css, 반응형은 각 파일 아래쪽)
***********************************************************/

/* ---------------------------------------------------------- Header */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 80;
    width: 100%;
    color: #f3f2e9;
    background: transparent;
    transition: background 0.3s, color 0.3s, box-shadow 0.3s;
}

.main-header.is-stuck {
    background: #f3f2e9;
    color: #342d29;
    box-shadow: 0 1px 0 rgba(52, 45, 41, 0.08);
}

/* 밝은 배경 페이지: 처음부터 밝은 헤더 */
.header--ink {
    color: #342d29;
    background: #f3f2e9;
    box-shadow: 0 1px 0 #d5d4c6;
}

.header_wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 96px;
    width: min(1600px, calc(100% - 40px));
    margin: 0 auto;
    padding: 0;
}

.header_brand {
    display: block;
    flex: none;
}

.header_brand img {
    display: block;
    width: auto;
    height: 56px;
}

.main-header.is-stuck .header_brand img,
.header--ink .header_brand img {
    filter: brightness(0);
}

.header_nav {
    display: flex;
    align-items: flex-start;
    gap: 40px;
}

.header_nav a {
    padding: 8px 0;
    border-bottom: 2px solid transparent;
    color: inherit;
    font-family: var(--font-serif);
    font-size: 15px;
    font-weight: 400;
    letter-spacing: 0.14em;
    line-height: normal;
    text-decoration: none;
    white-space: nowrap;
    transition: border-color 0.3s;
}

.header_nav a:hover,
.header_nav a.is-current {
    border-bottom-color: currentColor;
}

/* 밝은 헤더에서는 밑줄을 대표 컬러(올리브)로 */
.main-header.is-stuck .header_nav a:hover,
.main-header.is-stuck .header_nav a.is-current,
.header--ink .header_nav a:hover,
.header--ink .header_nav a.is-current {
    border-bottom-color: #545c48;
}

.header_right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header_cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 38px;
    padding: 0 20px;
    border: 1px solid currentColor;
    border-radius: 999px;
    color: inherit;
    font-family: var(--font-serif);
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0.16em;
    line-height: 1;
    text-decoration: none;
    transition: background 0.3s, color 0.3s, border-color 0.3s;
}

a.header_cta:hover {
    border-color: #f3f2e9;
    background: #f3f2e9;
    color: #342d29;
}

.main-header.is-stuck a.header_cta:hover,
.header--ink a.header_cta:hover {
    border-color: #342d29;
    background: #342d29;
    color: #f3f2e9;
}

/* ---------------------------------------------------------- Hamburger */
.hamberger,
.gnb_close {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 0;
    cursor: pointer;
    color: inherit;
    padding: 0;
}

.hamberger {
    display: none;
    width: 42px;
    height: 42px;
}

/* ---------------------------------------------------------- 모바일 메뉴 오버레이 */
.gnb-outer {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    padding: 22px 26px calc(36px + env(safe-area-inset-bottom));
    background: #342d29;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    transform: translateY(-100%);
    transition: transform 0.5s var(--ease-out);
    visibility: hidden;
}

.gnb-outer.open,
html.open .gnb-outer {
    transform: none;
    visibility: visible;
}

.gnb-inner,
.gnb-menu-list {
    display: flex;
    flex-direction: column;
}

.gnb-inner {
    min-height: 100%;
}

.gnb_top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 0 0 auto;
    margin-bottom: 26px;
}

.gnb_brand {
    display: flex;
    align-items: center;
    line-height: 0;
}

.gnb_brand img {
    display: block;
    width: auto;
    height: 40px;
}

.gnb_close {
    padding: 8px;
    color: #f0ebd6;
}

a.gnb-menu-link {
    display: flex;
    align-items: center;
    min-height: 56px;
    padding: 14px 0;
    border-bottom: 1px solid rgba(240, 235, 214, 0.14);
    font-family: var(--font-serif);
    font-size: 20px;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: #f0ebd6;
}

/* 상담/예약 + 로그인 버튼 줄 */
.gnb_actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 30px;
}

a.gnb_login {
    padding: 13px 34px;
    border: 1px solid rgba(240, 235, 214, 0.7);
    border-radius: 999px;
    background: transparent;
    color: #f0ebd6;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-decoration: none;
}

a.gnb_cta {
    align-self: flex-start;
    margin-top: 0;
    padding: 14px 34px;
    border-radius: 999px;
    background: #f3f2e9;
    color: #342d29;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.06em;
}

/* 헤더 메뉴가 한 줄에 다 들어가지 않는 노트북 폭(1201~1440px)에서는 간격·글자 간격을 줄여 로그인 버튼이 잘리지 않게 */
@media (min-width: 1201px) and (max-width: 1440px) {
    .header_nav {
        gap: clamp(14px, 1.9vw, 28px);
    }

    .header_nav a {
        font-size: 14px;
        letter-spacing: 0.08em;
    }

    .header_right {
        gap: 8px;
    }

    .header_cta {
        padding: 0 16px;
    }
}

/* ---------------------------------------------------------- 언어 선택 */
.lang_switch {
    position: relative;
    color: inherit;
}

.lang_current_btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 38px;
    padding: 0 12px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: transparent;
    color: inherit;
    font-family: var(--font-serif);
    font-size: 13px;
    letter-spacing: 0.12em;
    line-height: 1;
    cursor: pointer;
    transition: border-color 0.3s;
}

.lang_current_btn:hover,
.lang_switch.is-open .lang_current_btn {
    border-color: currentColor;
}

.lang_menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    z-index: 70;
    min-width: 132px;
    margin: 0;
    padding: 6px;
    list-style: none;
    border-radius: 12px;
    background: #f3f2e9;
    box-shadow: 0 14px 30px -12px rgba(20, 16, 12, 0.4);
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, -6px);
    transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
}

.lang_switch.is-open .lang_menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%);
}

.lang_menu .lang_opt {
    display: block;
    width: 100%;
    padding: 10px 14px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #342d29;
    font-family: var(--font-kr);
    font-size: 14px;
    text-align: center;
    cursor: pointer;
}

.lang_menu .lang_opt:hover {
    background: rgba(139, 146, 128, 0.22);
}

.lang_opt[aria-current='true'] {
    font-weight: 700;
}

/* 모바일 메뉴 안: 한 줄 버튼 */
.lang_switch_inline {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 26px;
}

.lang_switch_inline .lang_opt {
    padding: 9px 16px;
    border: 1px solid rgba(240, 235, 214, 0.45);
    border-radius: 999px;
    background: transparent;
    color: #f0ebd6;
    font-family: var(--font-kr);
    font-size: 14px;
    cursor: pointer;
}

.lang_switch_inline .lang_opt[aria-current='true'] {
    background: #f3f2e9;
    border-color: #f3f2e9;
    color: #342d29;
}

/* 번역 중 / 번역된 화면 */
html.is-translating body {
    cursor: progress;
}

.tr-nobr br {
    display: none;
}

/* 모바일 헤더: 언어 버튼을 작게 (메뉴는 웹과 같이 버튼 가운데 기준) */
@media (max-width: 1080px) {
    .main-header .lang_current_btn {
        height: 36px;
        padding: 0 8px;
        gap: 4px;
        font-size: 12px;
    }

}

/* ---------------------------------------------------------- 번역 화면: 어느 언어든 틀 밖으로 넘치지 않게 */
html.is-translated body * {
    word-break: normal;
    overflow-wrap: anywhere;
    line-break: auto;
}

html.is-translated .btn {
    white-space: normal;
    text-align: center;
    line-height: 1.25;
    height: auto;
    min-height: 52px;
    padding-top: 10px;
    padding-bottom: 10px;
}

/* 번역 화면: 한글 기준으로 줄바꿈을 막아 둔 글자는 번역문이 길어도 줄바꿈되게 (헤더·퀵메뉴는 제외) */
html.is-translated :is(h1, h2, h3, h4, p, dt, dd, li, figcaption, summary, span, strong, em, time, label, a) {
    white-space: normal !important;
}

html.is-translated .main-header :is(a, span, button),
html.is-translated .quick_menu :is(a, span, button),
html.is-translated .lang_switch :is(button, span) {
    white-space: nowrap !important;
}

/* 언어 선택: 각 언어 앞에 국기 */
.lang_menu .lang_opt,
.lang_switch_inline .lang_opt {
    display: flex;
    align-items: center;
    gap: 8px;
}

.lang_menu .lang_opt {
    justify-content: flex-start;
    text-align: left;
}

.lang_opt .lang_flag {
    flex: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    box-shadow: 0 0 0 1px rgba(52, 45, 41, 0.12);
}

.lang_current_btn .lang_current_flag {
    flex: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35);
}

/* 헤더 국기 4개 (PC·모바일 모두 바로 보임) */
.lang_switch_flags {
    display: flex;
    align-items: center;
    gap: 8px;
}


.lang_flag_btn {
    display: block;
    width: 26px;
    height: 26px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: none;
    cursor: pointer;
    opacity: 0.75;
    box-shadow: 0 0 0 1px #cfcfcf; /* 선택 안 된 국기: 연한 회색 1px 테두리 */
    transition: opacity 0.2s, transform 0.2s, box-shadow 0.2s;
}

.lang_flag_btn img {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
}

.lang_flag_btn:hover {
    opacity: 1;
    transform: scale(1.08);
}

/* 지금 보고 있는 언어 */
/* 지금 언어: 대표 컬러보다 진한 올리브 테두리 (잘 보이도록 조금 두껍게) */
.lang_flag_btn[aria-current='true'] {
    opacity: 1;
    box-shadow: 0 0 0 2.5px #2f3527;
}

/* 좁은 PC(메뉴가 다 보이는 1201~1360px): 국기를 조금 작게 해서 메뉴와 붙지 않게 */
@media (min-width: 1201px) and (max-width: 1360px) {
    .lang_switch_flags {
        gap: 5px;
        margin-left: 10px;
    }

    .lang_flag_btn {
        width: 22px;
        height: 22px;
    }
}

/* 모바일: 국기를 작게 해서 그대로 보여 줌 (외국 손님이 첫 화면에서 바로 고를 수 있게) */
@media (max-width: 720px) {
    .lang_switch_flags {
        gap: 5px;
    }

    .lang_flag_btn {
        width: 20px;
        height: 20px;
    }
}

@media (max-width: 360px) {
    .lang_switch_flags {
        gap: 4px;
    }

    .lang_flag_btn {
        width: 18px;
        height: 18px;
    }
}

/* 아주 작은 휴대폰(360px 이하): 로고와 국기가 붙지 않게 LOGIN 버튼을 조금 줄임 */
@media (max-width: 360px) {
    .header_right {
        gap: 6px;
    }

    .header_right .header_cta {
        padding: 0 8px;
        letter-spacing: 0.04em;
    }
}

/* ---------------------------------------------------------- 헤더 하위 메뉴 (SKIN ENERGY) */
.header_nav_item {
    position: relative;
}

/* 다른 메뉴 글자와 높이를 맞춤 (감싸는 칸 안에서도 위아래 여백이 적용되게) */
.header_nav_item > a {
    display: inline-block;
}

.header_sub {
    position: absolute;
    top: 100%;
    left: 50%;
    z-index: 90;
    min-width: 180px;
    margin: 0;
    padding: 0;
    list-style: none;
    background: #342d29;
    box-shadow: 0 18px 36px -16px rgba(20, 16, 12, 0.55);
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, 6px);
    transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
}

/* 메뉴와 목록 사이 빈틈에서 마우스가 빠져도 닫히지 않게 */
.header_sub::before {
    content: '';
    position: absolute;
    top: -14px;
    left: 0;
    right: 0;
    height: 14px;
}

.header_nav_item:hover .header_sub,
.header_nav_item:focus-within .header_sub {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 10px);
}

.header_nav .header_sub a {
    display: block;
    padding: 12px 24px;
    border: 0;
    color: #f3f2e9;
    font-family: var(--font-kr);
    font-size: 15px;
    font-weight: 400;
    letter-spacing: 0;
    white-space: nowrap;
    transition: background 0.2s, color 0.2s;
}

.header_nav .header_sub a:hover,
.header_nav .header_sub a:focus-visible {
    background: rgba(243, 242, 233, 0.08);
    color: #c9d19a;
}

/* 모바일 메뉴(≡): 하위 메뉴는 아코디언 (처음엔 닫힘, 제목 줄 전체를 누르면 열기), 항목은 한 줄에 하나씩 */
.gnb-menu-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0;
    border: 0;
    border-bottom: 1px solid rgba(240, 235, 214, 0.14);
    background: none;
    color: #f0ebd6;
    text-align: left;
    cursor: pointer;
}

.gnb-menu-row .gnb-menu-link {
    display: flex;
    align-items: center;
    min-height: 56px;
    padding: 14px 0;
    font-family: var(--font-serif);
    font-size: 20px;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: #f0ebd6;
}

.gnb-sub-toggle svg {
    transition: transform 0.25s;
}

.has-sub.is-open .gnb-sub-toggle svg {
    transform: rotate(180deg);
}

.gnb-sub {
    display: none;
    margin: 0;
    padding: 6px 0 12px 4px;
    list-style: none;
    border-bottom: 1px solid rgba(240, 235, 214, 0.14);
}

.has-sub.is-open .gnb-sub {
    display: block;
}

a.gnb-sub-link {
    display: block;
    padding: 10px 0;
    font-family: var(--font-kr);
    font-size: 15px;
    color: rgba(240, 235, 214, 0.78);
    text-decoration: none;
}

a.gnb-sub-link:hover {
    color: #f0ebd6;
}

/* 모바일 메뉴: 하위 항목 묶음 제목 (스킨부스터 · 피부보습영양주사 · 영양수액) */
.gnb-sub-group {
    padding: 14px 0 2px;
    font-family: var(--font-kr);
    font-size: 12px;
    letter-spacing: 0.04em;
    color: #c9d19a;
}

.gnb-sub-group:first-child {
    padding-top: 6px;
}

/* PC 하위 메뉴: group 별 열 나눔 */
.header_sub_groups {
    display: flex;
    gap: 8px;
    padding: 22px 12px 18px;
}

.header_sub_col {
    min-width: 150px;
}

.header_sub_col + .header_sub_col {
    padding-left: 8px;
    border-left: 1px solid rgba(243, 242, 233, 0.12);
}

.header_sub_title {
    margin: 0 0 6px;
    padding: 0 12px;
    font-family: var(--font-kr);
    font-size: 12px;
    letter-spacing: 0.04em;
    color: #c9d19a;
    white-space: nowrap;
}

.header_sub_col ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.header_nav .header_sub_groups a {
    padding: 9px 12px;
}
