/* SINCAR Header Styles */

.home-header {
    position: sticky;
    top: 0;
    z-index: 12000;
    /* 모바일 GNB가 항상 콘텐츠 위로 올라오도록 z-index 강화 */
    background: #ffffff;
    border-bottom: 1px solid #dddddd;
}

.google-auth-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    color: #1f2937;
    background: #ffffff;
    border: 1px solid #d1d5db;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
    cursor: pointer;
    transition: all 0.2s ease;
}

.google-auth-btn::before {
    content: '';
    width: 14px;
    height: 14px;
    background: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48"%3E%3Cpath fill="%234285F4" d="M24 9.5c3.46 0 5.82 1.5 7.16 2.75l5.2-5.05C33.73 3.56 29.2 1.5 24 1.5 14.79 1.5 6.69 6.95 3.04 15.02l6.46 5.02C11.58 13.89 17.2 9.5 24 9.5Z"/%3E%3Cpath fill="%2334A853" d="M46.5 24.5c0-1.64-.15-3.21-.43-4.74H24v9.09h12.71c-.55 2.89-2.24 5.28-4.77 6.87l7.29 5.63C43.84 37.26 46.5 31.44 46.5 24.5Z"/%3E%3Cpath fill="%23FBBC05" d="M9.51 21.22c-.33 1-.51 2.07-.51 3.28s.18 2.28.51 3.28l-6.47 5.04C1.64 30.19.75 27.47.75 24.5s.89-5.69 2.29-8.32l6.47 5.04Z"/%3E%3Cpath fill="%23EA4335" d="M24 46c6.5 0 11.96-2.14 15.94-5.82l-7.29-5.63c-2 1.36-4.61 2.21-8.65 2.21-6.8 0-12.54-4.59-14.2-10.88l-6.74 5.25C7.72 41.18 15.04 46 24 46Z"/%3E%3C/svg%3E') no-repeat center/contain;
}

.google-auth-btn:hover {
    transform: translateY(-1px);
    border-color: #9ca3af;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.12);
}

.google-auth-btn:active {
    transform: translateY(0);
    box-shadow: 0 3px 8px rgba(15, 23, 42, 0.1);
}

.home-header__inner {
    max-width: 1440px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    height: 72px;
    padding: 0 24px;
}

/* 브랜드 로고 */
.home-header .brand a {
    color: #2563eb;
    text-decoration: none;
    font-weight: 800;
    letter-spacing: -0.2px;
    font-size: 28px;
}

/* 헤더 왼쪽 영역 */
.header-left {
    display: flex;
    align-items: center;
    gap: 32px;
    height: 100%;
}

.header-left nav.gnb {
    height: 100%;
}

/* GNB 메뉴 */
.home-header .gnb ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 4px;
    height: 100%;
}

.home-header .gnb ul li {
    height: 100%;
}

.home-header .gnb a {
    display: flex;
    align-items: center;
    padding: 8px 14px;
    color: #374151;
    text-decoration: none;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 16px;
    height: 100%;
    border-radius: 8px;
}

.home-header .gnb a:hover {
    color: #2563eb;
    background: rgba(37, 99, 235, 0.05);
}

.home-header .gnb a.is-active {
    color: #2563eb;
    font-weight: 700;
    border-bottom: 3px solid #2563eb;
    border-radius: 0;
}

.home-header .gnb a.highlight {
    font-weight: 700;
    color: #2563eb;
}

/* 모바일 헤더 래퍼 */
.mobile-header-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* 사용자 영역 */
.home-header .user-area {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-logged-out {
    display: flex;
    gap: 8px;
}

/* 카카오 로그인 버튼 */
.kakao-auth-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    color: #3C1E1E;
    background: #FEE500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.kakao-auth-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(254, 229, 0, 0.4);
}

/* 로그인 상태 */
.home-header .welcome-msg {
    color: #374151;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
}

.home-header .user-name {
    color: #2563eb;
    font-weight: 600;
}

