/* ==========================================
   Header 優化設計 - 精美玻璃擬態版
   現代化導航列，採用毛玻璃效果與流暢動畫
   ========================================== */

.header {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    padding: 1rem 0 !important;
    background: rgba(250, 246, 240, 0.85) !important;
    backdrop-filter: blur(25px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(25px) saturate(180%) !important;
    z-index: 1000 !important;
    box-shadow: 0 8px 32px rgba(44, 36, 22, 0.08),
        0 2px 8px rgba(212, 165, 116, 0.1) !important;
    border-bottom: 1px solid rgba(212, 165, 116, 0.15) !important;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.header.scrolled {
    padding: 0.7rem 0 !important;
    background: rgba(250, 246, 240, 0.95) !important;
    backdrop-filter: blur(30px) saturate(200%) !important;
    -webkit-backdrop-filter: blur(30px) saturate(200%) !important;
    box-shadow: 0 12px 40px rgba(44, 36, 22, 0.12),
        0 4px 12px rgba(212, 165, 116, 0.15) !important;
    border-bottom: 1px solid rgba(212, 165, 116, 0.25) !important;
}

/* Header 內部佈局：Logo 左，選單右 */
.header .container {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
}

/* Logo 樣式優化 */
.logo {
    text-shadow: 0 2px 8px rgba(255, 255, 255, 0.9) !important;
    color: var(--color-dark) !important;
    font-weight: 700 !important;
    font-size: 1.4rem !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    transition: all 0.3s ease !important;
    font-family: var(--font-serif) !important;
    position: relative;
}

.logo span:first-child {
    font-size: 1.6rem;
    filter: drop-shadow(0 2px 4px rgba(212, 165, 116, 0.3));
    transition: transform 0.3s ease;
}

.logo:hover span:first-child {
    transform: scale(1.15) rotate(-10deg);
}

.logo span:last-child {
    background: linear-gradient(135deg, #2C2416 0%, #8B6F47 50%, #D4A574 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 確保導航是橫向排列且在右側 */
.nav {
    display: flex !important;
    align-items: center !important;
}

.nav-menu {
    display: flex !important;
    flex-direction: row !important;
    gap: 0.25rem !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* 導航連結優化 */
.nav-link {
    display: inline-block !important;
    padding: 0.75rem 1.5rem !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    color: var(--color-dark) !important;
    position: relative;
    border-radius: 12px !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    overflow: hidden;
}

/* 背景動畫效果 */
.nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(212, 165, 116, 0.15), rgba(139, 111, 71, 0.15));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

/* 底部線條動畫 */
.nav-link::after {
    content: '';
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #D4A574, #8B6F47);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 2px;
}

.nav-link:hover {
    color: #D4A574 !important;
    transform: translateY(-2px) !important;
}

.nav-link:hover::before {
    opacity: 1;
}

.nav-link:hover::after {
    width: 70%;
}

/* 活動狀態 */
.nav-link.active {
    background: linear-gradient(135deg, rgba(212, 165, 116, 0.2), rgba(139, 111, 71, 0.15));
    color: #D4A574 !important;
}

.nav-link.active::after {
    width: 70%;
}

/* 移動端選單按鈕 */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 8px;
    background: rgba(212, 165, 116, 0.1);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mobile-menu-toggle span {
    display: block;
    width: 25px;
    height: 2.5px;
    background: linear-gradient(90deg, #D4A574, #8B6F47);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu-toggle:hover {
    background: rgba(212, 165, 116, 0.2);
}

.mobile-menu-toggle:hover span {
    background: linear-gradient(90deg, #C08F5A, #D4A574);
}

/* 確保 header 在 hero 分屏模式下也正常顯示 */
body {
    padding-top: 0 !important;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }

    .nav-menu {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: rgba(250, 246, 240, 0.98);
        backdrop-filter: blur(30px);
        flex-direction: column !important;
        gap: 0 !important;
        padding: var(--spacing-sm) 0;
        box-shadow: 0 8px 32px rgba(44, 36, 22, 0.15);
        opacity: 0;
        visibility: hidden;
        transform: translateY(-20px);
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        border-bottom: 1px solid rgba(212, 165, 116, 0.2);
    }

    .nav-menu.active {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .nav-link {
        width: 100%;
        text-align: center;
        padding: 1rem 2rem !important;
        border-radius: 0 !important;
    }

    .nav-link::after {
        bottom: 4px;
    }

    .logo {
        font-size: 1.2rem !important;
    }
}