/**
 * Gamevers Wishlist Dropdown Styles
 * Location: woocommerce/global/css/gv-wishlist-dropdown.css
 * 
 * Styled to match the Gamevers Cart System dropdown
 */

/* Wishlist Icon & Count Badge (Inherited from gv-user-nav.css for positioning) */
.gv-nav-wishlist-toggle {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    cursor: pointer;
    position: relative;
}

/* Explicitly center the heart icons */
.gv-nav-item-wishlist .gv-nav-icon {
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    margin: 0 !important;
}

/* Heartbeat Animation on Hover */
.gv-nav-item-wishlist:hover .gv-nav-icon-fill {
    animation: gv-heart-pulse 0.8s ease-in-out infinite;
}

@keyframes gv-heart-pulse {
    0% { transform: translate(-50%, -50%) scale(1); }
    15% { transform: translate(-50%, -50%) scale(1.2); }
    30% { transform: translate(-50%, -50%) scale(1); }
    45% { transform: translate(-50%, -50%) scale(1.15); }
    60% { transform: translate(-50%, -50%) scale(1); }
}

/* Disable animation when dropdown is open */
.gv-nav-item-wishlist.gv-dropdown-active:hover .gv-nav-icon-fill {
    animation: none !important;
}

.gv-wishlist-count {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: #e41e3f; /* Match Bell Red */
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    pointer-events: none;
    border: none;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.gv-wishlist-count.show {
    opacity: 1;
    transform: scale(1);
}

/* Pop animation when count increments (product added) */
.gv-wishlist-count.gv-count-pop {
    animation: gv-badge-pop 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.6) forwards;
}

@keyframes gv-badge-pop {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.5); }
    100% { transform: scale(1); }
}

/* Dropdown Container - Replicating .gv-mini-cart */
.gv-wishlist-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 26em; /* Match cart width */
    max-width: calc(100vw - 32px);
    background: rgba(26, 26, 26, 0.98); /* Match gv-cart-glass */
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.25s ease;
    z-index: 100;
    display: block;
    pointer-events: none;
    overflow: visible; /* Must be visible so ::before arrow shows above the border */
}

/* Upward-pointing arrow on the wishlist dropdown */
.gv-wishlist-dropdown::before {
    content: '';
    position: absolute;
    top: -7px;
    right: 18px; /* Aligns with the wishlist heart icon */
    width: 13px;
    height: 13px;
    background: rgba(26, 26, 26, 0.98);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    transform: rotate(45deg);
    z-index: 1;
}

/* ── "Added to Wishlist" notification popup ─────────────────────────────────
   Same pattern as .gv-cart-success-notification:
   position:absolute + left:50% + translateX(-50%) = always centred under icon.
   No JS coordinate math needed.
   ──────────────────────────────────────────────────────────────────────────── */
.gv-wishlist-notification {
    position: absolute;
    top: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    width: 300px;
    background: rgba(28, 28, 32, 0.97);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
    padding: 12px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.165, 0.84, 0.44, 1), visibility 0.35s;
    z-index: 200;
    pointer-events: none;
}

/* Arrow pointing up at the icon */
.gv-wishlist-notification::before {
    content: '';
    position: absolute;
    top: -7px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 13px;
    height: 13px;
    background: rgba(28, 28, 32, 0.97);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.gv-wishlist-notification.gv-show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

.gv-wl-notif-content {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 12px;
    padding: 10px;
}

.gv-wl-notif-img {
    width: 52px;
    height: 52px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.25);
}

.gv-wl-notif-product-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gv-wl-notif-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.gv-wl-notif-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
}

.gv-wl-notif-name {
    font-size: 14px;
    font-weight: 500;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gv-wl-notif-price {
    font-size: 13px;
    font-weight: 600;
    color: #ffd700;
}


.gv-nav-item-wishlist.gv-dropdown-active .gv-wishlist-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

/* Dropdown Arrow Pointer */
.gv-wishlist-dropdown::before {
    content: '';
    position: absolute;
    top: -6px;
    right: 16px;
    width: 12px;
    height: 12px;
    background: rgba(26, 26, 26, 0.98);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    transform: rotate(45deg);
    z-index: -1;
}

/* Header - Replicating .gv-mini-cart-header */
.gv-mini-cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.gv-mini-cart-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.gv-mini-cart-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.gv-mini-cart-text {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
}

.gv-mini-cart-badge {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
    min-width: 20px;
    text-align: center;
}

.gv-mini-cart-close {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gv-mini-cart-close:hover {
    color: #fff;
}

/* Items List - Replicating .gv-mini-cart-items */
.gv-mini-cart-items {
    max-height: 400px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 10px 0;
}

.gv-mini-cart-items::-webkit-scrollbar {
    width: 4px;
}

.gv-mini-cart-items::-webkit-scrollbar-track {
    background: transparent;
}

.gv-mini-cart-items::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

/* Item Row - Replicating .gv-mini-cart-item with Boxed Style */
.gv-mini-cart-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 15px;
    margin: 8px 15px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    transition: all 0.2s ease;
}

.gv-mini-cart-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
}

