/* =========================================
   Fast Gives – Recently Viewed Products Bar
   v1.0.0
   ========================================= */

/* ── CSS Variables (set inline by PHP) ── */
#fgrvp-bar {
    --fgrvp-bg:     #1a1a2e;
    --fgrvp-text:   #ffffff;
    --fgrvp-accent: #ff6b35;
    --fgrvp-radius: 6px;
    --fgrvp-img:    56px;
}

/* ── Bar Container ── */
#fgrvp-bar {
    width: 100%;
    background: var(--fgrvp-bg);
    color: var(--fgrvp-text);
    font-family: inherit;
    font-size: 13px;
    line-height: 1.3;
    border-top: 3px solid var(--fgrvp-accent);
    position: relative;
    z-index: 9990;
    box-sizing: border-box;
    /* Smooth entrance */
    animation: fgrvpSlideUp 0.35s ease both;
}

@keyframes fgrvpSlideUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0);    }
}

#fgrvp-bar.fgrvp-hidden {
    display: none !important;
}

/* ── Inner wrapper ── */
.fgrvp-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ── Section title ── */
.fgrvp-title {
    white-space: nowrap;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--fgrvp-accent);
    flex-shrink: 0;
    padding-right: 8px;
    border-right: 1px solid rgba(255,255,255,0.15);
}

/* ── Track wrapper (scroll container + arrows) ── */
.fgrvp-track-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    position: relative;
}

/* ── Scrollable track ── */
.fgrvp-track {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    padding: 4px 0;
    scrollbar-width: none;
}
.fgrvp-track::-webkit-scrollbar { display: none; }

/* ── Arrow buttons ── */
.fgrvp-arrow {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    color: var(--fgrvp-text);
    cursor: pointer;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    line-height: 1;
    flex-shrink: 0;
    transition: background 0.2s, opacity 0.2s;
    padding: 0;
}
.fgrvp-arrow:hover {
    background: var(--fgrvp-accent);
    border-color: var(--fgrvp-accent);
}
.fgrvp-arrow:disabled,
.fgrvp-arrow.fgrvp-arrow--hidden {
    opacity: 0.2;
    pointer-events: none;
}

/* ── Individual product item ── */
.fgrvp-item {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    max-width: 180px;
    background: rgba(255,255,255,0.05);
    border-radius: var(--fgrvp-radius);
    padding: 6px 8px;
    transition: background 0.2s;
    cursor: pointer;
}
.fgrvp-item:hover {
    background: rgba(255,255,255,0.10);
}

/* ── Product thumbnail link ── */
.fgrvp-thumb {
    display: block;
    flex-shrink: 0;
    width: var(--fgrvp-img);
    height: var(--fgrvp-img);
    border-radius: 4px;
    overflow: hidden;
    background: rgba(255,255,255,0.08);
}
.fgrvp-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.25s ease;
}
.fgrvp-item:hover .fgrvp-thumb img {
    transform: scale(1.06);
}

/* ── Product info ── */
.fgrvp-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.fgrvp-name {
    color: var(--fgrvp-text);
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.3;
}
.fgrvp-name:hover {
    color: var(--fgrvp-accent);
    text-decoration: underline;
}

.fgrvp-price {
    font-size: 12px;
    font-weight: 700;
    color: var(--fgrvp-accent);
}
.fgrvp-price del {
    opacity: 0.5;
    font-weight: 400;
    font-size: 11px;
    color: var(--fgrvp-text);
}
.fgrvp-price ins {
    text-decoration: none;
}

/* ── Add to cart button ── */
.fgrvp-atc {
    display: inline-block;
    background: var(--fgrvp-accent);
    color: #fff;
    text-decoration: none;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 3px 7px;
    border-radius: 3px;
    white-space: nowrap;
    border: none;
    cursor: pointer;
    transition: opacity 0.2s;
    margin-top: 2px;
}
.fgrvp-atc:hover { opacity: 0.85; color: #fff; }
.fgrvp-atc--select { background: transparent; border: 1px solid var(--fgrvp-accent); color: var(--fgrvp-accent); }
.fgrvp-atc--select:hover { background: var(--fgrvp-accent); color: #fff; }

/* ── Close button ── */
.fgrvp-close {
    flex-shrink: 0;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.5);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: border-color 0.2s, color 0.2s;
}
.fgrvp-close:hover {
    border-color: rgba(255,255,255,0.5);
    color: #fff;
}

/* ════════════════════════════════════════
   SIDEBAR WIDGET
   ════════════════════════════════════════ */

.fgrvp-sidebar-list {
    --fgrvp-accent: #ff6b35;
    list-style: none;
    margin: 0;
    padding: 0;
}
.fgrvp-sidebar-list li { margin-bottom: 12px; }
.fgrvp-sidebar-list li a {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
}
.fgrvp-sidebar-list li a:hover { color: var(--fgrvp-accent); }
.fgrvp-sidebar-list img {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}
.fgrvp-sb-name {
    display: block;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
}
.fgrvp-sb-price {
    display: block;
    font-size: 12px;
    color: var(--fgrvp-accent);
    font-weight: 700;
    margin-top: 2px;
}

/* ════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════ */

@media ( max-width: 600px ) {
    .fgrvp-title {
        display: none;
    }
    .fgrvp-inner {
        padding: 8px 10px;
    }
    #fgrvp-bar {
        --fgrvp-img: 44px;
        font-size: 12px;
    }
    .fgrvp-item {
        max-width: 140px;
    }
}

/* ── Respect reduced motion ── */
@media ( prefers-reduced-motion: reduce ) {
    #fgrvp-bar         { animation: none; }
    .fgrvp-thumb img   { transition: none; }
}
