/* ===========================================
   청원한의원 헤더 스타일
   =========================================== */


/* 초기화 */

.fw-header * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}


/* 헤더 전체 */

.fw-header {
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    background: var(--bg-overlay);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 1000;
}


/* 컨테이너 */

.fw-header .fw-header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 0px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}


/* ===========================================
   상단 바 (로고, 가이드, 전화번호)
   =========================================== */

.fw-header .fw-header-top {
    height: 80px;
    border-bottom: 1px solid var(--color-primary-border);
}

.fw-header .fw-header-top .fw-header-container {
    height: 100%;
}


/* 로고 */

.fw-header .fw-logo {
    flex-shrink: 0;
}

.fw-header .fw-logo a {
    display: block;
}

.fw-header .fw-logo img {
    height: 46px;
    width: auto;
    display: block;
    filter: brightness(0) invert(1);
}


/* 로그인/회원가입 버튼들 */

.fw-header .fw-guide-buttons {
    display: flex;
    gap: 25px;
    align-items: center;
}


/* 로그인 링크 (텍스트만) */

.fw-header .fw-login-link,
.fw-header .cart-btn {
    color: #FFFFFF;
    font-size: 18px;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.3s ease;
}

.fw-header .fw-login-link:hover {
    color: var(--color-primary);
}

.fw-header .fw-guide-buttons .divider {
    width: 1px;
    border-right: 2px solid #ffffff40;
    height: 17px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 -10px;
}


/* 회원가입 버튼 */

.fw-header .fw-guide-btn {
    padding: 12px 16px;
    background: var(--color-primary-light);
    border: 1px solid var(--color-primary-border-light);
    border-radius: 4px;
    color: var(--color-primary);
    font-size: 16px;
    font-weight: 500;
    line-height: 1em;
    text-decoration: none;
    transition: all 0.3s ease;
}

.fw-header .fw-guide-btn:hover {
    background: var(--color-primary-hover-bg);
    border-color: var(--color-primary-hover);
    color: var(--color-primary-hover);
}


/* ===========================================
   메인 네비게이션
   =========================================== */

.fw-header .fw-nav {
    height: 60px;
    border-bottom: 1px solid var(--color-primary-border);
    background: transparent;
    position: relative;
}

.fw-header .fw-nav .fw-header-container {
    height: 100%;
}


/* 네비게이션 메뉴 */

.fw-header .fw-nav-menu {
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0px;
    height: 100%;
    width: 100%;
}


/* 네비게이션 아이템 */

.fw-header .fw-nav-item {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
    flex: 1;
    justify-content: center;
}

.fw-header .fw-nav-item>a {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 0 5px;
    /* 양옆 아이콘 공간 확보 */
    color: #FFFFFF;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.4em;
    text-decoration: none;
    text-align: center;
    position: relative;
    transition: color 0.3s ease;
}


/* 아이콘 스타일 (JS로 동적 생성) - absolute 왼쪽 배치 */

.fw-header .fw-nav-icon svg {
    width: 22px;
    height: 18px;
}

@keyframes iconFadeIn {
    from {
        opacity: 0;
        transform: translateY(-50%) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateY(-50%) scale(1);
    }
}


/* 점 스타일 (JS로 동적 생성) - absolute 오른쪽 배치 */


/* 기본적으로는 숨김, 호버나 현재 페이지일 때만 표시 */

.fw-header .fw-nav-dot {
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 4px;
    background: var(--color-primary);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s ease;
}


/* 호버 시 dot 표시 */

.fw-header .fw-nav-item:hover .fw-nav-dot {
    opacity: 1;
}


/* 현재 페이지일 때 dot 표시 */

.fw-header .fw-nav-item.current-page .fw-nav-dot {
    opacity: 1;
}

@keyframes dotFadeIn {
    from {
        opacity: 0;
        transform: translateY(-50%) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateY(-50%) scale(1);
    }
}

@keyframes iconFadeOut {
    from {
        opacity: 1;
        transform: translateY(-50%) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(-50%) scale(0.8);
    }
}

@keyframes dotFadeOut {
    from {
        opacity: 1;
        transform: translateY(-50%) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(-50%) scale(0.8);
    }
}


/* 호버 효과 */

.fw-header .fw-nav-item:hover>a {
    color: var(--color-primary);
}

.fw-header .fw-nav-item {
    position: relative;
}


/* 마우스 오버시 현재 페이지 효과 - fw-nav-item 전체 너비 */

.fw-header .fw-nav-item:hover::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--color-primary-hover);
}


/* 현재 페이지 표시 - fw-nav-item 전체 너비 */

.fw-header .fw-nav-item.current-page>a {
    color: var(--color-primary);
}

