/* ============================================================
   HBE Wishlist Overhaul — wishlist-overhaul.css
   Scoped to: html.hbe-wishlist-overhaul
   Variables prefix: --wl-
   ============================================================ */

html.hbe-wishlist-overhaul {
    --wl-bg:          #080d1a;
    --wl-bg2:         #0c1526;
    --wl-surface:     rgba(255,255,255,0.042);
    --wl-surface-hov: rgba(255,255,255,0.072);
    --wl-border:      rgba(255,255,255,0.07);
    --wl-border-gold: rgba(212,175,55,0.22);
    --wl-gold:        #d4af37;
    --wl-gold-dim:    rgba(212,175,55,0.14);
    --wl-gold-glow:   rgba(212,175,55,0.28);
    --wl-text:        #e8eeff;
    --wl-text-dim:    #6b7a9a;
    --wl-text-mid:    #94a3b8;
    --wl-red:         #ef4444;
    --wl-red-dim:     rgba(239,68,68,0.14);
    --wl-green:       #22c55e;
    --wl-green-dim:   rgba(34,197,94,0.14);
    --wl-header-h:    58px;
    --wl-radius:      14px;
    --wl-radius-sm:   8px;
    --wl-font:        'rabar_021', 'Segoe UI', Tahoma, sans-serif;
    --wl-img-mobile:  72px;
    --wl-img-card:    100%;
}

/* ── Reset ── */
html.hbe-wishlist-overhaul *,
html.hbe-wishlist-overhaul *::before,
html.hbe-wishlist-overhaul *::after { box-sizing: border-box; }

html.hbe-wishlist-overhaul body {
    background: var(--wl-bg);
    margin: 0; padding: 0;
    overflow: hidden;
    font-family: var(--wl-font);
    direction: rtl;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    color: var(--wl-text);
}

/* ── Hide legacy chrome ── */
html.hbe-wishlist-overhaul body > header,
html.hbe-wishlist-overhaul .wishlist-hero,
html.hbe-wishlist-overhaul .wishlist-container,
html.hbe-wishlist-overhaul .hbe-footer,
html.hbe-wishlist-overhaul .mobile-nav-overlay { display: none !important; }

/* ══════════════════════════════════════════
   ROOT SHELL
══════════════════════════════════════════ */
html.hbe-wishlist-overhaul #wl-root {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    background: linear-gradient(160deg, #080d1a 0%, #0c1526 55%, #080d1a 100%);
    font-family: var(--wl-font);
    direction: rtl;
    color: var(--wl-text);
    overflow: hidden;
}

/* ══════════════════════════════════════════
   STICKY HEADER
══════════════════════════════════════════ */
html.hbe-wishlist-overhaul #wl-header {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 10px;
    height: calc(var(--wl-header-h) + env(safe-area-inset-top, 0px));
    padding-top: env(safe-area-inset-top, 0px);
    background: rgba(8,13,26,0.9);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--wl-border-gold);
    z-index: 20;
    position: relative;
}

html.hbe-wishlist-overhaul .wl-icon-btn {
    flex-shrink: 0;
    width: 40px; height: 40px;
    border: none;
    background: var(--wl-surface);
    border-radius: 50%;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: var(--wl-text-mid);
    transition: background 0.2s, color 0.2s;
    padding: 0;
}
html.hbe-wishlist-overhaul .wl-icon-btn svg {
    width: 20px; height: 20px; fill: currentColor;
}
html.hbe-wishlist-overhaul .wl-icon-btn:hover,
html.hbe-wishlist-overhaul .wl-icon-btn:focus-visible {
    background: var(--wl-gold-dim);
    color: var(--wl-gold);
    outline: none;
}
html.hbe-wishlist-overhaul .wl-icon-btn.spin svg {
    animation: wl-spin 0.7s linear infinite;
}

html.hbe-wishlist-overhaul #wl-header-title {
    flex: 1;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--wl-text);
    letter-spacing: 0.3px;
    display: flex;
    align-items: center;
    gap: 8px;
}
html.hbe-wishlist-overhaul #wl-count-badge {
    background: linear-gradient(135deg, var(--wl-gold), #c9a227);
    color: #0a0f1e;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 20px;
    min-width: 22px;
    text-align: center;
    line-height: 1.6;
}

