/* =====================================================================
   wishlist-v2.css — Visual grid wishlist
   Grid of saved items with filled heart + Add to cart action
   Same theme as cart-v2/shop-v2, different layout (grid vs list)
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Onest:wght@300;400;500;600;700;800;900&display=swap');

:root {
    --w-blue-50:   #eff6ff;
    --w-blue-100:  #dbeafe;
    --w-blue-200:  #bfdbfe;
    --w-blue-300:  #93c5fd;
    --w-blue-400:  #60a5fa;
    --w-blue-500:  #3b82f6;
    --w-blue-600:  #2563eb;
    --w-blue-700:  #1d4ed8;
    --w-blue-800:  #1e40af;
    --w-blue-900:  #1e3a8a;

    --w-white:     #ffffff;
    --w-ink:       #0f172a;
    --w-ink-soft:  #334155;
    --w-ink-mute:  #64748b;
    --w-ink-mute2: #94a3b8;
    --w-line:      #e2e8f0;
    --w-line-soft: #f1f5f9;

    --w-success:   #059669;
    --w-danger:    #dc2626;
    --w-heart:     #ef4444;

    --w-shadow-xs: 0 1px 2px rgba(30, 58, 138, 0.06);
    --w-shadow-sm: 0 2px 8px rgba(30, 58, 138, 0.08);
    --w-shadow:    0 10px 24px rgba(30, 58, 138, 0.10);
    --w-shadow-lg: 0 20px 44px -12px rgba(30, 58, 138, 0.22);

    --w-radius:    14px;
    --w-radius-lg: 20px;

    --w-sans: 'Onest', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

/* ---------- Reset ---------- */
body.wishlist-v2 {
    background: var(--w-white);
    color: var(--w-ink);
    font-family: var(--w-sans);
    font-size: 15px;
    line-height: 1.5;
    margin: 0;
    -webkit-font-smoothing: antialiased;
    font-variant-numeric: tabular-nums lining-nums;
}

body.wishlist-v2 *, body.wishlist-v2 *::before, body.wishlist-v2 *::after { box-sizing: border-box; }
body.wishlist-v2 img { max-width: 100%; display: block; }
body.wishlist-v2 button, body.wishlist-v2 input { font-family: inherit; }

.wv2-container {
    width: 100%;
    max-width: 1360px;
    margin: 0 auto;
    padding: 0 20px;
}

@media (min-width: 768px) { .wv2-container { padding: 0 32px; } }

/* ---------- Page head strip ---------- */
.wv2-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 16px;
    padding: 32px 0 6px;
}

.wv2-head-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.wv2-head-heart {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--w-heart);
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.18);
    flex-shrink: 0;
}

.wv2-head-heart svg {
    width: 26px;
    height: 26px;
    fill: currentColor;
}

.wv2-head h1 {
    font-family: var(--w-sans);
    font-weight: 800;
    font-size: clamp(1.6rem, 4vw, 2.2rem);
    color: var(--w-blue-900);
    margin: 0;
    letter-spacing: -0.025em;
    line-height: 1.1;
}

.wv2-head h1 span {
    color: var(--w-blue-500);
    font-weight: 500;
    font-size: 0.75em;
    margin-left: 6px;
}

.wv2-head-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.wv2-btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    background: var(--w-white);
    color: var(--w-blue-900);
    border: 1.5px solid var(--w-line);
    border-radius: 999px;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.82rem;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    min-height: 38px;
}

.wv2-btn-ghost:hover {
    background: var(--w-blue-900);
    color: var(--w-white);
    border-color: var(--w-blue-900);
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(30, 58, 138, 0.28);
}

.wv2-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    background: var(--w-blue-900);
    color: var(--w-white);
    border: 1.5px solid var(--w-blue-900);
    border-radius: 999px;
    font-family: inherit;
    font-weight: 800;
    font-size: 0.82rem;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    min-height: 38px;
    box-shadow: 0 6px 16px rgba(30, 58, 138, 0.3);
}

.wv2-btn-primary:hover {
    background: var(--w-blue-700);
    border-color: var(--w-blue-700);
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(30, 58, 138, 0.38);
}

.wv2-btn-primary:disabled,
.wv2-btn-ghost:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
}

/* ---------- Stats strip ---------- */
.wv2-stats {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    background: linear-gradient(135deg, var(--w-blue-50) 0%, var(--w-white) 100%);
    border: 1px solid var(--w-line);
    border-radius: var(--w-radius);
    margin: 22px 0 10px;
    flex-wrap: wrap;
}

