/* =========================================
   Wishlist Popup Styles
   ========================================= */

/* Heart Icon Toggle State */
.wishlist-toggle {
    transition: all 0.3s ease;
    z-index: 10;
}

.wishlist-toggle:hover {
    transform: scale(1.1);
    color: var(--color-primary);
}

.wishlist-toggle.active {
    color: #F44336;
    /* Red for active state */
    background-color: #FFEBEE;
    /* Light red background if it has background */
    border-color: #F44336;
}

.wishlist-toggle.active i {
    font-weight: 900;
    /* Solid style for FontAwesome */
    color: #F44336;
}

/* Modal Overlay */
.wishlist-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.wishlist-modal.open {
    opacity: 1;
    visibility: visible;
}

.wishlist-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

/* Modal Box */
.wishlist-popup {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 90%;
    max-width: 500px;
    min-width: 320px;
    min-height: 300px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
}

.wishlist-modal.open .wishlist-popup {
    transform: translate(-50%, -50%) scale(1);
}

/* Header */
.wishlist-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    background: #fff;
}

.wishlist-title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--color-secondary);
    font-family: var(--font-jp);
}

.wishlist-close {
    width: 30px;
    height: 30px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 20px;
    color: #999;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wishlist-close:hover {
    color: #F44336;
}

/* Items List */
.wishlist-items {
    padding: 0 20px;
    overflow-y: auto;
    flex: 1;
    min-height: 150px;
    scrollbar-width: thin;
    scrollbar-color: #ddd transparent;
}

.wishlist-items::-webkit-scrollbar {
    width: 6px;
}

.wishlist-items::-webkit-scrollbar-thumb {
    background-color: #ddd;
    border-radius: 3px;
}

.wishlist-item {
    display: flex;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid #f0f0f0;
    position: relative;
    align-items: center;
    transition: background-color 0.2s;
}

.wishlist-item:last-child {
    border-bottom: none;
}

.item-remove {
    background: transparent;
    border: none;
    color: #ccc;
    cursor: pointer;
    font-size: 16px;
    transition: color 0.2s;
    padding: 5px;
}

.item-remove:hover {
    color: #F44336;
}

.item-thumbnail {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #eee;
}

.item-details {
    flex: 1;
    min-width: 0;
    /* Text truncation fix */
}

.item-name {
    font-weight: 700;
    margin: 0 0 5px 0;
    font-size: 14px;
    color: var(--color-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-price {
    color: var(--color-primary);
    font-weight: 700;
    margin: 0 0 5px 0;
    font-size: 14px;
    font-family: var(--font-en);
}

.item-date {
    font-size: 11px;
    color: #999;
    margin: 0;
}

.add-to-cart-btn-popup {
    background: #FF9800;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    transition: background 0.3s;
    box-shadow: 0 2px 5px rgba(255, 152, 0, 0.3);
}

.add-to-cart-btn-popup:hover {
    background: #F57C00;
}

/* Empty State */
.wishlist-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--color-text-light);
}

.wishlist-empty i {
    font-size: 40px;
    margin-bottom: 10px;
    color: #eee;
}

/* Footer */
.wishlist-footer {
    border-top: 1px solid #e0e0e0;
    background: #fff;
}

.wishlist-success-message {
    background: #4CAF50;
    color: white;
    padding: 12px 20px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
    }

    to {
        transform: translateY(0);
    }
}

.wishlist-links {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
}

.wishlist-page-link {
    color: var(--color-primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.wishlist-page-link:hover {
    border-color: var(--color-primary);
}

.continue-shopping {
    color: #757575;
    text-decoration: none;
    font-size: 13px;
    cursor: pointer;
    transition: color 0.2s;
}

.continue-shopping:hover {
    color: var(--color-secondary);
}

/* Responsive */
@media (max-width: 600px) {
    .wishlist-popup {
        width: 100%;
        height: 100%;
        max-height: 100vh;
        max-width: 100%;
        border-radius: 0;
        top: 0;
        left: 0;
        transform: none;
    }

    .wishlist-modal.open .wishlist-popup {
        transform: none;
    }

    .wishlist-item {
        flex-wrap: wrap;
    }

    .add-to-cart-btn-popup {
        width: 100%;
        margin-top: 5px;
    }
}