.fw-header .fw-nav-item.current-page::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--color-primary);
}


/* 마지막 네비게이션 아이템 왼쪽 디바이더 */

.fw-header .fw-nav-item:nth-child(6)::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 100%;
    background: rgb(201 168 106 / 24%);
    opacity: 0.8;
}


/* ===========================================
   서브메뉴 (각 아이템 내부)
   =========================================== */


/* 서브메뉴 기본 스타일 */

.fw-header .fw-submenu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    padding: 24px 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.3s ease 0.2s;
    pointer-events: none;
    z-index: 998;
}


/* 서브메뉴 리스트 */

.fw-header .fw-submenu ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}


/* 서브메뉴 링크 */

.fw-header .fw-submenu a {
    display: block;
    color: #FFFFFF;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.4em;
    text-decoration: none;
    transition: color 0.3s ease;
    padding: 4px 0;
    word-break: keep-all;
    text-align: center;
}

.fw-header .fw-submenu a:hover {
    color: var(--color-primary);
}


/* 카테고리 구분선 스타일 */

.fw-header .fw-submenu .menu-category-divider {
    font-size: 13px;
    font-weight: 400;
    color: #d6d6d6;
    text-align: center;
    padding: 0px 20px;
    width: 100%;
    margin-top: 0;
    position: relative;
    pointer-events: none;
    cursor: default;
    letter-spacing: 1px;
}


/* 구분선 효과 (텍스트 양쪽에) */

.fw-header .fw-submenu .menu-category-divider::before,
.fw-header .fw-submenu .menu-category-divider::after {
    content: '';
    position: absolute;
    top: 47%;
    width: 37%;
    height: 1px;
    background: linear-gradient(to right, transparent, #585858, transparent);
}

.fw-header .fw-submenu .menu-category-divider::before {
    left: 0;
}

.fw-header .fw-submenu .menu-category-divider::after {
    right: 0;
}


/* 서브메뉴 오버레이 */

.fw-header .fw-submenu-overlay {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-overlay-dark);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    /* 높이는 JavaScript로 동적 설정 */
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 997;
}


/* 네비게이션 전체 호버 시 모든 서브메뉴와 오버레이 표시 */

.fw-header .fw-nav:hover .fw-submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.3s ease 0.2s;
}

.fw-header .fw-nav:hover .fw-submenu-overlay {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}


/* 서브메뉴가 숨겨질 때는 즉시 사라지도록 */

.fw-header .fw-nav:not(:hover) .fw-submenu {
    transition: opacity 0.1s ease, visibility 0.1s ease, transform 0.1s ease;
}


/* ===========================================
   모바일 헤더 스타일
   =========================================== */


/* 모바일 헤더 기본 */

.fw-header-mobile {
    display: none;
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    height: 68px;
    border-bottom: 1px solid var(--color-primary-border);
    z-index: 2147483646;
}


/* 모바일 메뉴 열릴 때 body 스크롤 잠금 */

body.mobile-menu-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}


/* 모바일 메뉴 열릴 때 관리자 바 숨김 */

body.mobile-menu-open #wpadminbar {
    display: none !important;
}

.fw-mobile-container {
    width: 100%;
    height: 100%;
    margin: 0 auto;
    padding: 0 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}


/* 모바일 로고 */

.fw-mobile-logo img {
    height: 35px;
    width: auto;
    filter: brightness(0) invert(1);
}


/* 햄버거 버튼 */

.fw-mobile-menu-toggle {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.fw-mobile-menu-toggle img {}


/* 모바일 메뉴 오버레이 */

.fw-mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #080808ab;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 2147483647;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    overflow-y: auto;
}

.fw-mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
    height: 100vh;
}


/* 모바일 메뉴 컨테이너 */

.fw-mobile-menu {
    width: 100%;
    max-width: 380px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin-left: auto;
    background: var(--bg-dark);
}


/* 모바일 메뉴 헤더 */

.fw-mobile-menu-header {
    width: 100%;
    height: 68px;
    padding: 0 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--color-primary-border);
    background: transparent;
}

.fw-mobile-menu-logo img {
    height: 35px;
    width: auto;
    filter: brightness(0) invert(1);
}

