@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800&display=swap');

body {
    margin: 0;
    padding: 0;
    font-family: 'Cairo', sans-serif;
    background-color: #F5F3EF;
}

.wishlist-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.wishlist-container h1 {
    text-align: center;
    font-size: 42px;
    color: #0D1B2A;
    margin-bottom: 10px;
}

.wishlist-subtitle {
    text-align: center;
    font-size: 16px;
    color: #888;
    margin-bottom: 30px;
}

.results-count {
    text-align: center;
    font-size: 18px;
    color: #666;
    margin-bottom: 30px;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    padding: 20px 0;
    justify-items: center;
}

.product-card {
    width: 300px;
    background: #fff;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    position: relative;
}

.image-gallery {
    position: relative;
    background: #f8f8f8;
}

.product-image {
    width: 100%;
    height: 300px;
    object-fit: contain;
    cursor: pointer;
    background: #f8f8f8;
    border-radius: 8px;
}

.product-info {
    padding: 15px;
    text-align: center;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.product-name {
    margin-bottom: 8px;
    color: #3d2f2f;
    font-weight: 600;
    font-size: 18px;
}

.product-description {
    font-size: 16px;
    color: #6f5b5b;
    line-height: 1.5;
    word-break: break-word;
    max-width: 100%;
}

.product-seller {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    justify-content: center;
    margin-top: 10px;
}

.seller-link {
    text-decoration: none;
    color: #3d2f2f;
    font-weight: 600;
    font-size: 16px;
}

/* تصميم القلب */
.heart-icon {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 38px;
    height: 38px;
    background-color: rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.heart-icon:hover {
    transform: scale(1.1);
    background-color: rgba(255, 255, 255, 0.35);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.heart-icon:active {
    transform: scale(0.95);
}

.heart-icon svg {
    width: 20px;
    height: 20px;
    transition: all 0.3s ease;
}

.heart-icon.animating {
    animation: heartBeat 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.heart-icon.active svg {
    fill: #ff4757;
    stroke: #ff4757;
    filter: drop-shadow(0 2px 8px rgba(255, 71, 87, 0.4));
}

.heart-icon:not(.active) svg {
    fill: none;
    stroke: #666;
    stroke-width: 2;
}

/* أنيميشن نبض القلب */
@keyframes heartBeat {
    0% { transform: scale(1); }
    20% { transform: scale(1.3) rotate(-5deg); }
    40% { transform: scale(1.1) rotate(5deg); }
    60% { transform: scale(1.25) rotate(-3deg); }
    80% { transform: scale(1.05) rotate(2deg); }
    100% { transform: scale(1) rotate(0deg); }
}

.no-products {
    text-align: center;
    color: #666;
    font-size: 1.1rem;
    grid-column: 1 / -1;
    padding: 60px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.loading {
    text-align: center;
    color: #888;
    font-size: 18px;
    padding: 60px;
    grid-column: 1 / -1;
}

/* Lightbox */
.lightbox {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    width: 85%;
    max-width: 750px;
    background: rgba(30, 30, 30, 0.95);
    border-radius: 25px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 25px;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: transform 0.5s cubic-bezier(0.25, 1.25, 0.5, 1), opacity 0.5s ease;
}

.lightbox.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    pointer-events: auto;
}

.lightbox img,
#lightbox-img {
    max-width: 92%;
    max-height: 75vh;
    border-radius: 18px;
    object-fit: contain;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.4);
}

@keyframes fadeSlide {
    0% {
        opacity: 0;
        transform: translateX(20px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeSlideReverse {
    0% {
        opacity: 0;
        transform: translateX(-20px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

.close-lightbox {
    position: absolute;
    top: 14px;
    right: 20px;
    background: none;
    border: none;
    font-size: 32px;
    color: #fff;
    cursor: pointer;
}

.lightbox-nav,
.prev-btn,
.next-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(90, 67, 45, 0.85) !important;
    border: none;
    color: #fff !important;
    font-size: 30px;
    cursor: pointer;
    padding: 12px 20px;
    border-radius: 50%;
    transition: background 0.3s;
}

.lightbox-nav:hover,
.prev-btn:hover,
.next-btn:hover {
    background: #3b2a1a !important;
}

.prev-btn {
    left: 20px;
}

.next-btn {
    right: 10px;
}

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

    .product-card {
        width: 100%;
        max-width: 340px;
    }
    
    .heart-icon {
        width: 35px;
        height: 35px;
        top: 8px;
        left: 8px;
    }
    
    .heart-icon svg {
        width: 18px;
        height: 18px;
    }
}

@media (max-width: 600px) {
    .wishlist-container {
        padding: 20px 10px;
    }

    .wishlist-container h1 {
        font-size: 28px;
    }

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        padding: 0;
    }

    .product-card {
        width: 100%;
        border-radius: 18px;
        box-shadow: 0 6px 20px rgba(31, 36, 73, 0.1);
        border: 1px solid #e2e8f0;
    }

    .product-image {
        height: 200px;
    }
}

@media (max-width: 480px) {
    .heart-icon {
        width: 32px;
        height: 32px;
        top: 6px;
        left: 6px;
    }
    
    .heart-icon svg {
        width: 16px;
        height: 16px;
    }
}

@media (max-width: 400px) {
    .products-grid {
        grid-template-columns: 1fr;
    }
}