/**
 * 瀏覽紀錄組件 - 等高商品卡片
 */

/* === 瀏覽紀錄卡片基礎樣式 === */
.browsing-history .product-card-modern {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    height: 100%;
    margin-bottom: 0 !important;
    position: relative;
    display: flex;
    flex-direction: column;
}

.browsing-history .product-card-modern:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

/* === 商品圖片容器 === */
.browsing-history .product-image-container {
    position: relative;
    overflow: hidden;
    background: #f8f9fa;
    height: 200px; /* 固定高度 */
    border-radius: 0.5rem 0.5rem 0 0;
}

.browsing-history .card_product {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease;
}

.browsing-history .product-card-modern:hover .card_product {
    transform: scale(1.05);
}

/* === 商品類型標籤 (右上角) === */
.browsing-history .product-type {
    position: absolute !important;
    top: 8px !important;
    right: 8px !important;
    z-index: 10 !important;
    font-size: 0.75rem !important;
    padding: 6px 12px !important;
    font-weight: 600 !important;
    border-radius: 4px !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3) !important;
    border: 1px solid rgba(255,255,255,0.5) !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
}

/* === 商品覆蓋層 === */
.browsing-history .product-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 5; /* 確保在圖片之上但在標籤之下 */
}

.browsing-history .product-card-modern:hover .product-overlay {
    opacity: 1;
}

.browsing-history .overlay-content {
    text-align: center;
}

/* === 商品資訊區域 - 固定高度版本 === */
.browsing-history .card-body {
    padding: 1rem;
    position: relative;
    z-index: 2;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 140px; /* 固定高度，比精選商品稍小 */
    min-height: 140px; /* 最小高度 */
}

.browsing-history .card-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.3;
    height: 2.6rem; /* 固定標題高度，約2行文字 */
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    color: #212529;
}

.browsing-history .price-section {
    margin-top: auto; /* 推到底部 */
    padding-top: 0.5rem;
}

.browsing-history .original-price-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.25rem;
}

.browsing-history .original-price {
    text-decoration: line-through;
    color: #6c757d;
    font-size: 0.85rem;
}

.browsing-history .current-price-wrapper .product-price {
    color: #e74c3c;
    font-weight: 700;
    font-size: 1.1rem;
}

/* === 再次購買按鈕 === */
.browsing-history .btn-view-product {
    background: linear-gradient(45deg, #28a745, #20c997);
    border: none;
    color: white;
    padding: 0.6rem;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.3s ease;
    margin-top: 0.75rem;
    font-size: 0.85rem;
}

.browsing-history .btn-view-product:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(40, 167, 69, 0.3);
    background: linear-gradient(45deg, #20c997, #17a2b8);
    color: white;
}

/* === 響應式調整 === */
@media (max-width: 768px) {
    .browsing-history .product-image-container {
        height: 180px;
    }
    
    .browsing-history .card-body {
        height: 140px; /* 手機版稍微增加高度 */
        min-height: 140px;
        padding: 0.8rem;
    }
    
    .browsing-history .card-title {
        font-size: 0.9rem;
        height: 3.6rem; /* 增加高度，約3行文字 */
        -webkit-line-clamp: 3; /* 增加到3行 */
    }
    
    .browsing-history .btn-view-product {
        padding: 0.5rem;
        font-size: 0.8rem;
        margin-top: 0.5rem;
    }
} 