.fw-mobile-menu-close {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.fw-mobile-menu-close img {
    width: 100%;
    filter: invert(1);
    opacity: 0.7;
}


/* 모바일 프로필 섹션 */

.fw-mobile-profile-section {
    width: 100%;
    padding: 20px 15px;
    background: transparent;
    border-bottom: 1px solid var(--color-primary-border);
}


/* 모바일 프로필 정보 */

.fw-mobile-profile-info {
    padding: 0;
    margin-bottom: 20px;
}

.fw-mobile-profile-name {
    font-size: 18px;
    margin: 0 0 10px 0;
    color: #ffffff;
    font-weight: 600;
}

.fw-mobile-user-stats {
    margin-top: 8px;
}

.fw-mobile-points {
    margin: 0;
    font-size: 14px;
    color: #c1c1c1;
}

.fw-mobile-user-stats i {
    color: var(--e-global-color-accent);
}

.fw-mobile-points strong {
    font-size: 16px;
    letter-spacing: -0.5px;
    margin-right: 2px;
    color: #ffffff;
}


/* 모바일 멤버십 카드 */

.fw-mobile-membership-card-wrapper {
    margin-top: 20px;
}

.fw-mobile-membership-card {
    background: linear-gradient(135deg, rgba(240, 240, 245, 0.12) 0%, rgba(200, 200, 210, 0.08) 25%, rgba(180, 180, 190, 0.10) 50%, rgba(200, 200, 210, 0.08) 75%, rgba(240, 240, 245, 0.12) 100%);
    border: 1px solid rgba(220, 220, 230, 0.25);
    border-radius: 5px;
    padding: 16px;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.fw-mobile-membership-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.15) 50%, transparent 100%);
    transition: left 0.6s ease;
}

.fw-mobile-membership-card:active::before {
    left: 100%;
}

.fw-mobile-membership-card-content {
    position: relative;
    z-index: 1;
}

.fw-mobile-membership-title {
    font-size: 15px;
    font-weight: 600;
    color: #f5f5f5;
    margin: 0 0 4px 0;
    letter-spacing: -0.3px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.fw-mobile-membership-desc {
    font-size: 12px;
    color: #d0d0d0;
    margin: 0;
}

.fw-mobile-membership-btn {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    color: #e8e8e8;
    font-size: 13px;
    font-weight: 500;
    position: relative;
    z-index: 1;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
}

.fw-mobile-membership-btn svg {
    transition: transform 0.3s ease;
}

.fw-mobile-membership-btn:active svg {
    transform: translateX(3px);
}


/* 로그인/회원가입 버튼 */

.fw-mobile-auth-buttons {
    width: 100%;
    padding: 12px 15px;
    background: transparent;
    border-bottom: 1px solid var(--color-primary-border);
    display: flex;
    gap: 10px;
}

.fw-mobile-auth-btn {
    flex: 1;
    padding: 8px 16px;
    background: var(--color-primary-light);
    border: 1px solid var(--color-primary-border-light);
    border-radius: 4px;
    color: var(--color-primary);
    font-size: 14px;
    font-weight: 500;
    line-height: 16.8px;
    text-decoration: none;
    text-align: center;
    transition: all 0.3s ease;
}


/* 메인 메뉴 컨텐츠 */

.fw-mobile-menu-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}


/* 메뉴 아이템 */

.fw-mobile-menu-item {
    width: 100%;
    border-bottom: 1px solid var(--color-primary-border);
}

.fw-mobile-menu-link {
    width: 100%;
    padding: 17px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: transparent;
    color: #FFFFFF;
    font-size: 15px;
    font-weight: 500;
    line-height: 19.6px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: background 0.3s ease;
}


/* 특별 스타일 */

.fw-mobile-menu-special {
    color: var(--color-primary) !important;
}


/* 메뉴 아이콘 */

.fw-mobile-menu-icon {
    margin-right: 8px;
}


/* 메뉴 컨텐츠 래퍼 (아이콘, 텍스트, dot을 그룹화) */

.fw-mobile-menu-content-wrapper {
    display: flex;
    align-items: center;
    gap: 3px;
}


/* 메뉴 dot */

.fw-mobile-menu-dot {
    display: none;
    width: 4px;
    height: 4px;
    background: var(--color-primary);
    border-radius: 50%;
}


/* 토글 아이콘 (+와 - 모양) */

.fw-mobile-menu-toggle-icon {
    width: 10px;
    height: 10px;
    transition: opacity 0.3s ease;
    filter: brightness(0) invert(0.4);
}

.fw-mobile-menu-item-parent.active .fw-mobile-menu-toggle-open {
    display: none;
}

.fw-mobile-menu-item-parent.active .fw-mobile-menu-toggle-close {
    display: block !important;
    filter: brightness(0) invert(0.7);
}


/* 서브메뉴 */

.fw-mobile-submenu {
    max-height: 0;
    overflow: hidden;
    background: var(--bg-overlay-dark);
    transition: max-height 0.3s ease;
}

.fw-mobile-submenu.active {
    max-height: fit-content;
}

