/**
 * UV100 商品頁「推薦商品」側邊欄樣式
 * 按鈕插在 .product_meta 後面，點擊開關右側 uv100-recommend-sidebar。
 */

/* ========================================
   開關按鈕（樣式比照 product-compare.css 的 .uv100-add-compare-btn）
   ======================================== */

.uv100-recommend-toggle-btn {
    display: inline-block;
    margin-top: 0.75rem;
}

.uv100-recommend-toggle-btn a {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border: 1px solid #ddd;
    line-height: 1.6;
    border-radius: 3px;
    font-weight: 400;
    font-size: 15px;
    padding: 3px 15px;
    cursor: pointer;
    color: inherit;
    text-decoration: none;
    transition: color 0.2s, border-color 0.2s;
}

.uv100-recommend-toggle-btn a:hover {
    color: #fe8d00;
    border-color: #fe8d00;
}

.uv100-recommend-toggle-btn a.active {
    color: #fe8d00;
    border-color: #fe8d00;
}

/* ========================================
   側邊欄（開關顯示/隱藏，不隨捲動變 fixed —— 開啟時就是 fixed）
   ======================================== */

.uv100-recommend-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 300px;
    max-width: 85vw;
    height: 100vh;
    background: #fff;
    box-shadow: -4px 0 16px rgba(0, 0, 0, 0.15);
    z-index: 999998;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.uv100-recommend-sidebar.open {
    transform: translateX(0);
}

.uv100-recommend-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 16px 12px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}

.uv100-recommend-sidebar-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #333;
}

.uv100-recommend-sidebar-close {
    background: none;
    border: none;
    font-size: 22px;
    line-height: 1;
    color: #999;
    cursor: pointer;
    padding: 4px;
    margin: 0px;
}

.uv100-recommend-sidebar-close:hover {
    color: #333;
}

.uv100-recommend-sidebar-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    -webkit-overflow-scrolling: touch;
}

.uv100-recommend-sidebar-body::-webkit-scrollbar {
    width: 4px;
}

.uv100-recommend-sidebar-body::-webkit-scrollbar-thumb {
    background: #ff8b00;
    border-radius: 10px;
}

.uv100-recommend-loading,
.uv100-recommend-empty {
    text-align: center;
    padding: 40px 12px;
    color: #999;
    font-size: 13px;
}

/* ========================================
   商品卡片
   ======================================== */

.uv100-recommend-card {
    display: block;
    margin-bottom: 14px;
    border: 1px solid #eee;
    border-radius: 6px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.2s, border-color 0.2s;
}

.uv100-recommend-card:hover {
    border-color: #ff8b00;
    box-shadow: 0 2px 8px rgba(255, 139, 0, 0.15);
}

.uv100-recommend-card-img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
    background: #f5f5f5;
}

.uv100-recommend-card-body {
    padding: 8px 10px;
}

.uv100-recommend-card-name {
    font-size: 13px;
    color: #333;
    margin: 0 0 4px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.uv100-recommend-card-price {
    font-size: 13px;
    font-weight: 700;
    color: #ff8b00;
    margin: 0;
}

/* ========================================
   遮罩（手機版點背景可關閉）
   ======================================== */

.uv100-recommend-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 999997;
    display: none;
}

.uv100-recommend-overlay.open {
    display: block;
}

@media (max-width: 768px) {
    .uv100-recommend-sidebar {
        width: 85vw;
    }
}
