/* ============================================
   CART-HEADER.CSS
   頂部購物車 / 收藏按鈕樣式
   + Toast 倒數 bar
   + Header z-index 修復（不蓋 chatbox）
   ============================================ */

/* ============================================
   1. Header z-index 修復
   讓聊天工具的對話框顯示在 header 上面
   ============================================ */

.header-main {
    position: sticky;
    top: 0;
    z-index: 200 !important;    /* 降低，讓 chatbox 可以蓋過去 */
}

.header-top {
    z-index: 200 !important;
}

/* 聊天工具通常用 z-index 999999，這裡確保不衝突 */
/* Tidio / Tawk / Intercom 的 iframe 會自帶高 z-index，無需額外設定 */

/* ============================================
   2. 頂部動作按鈕
   ============================================ */

.header-action-btn {
    position: relative;
    display: flex;
    align-items: center;
    gap: 4px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: inherit;
    font-size: 20px;
    padding: 4px 6px;
    border-radius: 6px;
    transition: color 0.2s;
}

.header-action-btn:hover {
    color: #4CCAB8;
}

/* ============================================
   3. 計數徽章
   ============================================ */

.bookmark-count,
.cart-count {
    display: none;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    border-radius: 9px;
    line-height: 1;
}

.bookmark-count { background: #ff4757; }
.cart-count     { background: #FF6B35; }

/* ============================================
   4. Toast 通知 + 倒數 Bar
   ============================================ */

.custom-notification {
    position: fixed;
    bottom: 24px;
    right: 24px;
    min-width: 260px;
    max-width: 320px;
    padding: 14px 18px 18px;     /* 底部多留空間給 bar */
    border-radius: 10px;
    color: #fff;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    z-index: 9999;
    box-shadow: 0 6px 20px rgba(0,0,0,0.18);
    font-size: 14px;
    overflow: hidden;             /* 裁切 bar */
    animation: toastSlideIn 0.3s ease;
}

@keyframes toastSlideIn {
    from { transform: translateX(110%); opacity: 0; }
    to   { transform: translateX(0);    opacity: 1; }
}

@keyframes toastSlideOut {
    from { transform: translateX(0);    opacity: 1; }
    to   { transform: translateX(110%); opacity: 0; }
}

.custom-notification ion-icon {
    font-size: 20px;
    flex-shrink: 0;
    margin-top: 1px;
}

/* 倒數進度條 */
.custom-notification::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 4px;
    width: 100%;
    background: rgba(255,255,255,0.5);
    border-radius: 0 0 10px 10px;
    animation: toastCountdown var(--toast-duration, 3s) linear forwards;
}

@keyframes toastCountdown {
    from { width: 100%; }
    to   { width: 0%; }
}

/* 顏色變體 */
.custom-notification.notification-success { background: #4CAF50; }
.custom-notification.notification-error   { background: #F44336; }
.custom-notification.notification-info    { background: #4CCAB8; }

/* ============================================
   修復：停用原有 notification-toast box
   （改用統一的 .custom-notification toast）
   ============================================ */

.notification-toast {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}