/* ========================================
   Recently Visited Products
   Cloned from Game Recommendations (gv-gr) -> (gv-rv)
   ======================================== */

.gv-recently-visited-wrapper {
    background: transparent;
}

/* Header */
.gv-rv-header {
    text-align: center;
    /* Centered Title */
    /* Match grid width */
    margin: 1em auto 1.5em auto;
}

.gv-rv-title {
    font-size: 2rem;
    font-weight: 600;
    color: #4a4a4a;
    /* Muted dark grey */
    margin: 0;
    font-family: inherit;
    text-transform: none;
}

.gv-rv-subtitle {
    font-size: 0.9rem;
    line-height: 1.5;
    color: #b6b6b6;
    margin: 0;
}

/* Grid Layout */
.gv-rv-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(270px, auto));
    gap: 1.2em;
    justify-content: center;
    /* Centers the grid tracks */
    /* Centers items within tracks if they are smaller */
}

/* --- CARD STYLING (Identical to gv-sp-card) --- */
.gv-rv-card {
    /* Fix squashing issue: Don't shrink, fixed width */
    flex: 0 0 270px;
    display: flex;
    flex-direction: column;
    border-radius: 1.3em;

    /* Animation Entrance (Smart Rendering) */
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);

    overflow: visible;

    /* Fixes for rendering artifacts (Jitter on Hover) */
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
    /* Switched to antialiased for stability */
    will-change: transform;
    /* Hint to browser */

    /* Classic Premium Dark Look (Rich Gradient + Depth) */
    background: linear-gradient(135deg, #383838 0%, #121212 100%);
    /* Static Depth */

    border: 1px solid rgba(255, 255, 255, 0.08);
    /* Subtle highlight border */

    /* Fixed Dimensions to Match Similar Products */
    width: 270px;
    height: 298.88px;
    cursor: pointer;

    /* Image Container Separation */
    /* Increased for clear separation */
}

/* Visible State (Triggered by JS IntersectionObserver - or CSS animation fallback) */
.gv-rv-card.visible {
    opacity: 1;
    transform: translateY(0) translateZ(0);
    /* Maintain hardware acceleration */
}


/* Hover State: Grow effect added, Shadow removed */
.gv-rv-card:hover {
    transform: scale(1.05) translateZ(0) !important;
    /* Maintain hardware acceleration */
    z-index: 10;
    box-shadow: none !important;
    /* Explicitly remove shadow */
    border-color: rgba(255, 255, 255, 0.45);
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94), border-color 0.2s ease;
}

/* Image */
.gv-rv-image {
    width: 100%;
    height: auto;
    transform: scale(1.015);
    aspect-ratio: 16/9;
    overflow: hidden;
    /* REQUIRED: Clips images to border-radius and aspect-ratio */
    margin: 0;
    padding: 0;
    border-radius: 1.3em;
    /* Matches user manual update */
    position: relative;
    /* Base shadow for floating effect */
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.3s ease;
    /* Smooth scale */
}

.gv-rv-card:hover .gv-rv-image {
    transform: scale(1.03);
    /* Increased grow effect 
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
    /* Stronger pop on hover */
}

.gv-rv-main-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 1;
    /* border-radius: 1.3em; REMOVED to let parent clip */
    position: relative;
    border-radius: 1.3em !important;
    z-index: 1;
    display: block;
    /* Removes bottom space/gap */
}

/* Product Label Styling (Manual Override to match Image 1) */
/* Product Label Styling (Manual Override to match Image 1 - Blue) */
/* Product Label Styling (Manual Override to match Image) - High Specificity */
/* Product Label Positioning (Dynamic Style from PHP) */
.gv-rv-card .gv-label,
.gv-rv-card .gv-product-label-gradient {
    position: absolute;
    top: 0.5em;
    left: 0.0em;
    z-index: 20;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.35em 0.8em 0.2em 0.8em;
    border-radius: 1.2em 0.2em 0.2em 0.2em;
    line-height: 1;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    /* Prevent jitter on card scale */
    transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.gv-rv-card.visible:hover .gv-label.gv-label--custom {
    top: 0.5em;
    left: 0em;
}

/* External Link Icon */
.gv-rv-external-link {
    position: absolute;
    top: 0.3em;
    right: 0.3em;
    width: 2em;
    height: 2em;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    z-index: 20;
    transition: all 0.3s ease;
    text-decoration: none;
    opacity: 0;
    transform: translateY(-5px);
}

.gv-rv-external-link img {
    width: 14px;
    height: 14px;
    filter: brightness(0) invert(1);
    transition: transform 0.3s ease;
}

.gv-rv-card:hover .gv-rv-external-link {
    opacity: 1;
    transform: translateY(0);
}

.gv-rv-external-link:hover {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    transform: scale(1.1) !important;
}

/* Video Frame (Structure kept but unused/hidden in logic) */
.gv-rv-video-frame {
    position: absolute;
    width: 270% !important;
    height: 270% !important;
    top: -100% !important;
    left: -100% !important;
    z-index: 1;
    pointer-events: none;
    background: transparent;
}

.gv-rv-video-frame iframe {
    position: absolute;
    /* Fix for potential layout issue */
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.5s ease-in;
    pointer-events: none;
}

/* Content */
.gv-rv-content {
    padding: 0.75em;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.gv-rv-info-top {
    display: flex;
    flex-direction: column;
}

.gv-rv-card-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
    line-height: 1.3 !important;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    flex-grow: 0;
}

/* Meta: Icon + Type (Platform, Type) */
.gv-rv-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.2em;
    /* Added gap */
}

