/* ================================================================
   WooPlus Wishlist — frontend styles (v6.10.4.0 redesign).
   Design system: indigo chrome (matches the WooCommerce+ admin
   palette) + a warm rose accent for the "loved" heart — the
   universally-understood favourited signal. RTL-first, scoped via
   .wpl-wishlist-btn / .wpl-wishlist-page so nothing leaks.
   ================================================================ */
.wpl-wishlist-btn,
.wpl-wishlist-page {
    --wl-primary: #6366f1;
    --wl-primary-d: #4f46e5;
    --wl-rose: #e11d48;
    --wl-border: #e2e8f0;
    --wl-text: #1e293b;
    --wl-muted: #64748b;
    --wl-bg: #f8fafc;
}

/* ---- The heart toggle button (loop / single / shortcode) ---- */
.wpl-wishlist-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: transparent;
    border: 1px solid var(--wl-border);
    border-radius: 999px;
    color: #475569;
    font: inherit;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    transition: color .15s, background-color .15s, border-color .15s, transform .12s, box-shadow .15s;
}
.wpl-wishlist-btn:hover {
    color: var(--wl-rose);
    border-color: rgba(225, 29, 72, .35);
    background: rgba(225, 29, 72, .05);
}
.wpl-wishlist-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, .25);
    border-color: var(--wl-primary);
}
.wpl-wishlist-btn:active { transform: scale(.96); }
.wpl-wishlist-btn.is-active {
    color: var(--wl-rose);
    border-color: var(--wl-rose);
    background: rgba(225, 29, 72, .08);
}
.wpl-wishlist-btn svg { display: block; flex-shrink: 0; }

/* Loop context — icon-only chip floating on the product card */
.wpl-wishlist-btn.wpl-context-loop {
    position: absolute;
    top: 10px;
    inset-inline-end: 10px;
    padding: 8px;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .12);
    border-color: transparent;
}
.wpl-wishlist-btn.wpl-context-loop:hover {
    box-shadow: 0 4px 14px rgba(225, 29, 72, .22);
}
.wpl-wishlist-btn.wpl-context-loop .wpl-wishlist-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

/* Single context — full button under the price / cart button */
.wpl-wishlist-btn.wpl-context-single { margin-top: 12px; }

/* Account / shortcode corner button */
.wpl-wishlist-btn.wpl-context-account,
.wpl-wishlist-btn.wpl-context-shortcode {
    padding: 8px;
    flex-shrink: 0;
}

/* Pulse animation when the saved-state flips */
.wpl-wishlist-btn.is-flipping svg { animation: wpl-pulse .35s ease; }
@keyframes wpl-pulse {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* ================================================================
   Account endpoint list (/my-account/wishlist/) — card rows
   ================================================================ */
.wpl-account-wishlist {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}
.wpl-account-wishlist li {
    background: #fff;
    border: 1px solid var(--wl-border);
    border-radius: 14px;
    padding: 12px;
    display: flex;
    gap: 12px;
    align-items: center;
    position: relative;
    transition: box-shadow .15s, transform .12s;
}
.wpl-account-wishlist li:hover { box-shadow: 0 8px 22px rgba(15, 23, 42, .09); transform: translateY(-1px); }
.wpl-account-wishlist li > a {
    display: flex;
    gap: 12px;
    flex: 1;
    color: inherit;
    text-decoration: none;
    align-items: center;
}
.wpl-account-wishlist li img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 10px;
    flex-shrink: 0;
    background: #f1f5f9;
}
.wpl-account-wishlist .wpl-name {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--wl-text);
}
.wpl-account-wishlist .wpl-price { display: block; color: var(--wl-muted); font-size: 13px; }

/* ================================================================
   [wooplus_wishlist] — designed wishlist page / card grid
   ================================================================ */
.wpl-wishlist-page { direction: rtl; color: var(--wl-text); font-family: inherit; }
.wpl-wishlist-page .wpl-wl-head {
    display: flex; align-items: center; gap: 9px;
    font-size: 19px; font-weight: 700; margin: 0 0 16px;
}
.wpl-wishlist-page .wpl-wl-head::before {
    content: ""; width: 4px; height: 20px; border-radius: 2px; background: var(--wl-primary);
}
.wpl-wishlist-page .wpl-wl-head .wpl-wl-badge {
    margin-inline-start: auto; font-size: 12px; font-weight: 700;
    background: #eef2ff; color: var(--wl-primary-d); border-radius: 999px; padding: 3px 11px;
}