.wv2-stat {
    display: flex;
    align-items: baseline;
    gap: 6px;
    font-size: 0.88rem;
    color: var(--w-ink-soft);
    font-weight: 500;
}

.wv2-stat strong {
    font-family: var(--w-sans);
    font-size: 1.3rem;
    font-weight: 900;
    color: var(--w-blue-900);
    letter-spacing: -0.02em;
    line-height: 1;
}

.wv2-stat-sep {
    width: 1px;
    height: 24px;
    background: var(--w-blue-200);
    align-self: center;
}

.wv2-stats-spacer { flex: 1; }

@media (max-width: 520px) {
    .wv2-stats { padding: 14px 16px; gap: 10px; }
    .wv2-stat { font-size: 0.82rem; }
    .wv2-stat strong { font-size: 1.15rem; }
}

/* ---------- Grid ---------- */
.wv2-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    padding: 18px 0 80px;
}

@media (min-width: 600px) {
    .wv2-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 20px;
    }
}

@media (min-width: 1024px) {
    .wv2-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 24px;
    }
}

/* ---------- Card ---------- */
.wv2-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--w-white);
    border: 1px solid var(--w-line);
    border-radius: var(--w-radius-lg);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: var(--w-shadow-xs);
    opacity: 0;
    transform: translateY(16px);
    animation: wv2-fade-up 0.6s ease forwards;
}

@keyframes wv2-fade-up {
    to { opacity: 1; transform: translateY(0); }
}

.wv2-card:nth-child(1)  { animation-delay: 0.05s; }
.wv2-card:nth-child(2)  { animation-delay: 0.10s; }
.wv2-card:nth-child(3)  { animation-delay: 0.15s; }
.wv2-card:nth-child(4)  { animation-delay: 0.20s; }
.wv2-card:nth-child(5)  { animation-delay: 0.25s; }
.wv2-card:nth-child(6)  { animation-delay: 0.30s; }
.wv2-card:nth-child(7)  { animation-delay: 0.35s; }
.wv2-card:nth-child(8)  { animation-delay: 0.40s; }

@media (prefers-reduced-motion: reduce) {
    .wv2-card {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
}

.wv2-card:hover {
    transform: translateY(-4px);
    border-color: var(--w-blue-300);
    box-shadow: var(--w-shadow-lg);
}

.wv2-card.removing {
    animation: wv2-remove 0.45s ease forwards;
}

@keyframes wv2-remove {
    to {
        opacity: 0;
        transform: scale(0.92) translateY(10px);
    }
}

/* Image well */
.wv2-card-img {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    cursor: pointer;
    background: linear-gradient(135deg, var(--w-blue-50) 0%, var(--w-blue-100) 100%);
    border-bottom: 1px solid var(--w-line);
}

.wv2-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}

.wv2-card:hover .wv2-card-img img {
    transform: scale(1.05);
}

/* Filled heart (top-right of image) — signals "saved" */
.wv2-card-heart {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 4;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--w-white);
    border: 1.5px solid var(--w-line);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--w-heart);
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.14);
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 0;
}

.wv2-card-heart svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
    transition: transform 0.22s ease;
}

.wv2-card-heart:hover {
    background: var(--w-heart);
    color: var(--w-white);
    border-color: var(--w-heart);
    transform: scale(1.1) rotate(-8deg);
    box-shadow: 0 8px 18px rgba(239, 68, 68, 0.4);
}

.wv2-card-heart:hover svg {
    transform: scale(1.12);
}

/* Offer pill (bottom-left of image) */
.wv2-card-pill {
    position: absolute;
    bottom: 10px;
    left: 10px;
    z-index: 3;
    padding: 4px 10px;
    border-radius: 6px;
    background: var(--w-blue-900);
    color: var(--w-white);
    font-size: 0.64rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    line-height: 1;
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.32);
}

.wv2-card-pill.success { background: var(--w-success); box-shadow: 0 4px 12px rgba(5, 150, 105, 0.32); }

/* Card body */
.wv2-card-body {
    padding: 14px 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.wv2-card-type {
    font-size: 0.62rem;
    color: var(--w-blue-700);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 800;
    margin-bottom: 2px;
}

.wv2-card-title {
    font-family: var(--w-sans);
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--w-ink);
    margin: 0;
    line-height: 1.3;
    letter-spacing: -0.01em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.4em;
}

