/* =================================================================
   header_index.css — 메인 페이지 전용 상단 메뉴바 스타일
   - 불러오는 곳: includes/header_index.php → index.php 만
   - 내용: header.css 전체 복사본 + 메인 전용 "투명 메뉴바"(.transparent-nav) 규칙
     (header_index.php가 index.php일 때 nav에 transparent-nav 클래스를 붙임)
   - 따로 둔 이유: 투명 메뉴 규칙이 공통 규칙 사이사이에서 값을 덮어쓰므로
     header.css와 합치면 다른 페이지 메뉴까지 바뀔 수 있음
   - 주의: 메뉴·서브메뉴·햄버거·모바일 메뉴·한/영 버튼을 고치면
     header.css도 똑같이 고쳐야 함
   ================================================================= */

/* ── 글꼴: 롯데마트드림 (웹폰트, 보통/굵게/얇게) ── */
@font-face {
    font-family: 'LotteMartDream';
    src: url('//cdn.jsdelivr.net/korean-webfonts/1/corps/lottemart/LotteMartDream/LotteMartDreamMedium.woff2') format('woff2'),
        url('//cdn.jsdelivr.net/korean-webfonts/1/corps/lottemart/LotteMartDream/LotteMartDreamMedium.woff') format('woff');
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: 'LotteMartDream';
    src: url('//cdn.jsdelivr.net/korean-webfonts/1/corps/lottemart/LotteMartDream/LotteMartDreamBold.woff2') format('woff2'),
        url('//cdn.jsdelivr.net/korean-webfonts/1/corps/lottemart/LotteMartDream/LotteMartDreamBold.woff') format('woff');
    font-weight: 700;
    font-display: swap;
}

@font-face {
    font-family: 'LotteMartDream';
    src: url('//cdn.jsdelivr.net/korean-webfonts/1/corps/lottemart/LotteMartDream/LotteMartDreamLight.woff2') format('woff2'),
        url('//cdn.jsdelivr.net/korean-webfonts/1/corps/lottemart/LotteMartDream/LotteMartDreamLight.woff') format('woff');
    font-weight: 300;
    font-display: swap;
}

body {
    font-family: 'LotteMartDream', sans-serif;
    margin: 0;
    padding: 0;
}

/* ── 네비게이션 공통 베이스 ── */
nav#navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
    position: relative;
    z-index: 1000;
    box-sizing: border-box;
    transition: all 0.3s ease;
}

/* ── 메인 전용: 투명 메뉴바 (슬라이더 위에 겹쳐 뜸) ── */
nav#navbar.transparent-nav {
    position: absolute;
    /* 절대 좌표로 띄워서 하단 슬라이더가 밀려 올라오도록 처리 */
    top: 0;
    left: 0;
    width: 100%;
    background: transparent !important;
    /* 배경 투명화 */
    border-bottom: 0px solid rgba(225, 225, 225, 0.001);
    /* 테두리 없음 (두께 0) */
    /* 위쪽은 반투명 흰색 → 아래로 갈수록 투명해지는 그라데이션 (바로 위 background 값을 덮어씀) */
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.75) 0%, rgba(0, 0, 0, 0) 100%) !important;
}

/* 투명 메뉴일 때 메뉴 글자는 흰색 + 옅은 그림자 */
nav#navbar.transparent-nav .nav-links>li>a,
nav#navbar.transparent-nav .nav-links>li>span {
    color: #ffffff !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* 투명 메뉴일 때 햄버거 버튼 줄도 흰색 */
nav#navbar.transparent-nav .hamburger span {
    background-color: #ffffff !important;
}

/* ── [PC 브레이크포인트] 데스크톱 대메뉴 및 서브메뉴 스타일 ── */
@media (min-width: 769px) {
    nav#navbar .nav-links {
        margin-left: auto;
        display: flex;
        align-items: center;
        gap: 32px;
        list-style: none;
        padding: 0;
        margin: 0;
    }

    nav#navbar .nav-links>li {
        position: relative;
        padding: 10px 0;
    }

    nav#navbar .nav-links>li>a,
    nav#navbar .nav-links>li>span {
        text-decoration: none;
        color: #333;
        font-weight: 500;
        font-size: 1rem;
        cursor: pointer;
        transition: color 0.2s;
    }

    nav#navbar .nav-links>li:hover>a,
    nav#navbar .nav-links>li:hover>span {
        color: #1a6fd4;
    }

    /* 투명헤더 상태에서 메뉴 마우스 호버 시 포인트 컬러 */
    nav#navbar.transparent-nav .nav-links>li:hover>a,
    nav#navbar.transparent-nav .nav-links>li:hover>span {
        color: #64b5f6 !important;
    }

    nav#navbar .nav-links .pc-sub-menu {
        position: absolute;
        top: 100%;
        left: 50%;
        transform: translateX(-50%);
        background: #ffffff;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        border-radius: 6px;
        padding: 0 16px;
        min-width: 130px;
        display: flex;
        flex-direction: column;
        gap: 4px;
        z-index: 1010;
        border: 1px solid #eaeaea;

        max-height: 0;
        opacity: 0;
        overflow: hidden;
        transition: max-height 0.3s ease-in-out, opacity 0.2s ease, padding 0.3s ease;
    }

    nav#navbar .nav-links>li:hover .pc-sub-menu {
        max-height: 250px;
        opacity: 1;
        padding: 12px 16px;
    }

    nav#navbar .pc-sub-menu a {
        text-decoration: none;
        color: #666;
        font-size: 0.9rem;
        font-weight: 400;
        padding: 8px 0;
        white-space: nowrap;
        transition: color 0.2s;
    }

    nav#navbar .pc-sub-menu a:hover {
        color: #1a6fd4;
    }

    /* PC 화면에서는 햄버거 버튼·모바일 메뉴를 항상 숨김 */
    .hamburger,
    .mobile-menu {
        display: none !important;
    }
}

