* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Navbar 樣式 */
.modern-navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0,0,0,0.08);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
    width: 100%;
}

    .modern-navbar.scrolled {
        box-shadow: 0 4px 30px rgba(0,0,0,0.12);
    }

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 40px;
    height: 80px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    transition: transform 0.3s ease;
}

    .nav-logo:hover {
        transform: scale(1.05);
    }

.logo-icon {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.logo-text {
    font-size: 28px;
    font-weight: 800;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 40px;
    align-items: center;
}

    .nav-menu a {
        color: #2c3e50;
        text-decoration: none;
        font-size: 16px;
        font-weight: 600;
        position: relative;
        transition: color 0.3s ease;
        padding: 8px 0;
    }

        .nav-menu a::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 50%;
            width: 0;
            height: 3px;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            transition: all 0.3s ease;
            transform: translateX(-50%);
            border-radius: 10px;
        }

        .nav-menu a:hover {
            color: #667eea;
        }

            .nav-menu a:hover::after {
                width: 100%;
            }

        .nav-menu a.active::after {
            width: 100%;
        }

.nav-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-search {
    position: relative;
}

.search-input {
    width: 250px;
    padding: 10px 40px 10px 20px;
    border: 2px solid #e8e8e8;
    border-radius: 25px;
    font-size: 14px;
    transition: all 0.3s ease;
    outline: none;
}

    .search-input:focus {
        border-color: #667eea;
        width: 300px;
        box-shadow: 0 5px 15px rgba(102, 126, 234, 0.2);
    }

.search-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #95a5a6;
    font-size: 18px;
    pointer-events: none;
}

.nav-icon-btn {
    position: relative;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: #f8f9fa;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.3s ease;
}

    .nav-icon-btn:hover {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        transform: translateY(-2px);
        box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
    }

    .nav-icon-btn:hover {
        color: white;
    }

.cart-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(245, 87, 108, 0.4);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #2c3e50;
}

/* 行動版選單 */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

    .mobile-menu-overlay.active {
        display: block;
        opacity: 1;
    }

.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 300px;
    height: 100%;
    background: white;
    z-index: 1001;
    padding: 30px;
    transition: right 0.3s ease;
    overflow-y: auto;
}

    .mobile-menu.active {
        right: 0;
    }

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.mobile-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #2c3e50;
}

.mobile-nav-menu {
    list-style: none;
}

    .mobile-nav-menu li {
        margin-bottom: 25px;
    }

    .mobile-nav-menu a {
        color: #2c3e50;
        text-decoration: none;
        font-size: 18px;
        font-weight: 600;
        display: block;
        padding: 10px 0;
        transition: color 0.3s ease;
    }

        .mobile-nav-menu a:hover {
            color: #667eea;
        }

/* RWD */
@media (max-width: 992px) {
    .nav-container {
        padding: 0 20px;
    }

    .nav-menu {
        display: none;
    }

    .nav-search {
        display: none;
    }

    .menu-toggle {
        display: block;
    }

    .modern-navbar {
        position: fixed;
    }
}

@media (max-width: 576px) {
    .nav-container {
        height: 70px;
    }

    .logo-text {
        font-size: 22px;
    }

    .logo-icon {
        width: 38px;
        height: 38px;
        font-size: 20px;
    }

    .nav-icon-btn {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
}

/* ========== 用戶選單容器 ========== */
.user-menu-container {
    position: relative;
}

/* ========== 用戶下拉選單 ========== */
.user-dropdown {
    position: absolute;
    top: calc(100% + 15px);
    right: 0;
    width: 280px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    overflow: hidden;
}

    .user-dropdown.show {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    /* 下拉選單三角形箭頭 */
    .user-dropdown::before {
        content: '';
        position: absolute;
        top: -8px;
        right: 20px;
        width: 16px;
        height: 16px;
        background: white;
        transform: rotate(45deg);
        box-shadow: -2px -2px 4px rgba(0, 0, 0, 0.05);
    }

/* ========== 用戶資訊頭部 ========== */
.user-dropdown-header {
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    backdrop-filter: blur(10px);
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-email {
    font-size: 13px;
    opacity: 0.9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ========== 分隔線 ========== */
.dropdown-divider {
    height: 1px;
    background: #e8e8e8;
    margin: 8px 0;
}

/* ========== 下拉選單項目 ========== */
.user-dropdown-menu {
    list-style: none;
    padding: 8px 0;
    margin: 0;
}

    .user-dropdown-menu li {
        margin: 0;
    }

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: #333;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

    .dropdown-item:hover {
        background: #f5f5f5;
        color: #667eea;
    }

.dropdown-icon {
    font-size: 18px;
    width: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 登出按鈕特殊樣式 */
.logout-item {
    color: #e74c3c;
}

    .logout-item:hover {
        background: #fee;
        color: #c0392b;
    }

/* ========== 行動版用戶資訊 ========== */
.mobile-user-info {
    padding: 24px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}

.mobile-user-avatar {
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    backdrop-filter: blur(10px);
}

.mobile-user-details {
    flex: 1;
}

.mobile-user-name {
    font-weight: 600;
    font-size: 18px;
    margin-bottom: 4px;
}

.mobile-user-email {
    font-size: 14px;
    opacity: 0.9;
}

/* 行動版分隔線 */
.mobile-divider {
    height: 1px;
    background: #e8e8e8;
    margin: 10px 0;
    list-style: none;
}

/* 行動版登出連結 */
.logout-link {
    color: #e74c3c !important;
    font-weight: 500;
}

    .logout-link:hover {
        background: #fee !important;
    }

/* ========== 響應式設計 ========== */
@media (max-width: 768px) {
    .user-dropdown {
        width: 260px;
        right: -10px;
    }
}
