/* ==========================================================================
   ROHN8 Auto & Smart — Unified Like / Favorite (Wishlist) UI (IMP-008)
   Covers header badge, product card heart FAB, PDP Like button, Pre-Footer
   Dock heart button, floating toast, /yeu-thich page & Account Wishlist cards.
   ========================================================================== */

:root {
    --r8-heart-rose: #fb7185;
    --r8-heart-glow: rgba(251, 113, 133, .28);
    --r8-heart-bg: rgba(54, 17, 26, .92);
    --r8-heart-edge: rgba(251, 113, 133, .62);
}

/* Toggle dual Font Awesome Pro 7.2 icons (duotone-light outline vs duotone filled) */
[data-r8-wish-toggle] .r8-wish-icon--on {
    display: none;
}
[data-r8-wish-toggle].is-liked .r8-wish-icon--off {
    display: none;
}
[data-r8-wish-toggle].is-liked .r8-wish-icon--on {
    display: inline-flex;
    color: var(--r8-heart-rose);
}
[data-r8-wish-toggle].is-liked .r8-wish-icon--on .r8-fa,
.r8-wish-toast:not(.is-removed) .r8-wish-toast-icon .r8-fa {
    --r8-fa-primary: #fb7185;
    --r8-fa-secondary: #fb7185;
    --r8-fa-secondary-opacity: .92;
    color: #fb7185;
}

@keyframes r8-heart-pop {
    0% { transform: scale(1); }
    42% { transform: scale(1.24); }
    72% { transform: scale(.94); }
    100% { transform: scale(1); }
}

[data-r8-wish-toggle].is-popping .r8-wish-icon--on {
    animation: r8-heart-pop .34s cubic-bezier(.22, 1, .36, 1);
}

/* 1. Global Header Wishlist Button & Live Counter Badge */
.r8-wish-btn {
    position: relative;
}
.r8-wish-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 19px;
    height: 19px;
    padding-inline: 5px;
    border-radius: 999px;
    background: var(--r8-heart-rose);
    color: #21070d;
    border: 2px solid #07110d;
    font-size: .66rem;
    font-weight: 850;
    line-height: 1;
    display: inline-grid;
    place-items: center;
    pointer-events: none;
}
.r8-wish-badge[hidden] {
    display: none !important;
}

/* 2. Catalog / Home / Collection / Search Product Card Floating Heart FAB */
.r8-product-card-shell {
    position: relative;
    display: flex;
    min-width: 0;
}
.r8-product-card-shell > .r8-product-card {
    width: 100%;
}
.r8-wish-fab {
    position: absolute;
    top: 24px;
    left: 24px;
    z-index: 4;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: 1px solid rgba(72, 114, 88, .72);
    background: rgba(7, 19, 13, .84);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #cde3d4;
    display: inline-grid;
    place-items: center;
    padding: 0;
    cursor: pointer;
    transition: border-color .18s ease, background-color .18s ease, color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.r8-wish-fab:hover,
.r8-wish-fab:focus-visible {
    border-color: var(--r8-heart-edge);
    color: var(--r8-heart-rose);
    background: rgba(28, 15, 20, .92);
    transform: scale(1.06);
}
.r8-wish-fab.is-liked {
    border-color: var(--r8-heart-edge);
    background: var(--r8-heart-bg);
    color: var(--r8-heart-rose);
    box-shadow: 0 0 14px var(--r8-heart-glow);
}

/* 3. PDP Primary Action Row Like Button */
.r8-wish-pdp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    transition: border-color .18s ease, background-color .18s ease, color .18s ease, box-shadow .18s ease;
}
.r8-wish-pdp-btn:hover {
    border-color: var(--r8-heart-edge);
    color: #ffe4e8;
    background: rgba(54, 17, 26, .48);
}
.r8-wish-pdp-btn.is-liked {
    border-color: var(--r8-heart-edge);
    background: linear-gradient(155deg, rgba(68, 20, 32, .88) 0%, rgba(36, 12, 18, .92) 100%);
    color: #ffe4e8;
    box-shadow: 0 8px 22px rgba(251, 113, 133, .16);
}