.fw-mobile-submenu-link {
    display: block;
    padding: 14px 16px 14px 17px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    font-weight: 400;
    line-height: 19.6px;
    text-decoration: none;
    transition: color 0.3s ease;
}


/* 모바일 메뉴 카테고리 디바이더 */

.fw-mobile-submenu .menu-category-divider {
    display: block;
    font-size: 13px;
    font-weight: 400;
    color: #d6d6d6;
    text-align: center;
    padding: 0px;
    width: 100%;
    margin-top: 10px;
    position: relative;
    pointer-events: none;
    cursor: default;
    letter-spacing: 1px;
}


/* 모바일 메뉴 디바이더 구분선 효과 (텍스트 양쪽에) */

.fw-mobile-submenu .menu-category-divider::before,
.fw-mobile-submenu .menu-category-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 30%;
    height: 1px;
    background: linear-gradient(to right, transparent, #585858, transparent);
}

.fw-mobile-submenu .menu-category-divider::before {
    left: 0;
}

.fw-mobile-submenu .menu-category-divider::after {
    right: 0;
}


/* 활성화된 부모 메뉴 */

.fw-mobile-menu-item-parent.active .fw-mobile-menu-link {
    background: var(--color-primary-hover-bg);
    color: var(--color-primary);
}

.fw-mobile-menu-item-parent.active .fw-mobile-menu-link:hover {
    background: var(--color-primary-hover-bg);
}


/* 활성화된 메뉴의 아이콘과 텍스트 색상 */

.fw-mobile-menu-item-parent.active .fw-mobile-menu-icon {
    color: var(--color-primary);
}

.fw-mobile-menu-item-parent.active .fw-mobile-menu-content-wrapper span {
    color: var(--color-primary);
}

.fw-mobile-menu-item-parent.active .fw-mobile-menu-dot {
    background: var(--color-primary);
}


/* 하단 가이드 버튼 */

.fw-mobile-guide-buttons {
    width: 100%;
    padding: 12px 16px;
    background: #F7F7FB;
    display: flex;
    gap: 3px;
}

.fw-mobile-guide-btn {
    flex: 1;
    padding: 12px 16px;
    background: white;
    border: 1px solid #F1F1F5;
    border-radius: 4px;
    color: #555555;
    font-size: 12px;
    font-weight: 500;
    line-height: 16.8px;
    text-decoration: none;
    text-align: center;
    transition: background 0.3s ease;
}

.fw-mobile-guide-btn:hover {
    background: #F9F9F9;
}


/* 하단 전화번호 박스 */

.fw-mobile-phone-box {
    width: 100%;
    height: 80px;
    padding: 15px 30px;
    background: #006F3F;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    animation: phoneBoxColorChange 600ms infinite alternate;
}

@keyframes phoneBoxColorChange {
    0% {
        background: #006F3F;
    }
    100% {
        background: #2A844D;
    }
}

.fw-mobile-phone-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.fw-mobile-phone-label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    font-weight: 400;
    line-height: 14px;
}

.fw-mobile-phone-number {
    color: white;
    text-decoration: none;
    display: flex;
    align-items: baseline;
    gap: 2px;
}

.fw-mobile-phone-prefix {
    font-size: 18px;
    font-weight: 700;
    line-height: 18px;
}

.fw-mobile-phone-main {
    font-size: 24px;
    font-weight: 700;
    line-height: 24px;
}

.fw-mobile-phone-box img {
    opacity: 0.2;
}


/* ===========================================
   반응형 (모바일은 추후 추가 예정)
   =========================================== */

@media (max-width: 1600px) {}

@media (max-width: 1280px) {
    .fw-header .fw-header-container {}
    .fw-header .fw-nav .fw-header-container {}
    .fw-header .fw-nav-menu {}
    .fw-header .fw-nav-item>a {
        font-size: 16px;
        padding: 0 8px;
    }
    .fw-header .fw-header-top-right {}
}

@media (max-width: 1024px) {
    .fw-header .fw-guide-btn {
        font-size: 14px;
        padding: 10px 12px;
    }
    .fw-header .fw-phone-label {
        font-size: 12px;
    }
    .fw-header .fw-phone-prefix {
        font-size: 16px;
    }
    .fw-header .fw-phone-main {
        font-size: 20px;
    }
    .fw-header .fw-nav-item>a {
        font-size: 15px;
    }
    .fw-header .fw-nav-menu {
        gap: 12px;
    }
}

@media (max-width: 768px) {
    .fw-header {
        margin-bottom: 68px;
    }
    /* PC 헤더 숨김 */
    .fw-header .fw-header-top {
        display: none;
    }
    .fw-header .fw-nav {
        display: none;
    }
    /* 모바일 헤더 표시 */
    .fw-header-mobile {
        display: block;
    }
}