.gv-item-image {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    background: #2a2a2a;
    border-radius: 8px;
    overflow: hidden;
}

.gv-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gv-item-details {
    flex: 1;
    min-width: 0;
}

.gv-item-name {
    margin: 0 0 6px;
    font-size: 14px;
    font-weight: 500;
}

.gv-item-name a {
    color: #fff;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

/* Star Rating */
.gv-mini-cart-product-rating {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-bottom: 6px;
}

.gv-mini-cart-product-rating .gv-star {
    font-size: 12px;
    color: #444;
    line-height: 1;
}

.gv-mini-cart-product-rating .gv-star-filled {
    color: #ffb400;
}

.gv-item-price {
    font-size: 14px;
    font-weight: 600;
    color: #ffd700; /* Match gv-cart-primary gold */
}

.gv-item-price ins {
    text-decoration: none;
}

.gv-item-price del {
    font-size: 12px;
    color: #999;
    margin-right: 6px;
    font-weight: 400;
}

/* Actions: custom native heart remove button */
.gv-item-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    flex-shrink: 0;
}

/* Heart Remove Button */
.gv-wl-remove-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 7px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #e41e3f;
    transition: background 0.2s ease, transform 0.2s ease;
    line-height: 1;
}

.gv-wl-remove-btn svg {
    display: block;
    width: 22px;
    height: 22px;
    fill: #e41e3f;
    transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275), fill 0.2s ease;
    filter: drop-shadow(0 0 4px rgba(228, 30, 63, 0.45));
}

.gv-wl-remove-btn:hover {
    background: rgba(228, 30, 63, 0.12);
}

.gv-wl-remove-btn:hover svg {
    transform: scale(1.2);
    fill: #ff3b5c;
    filter: drop-shadow(0 0 7px rgba(228, 30, 63, 0.7));
}

.gv-wl-remove-btn:active svg {
    transform: scale(0.88);
}

/* Empty State */
.gv-mini-cart-empty {
    padding: 60px 20px;
    text-align: center;
    color: #999;
}

.gv-empty-wishlist-image {
    width: 18em;
    height: auto;
    opacity: 0.8;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.gv-mini-cart-empty p {
    margin: 0;
    font-size: 15px;
}

/* Footer - Replicating .gv-mini-cart-footer */
.gv-mini-cart-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: #0f0f0f; /* Match gv-cart-bg-dark */
}

.gv-cart-actions {
    display: flex;
    flex-direction: column;
}

.gv-cart-actions .button {
    width: 100%;
    padding: 12px;
    text-align: center;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.gv-btn-view-cart {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
}

.gv-btn-view-cart:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-2px);
}

/* Loading Spinner */
.gv-wishlist-loading {
    padding: 60px 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.gv-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(255, 215, 0, 0.1);
    border-top-color: #ffd700;
    border-radius: 50%;
    animation: gv-spin 0.8s linear infinite;
}

@keyframes gv-spin {
    to { transform: rotate(360deg); }
}

/* Removing Animation */
.gv-mini-cart-item.gv-removing {
    opacity: 0.5;
    pointer-events: none;
    filter: grayscale(1);
}

/* Responsive adjustments */
@media (max-width: 1023px) {
    .gv-wishlist-dropdown {
        display: none !important;
    }
}

/* =====================================================
   Wishlist Toast Notification
   Matches the cart's success notification style
   ===================================================== */

.gv-wishlist-toast {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 100;
    width: 320px;
    background: rgba(28, 28, 32, 0.97);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
    padding: 12px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.165, 0.84, 0.44, 1);
    pointer-events: none;
    overflow: visible;
}

/* Upward-pointing arrow — always centred because toast is centred under the icon */
.gv-wishlist-toast::before {
    content: '';
    position: absolute;
    top: -7px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 13px;
    height: 13px;
    background: rgba(28, 28, 32, 0.97);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.gv-wishlist-toast--visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.gv-wl-toast-content {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 12px;
    padding: 10px;
}

.gv-wl-toast-img {
    width: 52px;
    height: 52px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.25);
}

.gv-wl-toast-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gv-wl-toast-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.gv-wl-toast-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
}

.gv-wl-toast-name {
    font-size: 14px;
    font-weight: 500;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gv-wl-toast-price {
    font-size: 13px;
    font-weight: 600;
    color: #ffd700;
}