/* Type Container */
.gv-rv-type {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.2em;
    /* Added gap */
}

/* Label Style */
.gv-rv-label {
    font-size: 13px;
    color: #828282;
    /* White for better visibility on dark bg, assuming dark theme from context */
    font-weight: 600;
    opacity: 0.8;
    line-height: normal;
}

/* Icons */
.gv-rv-attr-icon {
    transform: scale(1.2);
    width: 1.1em;
    /* Increased size */
    height: 1.1em;
    object-fit: contain;
    display: block;
    /* Tint to #b3b3b3 (approximate) */
    filter: grayscale(100%) brightness(1.2) opacity(0.8);
}

/* Footer (Hybrid Layout) */
.gv-rv-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    position: relative;
    /* For absolute positioning of wishlist if needed */
}

/* Price */
/* Price - Matched to Similar Products */
.gv-rv-price {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    align-self: center;
    line-height: 1;
    gap: 2px;
    max-width: 80%;
}

.gv-rv-price-top {
    display: flex;
    align-items: center;
    gap: 8px;
    order: 2;
    /* New Price Bottom */
}

.gv-rv-price-current {
    font-size: 1.25rem;
    font-weight: 800;
    color: #fff;
    line-height: 1;
}

.gv-rv-discount {
    background: linear-gradient(90deg, #ff4e00 0%, #ff0000 100%);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    transform: skewX(-10deg);
    box-shadow: 0 2px 4px rgba(255, 0, 0, 0.3);
}

.gv-rv-price-bottom {
    display: flex;
    order: 1;
    /* Old Price Top */
    margin-top: 0;
    align-items: center;
    gap: 4px;
}

/* --- 3-TIER PRICING STYLES (MATCHING SIMILAR PRODUCTS) --- */

/* 1. Official Price */
.gv-rv-price-official {
    font-size: 0.85rem;
    color: #a9a9a9 !important;
    /* Medium Grey */
    text-decoration: line-through;
    text-decoration-color: #ff0000 !important;
    /* Red Strike */
    display: inline-block;
    font-weight: 500;
}

/* Force Inner Elements */
.gv-rv-price-official .amount,
.gv-rv-price-official bdi,
.gv-rv-price-official .woocommerce-Price-currencySymbol {
    color: inherit !important;
    text-decoration: inherit !important;
}

/* 2. Separator */
.gv-rv-price-separator {
    font-size: 0.85rem;
    color: #999;
    margin: 0 2px;
}

/* 3. Regular Price (Intermediate or Old) */
.gv-rv-price-regular {
    font-size: 0.85rem;
    color: #a9a9a9 !important;
    /* Medium Grey */
    display: inline-block;
    font-weight: 500;
}

/* Force Inner Elements for Regular */
.gv-rv-price-regular .amount,
.gv-rv-price-regular bdi,
.gv-rv-price-regular .woocommerce-Price-currencySymbol {
    color: inherit !important;
    text-decoration: inherit !important;
}

/* Strikethrough for Regular when Sale is Active */
del.gv-rv-price-regular {
    text-decoration: line-through;
    text-decoration-color: #ff0000 !important;
}

/* Normal for Regular when NO Sale */
span.gv-rv-price-regular {
    text-decoration: none;
}

/* Old .gv-rv-price-old kept for any legacy fallback */
.gv-rv-price-old {
    font-size: 0.85rem;
    color: #a9a9a9;
    text-decoration: line-through;
    font-weight: 500;
}

.gv-rv-price-old .amount,
.gv-rv-price-old bdi,
.gv-rv-price-old .woocommerce-Price-currencySymbol {
    color: inherit !important;
    text-decoration: inherit !important;
}

/* Actions (Wishlist) */
.gv-rv-actions {
    position: absolute;
    bottom: 0px;
    right: 0px;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.gv-rv-card:hover .gv-rv-actions {
    opacity: 1;
    transform: translateY(0);
}

.gv-rv-wishlist .yith-wcwl-add-to-wishlist {
    margin: 0;
}

.gv-rv-wishlist .yith-wcwl-add-button a i,
.gv-rv-wishlist .yith-wcwl-wishlistaddedbrowse a i,
.gv-rv-wishlist .yith-wcwl-wishlistexistsbrowse a i {
    font-size: 1.2rem !important;
    color: #fff !important;
    transition: transform 0.2s ease;
}

.gv-rv-wishlist .yith-wcwl-add-button a:hover i {
    transform: scale(1.1);
    color: #ff4757 !important;
}

/* Responsive */
@media (max-width: 768px) {
    .gv-rv-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .gv-rv-grid {
        grid-template-columns: 1fr;
    }
}