/**
 * 스스로법인 v2 - 글로벌 레이아웃 (헤더/푸터/하단 스티키 네비)
 * 모든 페이지에 적용되는 공통 영역
 * - 드로어 메뉴: 로그인 시 하단 로그아웃 고정 영역(site-nav-drawer-footer)
 * - 1:1 상담: 푸터·드로어 body 내 버튼/앵커 공통 행 스타일(ChannelIO 트리거)
 */

/* ============================================
   1. 폰트 - 코트라체 (브랜드 로고용)
   - 보통(KOTRA_GOTHIC) + 굵음(KOTRA_BOLD) 두 변종을 같은 패밀리 alias 로 묶어
     필요 시 font-weight 로 호출한다.
   ============================================ */
@font-face {
    font-family: '코트라체';
    src: local('KOTRA_GOTHIC'),
         local('코트라체'),
         url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_22-08@1.0/KOTRA_GOTHIC.woff2') format('woff2');
    font-weight: 400 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: '코트라체';
    src: local('KOTRA_BOLD'),
         local('코트라체 Bold'),
         url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_20-10-21@1.1/KOTRA_BOLD-Bold.woff') format('woff');
    font-weight: 700 900;
    font-style: normal;
    font-display: swap;
}

/* 별칭(요청 사양 호환): 'KotraBold' 로 직접 호출 가능 */
@font-face {
    font-family: 'KotraBold';
    src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_20-10-21@1.1/KOTRA_BOLD-Bold.woff') format('woff');
    font-weight: normal;
    font-display: swap;
}

/* ============================================
   2. 베이스
   ============================================ */
body {
    margin: 0;
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif;
    color: #0f172a;
    background: #ffffff;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 하단 스티키 네비가 있을 때 페이지 끝에 가려지지 않도록 여백
   PC/모바일 모두 적용 — 모바일 친화 UX (사이트 어디서나 빠른 탐색) */
body.has-bottom-nav {
    padding-bottom: 80px;
}

/* ============================================
   3. 상단 헤더 (글로벌)
   ============================================ */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid #e2e8f0;
}

.site-header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 14px 24px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 16px;
}

/* 좌측: 모바일에서만 햄버거, 데스크탑에서는 글로벌 nav (옵션) */
.site-header-left {
    display: flex;
    align-items: center;
}

/* 햄버거 — 모바일 우선 원칙에 따라 모든 화면에서 노출 (좌측 끝, 항상 보임) */
.site-nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 0;
    padding: 8px;
    font-size: 24px;
    color: #0f172a;
    cursor: pointer;
    line-height: 1;
}

.site-nav-toggle:hover {
    color: #1d4ed8;
}

.site-nav-toggle:focus-visible {
    outline: 2px solid #1d4ed8;
    outline-offset: 2px;
    border-radius: 6px;
}

/* 중앙: 로고 */
.site-header-center {
    display: flex;
    justify-content: center;
}

.site-logo {
    font-family: '코트라체', 'KOTRA', 'Pretendard', sans-serif;
    font-weight: 700;
    font-size: clamp(18px, 2.4vw, 22px);
    color: #0f172a;
    text-decoration: none;
    letter-spacing: -0.02em;
    transition: color 0.2s ease;
    white-space: nowrap;
}

.site-logo:hover {
    color: #1d4ed8;
}

.site-logo .ssro-logo-mark {
    color: #1d4ed8;
}

/* 우측: 내 계정 / CTA */
.site-header-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.site-header-account {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 999px;
    color: #334155;
    font-size: 14px;
    font-weight: 600;
    background: #f1f5f9;
    transition: background 0.2s ease, color 0.2s ease;
    text-decoration: none;
}

.site-header-account:hover {
    background: #1d4ed8;
    color: #fff;
}

.site-header-account i {
    font-size: 18px;
    line-height: 1;
}

.site-header-account .label {
    display: inline;
}

@media (max-width: 480px) {
    .site-header-account .label {
        display: none;
    }
    .site-header-account {
        padding: 8px;
    }
}


/* =============================================================
   기본 페이지 (page.php / index.php fallback)
   - my-account, lost-password, 정책 페이지, 우커머스 화면 등
   - 메인 페이지(헤더/푸터)와 동일한 톤으로 가운데 정렬 + 폭 제한
   ============================================================= */
.ssro-default-page {
    background: #f8fafc;
    padding: clamp(40px, 6vw, 72px) 0 clamp(56px, 8vw, 96px);
    min-height: 40vh;
}

.ssro-default-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.ssro-default-article {
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 16px;
    padding: clamp(28px, 5vw, 48px) clamp(20px, 5vw, 48px);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.04);
}

.ssro-default-article .entry-title {
    font-size: clamp(24px, 3.4vw, 32px);
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.02em;
    margin: 0 0 24px;
    line-height: 1.3;
}

.ssro-default-article .entry-content {
    color: #334155;
    font-size: 16px;
    line-height: 1.75;
}

.ssro-default-article .entry-content p {
    margin: 0 0 16px;
}

