/* ==================== 企業級支援滾動變色 Header ==================== */

/* 1. 基礎狀態：初始透明，浮動在 Hero 圖片之上 */
.header {
    background: transparent; /* 初始透明 */
    position: fixed;        /* 固定在最上方 */
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;          /* 確保高於 Swiper 與 Modal */
    /* 🎯 核心修正：為手機狀態列預留空間 */
    /* padding-top: env(safe-area-inset-top); */

    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1); /* 平滑過渡動畫 */
    border-bottom: 1px solid rgba(255, 255, 255, 0); /* 初始微弱白線 */
}

/* 2. 滾動後的狀態：變為白色背景 (由 JS 觸發 .scrolled) */
.header.scrolled {
    background: rgba(255, 255, 255, .95); /* 白色背景 */
    backdrop-filter: blur(15px);          /* 毛玻璃模糊效果 */
    /* box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);  */
    border-bottom: 1px solid rgba(0, 0, 0, 0.05); 
}

/* 3. 佈局容器 */
.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 75px;
    padding: 0 24px;
    max-width: 1400px;
    margin: auto;
}

/* 4. Logo 連結 */
.logo-link {
    display: flex;
    align-items: center;
    transition: transform 0.2s;
}

.logo-link:hover {
    transform: scale(1.02);
}

/* 5. 右側動作區塊 */
.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

    
    /* 6. 城市選擇器 (Location Selector) - 隨背景變化 */
    .location-selector {
        padding: 6px 8px;
        border-radius: 8px;
        color: white !important;
        border: 1px solid #e2e8f0 !important; /* Defined width and style */
        display: inline-block;
    }

    .location-selector:hover {
        background: rgba(0, 0, 0, 0.07);
    }

    /* 初始文字顏色：白色 */
    .location-selector .location-text,
    .location-selector i {
        color: white !important; /* */
        /* font-weight: 600; */
        
    }

    /* 滾動後：變為淺灰背景與深色文字 */
    .header.scrolled .location-selector {
        /* background: #f1f5f9 !important;  */
        border-color: #e2e8f0 !important;
    }

.header.scrolled .location-selector .location-text,
.header.scrolled .location-selector i {
    color: #1a202c !important; 
}

/* 7. 圖示按鈕 (Icon Buttons: 通知、購物車、選單) */
.icon-btn {
    width: 42px;
    height: 42px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    transition: all 0.2s;
    position: relative;
    text-decoration: none;
}

/* 初始圖示顏色：白色 */
.icon-btn i, .icon-btn .bi {
    color: white !important; /* */
    font-size: 1.3rem;
}

/* 滾動後圖示變深色 */
.header.scrolled .icon-btn i, 
.header.scrolled .icon-btn .bi {
    color: #4a5568 !important; /* */
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.header.scrolled .icon-btn:hover {
    background: #f1f5f9;
}

/* 8. 通知紅點 */
.notification-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 10px;
    height: 10px;
    background: #ef4444;
    border-radius: 50%;
    border: 2px solid white;
}

/* 9. 手機版隱藏元素處理 */
/* .hidden {
    display: none !important;
} */

@media (max-width: 768px) {

    .menu-btn {
        /* display: block; */
        display: none !important;
    }

    .header {
        height: 75px; 
        background: rgba(255, 255, 255, 1); 
        backdrop-filter: blur(10px);
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    }
    
    .header-content {
        height: 75px;
        padding: 0 15px;
    }

    .header .location-selector .location-text,
    .header .location-selector i {
        color: #1a202c !important; 
    }
    
    .header .icon-btn i, 
    .header .icon-btn .bi {
        color: #4a5568 !important; 
    }

}