/* ── 한영 변환 버튼 공통 스타일 ── */
.nav-lang-btn {
    display: flex;
    align-items: center;
    gap: 0;
    border: 1.5px solid #ccc;
    border-radius: 20px;
    overflow: hidden;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    cursor: pointer;
    background: transparent;
    margin-left: 16px;
    flex-shrink: 0;
}

/* 투명헤더일 때 언어버튼 테두리 대응 */
nav#navbar.transparent-nav .nav-lang-btn {
    border-color: rgba(255, 255, 255, 0.4);
}

.nav-lang-btn span {
    padding: 5px 12px;
    transition: background 0.2s, color 0.2s;
    color: #999;
}

nav#navbar.transparent-nav .nav-lang-btn span {
    color: rgba(255, 255, 255, 0.6);
}

.nav-lang-btn span.nav-lang-active {
    background: #1a6fd4;
    color: #fff !important;
}

/* ── 햄버거 버튼 스타일 (모바일 전용, .active가 붙으면 X 모양) ── */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    box-sizing: border-box;
    z-index: 1001;
}

.hamburger span {
    display: block;
    width: 100%;
    height: 2.5px;
    background-color: #111;
    border-radius: 2px;
    transition: all 0.3s ease-in-out;
}

.hamburger.active span:nth-child(1) {
    transform: translateY(7.5px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* 모바일 메뉴가 열리면(흰 배경) 햄버거 X 표시는 다시 검정색 */
nav#navbar.transparent-nav .hamburger.active span {
    background-color: #111 !important;
}

/* ── 모바일 전체 메뉴 및 드롭다운 시스템 ──
   .mobile-menu.active = 메뉴 열림, .has-sub.open = 하위 메뉴 펼침 (header.js가 붙임) */
.mobile-menu {
    display: flex !important;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: #ffffff;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
    padding: 0 20px;
    box-sizing: border-box;
    flex-direction: column;
    z-index: 999;
    border-top: 1px solid #f5f5f5;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.35s ease-in-out, opacity 0.25s ease-in-out, padding 0.35s ease-in-out;
}

.mobile-menu.active {
    max-height: 800px;
    opacity: 1;
    padding: 20px;
    overflow-y: auto;
}

.mobile-menu-item {
    display: flex;
    flex-direction: column;
    width: 100%;
    border-bottom: 1px solid #fafafa;
}

.mobile-menu-item>a,
.mobile-menu-item>span {
    display: block;
    text-decoration: none;
    color: #333 !important;
    /* 모바일 메뉴 내부 텍스트는 언제나 보일수 있도록 검정 고정 */
    font-size: 1.05rem;
    font-weight: 500;
    padding: 14px 0;
    cursor: pointer;
    position: relative;
}

.mobile-menu-item.has-sub>a::after,
.mobile-menu-item.has-sub>span::after {
    content: '▾';
    position: absolute;
    right: 4px;
    color: #aaa;
    transition: transform 0.2s ease;
}

.mobile-menu-item.has-sub.open>a::after,
.mobile-menu-item.has-sub.open>span::after {
    transform: rotate(180deg);
}

.mobile-menu .sub-menu {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: #fcfcfc;
    padding-left: 12px;
    transition: max-height 0.3s ease-in-out, opacity 0.2s ease-in-out, padding 0.3s ease;
}

.mobile-menu-item.has-sub.open .sub-menu {
    max-height: 300px;
    opacity: 1;
    padding-top: 4px;
    padding-bottom: 12px;
}

.mobile-menu .sub-menu a {
    text-decoration: none;
    color: #666 !important;
    font-size: 0.95rem;
    font-weight: 400;
    padding: 10px 0;
}

/* 모바일 메뉴 안의 한/영 버튼 */
.mobile-lang-btn {
    display: flex;
    justify-content: center;
    gap: 0;
    border: 1.5px solid #ccc;
    border-radius: 20px;
    overflow: hidden;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    background: transparent;
    margin-top: 20px;
    width: fit-content;
    align-self: center;
}

.mobile-lang-btn span {
    padding: 7px 20px;
    color: #999;
    transition: background 0.2s, color 0.2s;
}

.mobile-lang-btn span.nav-lang-active {
    background: #1a6fd4;
    color: #fff !important;
}

/* ── [모바일 브레이크포인트] 768px 이하 처리 ── */
@media (max-width: 768px) {
    nav#navbar .nav-links {
        display: none !important;
    }

    .hamburger {
        display: flex !important;
    }
}
