/* ============================================
   BOOKMARK-SIDEBAR.CSS v3
   - 右側滑入，上下滾動
   - 透明灰背景遮罩，點空白關閉
   ============================================ */

/* ============================================
   1. 遮罩層 - 透明灰
   ============================================ */

#bookmarkOverlay {
    position: fixed;
    inset: 0;
    background: rgba(80, 80, 80, 0.45);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 8998;
    opacity: 0;
    transition: opacity 0.3s ease;
    cursor: pointer;
}

#bookmarkOverlay.active {
    opacity: 1;
}

/* ============================================
   2. 側邊欄主體 - 右側滑入
   ============================================ */

#bookmarkModal {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 460px;
    max-width: 95vw;
    background: #fff;
    z-index: 9000;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 24px rgba(0,0,0,0.12);
}

#bookmarkModal.active {
    transform: translateX(0);
}

/* ============================================
   3. 內部容器
   ============================================ */

#bookmarkModal .sidebar-category {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    padding: 0;
}

/* ============================================
   4. 頂部標題欄
   ============================================ */

#bookmarkModal .sidebar-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 2px solid #f0f0f0;
    background: #fff;
    flex-shrink: 0;
}

#bookmarkModal .sidebar-title {
    font-size: 16px;
    font-weight: 700;
    color: #333;
    letter-spacing: 1px;
    margin: 0;
}

.bookmarkModal_close {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1.5px solid #ddd;
    background: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #666;
    transition: all 0.2s;
    flex-shrink: 0;
}

.bookmarkModal_close:hover {
    background: #ff4757;
    color: #fff;
    border-color: #ff4757;
}

/* ============================================
   5. 書籤列表 - 垂直滾動
   ============================================ */

#bookmarkList {
    flex: 1;
    overflow-y: auto;               /* 上下滾動 */
    overflow-x: hidden;
    display: flex;
    flex-direction: column;         /* 垂直排列 */
    gap: 0;
    padding: 0;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: #4CCAB8 #f0f0f0;
}

#bookmarkList::-webkit-scrollbar { width: 5px; }
#bookmarkList::-webkit-scrollbar-track { background: #f0f0f0; }
#bookmarkList::-webkit-scrollbar-thumb { background: #4CCAB8; border-radius: 3px; }

/* ============================================
   6. 書籤卡片 - 橫向 list 樣式
   ============================================ */

.bookmark-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    background: #fff;
    position: relative;
    transition: background 0.15s;
    cursor: pointer;
    width: 100%;
}

.bookmark-item:hover {
    background: #f9fffe;
}

.bookmark-item:last-child {
    border-bottom: none;
}

/* 圖片 */
.bookmark-item .showcase-banner {
    position: relative;
    width: 80px;
    height: 80px;
    min-width: 80px;
    border-radius: 8px;
    overflow: hidden;
    background: #f8f8f8;
}

.bookmark-item .showcase-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.3s;
}

.bookmark-item .showcase-banner .product-img.hover {
    position: absolute;
    top: 0; left: 0;
    opacity: 0;
}

.bookmark-item:hover .showcase-banner .product-img.hover  { opacity: 1; }
.bookmark-item:hover .showcase-banner .product-img.default { opacity: 0; }

.bookmark-item .showcase-badge {
    position: absolute;
    top: 4px; left: 4px;
    z-index: 2;
    font-size: 9px;
    padding: 2px 5px;
    border-radius: 4px;
}

/* 文字區域 */
.bookmark-item .showcase-content {
    flex: 1;
    min-width: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.bookmark-item .showcase-category {
    font-size: 10px;
    color: #4CCAB8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.bookmark-item .showcase-title,
.bookmark-item .showcase-title h3 {
    font-size: 13px !important;
    color: #333;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
}

.bookmark-item .showcase-rating {
    display: flex;
    gap: 2px;
}

.bookmark-item .showcase-rating ion-icon { font-size: 10px; color: #ffc107; }

.bookmark-item .price-box {
    display: flex;
    align-items: center;
    gap: 6px;
}

.bookmark-item .price { font-size: 14px; font-weight: 700; color: #4CCAB8; }
.bookmark-item del    { font-size: 11px; color: #aaa; }

/* 隱藏不需要的元素 */
.bookmark-item .showcase-actions { display: none !important; }
.bookmark-item .eye_modal        { display: none !important; }

/* ============================================
   7. 移除按鈕
   ============================================ */

.bookmark-remove-btn {
    width: 28px;
    height: 28px;
    min-width: 28px;
    border-radius: 50%;
    background: #f5f5f5;
    border: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    color: #aaa;
    transition: all 0.2s;
    padding: 0;
    flex-shrink: 0;
}

.bookmark-remove-btn:hover {
    background: #ff4757;
    color: #fff;
    border-color: #ff4757;
}

/* ============================================
   8. 空狀態
   ============================================ */

.bookmark-empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    gap: 12px;
}

.bookmark-empty-state ion-icon { font-size: 52px; color: #ddd; }
.bookmark-empty-state p { margin: 0; font-size: 15px; color: #999; text-align: center; }

/* ============================================
   9. 響應式
   ============================================ */

@media (max-width: 480px) {
    #bookmarkModal {
        width: 100%;
        max-width: 100%;
    }

    .bookmark-item .showcase-banner {
        width: 64px;
        height: 64px;
        min-width: 64px;
    }

    .bookmark-item .showcase-title,
    .bookmark-item .showcase-title h3 { font-size: 12px !important; }
    .bookmark-item .price { font-size: 13px; }
}