.ssro-default-article .entry-content h2,
.ssro-default-article .entry-content h3,
.ssro-default-article .entry-content h4 {
    color: #0f172a;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 28px 0 12px;
    line-height: 1.3;
}

.ssro-default-article .entry-content h2 { font-size: 22px; }
.ssro-default-article .entry-content h3 { font-size: 19px; }
.ssro-default-article .entry-content h4 { font-size: 17px; }

.ssro-default-article .entry-content a {
    color: #1d4ed8;
    text-decoration: underline;
}

.ssro-default-article .entry-content a:hover {
    color: #1e3a8a;
}

/* 우커머스 폼/버튼 — 기본 페이지 카드 안에서도 자연스럽게 어울리도록 보정 */
.ssro-default-article .woocommerce form .form-row input,
.ssro-default-article .entry-content input[type="text"],
.ssro-default-article .entry-content input[type="email"],
.ssro-default-article .entry-content input[type="password"],
.ssro-default-article .entry-content input[type="tel"] {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid #cbd5e1;
    border-radius: 10px;
    font-size: 15px;
    box-sizing: border-box;
    font-family: inherit;
}

.ssro-default-article .entry-content button,
.ssro-default-article .entry-content .button,
.ssro-default-article .entry-content input[type="submit"],
.ssro-default-article .woocommerce form .button,
.ssro-default-article .woocommerce button.button {
    background: #1d4ed8;
    color: #fff;
    border: 0;
    padding: 12px 22px;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
}

.ssro-default-article .entry-content button:hover,
.ssro-default-article .entry-content .button:hover,
.ssro-default-article .entry-content input[type="submit"]:hover,
.ssro-default-article .woocommerce form .button:hover,
.ssro-default-article .woocommerce button.button:hover {
    background: #1e3a8a;
}

/* 우커머스 my-account 좌측 내비게이션 정돈 */
.ssro-default-article .woocommerce-MyAccount-navigation ul {
    list-style: none;
    padding: 0;
    margin: 0 0 24px;
}

.ssro-default-article .woocommerce-MyAccount-navigation li {
    margin: 0 0 4px;
}

.ssro-default-article .woocommerce-MyAccount-navigation a {
    display: block;
    padding: 10px 14px;
    border-radius: 8px;
    text-decoration: none;
    color: #334155;
    background: #f1f5f9;
    transition: background 0.15s ease, color 0.15s ease;
}

.ssro-default-article .woocommerce-MyAccount-navigation li.is-active a,
.ssro-default-article .woocommerce-MyAccount-navigation a:hover {
    background: #1d4ed8;
    color: #fff;
}

/* Lost password 페이지는 비밀번호 재설정 폼에 집중시키기 위해
   상단 삽입된 소셜 로그인(카카오/네이버) 문구/이미지를 숨긴다. */
body.woocommerce-lost-password .ssro-default-article .entry-content > p:first-child,
body.woocommerce-lost-password .ssro-default-article .entry-content > p:nth-child(2) {
    display: none;
}

/* 데스크탑 글로벌 nav (옵션 — 추후 메뉴 위치에 따라 사용) */
.site-nav {
    display: none;
    gap: 24px;
    align-items: center;
}

.site-nav a {
    color: #334155;
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    transition: color 0.2s ease;
}

.site-nav a:hover {
    color: #1d4ed8;
}

/* 데스크탑 1024px 이상: 헤더 로고는 항상 중앙 유지
   (좌측 햄버거가 숨겨져도 grid 1fr auto 1fr 비율이 유지되어 가운데로 정렬된다) */

/* 모바일 드로어 메뉴 (햄버거로 열림) */
.site-nav-drawer {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    z-index: 100;
    display: none;
}

.site-nav-drawer.open {
    display: block;
}

.site-nav-drawer-panel {
    position: absolute;
    top: 0;
    left: 0;
    width: min(320px, 86vw);
    height: 100%;
    background: #fff;
    padding: 24px 20px;
    box-shadow: 8px 0 24px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.site-nav-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    margin-bottom: 24px;
}

/* 메뉴 목록만 스크롤 — 푸터(로그아웃)는 패널 하단 고정 */
.site-nav-drawer-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

.site-nav-drawer-close {
    background: none;
    border: 0;
    font-size: 22px;
    cursor: pointer;
    color: #0f172a;
    padding: 4px;
}

.site-nav-drawer ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.site-nav-drawer-body a,
.site-nav-drawer-body button {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 8px;
    color: #0f172a;
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    transition: background 0.2s ease;
    width: 100%;
    text-align: left;
    border: 0;
    background: transparent;
    cursor: pointer;
    font-family: inherit;
}

.site-nav-drawer-body a:hover,
.site-nav-drawer-body button:hover {
    background: #f1f5f9;
    color: #1d4ed8;
}

.site-nav-drawer-body a i,
.site-nav-drawer-body button i {
    color: #1d4ed8;
    font-size: 18px;
    width: 22px;
    text-align: center;
}

