/* === 基礎愛心按鈕樣式 === */
.wish-button {
    background: transparent !important;
    border: none !important;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    outline: none !important;
    box-shadow: none !important;
    border-radius: 0;
}

.wish-button:hover:not(:disabled) {
    background: none !important;
    background-color: transparent !important;
    transform: scale(1.1);
    box-shadow: none !important;
}

.wish-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.wish-button:active {
    background: none !important;
    background-color: transparent !important;
    transform: scale(0.95);
    box-shadow: none !important;
}

.wish-button:focus {
    background: none !important;
    background-color: transparent !important;
    box-shadow: none !important;
    border: none !important;
    outline: none !important;
}

/* === 愛心按鈕動畫 === */
@keyframes wishHeartBeat {
    0% { transform: scale(1); }
    14% { transform: scale(1.3); }
    28% { transform: scale(1); }
    42% { transform: scale(1.3); }
    70% { transform: scale(1); }
}

.wish-button.added svg {
    animation: wishHeartBeat 0.8s ease-in-out;
}

.wish-button svg {
    transition: all 0.2s ease;
    filter: drop-shadow(0px 0px 1px rgba(0,0,0,0.5));
}

/* === 乾淨的愛心按鈕樣式（用於產品卡片） === */
.wish-button-clean {
    background: none !important;
    background-color: transparent !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    transition: all 0.2s ease;
    padding: 0;
    margin: 0;
    cursor: pointer;
}

.wish-button-clean:hover {
    background: none !important;
    background-color: transparent !important;
    box-shadow: none !important;
    border: none !important;
    outline: none !important;
    transform: scale(1.1);
}

.wish-button-clean:focus {
    background: none !important;
    background-color: transparent !important;
    box-shadow: none !important;
    border: none !important;
    outline: none !important;
}

.wish-button-clean:active {
    background: none !important;
    background-color: transparent !important;
    box-shadow: none !important;
    border: none !important;
    outline: none !important;
    transform: scale(0.95);
}

/* === Category 頁面中的愛心按鈕 === */
.category-wish-btn {
    position: absolute;
    top: 3px;
    right: 3px;
    z-index: 10;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    padding: 6px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.category-wish-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* === Product 頁面中的愛心按鈕 === */
.product-wish-btn {
    transition: all 0.2s ease;
}

.product-wish-btn:hover {
    transform: scale(1.05);
}

/* === 收藏夾頁面樣式 === */
.wishlist-page {
    font-family: 'Mulish', -apple-system, BlinkMacSystemFont, sans-serif;
}

.wishlist-header {
    text-align: center;
    margin-bottom: 2rem;
    padding: 2rem 0;
}

.wishlist-title {
    font-family: 'Lora', serif;
    font-size: 2.5rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
}

.wishlist-subtitle {
    color: #666;
    font-size: 1rem;
    margin: 0;
}

.wishlist-grid {
    display: grid;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* === 響應式網格 === */
@media (max-width: 576px) {
    .wishlist-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
}

@media (min-width: 577px) and (max-width: 768px) {
    .wishlist-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

@media (min-width: 769px) and (max-width: 992px) {
    .wishlist-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.2rem;
    }
}

@media (min-width: 993px) and (max-width: 1200px) {
    .wishlist-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 1.5rem;
    }
}

@media (min-width: 1201px) {
    .wishlist-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 1.5rem;
        max-width: 1400px;
        margin: 0 auto 2rem auto;
    }
}

/* === 收藏夾產品卡片 === */
.wishlist-product-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    position: relative;
}

.wishlist-product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.wishlist-product-image {
    width: 100%;
    aspect-ratio: 4/5;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.wishlist-product-card:hover .wishlist-product-image {
    transform: scale(1.05);
}

.wishlist-product-info {
    padding: 1rem;
}

.wishlist-product-name {
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    line-height: 1.4;
    color: #333;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.wishlist-product-variant {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.wishlist-product-price {
    font-weight: 600;
    color: #333;
    font-size: 1rem;
}

/* === 空收藏夾狀態 === */
.wishlist-empty {
    text-align: center;
    padding: 4rem 2rem;
    color: #666;
}

.wishlist-empty-icon {
    width: 64px;
    height: 64px;
    color: #ddd;
    margin: 0 auto 1.5rem auto;
    stroke-width: 1.5;
}

.wishlist-empty-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
}

.wishlist-empty-text {
    font-size: 1rem;
    color: #666;
    margin-bottom: 2rem;
    line-height: 1.5;
}

.wishlist-empty-btn {
    display: inline-block;
    padding: 0.75rem 2rem;
    background-color: #000;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.wishlist-empty-btn:hover {
    background-color: #333;
    color: #fff;
    text-decoration: none;
}

/* === 載入狀態 === */
.wishlist-loading {
    text-align: center;
    padding: 3rem 2rem;
}

.wishlist-loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #f0f0f0;
    border-top: 3px solid #af9687;
    border-radius: 50%;
    animation: wishlistSpin 1s linear infinite;
    margin: 0 auto 1rem auto;
}

@keyframes wishlistSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.wishlist-loading-text {
    color: #666;
    font-size: 1rem;
}

/* === 錯誤狀態 === */
.wishlist-error {
    text-align: center;
    padding: 3rem 2rem;
    color: #dc3545;
}

.wishlist-error-icon {
    width: 48px;
    height: 48px;
    color: #dc3545;
    margin: 0 auto 1rem auto;
    stroke-width: 1.5;
}

.wishlist-error-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.wishlist-error-text {
    font-size: 1rem;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.wishlist-error-btn {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    background-color: #dc3545;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.wishlist-error-btn:hover {
    background-color: #c82333;
    color: #fff;
    text-decoration: none;
}

/* === Header Badge 樣式 === */
.wishlist-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: #dc3545;
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 0.7rem;
    font-weight: 600;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: all 0.2s ease;
}

.wishlist-badge:empty {
    display: none;
}

/* === 成功訊息 Toast === */
.wishlist-toast {
    position: fixed;
    top: 80px;
    right: 20px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1rem 1.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 9999;
    max-width: 300px;
    animation: wishlistToastSlideIn 0.3s ease-out;
}

.wishlist-toast.success {
    border-left: 4px solid #28a745;
}

.wishlist-toast.error {
    border-left: 4px solid #dc3545;
}

.wishlist-toast-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.wishlist-toast-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.wishlist-toast-text {
    font-size: 0.9rem;
    line-height: 1.4;
    margin: 0;
}

@keyframes wishlistToastSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* === 手機版調整 === */
@media (max-width: 768px) {
    .wish-button {
        padding: 6px;
    }
    
    .wishlist-title {
        font-size: 2rem;
    }
    
    .wishlist-product-info {
        padding: 0.75rem;
    }
    
    .wishlist-product-name {
        font-size: 0.8rem;
    }
    
    .wishlist-product-variant {
        font-size: 0.7rem;
    }
    
    .wishlist-product-price {
        font-size: 0.9rem;
    }
    
    .wishlist-toast {
        top: 60px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

/* === 無障礙支援 === */
@media (prefers-reduced-motion: reduce) {
    .wish-button,
    .wishlist-product-card,
    .wishlist-product-image,
    .wishlist-toast {
        transition: none;
        animation: none;
    }
    
    .wish-button.added svg {
        animation: none;
    }
}

/* === 高對比模式支援 === */
@media (prefers-contrast: high) {
    .wish-button svg {
        filter: none;
    }
    
    .wishlist-product-card {
        border: 2px solid #000;
    }
    
    .wishlist-toast {
        border: 2px solid #000;
    }
}