/* ══════════════════════════════════════════
   TOOLBAR (search + sort)
══════════════════════════════════════════ */
html.hbe-wishlist-overhaul #wl-toolbar {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(8,13,26,0.6);
    border-bottom: 1px solid var(--wl-border);
}

html.hbe-wishlist-overhaul #wl-search-wrap {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}
html.hbe-wishlist-overhaul #wl-search-wrap svg {
    position: absolute;
    right: 10px;
    width: 16px; height: 16px;
    fill: var(--wl-text-dim);
    pointer-events: none;
    flex-shrink: 0;
}
html.hbe-wishlist-overhaul #wl-search {
    width: 100%;
    background: var(--wl-surface);
    border: 1px solid var(--wl-border);
    border-radius: 10px;
    color: var(--wl-text);
    font-family: var(--wl-font);
    font-size: 0.88rem;
    padding: 7px 34px 7px 10px;
    outline: none;
    transition: border-color 0.2s;
}
html.hbe-wishlist-overhaul #wl-search::placeholder { color: var(--wl-text-dim); }
html.hbe-wishlist-overhaul #wl-search:focus { border-color: var(--wl-gold); }

html.hbe-wishlist-overhaul #wl-sort-select {
    flex-shrink: 0;
    background: var(--wl-surface);
    border: 1px solid var(--wl-border);
    border-radius: 10px;
    color: var(--wl-text);
    font-family: var(--wl-font);
    font-size: 0.82rem;
    padding: 7px 10px;
    outline: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    min-width: 100px;
    transition: border-color 0.2s;
}
html.hbe-wishlist-overhaul #wl-sort-select:focus { border-color: var(--wl-gold); }
html.hbe-wishlist-overhaul #wl-sort-select option { background: #0c1526; }

/* view toggle */
html.hbe-wishlist-overhaul #wl-view-toggle {
    flex-shrink: 0;
    display: flex;
    background: var(--wl-surface);
    border: 1px solid var(--wl-border);
    border-radius: 10px;
    overflow: hidden;
}
html.hbe-wishlist-overhaul .wl-view-btn {
    width: 34px; height: 34px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: var(--wl-text-dim);
    transition: background 0.2s, color 0.2s;
}
html.hbe-wishlist-overhaul .wl-view-btn svg { width: 16px; height: 16px; fill: currentColor; }
html.hbe-wishlist-overhaul .wl-view-btn.active {
    background: var(--wl-gold-dim);
    color: var(--wl-gold);
}

/* ══════════════════════════════════════════
   SCROLL BODY
══════════════════════════════════════════ */
html.hbe-wishlist-overhaul #wl-scroll {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 12px 10px calc(env(safe-area-inset-bottom, 0px) + 16px);
}

/* ── Scrollbar ── */
html.hbe-wishlist-overhaul #wl-scroll::-webkit-scrollbar { width: 4px; }
html.hbe-wishlist-overhaul #wl-scroll::-webkit-scrollbar-track { background: transparent; }
html.hbe-wishlist-overhaul #wl-scroll::-webkit-scrollbar-thumb {
    background: rgba(212,175,55,0.25);
    border-radius: 4px;
}

/* ══════════════════════════════════════════
   LIST VIEW (mobile default)
══════════════════════════════════════════ */
html.hbe-wishlist-overhaul #wl-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ── List Card ── */
html.hbe-wishlist-overhaul .wl-list-card {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--wl-surface);
    border: 1px solid var(--wl-border);
    border-radius: var(--wl-radius);
    padding: 10px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, transform 0.18s;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
}
html.hbe-wishlist-overhaul .wl-list-card::before {
    content: '';
    position: absolute;
    inset-inline-start: 0; top: 0; bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, var(--wl-gold), transparent);
    border-radius: 3px;
    opacity: 0;
    transition: opacity 0.2s;
}
html.hbe-wishlist-overhaul .wl-list-card:hover {
    background: var(--wl-surface-hov);
    border-color: var(--wl-border-gold);
    transform: translateY(-1px);
}
html.hbe-wishlist-overhaul .wl-list-card:hover::before { opacity: 1; }

html.hbe-wishlist-overhaul .wl-list-card.removing {
    opacity: 0;
    transform: scale(0.92) translateX(30px);
    pointer-events: none;
    transition: opacity 0.35s, transform 0.35s;
}

