

:root {
    --primary: hsl(16, 90%, 55%);
    --primary-dark: hsl(16, 90%, 45%);
    --secondary: hsl(174, 62%, 47%);
    --background: hsl(0, 0%, 98%);
    --foreground: hsl(222, 47%, 11%);
    --card: hsl(0, 0%, 100%);
    --border: hsl(214, 32%, 91%);
    --muted: hsl(210, 40%, 96%);
    --muted-foreground: hsl(215, 16%, 47%);
    --success: hsl(142, 71%, 45%);
    --warning: hsl(38, 92%, 50%);
    --destructive: hsl(0, 84%, 60%);
}

/* Wishlist Section Header */
.wishlist-page .section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--foreground);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.3rem; /* space between title and count */
}


             
        
.wishlist-page {
            padding: 2rem 0;
            min-height: 60vh;
        }
        
        .wishlist-item {
            background: var(--card);
            border: 1px solid var(--border);
            border-radius: 0.5rem;
            overflow: hidden;
            transition: all 0.3s;
        }
        
        .wishlist-item:hover {
            transform: translateY(-4px);
            box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
        }
        
.wishlist-image {
    width: 100%;
    /* 1/1 is a perfect square. Use 4/3 if you want it even shorter. */
    aspect-ratio: 4 / 3; 
    object-fit: cover;
}       
        
        .wishlist-info {
            padding: 0.7rem;
        }
        
        .wishlist-name {
            font-weight: 600;
            margin-bottom: 0.3rem;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
            font-size: 0.95rem;

        }
        
        .wishlist-price {
            font-size: 1rem;
            font-weight: bold;
            color: var(--primary);
            margin-bottom: 0.5rem;
        }
        
        .wishlist-actions {
            display: flex;
            gap: 0.5rem;
        }
        
        .add-to-cart-btn {
            flex: 1;
            background: var(--primary);
            color: white;
            padding: 0.5rem;
            border-radius: 0.375rem;
            font-size: 0.875rem;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.5rem;
            transition: background 0.2s;
        }
        
        .add-to-cart-btn:hover {
            background: var(--primary-dark);
        }
        
        .add-to-cart-btn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }
        
        .remove-from-wishlist-btn {
            background: var(--muted);
            padding: 0.5rem;
            border-radius: 0.375rem;
            transition: all 0.2s;
        }
        
        .remove-from-wishlist-btn:hover {
            background: var(--destructive);
            color: white;
        }


        .wishlist-delete-btn {
    background: transparent;
    border: none;
    color: var(--destructive);
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    
}

.wishlist-delete-btn:hover {
    color: var(--destructive);
    transform: scale(1.1);
}

.wishlist-delete-btn svg {
    pointer-events: none;
}
        
        .empty-wishlist {
            text-align: center;
            padding: 4rem 2rem;
        }
        
        .empty-wishlist-icon {
            font-size: 6rem;
            margin-bottom: 1rem;
            color: var(--muted-foreground);
        }
        
        .out-of-stock-badge {
            background: var(--destructive);
            color: white;
            padding: 0.2rem 0.6rem;
            border-radius: 0.2rem;
            font-size: 0.7rem;
            font-weight: 600;
            display: inline-block;
            

        }

        .sell-btn {
    background-color: var(--primary);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: background-color 0.2s;
}

        .delivery-btn {
    background-color: var(--primary);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: background-color 0.2s;
}

.products-grid {
    display: grid;
    
    gap: 1rem;
}


.product-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    overflow: hidden;
    transition: all 0.3s;
    opacity: 0;
    animation: fadeInUp 0.6s forwards;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.product-card:hover .product-image {
    transform: scale(1.05);
}

.product-badges {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.product-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.badge-flash {
    background: var(--destructive);
    color: white;
}

.badge-discount {
    background: var(--primary);
    color: white;
}


.pagination {
  margin-top: 20px;
  display: flex;
  justify-content: center;
  gap: 10px;
}

.pagination button {
  padding: 8px 14px;
  border-radius: 6px;
  border: 1px solid #ccc;
  background: white;
  cursor: pointer;
}

.pagination button.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.pagination button:hover {
  background: #eee;
}


@media(min-width: 769px){
  .products-grid{
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }
}


/* ============================= */
/* 📱 WISHLIST MOBILE VIEW FIX  */
/* ============================= */
@media (max-width: 600px) {

    /* Disable grid so cards become full-width rows */
    .products-grid {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    /* Horizontal card layout */
    .wishlist-item {
        display: flex;
        align-items: flex-start;
        gap: 12px;
        padding: 12px;
    }

    /* Small image on the left */
    .wishlist-image {
        width: 90px;
        height: 90px;
        flex-shrink: 0;
        border-radius: 8px;
        object-fit: cover;
        aspect-ratio: auto;
    }

    /* Content stretches to the right */
    .wishlist-info {
        flex: 1;
        display: flex;
        flex-direction: column;
        padding: 0;
        min-width: 0; /* 🔥 important for flex overflow */
    }

    /* Product name & price spacing */
    .wishlist-name {
        font-size: 1rem;
        line-height: 1.3;
        margin-bottom: 4px;
    }

    .wishlist-price {
        font-size: 0.95rem;
        margin-bottom: 6px;
    }

    /* Buttons spread horizontally */
    .wishlist-actions {
        margin-top: auto;
        display: flex;
        gap: 10px;
        width: 100%;
        align-items: center;
    }

    /* Add to Cart fills space */
    .add-to-cart-btn {
        flex: 1;
        height: 40px;
        font-size: 0.9rem;
    }

    /* Delete button stays compact */
    .wishlist-delete-btn {
        width: 42px;
        height: 42px;
        flex-shrink: 0;
    }

    /* Reduce top padding on mobile */
    .wishlist-page {
        padding: 1rem 0 0;
    }
}