.wv2-card-title a {
    color: inherit;
    text-decoration: none;
}

.wv2-card:hover .wv2-card-title a { color: var(--w-blue-700); }

.wv2-card-price {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 4px;
    margin-bottom: 4px;
}

.wv2-price-now {
    font-family: var(--w-sans);
    font-size: 1.12rem;
    font-weight: 800;
    color: var(--w-blue-900);
    letter-spacing: -0.015em;
}

.wv2-price-old {
    font-size: 0.8rem;
    color: var(--w-ink-mute2);
    text-decoration: line-through;
    font-weight: 500;
}

.wv2-price-save {
    font-size: 0.64rem;
    background: var(--w-blue-50);
    color: var(--w-blue-700);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Card actions */
.wv2-card-actions {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.wv2-card-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 11px 14px;
    border-radius: 10px;
    border: 1.5px solid transparent;
    font-family: var(--w-sans);
    font-size: 0.82rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    min-height: 40px;
    text-decoration: none;
    line-height: 1;
    letter-spacing: -0.005em;
    width: 100%;
}

.wv2-card-btn-primary {
    background: var(--w-blue-900);
    color: var(--w-white);
    border-color: var(--w-blue-900);
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.24);
    position: relative;
    overflow: hidden;
}

.wv2-card-btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -120%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.22) 50%, transparent 100%);
    transform: skewX(-18deg);
    transition: left 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}

.wv2-card-btn-primary:hover:not(:disabled) {
    background: var(--w-blue-700);
    border-color: var(--w-blue-700);
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(30, 58, 138, 0.36);
}

.wv2-card-btn-primary:hover:not(:disabled)::before {
    left: 140%;
}

.wv2-card-btn-primary.added {
    background: var(--w-success);
    border-color: var(--w-success);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.28);
}

.wv2-card-btn-ghost {
    background: transparent;
    color: var(--w-ink-mute);
    border-color: var(--w-line);
    min-height: 34px;
    padding: 8px 12px;
    font-size: 0.76rem;
}

.wv2-card-btn-ghost:hover:not(:disabled) {
    background: var(--w-blue-50);
    border-color: var(--w-blue-300);
    color: var(--w-blue-800);
}

/* Compact card buttons on mobile */
@media (max-width: 599px) {
    .wv2-card-body { padding: 12px 12px 14px; }
    .wv2-card-title { font-size: 0.85rem; min-height: 2.2em; }
    .wv2-price-now { font-size: 1rem; }
    .wv2-card-btn { font-size: 0.76rem; min-height: 36px; padding: 8px 10px; }
    .wv2-card-btn-ghost { min-height: 30px; font-size: 0.7rem; }
    .wv2-card-heart { width: 32px; height: 32px; top: 8px; right: 8px; }
    .wv2-card-heart svg { width: 15px; height: 15px; }
    .wv2-card-pill { font-size: 0.58rem; padding: 3px 8px; }
}

/* ---------- Empty state ---------- */
.wv2-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 24px;
    background: linear-gradient(180deg, var(--w-blue-50) 0%, var(--w-white) 100%);
    border: 1px dashed var(--w-line);
    border-radius: var(--w-radius-lg);
    color: var(--w-ink-mute);
}

.wv2-empty-heart {
    display: inline-flex;
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: var(--w-heart);
    align-items: center;
    justify-content: center;
    margin-bottom: 22px;
    box-shadow: 0 16px 40px rgba(239, 68, 68, 0.24);
    animation: wv2-heart-float 3.5s ease-in-out infinite;
}

.wv2-empty-heart svg {
    width: 48px;
    height: 48px;
    fill: currentColor;
}

@keyframes wv2-heart-float {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-6px); }
}

.wv2-empty h3 {
    font-family: var(--w-sans);
    font-weight: 800;
    font-size: 1.55rem;
    color: var(--w-blue-900);
    margin: 0 0 10px;
    letter-spacing: -0.02em;
}