.home-header .logout-btn {
    padding: 8px 16px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.home-header .logout-btn:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

/* 모바일 메뉴 토글 */
.home-header .menu-toggle {
    display: none;
    border: none;
    background: #2563eb;
    color: white;
    border-radius: 8px;
    height: 44px;
    width: 44px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 20px;
    align-items: center;
    justify-content: center;
}

.home-header .menu-toggle:hover {
    background: #1d4ed8;
}

/* 햄버거 아이콘 */
.menu-toggle .menu-icon {
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 20px;
}

.menu-toggle .menu-icon span {
    display: block;
    width: 100%;
    height: 2px;
    background: white;
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* 메뉴 열렸을 때 X 아이콘으로 변환 */
.home-header.is-open .menu-toggle .menu-icon span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.home-header.is-open .menu-toggle .menu-icon span:nth-child(2) {
    opacity: 0;
}

.home-header.is-open .menu-toggle .menu-icon span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ===== 태블릿 크기 ===== */
@media (max-width: 1024px) {
    .home-header__inner {
        height: 68px;
        padding: 0 20px;
    }

    .home-header .gnb ul {
        gap: 2px;
    }

    .home-header .gnb a {
        padding: 8px 10px;
        font-size: 15px;
    }

    .header-left {
        gap: 24px;
    }
}

/* ===== 모바일 크기 ===== */
@media (max-width: 768px) {
    .home-header__inner {
        height: 60px;
        padding: 0 16px;
    }

    .home-header .brand a {
        font-size: 24px;
    }

    .home-header .user-area {
        gap: 12px;
    }

    .kakao-auth-btn {
        padding: 8px 14px;
        font-size: 13px;
    }

    .home-header .welcome-msg {
        display: none;
    }

    .home-header .logout-btn {
        padding: 8px 12px;
        font-size: 12px;
    }

    /* 모바일 메뉴 토글 표시 */
    .home-header .menu-toggle {
        display: flex;
    }

    /* 모바일 드롭다운 메뉴 */
    .home-header .gnb {
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        display: none;
        background: #ffffff;
        border-bottom: 1px solid #e5e7eb;
        box-shadow: 0 15px 30px rgba(15, 23, 42, 0.15);
        z-index: 15000;
        /* 콘텐츠보다 항상 위 */
        border-radius: 0 0 16px 16px;
        overflow: hidden;
        animation: none;
        max-height: calc(100vh - 60px);
        overflow-y: auto;
    }

    .home-header.is-open .gnb {
        display: block;
        animation: mobileDropdown 0.3s ease forwards;
    }

    @keyframes mobileDropdown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .home-header .gnb ul {
        margin: 0;
        padding: 16px;
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .home-header.is-open .gnb li {
        height: auto;
    }

    .home-header.is-open .gnb a {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 18px 20px;
        border-radius: 12px;
        font-size: 17px;
        font-weight: 600;
        color: #374151;
        background: #f8fafc;
        border: 1px solid #e5e7eb;
        text-decoration: none;
        transition: all 0.2s ease;
    }

    .home-header.is-open .gnb a:hover,
    .home-header.is-open .gnb a:active {
        background: #e0e7ff;
        color: #2563eb;
        border-color: #c7d2fe;
    }

    /* 현재 선택된 메뉴만 파란색 활성화 */
    .home-header.is-open .gnb a.is-active {
        background: #2563eb;
        color: #ffffff;
        border-color: #2563eb;
    }

    /* highlight 클래스는 모바일에서 일반 스타일 유지 */
    .home-header.is-open .gnb a.highlight {
        color: #374151;
        background: #f8fafc;
        border-color: #e5e7eb;
    }

    .home-header.is-open .gnb a.highlight:hover {
        background: #e0e7ff;
        color: #2563eb;
        border-color: #c7d2fe;
    }

    .home-header.is-open .gnb a.highlight.is-active {
        background: #2563eb;
        color: #ffffff;
        border-color: #2563eb;
    }
}

/* ===== 작은 모바일 ===== */
@media (max-width: 480px) {
    .home-header__inner {
        height: 56px;
        padding: 0 12px;
    }

    .home-header .brand a {
        font-size: 20px;
    }

    .mobile-header-wrap {
        gap: 8px;
    }

    .kakao-auth-btn {
        padding: 6px 10px;
        font-size: 12px;
    }

    .home-header .logout-btn {
        padding: 6px 10px;
        font-size: 11px;
    }

    .home-header .menu-toggle {
        height: 40px;
        width: 40px;
    }

    .menu-toggle .menu-icon {
        width: 18px;
        gap: 4px;
    }

    /* 작은 모바일 메뉴 위치 조정 */
    .home-header .gnb {
        padding-top: 56px;
    }

    .home-header .gnb ul {
        height: calc(100vh - 56px);
        max-width: 320px;
        border-radius: 12px 0 0 12px;
    }

    .home-header.is-open .gnb a {
        padding: 16px 18px;
        font-size: 16px;
    }
}