/* ── List image ── */
html.hbe-wishlist-overhaul .wl-list-img {
    flex-shrink: 0;
    width: var(--wl-img-mobile);
    height: var(--wl-img-mobile);
    border-radius: var(--wl-radius-sm);
    background: rgba(255,255,255,0.06) center/cover no-repeat;
    border: 1px solid var(--wl-border);
    overflow: hidden;
    position: relative;
}
html.hbe-wishlist-overhaul .wl-list-img-inner {
    width: 100%; height: 100%;
    background: center/cover no-repeat;
}
html.hbe-wishlist-overhaul .wl-stock-badge {
    position: absolute;
    bottom: 4px; left: 4px;
    background: rgba(239,68,68,0.9);
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 4px;
    line-height: 1.5;
}
html.hbe-wishlist-overhaul .wl-stock-badge.in { background: rgba(34,197,94,0.85); }
html.hbe-wishlist-overhaul .wl-stock-badge.low { background: rgba(251,146,60,0.9); }

/* ── List info ── */
html.hbe-wishlist-overhaul .wl-list-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
html.hbe-wishlist-overhaul .wl-list-cat {
    font-size: 0.68rem;
    color: var(--wl-gold);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
html.hbe-wishlist-overhaul .wl-list-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--wl-text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.35;
}
html.hbe-wishlist-overhaul .wl-list-price {
    font-size: 0.88rem;
    font-weight: 800;
    color: var(--wl-gold);
    direction: ltr;
    text-align: right;
}
html.hbe-wishlist-overhaul .wl-list-price .wl-price-original {
    font-size: 0.72rem;
    color: var(--wl-text-dim);
    text-decoration: line-through;
    font-weight: 400;
    margin-inline-end: 4px;
}

/* ── List actions ── */
html.hbe-wishlist-overhaul .wl-list-actions {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
html.hbe-wishlist-overhaul .wl-act-btn {
    width: 36px; height: 36px;
    border: none;
    border-radius: var(--wl-radius-sm);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.2s, transform 0.15s;
    padding: 0;
    flex-shrink: 0;
}
html.hbe-wishlist-overhaul .wl-act-btn svg { width: 17px; height: 17px; fill: currentColor; }
html.hbe-wishlist-overhaul .wl-act-btn:active { transform: scale(0.88); }

html.hbe-wishlist-overhaul .wl-btn-cart {
    background: linear-gradient(135deg, #1a4a2e, #155c36);
    color: var(--wl-green);
    border: 1px solid rgba(34,197,94,0.2);
}
html.hbe-wishlist-overhaul .wl-btn-cart:hover { background: linear-gradient(135deg, #1f5e38, #1a6e40); }
html.hbe-wishlist-overhaul .wl-btn-cart.added {
    background: linear-gradient(135deg, var(--wl-green), #16a34a);
    color: #fff;
}

html.hbe-wishlist-overhaul .wl-btn-remove {
    background: var(--wl-red-dim);
    color: var(--wl-red);
    border: 1px solid rgba(239,68,68,0.18);
}
html.hbe-wishlist-overhaul .wl-btn-remove:hover { background: rgba(239,68,68,0.25); }

/* ══════════════════════════════════════════
   GRID VIEW
══════════════════════════════════════════ */
html.hbe-wishlist-overhaul #wl-list.grid-view {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

html.hbe-wishlist-overhaul #wl-list.grid-view .wl-list-card {
    flex-direction: column;
    align-items: stretch;
    padding: 0;
    gap: 0;
    overflow: hidden;
}
html.hbe-wishlist-overhaul #wl-list.grid-view .wl-list-card::before { display: none; }

html.hbe-wishlist-overhaul #wl-list.grid-view .wl-list-img {
    width: 100%;
    height: 140px;
    border-radius: 0;
    border: none;
    border-bottom: 1px solid var(--wl-border);
}
html.hbe-wishlist-overhaul #wl-list.grid-view .wl-stock-badge { bottom: 6px; left: 6px; }

html.hbe-wishlist-overhaul #wl-list.grid-view .wl-list-info {
    padding: 8px 10px 6px;
    gap: 4px;
}

html.hbe-wishlist-overhaul #wl-list.grid-view .wl-list-actions {
    flex-direction: row;
    gap: 6px;
    padding: 0 8px 8px;
}
html.hbe-wishlist-overhaul #wl-list.grid-view .wl-act-btn {
    flex: 1;
    height: 34px;
    width: auto;
    border-radius: var(--wl-radius-sm);
    font-size: 0.75rem;
    gap: 4px;
    font-family: var(--wl-font);
    font-weight: 700;
}
html.hbe-wishlist-overhaul #wl-list.grid-view .wl-act-btn svg { width: 14px; height: 14px; }
html.hbe-wishlist-overhaul #wl-list.grid-view .wl-btn-label { display: inline; }