/* 4. Pre-Footer Dock Product Card Heart Button */
.r8-rdock-wish {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    width: 30px;
    height: 30px;
    border-radius: 999px;
    border: 1px solid rgba(72, 114, 88, .72);
    background: rgba(7, 19, 13, .88);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #c8e0d0;
    display: inline-grid;
    place-items: center;
    padding: 0;
    cursor: pointer;
    transition: border-color .16s ease, background-color .16s ease, color .16s ease, transform .16s ease;
}
.r8-rdock-card.has-rm .r8-rdock-wish {
    right: 42px;
}
.r8-rdock-wish:hover,
.r8-rdock-wish:focus-visible {
    border-color: var(--r8-heart-edge);
    color: var(--r8-heart-rose);
    background: rgba(34, 15, 22, .94);
    transform: scale(1.06);
}
.r8-rdock-wish.is-liked {
    border-color: var(--r8-heart-edge);
    background: var(--r8-heart-bg);
    color: var(--r8-heart-rose);
    box-shadow: 0 0 12px var(--r8-heart-glow);
}

/* 5. Floating Feedback Toast */
.r8-wish-toast {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 95;
    max-width: min(400px, calc(100vw - 28px));
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 11px 15px;
    border-radius: 13px;
    border: 1px solid rgba(251, 113, 133, .46);
    background: linear-gradient(160deg, rgba(13, 30, 22, .96) 0%, rgba(7, 17, 12, .98) 100%);
    box-shadow: 0 18px 42px rgba(2, 8, 5, .74), 0 0 22px rgba(251, 113, 133, .14);
    color: var(--text);
    font-size: .82rem;
    font-weight: 660;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity .22s ease, transform .22s ease;
}
.r8-wish-toast.is-removed {
    border-color: rgba(76, 124, 95, .54);
    box-shadow: 0 18px 42px rgba(2, 8, 5, .74);
}
.r8-wish-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}
.r8-wish-toast-icon {
    color: var(--r8-heart-rose);
    display: inline-flex;
    flex: none;
}
.r8-wish-toast.is-removed .r8-wish-toast-icon {
    color: #93b39f;
}
.r8-wish-toast-msg {
    line-height: 1.38;
}
.r8-wish-toast-link {
    flex: none;
    color: var(--signal);
    font-weight: 800;
    white-space: nowrap;
    margin-inline-start: 4px;
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* 6. Dedicated /yeu-thich Storefront Page & Upgraded Account Wishlist Cards */
.r8-wishlist-page {
    position: relative;
    padding-block: clamp(32px, 4.5vw, 56px) clamp(48px, 6vw, 76px);
    background:
        radial-gradient(ellipse 60% 42% at 18% 0%, rgba(251, 113, 133, .11) 0%, transparent 64%),
        radial-gradient(ellipse 52% 48% at 86% 6%, rgba(52, 211, 153, .14) 0%, transparent 66%),
        var(--deep);
}
.r8-wishlist-shell {
    display: grid;
    gap: 22px;
}
.r8-wishlist-hero {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px 24px;
    padding: clamp(20px, 3vw, 28px);
    border-radius: 20px;
    border: 1px solid #2b4737;
    background: linear-gradient(158deg, rgba(13, 32, 22, .92) 0%, rgba(7, 17, 12, .96) 100%);
}
.r8-wishlist-hero-copy {
    display: grid;
    gap: 8px;
    max-width: 64ch;
}
.r8-wishlist-hero-copy h1 {
    font-size: clamp(1.65rem, 3.2vw, 2.45rem);
    display: inline-flex;
    align-items: center;
    gap: 12px;
}
.r8-wishlist-hero-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}
.r8-wishlist-sync-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 18px;
    padding: 14px 18px;
    border-radius: 15px;
    border: 1px solid #355844;
    background: rgba(11, 27, 19, .84);
}
.r8-wishlist-sync-banner.is-synced {
    border-color: rgba(199, 247, 149, .42);
    background: linear-gradient(155deg, rgba(17, 42, 28, .9) 0%, rgba(10, 24, 17, .92) 100%);
}
.r8-wishlist-sync-copy {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    min-width: 0;
}
.r8-wishlist-sync-copy strong {
    display: block;
    font-size: .9rem;
    color: var(--text);
}
.r8-wishlist-sync-copy p {
    margin: 2px 0 0;
    font-size: .8rem;
    line-height: 1.48;
    color: #a9c4b2;
}
.r8-wishlist-sync-cta {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.r8-wishlist-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.r8-wishlist-toolbar-info {
    font-size: .86rem;
    font-weight: 700;
    color: #c5decb;
}
.r8-wishlist-toolbar-actions {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.r8-wishlist-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}
.r8-wishlist-grid--account {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.r8-wcard {
    position: relative;
    display: flex;
    flex-direction: column;
    border-radius: 16px;
    border: 1px solid #2b4737;
    background: linear-gradient(168deg, #0e2218 0%, #08150f 100%);
    overflow: hidden;
    transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.r8-wcard:hover {
    border-color: rgba(199, 247, 149, .58);
    transform: translateY(-2px);
    box-shadow: 0 16px 32px rgba(2, 8, 5, .56);
}
.r8-wcard-media {
    position: relative;
    display: block;
    aspect-ratio: 5 / 4;
    background: radial-gradient(circle at 50% 44%, #12281d 0%, #06100b 84%);
    border-block-end: 1px solid #21382b;
    overflow: hidden;
}
.r8-wcard-media img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8px;
    display: block;
}
.r8-wcard-remove {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: 1px solid var(--r8-heart-edge);
    background: var(--r8-heart-bg);
    color: var(--r8-heart-rose);
    display: inline-grid;
    place-items: center;
    padding: 0;
    cursor: pointer;
    box-shadow: 0 0 14px var(--r8-heart-glow);
    transition: transform .16s ease, background-color .16s ease;
}
.r8-wcard-remove:hover {
    transform: scale(1.07);
    background: rgba(88, 22, 34, .96);
}
.r8-wcard-body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px 15px 15px;
}
.r8-wcard-sku {
    width: fit-content;
    font: 700 .7rem/1.2 ui-monospace, SFMono-Regular, Consolas, monospace;
    padding: 2px 7px;
    border-radius: 6px;
    border: 1px solid #325440;
    background: #08170f;
    color: #bfe6cc;
}
.r8-wcard-title {
    margin: 0;
    font-size: .96rem;
    font-weight: 760;
    line-height: 1.38;
    color: var(--text);
}
.r8-wcard-title a:hover {
    color: var(--signal);
}
.r8-wcard-desc {
    margin: 0;
    font-size: .8rem;
    line-height: 1.48;
    color: #9cb8a6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.r8-wcard-price {
    margin-block-start: auto;
    padding-block-start: 6px;
    font-size: .94rem;
    font-weight: 840;
    color: var(--signal);
}
.r8-wcard-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    padding-block-start: 8px;
    border-block-start: 1px solid rgba(43, 73, 56, .55);
}
.r8-wcard-bag-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 38px;
    padding: 0 12px;
    border-radius: 10px;
    border: 0;
    background: var(--signal);
    color: #10200b;
    font-size: .79rem;
    font-weight: 820;
    cursor: pointer;
    transition: background-color .16s ease;
}
.r8-wcard-bag-btn:hover {
    background: #e2ffbc;
}
.r8-wcard-bag-btn.is-added {
    background: #204d35;
    color: var(--signal);
    border: 1px solid var(--signal);
}
.r8-wcard-view-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    height: 38px;
    padding: 0 12px;
    border-radius: 10px;
    border: 1px solid #3c654d;
    background: #0d2117;
    color: #d7ecdc;
    font-size: .78rem;
    font-weight: 720;
    white-space: nowrap;
}
.r8-wcard-view-btn:hover {
    border-color: var(--signal);
    color: var(--signal);
}
.r8-wishlist-empty {
    padding: clamp(32px, 5vw, 52px) 22px;
    border-radius: 20px;
    border: 1px dashed #345843;
    background: rgba(9, 23, 16, .78);
    display: grid;
    justify-items: center;
    text-align: center;
    gap: 12px;
}
.r8-wishlist-empty h2 {
    margin: 0;
    font-size: 1.24rem;
    color: var(--text);
}
.r8-wishlist-empty p {
    margin: 0;
    max-width: 52ch;
    font-size: .88rem;
    line-height: 1.56;
    color: #9fbca9;
}

/* Responsive Breakpoints & Mobile Header Fit (zero overflow through 320px) */
@media (max-width: 980px) {
    .r8-wishlist-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 640px) {
    .r8-wishlist-grid,
    .r8-wishlist-grid--account {
        grid-template-columns: 1fr;
    }
    .r8-wish-toast {
        left: 14px;
        right: 14px;
        bottom: 14px;
        justify-content: space-between;
    }
}
@media (max-width: 480px) {
    .header-tools {
        gap: 5px;
    }
    .header-tools .icon-button {
        width: 38px;
        height: 38px;
    }
    .header-tools .r8-acct-login-pill,
    .header-tools .r8-acct-trigger {
        min-height: 38px;
        padding: 0 9px;
    }
}
@media (max-width: 373px) {
    /* Sticky global search strip sits directly below header, freeing space for Wishlist + Bag + Account + Menu */
    .header-tools [data-gsearch-header-trigger] {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    [data-r8-wish-toggle].is-popping .r8-wish-icon--on {
        animation: none !important;
    }
    .r8-wish-fab,
    .r8-rdock-wish,
    .r8-wcard,
    .r8-wish-toast {
        transition: none !important;
        transform: none !important;
    }
}
