/* 全站頂部導覽列：購物車膠囊 + 加入成功提示 */
.header-nav-bar {
    display: flex;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    gap: 12px;
}

.header-nav .header-nav-links {
    flex: 1 1 auto;
    min-width: 0;
}

.header-nav .header-nav-links--end {
    flex: 0 0 auto;
}

.header-cart-wrapper {
    flex: 0 0 auto;
    margin-left: auto;
    display: flex;
    align-items: center;
    padding-right: 4px;
}

.nav-cart-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    border: 0;
    font: inherit;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    text-decoration: none;
    background: #ff4757;
    color: #ffffff;
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 14px;
    line-height: 1.2;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    box-shadow: 0 2px 8px rgba(255, 71, 87, 0.35);
    white-space: nowrap;
}

.nav-cart-btn:hover {
    background: #ff6b81;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 71, 87, 0.45);
}

.nav-cart-btn__icon {
    font-size: 16px;
    line-height: 1;
}

.nav-cart-badge {
    background: #ffffff;
    color: var(--primary-color, var(--pos-btn-bg, #778ca3));
    border-radius: 999px;
    min-width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    padding: 0 5px;
    font-weight: 800;
}

.nav-cart-badge.is-empty {
    opacity: 0.95;
}

/* 加入購物車成功 Toast */
.wx-cart-toast {
    position: fixed;
    top: calc(var(--top-banner-height, 0px) + var(--header-main-height, 72px) + 56px);
    right: 16px;
    z-index: 5000;
    max-width: min(360px, calc(100vw - 32px));
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.wx-cart-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.wx-cart-toast__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-left: 4px solid var(--primary-color, var(--pos-btn-bg, #778ca3));
    border-radius: 12px;
    padding: 14px 16px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
}

.wx-cart-toast__msg {
    flex: 1 1 100%;
    font-weight: 700;
    font-size: 14px;
    color: #0f172a;
}

.wx-cart-toast__link {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: 999px;
    background: var(--primary-color, var(--pos-btn-bg, #778ca3));
    color: var(--btn-text-color, #ffffff) !important;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.wx-cart-toast__link:hover {
    background: color-mix(in srgb, var(--primary-color, var(--pos-btn-bg, #778ca3)) 82%, #1e293b);
}

/* 次要按鈕（查看購物車）：白底外框，讓「前往結帳」是主要動作 */
.wx-cart-toast__link--ghost {
    background: #ffffff;
    color: var(--primary-color, var(--pos-btn-bg, #778ca3)) !important;
    border: 1px solid var(--primary-color, var(--pos-btn-bg, #778ca3));
}

.wx-cart-toast__link--ghost:hover {
    background: color-mix(in srgb, var(--primary-color, var(--pos-btn-bg, #778ca3)) 10%, #ffffff);
}

.wx-cart-toast__close {
    margin-left: auto;
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
}

@media (max-width: 767px) {
    .header-nav-bar {
        gap: 8px;
    }

    .header-cart-wrapper {
        padding-right: 0;
    }

    .nav-cart-btn {
        padding: 5px 10px;
        font-size: 13px;
        gap: 6px;
    }

    .nav-cart-btn__label {
        display: none;
    }

    .wx-cart-toast {
        left: 16px;
        right: 16px;
        max-width: none;
    }
}