/* hide text labels in list view */
html.hbe-wishlist-overhaul .wl-btn-label { display: none; }

/* ── Discount badge in grid ── */
html.hbe-wishlist-overhaul .wl-discount-pill {
    position: absolute;
    top: 8px;
    right: 8px;
    background: linear-gradient(135deg, #ff4444, #c0392b);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 6px;
    line-height: 1.5;
    pointer-events: none;
    z-index: 2;
}
html.hbe-wishlist-overhaul #wl-list:not(.grid-view) .wl-discount-pill { display: none; }

/* ── Online-only badge ── */
html.hbe-wishlist-overhaul .wl-online-badge {
    display: inline-block;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
    font-family: 'rabar_021', 'Rabar_021', sans-serif !important;
    font-size: 0.62rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 5px;
    line-height: 1.4;
    white-space: nowrap;
    margin-top: 2px;
}

/* ══════════════════════════════════════════
   EMPTY STATE
══════════════════════════════════════════ */
html.hbe-wishlist-overhaul #wl-empty {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 60px 24px;
    text-align: center;
    flex: 1;
}
html.hbe-wishlist-overhaul #wl-empty.visible { display: flex; }

html.hbe-wishlist-overhaul .wl-empty-icon {
    width: 80px; height: 80px;
    border-radius: 50%;
    background: var(--wl-gold-dim);
    border: 2px solid var(--wl-border-gold);
    display: flex; align-items: center; justify-content: center;
    animation: wl-heartbeat 2s ease-in-out infinite;
}
html.hbe-wishlist-overhaul .wl-empty-icon svg {
    width: 36px; height: 36px;
    fill: var(--wl-gold);
}
html.hbe-wishlist-overhaul .wl-empty-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--wl-text);
    line-height: 1.4;
}
html.hbe-wishlist-overhaul .wl-empty-sub {
    font-size: 0.88rem;
    color: var(--wl-text-mid);
    line-height: 1.6;
    max-width: 260px;
}
html.hbe-wishlist-overhaul .wl-empty-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 24px;
    background: linear-gradient(135deg, var(--wl-gold), #c9a227);
    color: #0a0f1e;
    border-radius: 12px;
    font-weight: 800;
    font-family: var(--wl-font);
    font-size: 0.92rem;
    text-decoration: none;
    transition: opacity 0.2s, transform 0.2s;
    margin-top: 4px;
}
html.hbe-wishlist-overhaul .wl-empty-cta svg { width: 18px; height: 18px; fill: currentColor; }
html.hbe-wishlist-overhaul .wl-empty-cta:hover { opacity: 0.88; transform: translateY(-1px); }

/* ══════════════════════════════════════════
   SKELETON LOADER
══════════════════════════════════════════ */
html.hbe-wishlist-overhaul .wl-skeleton {
    background: var(--wl-surface);
    border: 1px solid var(--wl-border);
    border-radius: var(--wl-radius);
    padding: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}
html.hbe-wishlist-overhaul .wl-skel-img {
    flex-shrink: 0;
    width: 72px; height: 72px;
    border-radius: var(--wl-radius-sm);
    background: rgba(255,255,255,0.06);
    animation: wl-shimmer 1.4s ease-in-out infinite;
}
html.hbe-wishlist-overhaul .wl-skel-body {
    flex: 1;
    display: flex; flex-direction: column; gap: 6px;
}
html.hbe-wishlist-overhaul .wl-skel-line {
    height: 10px;
    border-radius: 6px;
    background: rgba(255,255,255,0.06);
    animation: wl-shimmer 1.4s ease-in-out infinite;
}
html.hbe-wishlist-overhaul .wl-skel-line.short { width: 55%; }
html.hbe-wishlist-overhaul .wl-skel-line.med   { width: 75%; }
html.hbe-wishlist-overhaul .wl-skel-line.long  { width: 90%; }