.wpl-wl-grid {
    display: grid;
    grid-template-columns: repeat(var(--wl-cols, 3), minmax(0, 1fr));
    gap: 16px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.wpl-wl-card {
    background: #fff;
    border: 1px solid var(--wl-border);
    border-radius: 16px;
    padding: 12px;
    position: relative;
    display: flex;
    flex-direction: column;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .04);
    transition: box-shadow .15s, transform .12s, border-color .15s;
}
.wpl-wl-card:hover {
    box-shadow: 0 10px 26px rgba(15, 23, 42, .10);
    transform: translateY(-2px);
    border-color: #c7d2fe;
}
.wpl-wl-card > a { display: block; text-decoration: none; color: inherit; }
.wpl-wl-thumb {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 11px;
    background: #f1f5f9;
    display: block;
}
.wpl-wl-name { margin-top: 11px; font-weight: 600; font-size: 14px; line-height: 1.6; color: var(--wl-text); }
.wpl-wl-price { margin-top: 5px; color: var(--wl-primary-d); font-size: 14px; font-weight: 700; }
.wpl-wl-price del { color: var(--wl-muted); font-weight: 400; font-size: 12px; margin-inline-start: 6px; }

.wpl-wl-actions { margin-top: 12px; display: flex; gap: 8px; align-items: center; }
.wpl-wl-add {
    flex: 1;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    background: var(--wl-primary); color: #fff !important;
    border: 0; border-radius: 10px; padding: 9px 14px;
    font: inherit; font-weight: 600; font-size: 13px; cursor: pointer; text-decoration: none;
    transition: background .15s, transform .12s;
}
.wpl-wl-add:hover { background: var(--wl-primary-d); color: #fff; }
.wpl-wl-add:active { transform: scale(.97); }
.wpl-wl-add.is-loading { opacity: .65; cursor: progress; }
.wpl-wl-add.is-added { background: #10b981; }

.wpl-wl-remove {
    flex-shrink: 0;
    width: 38px; height: 38px;
    display: inline-flex; align-items: center; justify-content: center;
    background: #fff; border: 1px solid var(--wl-border); border-radius: 10px;
    color: var(--wl-rose); cursor: pointer;
    transition: background .15s, border-color .15s, transform .12s;
}
.wpl-wl-remove:hover { background: rgba(225, 29, 72, .07); border-color: rgba(225, 29, 72, .4); }
.wpl-wl-remove:active { transform: scale(.94); }

.wpl-wl-empty {
    text-align: center; color: var(--wl-muted); font-size: 14px;
    padding: 30px 20px; background: var(--wl-bg);
    border: 1px dashed var(--wl-border); border-radius: 16px;
}
.wpl-wl-empty .wpl-wl-empty-ico { color: var(--wl-primary); opacity: .55; margin-bottom: 8px; }
.wpl-wl-empty a { color: var(--wl-primary-d); font-weight: 600; text-decoration: none; }
.wpl-wl-empty a:hover { text-decoration: underline; }

/* Shortcode count + link chips */
.wpl-wishlist-count { font-weight: 700; color: var(--wl-primary-d); }
.wpl-wishlist-link { display: inline-flex; align-items: center; color: var(--wl-primary-d); text-decoration: none; font-weight: 600; }
.wpl-wishlist-link:hover { text-decoration: underline; }

/* ================================================================
   Toast notification — created dynamically by JS
   ================================================================ */
.wpl-wishlist-toast {
    position: fixed;
    bottom: 24px;
    inset-inline-end: 24px;
    z-index: 99999;
    background: #0f172a;
    color: #fff;
    padding: 12px 18px;
    border-radius: 12px;
    font-size: 14px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, .28);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity .2s, transform .2s;
    pointer-events: none;
}
.wpl-wishlist-toast.is-visible { opacity: 1; transform: translateY(0); }

/* ---- Responsive ---- */
@media ( max-width: 640px ) {
    .wpl-wl-grid { --wl-cols: 2; gap: 12px; }
    .wpl-wl-actions { flex-direction: column; align-items: stretch; }
    .wpl-wl-remove { width: 100%; height: 36px; }
}
@media ( prefers-reduced-motion: reduce ) {
    .wpl-wishlist-btn, .wpl-wl-card, .wpl-wl-add, .wpl-account-wishlist li, .wpl-wishlist-toast { transition: none; }
    .wpl-wishlist-btn.is-flipping svg { animation: none; }
}