.site-nav-drawer-footer {
    flex-shrink: 0;
    margin-top: auto;
    margin-bottom: 24px;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
    margin-inline: -20px;
    padding-inline: 20px;
    padding-bottom: max(8px, env(safe-area-inset-bottom, 0px));
}

/* 일반 네비 링크 스타일과 구분되는 보조(세션 종료) 톤 */
.site-nav-drawer-footer .site-nav-drawer-logout {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #64748b;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.site-nav-drawer-footer .site-nav-drawer-logout:hover {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #b91c1c;
}

.site-nav-drawer-footer .site-nav-drawer-logout i {
    color: inherit;
    font-size: 18px;
    width: 22px;
    text-align: center;
}

#site-nav-drawer-channel-button {
    margin: 0;
}
/* 햄버거 보이는 조건: 1024px 이하 */
/* 햄버거는 1024px+ 에서도 그대로 노출 — 별도 미디어쿼리 불필요 */

/* ============================================
   4. 푸터
   ============================================ */
.site-footer {
    background: #0f172a;
    color: #cbd5e1;
    padding: 56px 0 24px;
    margin-top: 0;
}

/* 푸터 콘텐츠는 화면 가운데로 모아 정돈된 인상 — 너무 넓게 퍼지지 않도록 폭 제한 */
.site-footer-inner {
    max-width: 760px;
    margin: 0 auto;
    padding: 0 24px;
}

.site-footer-brand {
    margin-bottom: 28px;
}

.site-footer-logo {
    font-family: '코트라체', 'KOTRA', 'Pretendard', sans-serif;
    font-weight: 700;
    font-size: 20px;
    color: #fff;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.site-footer-tagline {
    color: #94a3b8;
    font-size: 14px;
    line-height: 1.6;
}

.site-footer-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 24px;
    font-size: 14px;
    line-height: 1.7;
    color: #94a3b8;
}

.site-footer-info strong {
    color: #f1f5f9;
    font-weight: 700;
}

.site-footer-info a {
    color: #cbd5e1;
    text-decoration: none;
    transition: color 0.2s ease;
}

.site-footer-info a:hover {
    color: #fff;
    text-decoration: underline;
}

.site-footer-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 24px;
    padding: 16px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.site-footer-actions a,
.site-footer-actions button.site-footer-chat {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: #f1f5f9;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease;
    border: 0;
    cursor: pointer;
    font-family: inherit;
}

.site-footer-actions a:hover {
    background: #1d4ed8;
    color: #fff;
}

.site-footer-actions button.site-footer-chat {
    background: #f59e0b;
    color: #fff;
}

.site-footer-actions button.site-footer-chat:hover {
    background: #b45309;
}

.site-footer-policies {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 20px;
    font-size: 13px;
}

.site-footer-policies a {
    color: #94a3b8;
    text-decoration: none;
}

.site-footer-policies a:hover {
    color: #fff;
    text-decoration: underline;
}

.site-footer-copy {
    font-size: 12px;
    color: #64748b;
    text-align: left;
}

@media (max-width: 768px) {
    .site-footer-actions {
        flex-direction: column;
    }
    .site-footer-actions a,
    .site-footer-actions button.site-footer-chat {
        justify-content: center;
    }
}

/* ============================================
   5. 하단 스티키 메뉴 (모바일 우선, 데스크탑에서도 같이 노출 가능)
   ============================================ */
.site-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-top: 1px solid #e2e8f0;
    box-shadow: 0 -2px 16px rgba(15, 23, 42, 0.06);
    /* iPhone safe-area */
    padding-bottom: env(safe-area-inset-bottom);
}

.site-bottom-nav-inner {
    max-width: 600px;
    margin: 0 auto;
    display: grid;
    grid-auto-columns: 1fr;
    grid-auto-flow: column;
    align-items: stretch;
}

.site-bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 10px 4px;
    color: #64748b;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    transition: color 0.2s ease, background 0.2s ease;
}

.site-bottom-nav-item i {
    font-size: 22px;
    line-height: 1;
}

.site-bottom-nav-item:hover {
    color: #1d4ed8;
    background: #f8fafc;
}

.site-bottom-nav-item.is-active {
    color: #1d4ed8;
}

.site-bottom-nav-item.is-active i {
    color: #1d4ed8;
}

/* 데스크탑에서는 화면 가운데 알약 형태로 띄워 모바일 친화 UX 유지
   (사용자가 처음 기획한 PC/모바일 공통 bottom sticky 의도) */
@media (min-width: 1024px) {
    .site-bottom-nav {
        left: 50%;
        right: auto;
        bottom: 20px;
        transform: translateX(-50%);
        width: min(560px, calc(100% - 48px));
        border: 1px solid #e2e8f0;
        border-radius: 999px;
        box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
        padding-bottom: 0;
    }

    .site-bottom-nav-inner {
        max-width: none;
        padding: 4px 8px;
    }

    .site-bottom-nav-item {
        padding: 10px 8px;
        border-radius: 999px;
    }
}

/* ============================================
   6. 글로벌 유틸리티
   ============================================ */
.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute !important;
    width: 1px;
    word-wrap: normal !important;
}
