/**
 * Wishlist Styles
 * 
 * @package PinterestShop
 * @version 1.0.0
 */

/* ==========================================================================
   HEADER WISHLIST
   ========================================================================== */

.header-wishlist {
    position: relative;
    display: inline-block;
}

.wishlist-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
}

.wishlist-toggle:hover {
    background: rgba(230, 0, 35, 0.1);
    color: #e60023;
}

.wishlist-toggle svg {
    transition: all 0.3s ease;
}

.wishlist-toggle:hover svg {
    transform: scale(1.1);
}

.wishlist-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #e60023;
    color: #fff;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    padding: 0 4px;
}

.wishlist-count:empty,
.wishlist-count[data-count="0"] {
    display: none;
}

/* ==========================================================================
   WISHLIST DROPDOWN
   ========================================================================== */

.wishlist-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    width: 350px;
    max-height: 500px;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    border: 1px solid #eee;
}

.wishlist-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.wishlist-header {
    padding: 20px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wishlist-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
}

.wishlist-total {
    font-size: 0.9rem;
    color: #666;
    font-weight: 500;
}

.wishlist-items {
    max-height: 300px;
    overflow-y: auto;
    padding: 0;
}

.wishlist-empty {
    padding: 40px 20px;
    text-align: center;
    color: #666;
}

.wishlist-empty p {
    margin: 0 0 10px 0;
    font-size: 1rem;
    font-weight: 500;
}

.wishlist-empty small {
    font-size: 0.85rem;
    opacity: 0.8;
}

.wishlist-item {
    display: flex;
    padding: 15px 20px;
    border-bottom: 1px solid #f5f5f5;
    transition: background 0.2s ease;
}

.wishlist-item:hover {
    background: #fafafa;
}

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

.wishlist-item-image {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    margin-right: 15px;
    flex-shrink: 0;
}

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

.wishlist-item-details {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.wishlist-item-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: #333;
    margin: 0 0 5px 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.wishlist-item-name a {
    color: inherit;
    text-decoration: none;
}

.wishlist-item-name a:hover {
    color: #e60023;
}

.wishlist-item-price {
    font-size: 0.9rem;
    font-weight: 600;
    color: #e60023;
    margin: 0;
}

.wishlist-item-actions {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-end;
    gap: 8px;
}

.wishlist-item-remove {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.wishlist-item-remove:hover {
    color: #e60023;
    background: rgba(230, 0, 35, 0.1);
}

.wishlist-item-add-cart {
    background: #e60023;
    color: #fff;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.wishlist-item-add-cart:hover {
    background: #c8001f;
    transform: translateY(-1px);
}

.wishlist-footer {
    padding: 15px 20px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    gap: 10px;
}

.wishlist-footer .btn {
    flex: 1;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.btn-primary {
    background: #e60023;
    color: #fff;
}

.btn-primary:hover {
    background: #c8001f;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #f5f5f5;
    color: #666;
}

.btn-secondary:hover {
    background: #eee;
    color: #333;
}

/* ==========================================================================
   CART COUNT STYLING
   ========================================================================== */

.cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #e60023;
    color: #fff;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    padding: 0 4px;
}

.cart-toggle {
    position: relative;
    display: inline-block;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.3s ease;
    color: #333;
    text-decoration: none;
}

.cart-toggle:hover {
    background: rgba(230, 0, 35, 0.1);
    color: #e60023;
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */

@media (max-width: 768px) {
    .wishlist-dropdown {
        width: 300px;
        right: -20px;
    }
    
    .wishlist-item {
        padding: 12px 15px;
    }
    
    .wishlist-item-image {
        width: 50px;
        height: 50px;
        margin-right: 12px;
    }
    
    .wishlist-item-name {
        font-size: 0.85rem;
    }
    
    .wishlist-item-price {
        font-size: 0.85rem;
    }
    
    .wishlist-footer {
        flex-direction: column;
    }
    
    .wishlist-footer .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .wishlist-dropdown {
        width: 280px;
        right: -40px;
    }
    
    .wishlist-header {
        padding: 15px;
    }
    
    .wishlist-header h3 {
        font-size: 1.1rem;
    }
    
    .wishlist-items {
        max-height: 250px;
    }
}

/* ==========================================================================
   ANIMATIONS
   ========================================================================== */

.wishlist-item {
    animation: wishlistItemFadeIn 0.3s ease-out;
}

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

.wishlist-count {
    animation: wishlistCountPulse 0.3s ease-out;
}

@keyframes wishlistCountPulse {
    0% {
        transform: scale(0.8);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

/* ==========================================================================
   LOADING STATES
   ========================================================================== */

.wishlist-loading {
    padding: 40px 20px;
    text-align: center;
    color: #666;
}

.wishlist-loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #e60023;
    border-radius: 50%;
    animation: wishlistSpin 1s linear infinite;
    margin-left: 10px;
}

@keyframes wishlistSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