.wv2-empty p {
    margin: 0 0 26px;
    font-size: 0.95rem;
    max-width: 440px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

.wv2-empty .wv2-btn-primary {
    padding: 14px 34px;
    font-size: 0.94rem;
    min-height: 50px;
}

/* ---------- Skeleton ---------- */
.wv2-skel {
    display: flex;
    flex-direction: column;
    background: var(--w-white);
    border: 1px solid var(--w-line);
    border-radius: var(--w-radius-lg);
    overflow: hidden;
}

.wv2-skel-img,
.wv2-skel-line {
    background: linear-gradient(90deg, var(--w-blue-50) 0%, var(--w-blue-100) 50%, var(--w-blue-50) 100%);
    background-size: 200% 100%;
    animation: wv2-shimmer 1.5s ease-in-out infinite;
}

.wv2-skel-img { aspect-ratio: 4/3; }
.wv2-skel-body { padding: 14px; }
.wv2-skel-line { height: 12px; margin: 7px 0; border-radius: 6px; width: 80%; }
.wv2-skel-line.short { width: 45%; }
.wv2-skel-line.btn { height: 38px; margin-top: 14px; border-radius: 10px; width: 100%; }

@keyframes wv2-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ---------- Legacy buy modal (preserved) ---------- */
.bn-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.72);
    backdrop-filter: blur(8px);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    animation: wv2-fade 0.3s ease;
}

.bn-modal.open { display: flex; }

@keyframes wv2-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes wv2-pop { from { opacity: 0; transform: scale(0.94) translateY(8px); } to { opacity: 1; transform: scale(1) translateY(0); } }

.bn-box {
    background: var(--w-white);
    width: 92%;
    max-width: 420px;
    padding: 26px 24px;
    border-radius: 18px;
    box-shadow: 0 30px 80px rgba(15, 23, 42, 0.4);
    animation: wv2-pop 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: var(--w-sans);
}

.bn-title {
    margin: 0 0 18px;
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--w-blue-900);
    border-bottom: 1px solid var(--w-line);
    padding-bottom: 14px;
    letter-spacing: -0.015em;
}

.bn-product { display: flex; gap: 14px; margin-bottom: 18px; align-items: center; }
.bn-img {
    width: 68px;
    height: 68px;
    border-radius: 12px;
    object-fit: cover;
    background: var(--w-blue-50);
    border: 1px solid var(--w-line);
}
.bn-details h4 { margin: 0 0 4px; font-weight: 700; font-size: 0.98rem; color: var(--w-ink); letter-spacing: -0.01em; }
.bn-details p { margin: 0; color: var(--w-blue-900); font-weight: 800; font-size: 1.12rem; }
.bn-coupon { display: flex; gap: 8px; margin-bottom: 16px; }
.bn-input {
    flex: 1;
    padding: 11px 14px;
    border: 1.5px solid var(--w-line);
    border-radius: 10px;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.04em;
    background: var(--w-blue-50);
    outline: none;
}
.bn-input:focus { border-color: var(--w-blue-500); background: var(--w-white); box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.16); }
.bn-apply {
    background: var(--w-blue-900);
    color: var(--w-white);
    border: none;
    padding: 0 18px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.85rem;
}
.bn-apply:hover { background: var(--w-blue-700); }
.bn-actions { display: flex; justify-content: flex-end; gap: 8px; }
.bn-btn {
    padding: 12px 22px;
    border-radius: 10px;
    border: 1.5px solid transparent;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: inherit;
    font-size: 0.86rem;
}
.bn-cancel { background: transparent; color: var(--w-ink-mute); border-color: var(--w-line); }
.bn-cancel:hover { border-color: var(--w-ink); color: var(--w-ink); }
.bn-confirm {
    background: var(--w-blue-900);
    color: var(--w-white);
    border-color: var(--w-blue-900);
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.28);
}
.bn-confirm:hover { background: var(--w-blue-700); border-color: var(--w-blue-700); transform: translateY(-1px); }

/* ---------- Toast ---------- */
.mini-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    background: var(--w-blue-900);
    color: var(--w-white);
    padding: 12px 20px;
    border-radius: var(--w-radius);
    font-family: var(--w-sans);
    font-size: 0.88rem;
    font-weight: 700;
    box-shadow: 0 18px 40px rgba(30, 58, 138, 0.4);
    transform: translateY(20px);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.mini-toast.show { transform: translateY(0); opacity: 1; }

@media (max-width: 560px) {
    .mini-toast { right: 14px; bottom: 14px; left: 14px; text-align: center; }
}

/* Kill v1 style bleed */
body.wishlist-v2 .shop-container,
body.wishlist-v2 .wishlist-header,
body.wishlist-v2 header,
body.wishlist-v2 .shutter-overlay { display: none !important; }
