/* ==========================================================
   Woo Wishlist — 前端样式
   ========================================================== */

/* ----------------------------------------------------------
   Toast 通知
   ---------------------------------------------------------- */
#woo-wishlist-toast {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.woo-wishlist-toast-item {
    padding: 12px 18px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #fff;
    line-height: 1.4;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transform: translateX(20px);
    animation: woo-toast-in 0.25s ease forwards, woo-toast-out 0.3s ease 1.8s forwards;
}

.woo-wishlist-toast-item.toast-added {
    background: #2ecc71;
}

.woo-wishlist-toast-item.toast-removed {
    background: #95a5a6;
}

@keyframes woo-toast-in {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes woo-toast-out {
    to {
        opacity: 0;
        transform: translateX(20px);
    }
}

/* ----------------------------------------------------------
   1. 产品详情页 — 心愿单按钮
   ---------------------------------------------------------- */
.woo-wishlist-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
    color: #555;
    text-decoration: none;
    transition: border-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
    margin-top: 8px;
    line-height: 1.4;
    vertical-align: middle;
}

.woo-wishlist-btn:focus {
    outline: none;
}

.woo-wishlist-btn:hover {
    border-color: #e74c3c;
    color: #e74c3c;
}

.woo-wishlist-btn.in-wishlist {
    border-color: #e74c3c;
    color: #e74c3c;
}

.woo-wishlist-btn.loading {
    cursor: wait;
    pointer-events: none;
}

/* 加载时隐藏心形图标，保留占位空间防止抖动 */
.woo-wishlist-btn.loading .woo-wishlist-svg {
    visibility: hidden;
}

/* spinner 绝对定位居中叠加在图标位置 */
.woo-wishlist-btn.loading .woo-wishlist-btn-icon::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    margin-top: -7px;
    margin-left: -7px;
    width: 14px;
    height: 14px;
    border: 1.5px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: woo-wishlist-spin 0.7s linear infinite;
}

@keyframes woo-wishlist-spin {
    to { transform: rotate(360deg); }
}

.woo-wishlist-btn-text:empty {
    display: none;
}

.woo-wishlist-btn-icon {
    display: inline-flex;
    align-items: center;
    position: relative;
}

/* SVG 心形图标通用样式 */
.woo-wishlist-svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
    transition: fill 0.2s ease, stroke 0.2s ease;
    display: block;
}

/* 已添加状态：实心 */
.in-wishlist .woo-wishlist-svg,
.woo-wishlist-btn:hover .woo-wishlist-svg {
    fill: currentColor;
}

/* ----------------------------------------------------------
   2. Header — 心愿单图标 + 角标
   ---------------------------------------------------------- */
.woo-wishlist-header-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
    margin-right: 10px;
    vertical-align: middle;
}

.woo-wishlist-header-icon {
    display: inline-flex;
    align-items: center;
}

.woo-wishlist-header-icon .woo-wishlist-svg {
    width: 24px;
    height: 24px;
}

.woo-wishlist-header-count {
    position: absolute;
    top: -8px;
    right: -10px;
    background: #e74c3c;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    pointer-events: none;
}

/* ----------------------------------------------------------
   3. 心愿单列表页面
   ---------------------------------------------------------- */
.woo-wishlist-page {
    width: 100%;
}

/* 空状态 */
.woo-wishlist-empty {
    text-align: center;
    padding: 60px 20px;
    color: #888;
}

.woo-wishlist-empty-icon {
    font-size: 64px;
    display: block;
    margin-bottom: 16px;
    color: #ddd;
    line-height: 1;
}

.woo-wishlist-empty p {
    margin-bottom: 20px;
    font-size: 16px;
}

/* 列表表格 */
.woo-wishlist-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

.woo-wishlist-table th,
.woo-wishlist-table td {
    padding: 14px 10px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
    text-align: left;
}

.woo-wishlist-table thead th {
    font-weight: 600;
    font-size: 13px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* 商品缩略图 */
.woo-wishlist-table .product-thumbnail {
    width: 90px;
}

.woo-wishlist-table .product-thumbnail img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 4px;
    display: block;
}

/* 商品名称链接 */
.woo-wishlist-table .product-name a {
    color: inherit;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s;
}

.woo-wishlist-table .product-name a:hover {
    color: #e74c3c;
}

/* 移除按钮 */
.woo-wishlist-remove {
    background: transparent;
    border: none;
    cursor: pointer;
    color: #bbb;
    font-size: 15px;
    padding: 6px 8px;
    border-radius: 50%;
    transition: color 0.15s, background 0.15s;
    line-height: 1;
}

.woo-wishlist-remove:hover {
    color: #e74c3c;
    background: #fff0f0;
}

.woo-wishlist-remove.loading {
    opacity: 0.5;
    cursor: wait;
}