/* ══════════════════════════════════════════
   TOAST NOTIFICATIONS
══════════════════════════════════════════ */
html.hbe-wishlist-overhaul #wl-toasts {
    position: fixed;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 16px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column-reverse;
    gap: 8px;
    pointer-events: none;
    width: min(92vw, 360px);
}
html.hbe-wishlist-overhaul .wl-toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    background: rgba(12,21,38,0.96);
    border: 1px solid var(--wl-border);
    border-radius: var(--wl-radius-sm);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    font-size: 0.88rem;
    color: var(--wl-text);
    animation: wl-toast-in 0.3s cubic-bezier(0.34,1.56,0.64,1) both;
    pointer-events: auto;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
html.hbe-wishlist-overhaul .wl-toast.out {
    animation: wl-toast-out 0.25s ease-in both;
}
html.hbe-wishlist-overhaul .wl-toast-icon {
    flex-shrink: 0;
    width: 22px; height: 22px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}
html.hbe-wishlist-overhaul .wl-toast-icon svg { width: 13px; height: 13px; fill: currentColor; }
html.hbe-wishlist-overhaul .wl-toast.success .wl-toast-icon { background: var(--wl-green-dim); color: var(--wl-green); }
html.hbe-wishlist-overhaul .wl-toast.error   .wl-toast-icon { background: var(--wl-red-dim); color: var(--wl-red); }
html.hbe-wishlist-overhaul .wl-toast.info    .wl-toast-icon { background: var(--wl-gold-dim); color: var(--wl-gold); }
html.hbe-wishlist-overhaul .wl-toast.success { border-color: rgba(34,197,94,0.2); }
html.hbe-wishlist-overhaul .wl-toast.error   { border-color: rgba(239,68,68,0.2); }
html.hbe-wishlist-overhaul .wl-toast.info    { border-color: var(--wl-border-gold); }

/* ══════════════════════════════════════════
   ANIMATIONS
══════════════════════════════════════════ */
@keyframes wl-spin {
    to { transform: rotate(360deg); }
}
@keyframes wl-heartbeat {
    0%, 100% { transform: scale(1); }
    50%       { transform: scale(1.08); }
}
@keyframes wl-shimmer {
    0%   { opacity: 0.5; }
    50%  { opacity: 1; }
    100% { opacity: 0.5; }
}
@keyframes wl-toast-in {
    from { opacity: 0; transform: translateY(12px) scale(0.94); }
    to   { opacity: 1; transform: translateY(0)    scale(1); }
}
@keyframes wl-toast-out {
    to { opacity: 0; transform: translateY(6px) scale(0.96); }
}
@keyframes wl-card-in {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

html.hbe-wishlist-overhaul .wl-list-card {
    animation: wl-card-in 0.28s ease both;
}

/* ══════════════════════════════════════════
   RESPONSIVE — DESKTOP
══════════════════════════════════════════ */
@media (min-width: 640px) {
    html.hbe-wishlist-overhaul #wl-list.grid-view {
        grid-template-columns: repeat(3, 1fr);
    }
    html.hbe-wishlist-overhaul #wl-list.grid-view .wl-list-img { height: 160px; }
}
@media (min-width: 1024px) {
    html.hbe-wishlist-overhaul #wl-scroll { padding: 16px 20px calc(env(safe-area-inset-bottom, 0px) + 16px); }

    html.hbe-wishlist-overhaul #wl-list.grid-view {
        grid-template-columns: repeat(4, 1fr);
        gap: 12px;
    }
    html.hbe-wishlist-overhaul #wl-list.grid-view .wl-list-img { height: 180px; }

    /* list view also wider on desktop */
    html.hbe-wishlist-overhaul #wl-list:not(.grid-view) .wl-list-card {
        max-width: 900px;
        margin: 0 auto;
        width: 100%;
    }
    html.hbe-wishlist-overhaul #wl-list:not(.grid-view) { align-items: center; }

    html.hbe-wishlist-overhaul .wl-list-img { width: 84px; height: 84px; }
    html.hbe-wishlist-overhaul .wl-list-name { font-size: 0.96rem; }
}
@media (min-width: 1400px) {
    html.hbe-wishlist-overhaul #wl-list.grid-view {
        grid-template-columns: repeat(5, 1fr);
    }
}
